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:
Mateo Wang 2026-11-10 10:54:59 -08:00 • committed by mateo-berri
parent 34ba84c165
commit bf8ccb1ff8

View file

@ -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:
"""