mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-05 08:07:05 +00:00
Merge pull request #14092 from gotsysdba/main
OCI Provder: Update OCIPromptTokensDetails
This commit is contained in:
commit
53bf023876
2 changed files with 8 additions and 4 deletions
|
|
@ -121,7 +121,7 @@ class OCICompletionTokenDetails(BaseModel):
|
|||
reasoningTokens: int
|
||||
|
||||
|
||||
class OCIPropmtTokensDetails(BaseModel):
|
||||
class OCIPromptTokensDetails(BaseModel):
|
||||
"""Prompt token details in the OCI response."""
|
||||
|
||||
cachedTokens: int
|
||||
|
|
@ -129,12 +129,12 @@ class OCIPropmtTokensDetails(BaseModel):
|
|||
|
||||
class OCIResponseUsage(BaseModel):
|
||||
"""Token usage in the OCI response."""
|
||||
|
||||
|
||||
promptTokens: int
|
||||
completionTokens: int
|
||||
totalTokens: int
|
||||
completionTokensDetails: OCICompletionTokenDetails
|
||||
promptTokensDetails: OCIPropmtTokensDetails
|
||||
completionTokensDetails: Optional[OCICompletionTokenDetails] = None
|
||||
promptTokensDetails: Optional[OCIPromptTokensDetails] = None
|
||||
|
||||
|
||||
class OCIResponseChoice(BaseModel):
|
||||
|
|
|
|||
|
|
@ -213,6 +213,10 @@ class TestOCIChatConfig:
|
|||
assert result.usage.prompt_tokens == 10 # type: ignore
|
||||
assert result.usage.completion_tokens == 20 # type: ignore
|
||||
assert result.usage.total_tokens == 30 # type: ignore
|
||||
# These are not handled in the transformer, TBH no idea why they are here
|
||||
# but, for now, they seem to be always None
|
||||
assert result.usage.completion_tokens_details is None
|
||||
assert result.usage.prompt_tokens_details is None
|
||||
|
||||
def test_transform_response_with_tool_calls(self):
|
||||
"""
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue