Missing Token Usage Metadata in LangChain Streaming Responses for ChatOpenAI
and ChatAnthropicAI
#7876
Open
5 tasks done
Labels
auto:bug
Related to a bug, vulnerability, unexpected error with an existing feature
Checked other resources
Example Code
Code
Logs for
ChatOpenAI
Logs for
ChatAnthropicAI
Error Message and Stack Trace (if applicable)
No response
Description
I don’t get
output_tokens
and thetotal_tokens
in the usage metadata, not eveninput_tokens
in case ofChatOpenAI
ChatOpenAI
.ChatAnthropicAI
.I am noticing a strange behaviour with
ChatAnthropicAI
where i am not always reciveing as input tokens as 0.As you can see in logs i am reciveing
input_tokens
in first message first messsage but in the last message.In case of
ChatOpeanAI
it usage is always an {}System Info
Dependencies and their versions
The text was updated successfully, but these errors were encountered: