fix: address code review feedback — remove unused imports, avoid dict mutation, move inline imports to module level

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Kavin Anand 2026-04-10 12:01:53 -07:00
parent 1d5d30e5f1
commit b0bbb9359b
2 changed files with 8 additions and 10 deletions

View file

@ -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,

View file

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