Proper count tokens for conversation / message level #1034
Replies: 2 comments 1 reply
-
Hi @vectorkovacspeter, thanks for trying out LibreChat. Are you on the latest commit on main branch? The message.tokenCount is mainly for caching the tokenCount on subsequent message requests.
This should not be the case, as you can see below
No, but you can inspect the schemas in /LibreChat/api/models/schema/ To view what is actually spent, you should be looking at the transactions collection and filter by conversationId |
Beta Was this translation helpful? Give feedback.
-
See these docs and PR for more info: |
Beta Was this translation helpful? Give feedback.
-
Contact Details
kovacs.peter@vector.hu
What is your question?
How can I properly get the input and output token numbers for a conversation or a message?
In the Mongo database, thez messages.tokenCount value is null for the non-user messages, am I search it in the wrong place?
Is there a detailed documentation available for the database schama, and its content?
More Details
I try to sum the tokens used by a specified conversation or a specified message stored in the chat database (I use mongo).
What is the main subject of your question?
Other
Screenshots
No response
Code of Conduct
Beta Was this translation helpful? Give feedback.
All reactions