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.
This commit is contained in:
hx 2026-10-03 00:58:16 +08:00
parent cdeb862da2
commit be312eb160

View file

@ -1467,7 +1467,7 @@ def responses(
)
# get llm provider logic
litellm_params: Final = GenericLiteLLMParams(**kwargs)
litellm_params: Final = GenericLiteLLMParams.model_validate(kwargs)
affinity_api_base: Final = (
get_openai_credentials(api_base=litellm_params.api_base).api_base
if custom_llm_provider == "openai"