The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
fix mypy linting errors
Ishaan Jaffde473bee4bdb
diff --git a/litellm/responses/streaming_iterator.py b/litellm/responses/streaming_iterator.pyindex 88d963c94ed..c016e71e7e2 100644--- a/litellm/responses/streaming_iterator.py+++ b/litellm/responses/streaming_iterator.py@@ -36,7 +36,7 @@ class BaseResponsesAPIStreamingIterator:self.logging_obj = logging_objself.finished = Falseself.responses_api_provider_config = responses_api_provider_config- self.completed_response = None+ self.completed_response: Optional[ResponsesAPIStreamingResponse] = Noneself.start_time = datetime.now()def _process_chunk(self, chunk):@@ -102,7 +102,6 @@ class ResponsesAPIStreamingIterator(BaseResponsesAPIStreamingIterator):):super().__init__(response, model, responses_api_provider_config, logging_obj)self.stream_iterator = response.aiter_lines()- self.completed_response: Optional[ResponsesAPIStreamingResponse] = Nonedef __aiter__(self):return selfdiff --git a/litellm/responses/utils.py b/litellm/responses/utils.pyindex 3a148aed033..49d850ec6aa 100644--- a/litellm/responses/utils.py+++ b/litellm/responses/utils.py@@ -1,4 +1,4 @@-from typing import Any, Dict, get_type_hints+from typing import Any, Dict, cast, get_type_hintsimport litellmfrom litellm.llms.base_llm.responses.transformation import BaseResponsesAPIConfig@@ -73,7 +73,7 @@ class ResponsesAPIRequestUtils:"""valid_keys = get_type_hints(ResponsesAPIOptionalRequestParams).keys()filtered_params = {k: v for k, v in params.items() if k in valid_keys}- return ResponsesAPIOptionalRequestParams(**filtered_params)+ return cast(ResponsesAPIOptionalRequestParams, filtered_params)class ResponseAPILoggingUtils:diff --git a/litellm/types/llms/openai.py b/litellm/types/llms/openai.pyindex 58cb2ab479d..5b811830e70 100644--- a/litellm/types/llms/openai.py+++ b/litellm/types/llms/openai.py@@ -35,7 +35,6 @@ from openai.types.embedding import Embedding as OpenAIEmbeddingfrom openai.types.fine_tuning.fine_tuning_job import FineTuningJobfrom openai.types.responses.response import (IncompleteDetails,- Reasoning,Response,ResponseOutputItem,ResponseTextConfig,