Update Anthropic token counting logic
This commit is contained in:
parent
304820c919
commit
ae1e85e166
@ -353,7 +353,8 @@ func (c *AnthropicClient) CreateChatCompletionStream(
|
|||||||
block.Text += text
|
block.Text += text
|
||||||
output <- provider.Chunk{
|
output <- provider.Chunk{
|
||||||
Content: text,
|
Content: text,
|
||||||
TokenCount: 1,
|
// rough, anthropic performs some chunking
|
||||||
|
TokenCount: uint(len(strings.Split(text, " "))),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
case "input_json_delta":
|
case "input_json_delta":
|
||||||
|
Loading…
Reference in New Issue
Block a user