forked from phoenix/litellm-mirror
fix(utils.py): fix anthropic streaming return usage tokens
This commit is contained in:
parent
495aebb582
commit
dacadbf624
1 changed files with 1 additions and 0 deletions
|
@ -9758,6 +9758,7 @@ class CustomStreamWrapper:
|
|||
if response_obj is None:
|
||||
return
|
||||
completion_obj["content"] = response_obj["text"]
|
||||
setattr(model_response, "usage", Usage())
|
||||
if response_obj.get("prompt_tokens", None) is not None:
|
||||
model_response.usage.prompt_tokens = response_obj[
|
||||
"prompt_tokens"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue