From be312eb160755b7f8eda9774c12c90ec13d037c7 Mon Sep 17 00:00:00 2001 From: hx <1367557521@qq.com> Date: Sat, 3 Oct 2026 00:58:16 +0800 Subject: [PATCH] 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. --- litellm/responses/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/litellm/responses/main.py b/litellm/responses/main.py index 0b526adf4fa..3e7d0f88965 100644 --- a/litellm/responses/main.py +++ b/litellm/responses/main.py @@ -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"