mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-12 08:42:18 +00:00
refactor(proxy): type TokenCountRequest messages and contents as main does
Backport of the TokenCountRequest field types from #47657 to lts/1.108.x, which the #50710 picks rely on to pass the type gate
Hand-ported from ea6dbd2109 (main). Type-only, so request validation and the API schema stay the same
This commit is contained in:
parent
34ba84c165
commit
bf8ccb1ff8
1 changed files with 2 additions and 2 deletions
|
|
@ -3400,12 +3400,12 @@ class LiteLLM_SpendLogs_ResponseObject(LiteLLMPydanticObjectBase):
|
|||
class TokenCountRequest(LiteLLMPydanticObjectBase):
|
||||
model: str
|
||||
prompt: str | None = None
|
||||
messages: list[dict] | None = None
|
||||
messages: list[dict[Any, Any]] | None = None
|
||||
"""
|
||||
Anthropic token counting endpoint uses /messages
|
||||
"""
|
||||
|
||||
contents: list[dict] | None = None
|
||||
contents: list[dict[Any, Any]] | None = None
|
||||
"""
|
||||
Google /countTokens endpoint expects contents to be a list of dicts with the following structure:
|
||||
"""
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue