feat: implement token usage tracking for LLM calls with new accumulator and callback

This commit is contained in:
Anish Sarkar 2026-04-14 13:40:32 +05:30
parent 917f35eb33
commit 3cfe53fb7f
6 changed files with 223 additions and 4 deletions

View file

@ -970,6 +970,7 @@ class ChatLiteLLMRouter(BaseChatModel):
messages=formatted_messages,
stop=stop,
stream=True,
stream_options={"include_usage": True},
**call_kwargs,
)
except ContextWindowExceededError as e: