mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-27 03:34:10 +00:00
fix(cohere.py): return usage as a pydantic object not dict
This commit is contained in:
parent
bd7b2f6daf
commit
235787ff67
2 changed files with 16 additions and 4 deletions
|
@ -300,8 +300,7 @@ def embedding(
|
|||
for text in input:
|
||||
input_tokens += len(encoding.encode(text))
|
||||
|
||||
model_response["usage"] = {
|
||||
"prompt_tokens": input_tokens,
|
||||
"total_tokens": input_tokens,
|
||||
}
|
||||
model_response["usage"] = Usage(
|
||||
prompt_tokens=input_tokens, completion_tokens=0, total_tokens=input_tokens
|
||||
)
|
||||
return model_response
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue