Is there a way to count the number of tokens? Cognee #1498
nauanelinhares
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm looking for a way to achieve token counting functionality similar to what LangChain offers.
For example, using LangChain, I can pass a callback to an LLM instance (like the one shown below) to count the number of tokens used for a request, such as when creating a knowledge graph:
Does this library have a way to implement token counting or use something else? I haven't been able to find this option within the configuration, like in the set_llm_config method.
I found this interface, but it seems there isn't an implementation for OpenAI. Could you provide an example of how to use this (or a similar concrete implementation)?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions