mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-06 02:48:13 +00:00
fix(oci/embed): always set usage on embedding response
Co-authored-by: Yassin Kortam <yassin@berri.ai>
This commit is contained in:
parent
36a8485a0c
commit
1f217af727
1 changed files with 4 additions and 0 deletions
|
|
@ -275,6 +275,10 @@ class OCIEmbedConfig(BaseEmbeddingConfig):
|
|||
prompt_tokens=parsed.usage.promptTokens,
|
||||
total_tokens=parsed.usage.totalTokens,
|
||||
)
|
||||
else:
|
||||
# Neither field returned — default to zero so downstream consumers
|
||||
# can always rely on usage being populated.
|
||||
model_response.usage = Usage(prompt_tokens=0, total_tokens=0)
|
||||
|
||||
return model_response
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue