You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note that the above library is no longer exactly accurate on Claude 3.
This package can be used to count tokens for Anthropic's older models. As of the Claude 3 models, this algorithm is no longer accurate, but can be used as a very rough approximation. We suggest that you rely on usage in the response body wherever possible.
Currently we're using
tiktoken
to calculate token count (not changed from original implementation.) It seems it's already providing a good estimation but ideally we should use this. https://github.com/anthropics/anthropic-tokenizer-typescriptThe text was updated successfully, but these errors were encountered: