From fa56dde92765fdc59f7f121aaa80460dcaa8f3a5 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. Co-authored-by: Cursor --- 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 5e2793ed40d..cfc2a8f09ab 100644 --- a/litellm/responses/main.py +++ b/litellm/responses/main.py @@ -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(