Open IngLP opened 3 months ago
I don't think Anthropic supports this: https://docs.anthropic.com/en/api/messages
What is the best way to have an estimate? BTW: this breaks all modules and functions in LangChain that rely on get_num_tokens. I want to use a cache but I can't.
we can add a get_num_tokens
method on the class level that would just give an estimation based on heuristics, wdyt?
Try to instantiate ChatAnthropicVertex and call get_num_tokens, it will fail:
I am using
langchain-google-vertexai = "^1.0.6"