mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-04-27 01:36:30 +02:00
feat: implement token usage tracking for LLM calls with new accumulator and callback
This commit is contained in:
parent
917f35eb33
commit
3cfe53fb7f
6 changed files with 223 additions and 4 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue