Open AsifMehmood97 opened 1 month ago
AzureOpenAIEmbeddings returns token usage:
{ "object": "list", "data": [ { "object": "embedding", "index": 0, "embedding": [...] } ], "model": "text-embedding-ada-002", "usage": { "prompt_tokens": 823, "total_tokens": 823 } }
However get_openai_callback is not tracking it:
get_openai_callback
Tokens Used: 0 Prompt Tokens: 0 Completion Tokens: 0 Successful Requests: 0 Total Cost (USD): $0.0
No response
I am tracking the tokens and cost usage for my application in the database, I can track the usage of the token for AzureOpenAI using get_openai_callback however it is not tracking the token usage for Embeddings.
langchain_openai==0.1.17 langchain==0.2.9 langchain-community==0.2.7
Hey, I was wondering if I could take a look at this issue
Checked other resources
Example Code
AzureOpenAIEmbeddings returns token usage:
However
get_openai_callback
is not tracking it:Error Message and Stack Trace (if applicable)
No response
Description
I am tracking the tokens and cost usage for my application in the database, I can track the usage of the token for AzureOpenAI using
get_openai_callback
however it is not tracking the token usage for Embeddings.System Info