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 = {