From 1c22ae4805bc845fc84db76d4a53513137be18b2 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Fri, 11 Sep 2026 14:34:45 +0000 Subject: [PATCH] fix(responses): drop Any from nested drop params helper Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- litellm/responses/utils.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/litellm/responses/utils.py b/litellm/responses/utils.py index 677c4950f96..42bd99ccae2 100644 --- a/litellm/responses/utils.py +++ b/litellm/responses/utils.py @@ -31,7 +31,7 @@ from litellm.types.utils import ( ) -def _apply_nested_drop_params(params: dict[str, Any], additional_drop_params: list[str] | None) -> dict[str, Any]: +def _apply_nested_drop_params(params: dict[str, object], additional_drop_params: list[str] | None) -> dict[str, object]: nested_paths: Final = tuple(path for path in additional_drop_params or () if is_nested_path(path)) return reduce(lambda acc, path: delete_nested_value(acc, path), nested_paths, params) @@ -288,7 +288,7 @@ class ResponsesAPIRequestUtils: if "previous_response_id" in non_default_params: decoded_previous_response_id: Final = ( ResponsesAPIRequestUtils.decode_previous_response_id_to_original_previous_response_id( - non_default_params["previous_response_id"] + cast(str, non_default_params["previous_response_id"]) ) ) non_default_params["previous_response_id"] = decoded_previous_response_id @@ -296,7 +296,9 @@ class ResponsesAPIRequestUtils: if "metadata" in non_default_params: from litellm.utils import add_openai_metadata - converted_metadata: Final = add_openai_metadata(non_default_params["metadata"]) + converted_metadata: Final = add_openai_metadata( + cast(Mapping[str, object] | None, non_default_params["metadata"]) + ) if converted_metadata is not None: non_default_params["metadata"] = converted_metadata else: