From b0bbb9359bf6ea9deac03295546be19ce28d7adb Mon Sep 17 00:00:00 2001 From: Kavin Anand Date: Fri, 10 Apr 2026 12:01:53 -0700 Subject: [PATCH] =?UTF-8?q?fix:=20address=20code=20review=20feedback=20?= =?UTF-8?q?=E2=80=94=20remove=20unused=20imports,=20avoid=20dict=20mutatio?= =?UTF-8?q?n,=20move=20inline=20imports=20to=20module=20level?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.6 (1M context) --- .../llms/sail_research/responses/transformation.py | 11 ++++++----- .../test_sail_research_responses_transformation.py | 7 ++----- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/litellm/llms/sail_research/responses/transformation.py b/litellm/llms/sail_research/responses/transformation.py index 449086e3109..816e2daa77a 100644 --- a/litellm/llms/sail_research/responses/transformation.py +++ b/litellm/llms/sail_research/responses/transformation.py @@ -12,11 +12,8 @@ Sail is a responses-only provider. Key differences from vanilla OpenAI: Ref: https://api.sailresearch.com """ -from typing import Any, Dict, List, Optional, Union +from typing import Dict, Optional, Union -import httpx - -from litellm.litellm_core_utils.litellm_logging import Logging as LiteLLMLoggingObj from litellm.llms.openai.responses.transformation import OpenAIResponsesAPIConfig from litellm.secret_managers.main import get_secret_str from litellm.types.llms.openai import ResponseInputParam @@ -95,7 +92,11 @@ class SailResearchResponsesConfig(OpenAIResponsesAPIConfig): } # Never send stream: true to Sail - response_api_optional_request_params.pop("stream", None) + response_api_optional_request_params = { + k: v + for k, v in response_api_optional_request_params.items() + if k != "stream" + } return super().transform_responses_api_request( model=model, diff --git a/tests/test_litellm/llms/sail_research/responses/test_sail_research_responses_transformation.py b/tests/test_litellm/llms/sail_research/responses/test_sail_research_responses_transformation.py index d10f3bfd63f..a0f10084c74 100644 --- a/tests/test_litellm/llms/sail_research/responses/test_sail_research_responses_transformation.py +++ b/tests/test_litellm/llms/sail_research/responses/test_sail_research_responses_transformation.py @@ -15,10 +15,12 @@ import pytest sys.path.insert(0, os.path.abspath("../../../../..")) +from litellm.litellm_core_utils.litellm_logging import Logging as LiteLLMLoggingObj from litellm.llms.sail_research.responses.transformation import ( SailResearchResponsesConfig, ) from litellm.types.llms.openai import ResponsesAPIOptionalRequestParams +from litellm.types.router import GenericLiteLLMParams from litellm.types.utils import LlmProviders from litellm.utils import ProviderConfigManager @@ -225,7 +227,6 @@ class TestSailResearchResponsesTransformation: def test_validate_environment_sets_auth_header(self): """API key is set in Authorization header""" config = SailResearchResponsesConfig() - from litellm.types.router import GenericLiteLLMParams headers = config.validate_environment( headers={}, @@ -237,10 +238,6 @@ class TestSailResearchResponsesTransformation: def test_successful_response_passes_through(self): """Normal completed response delegates to base OpenAI handler""" - from litellm.litellm_core_utils.litellm_logging import ( - Logging as LiteLLMLoggingObj, - ) - config = SailResearchResponsesConfig() success_body = {