added LangChain.TokenUsage for tracking input and output tokens for a chat completion
added new callback :on_llm_token_usage to notify when token information is received
support added in ChatOpenAI, ChatAnthropic, and ChatBumblebee
Token information is returned in different ways from each model. The biggest challenge is how it's returned with streaming deltas. More extensive changes were needed to make it work well.
LangChain.TokenUsage
for tracking input and output tokens for a chat completion:on_llm_token_usage
to notify when token information is receivedToken information is returned in different ways from each model. The biggest challenge is how it's returned with streaming deltas. More extensive changes were needed to make it work well.