Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support the Anthropic Token Counting API #83

Closed
areibman opened this issue Nov 3, 2024 · 2 comments · Fixed by #85
Closed

Support the Anthropic Token Counting API #83

areibman opened this issue Nov 3, 2024 · 2 comments · Fixed by #85
Assignees

Comments

@areibman
Copy link
Contributor

areibman commented Nov 3, 2024

Recent release: https://docs.anthropic.com/en/docs/build-with-claude/token-counting

We currently count tokens according to the GPT tiktoken tokenizer. We should use the API instead

@the-praxs
Copy link
Member

Currently, we can update the count_message_tokens function to use this API.

count_string_tokens will use the old estimation.

@the-praxs the-praxs self-assigned this Nov 8, 2024
@the-praxs
Copy link
Member

the-praxs commented Nov 8, 2024

Currently, we can update the count_message_tokens function to use this API.

count_string_tokens will use the old estimation.

They removed client.count_tokens in version 0.39.0 (Source) so we cannot use count_string_tokens anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants