fix(responses): validate litellm params without unpacking untyped kwargs

Adding xai_oauth_token_file to GenericLiteLLMParams adds one unknown
argument at every GenericLiteLLMParams(**kwargs) call site. Building the
params in responses() with model_validate, which behaves the same for a
model without a custom __init__, keeps the basedpyright total below base.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
hx 2026-10-03 00:58:16 +08:00
parent 4981dba25e
commit fa56dde927

View file

@ -1223,7 +1223,7 @@ def responses(
)
# get llm provider logic
litellm_params: Final = GenericLiteLLMParams(**kwargs)
litellm_params: Final = GenericLiteLLMParams.model_validate(kwargs)
try:
effective_extra_headers: Final = (
add_provider_affinity_header(