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 issues
Sameer Kankutee289dfc09489
diff --git a/litellm/llms/custom_httpx/llm_http_handler.py b/litellm/llms/custom_httpx/llm_http_handler.pyindex 1da6e61252f..2f6d74eb7a7 100644--- a/litellm/llms/custom_httpx/llm_http_handler.py+++ b/litellm/llms/custom_httpx/llm_http_handler.py@@ -4453,7 +4453,7 @@ class BaseLLMHTTPHandler:self,model: str,image: Any,- prompt: str,+ prompt: Optional[str],image_edit_provider_config: BaseImageEditConfig,image_edit_optional_request_params: Dict,custom_llm_provider: str,@@ -4572,7 +4572,7 @@ class BaseLLMHTTPHandler:self,model: str,image: FileTypes,- prompt: str,+ prompt: Optional[str],image_edit_provider_config: BaseImageEditConfig,image_edit_optional_request_params: Dict,custom_llm_provider: str,diff --git a/litellm/llms/custom_llm.py b/litellm/llms/custom_llm.pyindex d235df30f25..a820ac7f345 100644--- a/litellm/llms/custom_llm.py+++ b/litellm/llms/custom_llm.py@@ -201,7 +201,7 @@ class CustomLLM(BaseLLM):self,model: str,image: Any,- prompt: str,+ prompt: Optional[str],model_response: ImageResponse,api_key: Optional[str],api_base: Optional[str],@@ -216,7 +216,7 @@ class CustomLLM(BaseLLM):self,model: str,image: Any,- prompt: str,+ prompt: Optional[str],model_response: ImageResponse,api_key: Optional[str],api_base: Optional[str],diff --git a/litellm/llms/recraft/image_edit/transformation.py b/litellm/llms/recraft/image_edit/transformation.pyindex 94449257694..533a5108604 100644--- a/litellm/llms/recraft/image_edit/transformation.py+++ b/litellm/llms/recraft/image_edit/transformation.py@@ -124,7 +124,7 @@ class RecraftImageEditConfig(BaseImageEditConfig):########################################################## Reuse OpenAI logic: Separate images as `files` and send other parameters as `data`#########################################################- files_list = self._get_image_files_for_request(image=image)+ files_list = self._get_image_files_for_request(image=image) if image is not None else []data_without_images = {k: v for k, v in request_dict.items() if k != "image"}return data_without_images, files_list@@ -132,7 +132,7 @@ class RecraftImageEditConfig(BaseImageEditConfig):def _get_image_files_for_request(self,- image: FileTypes,+ image: Optional[FileTypes],) -> List[Tuple[str, Any]]:files_list: List[Tuple[str, Any]] = []diff --git a/litellm/llms/vertex_ai/image_edit/vertex_imagen_transformation.py b/litellm/llms/vertex_ai/image_edit/vertex_imagen_transformation.pyindex b61af6ffd3a..1515e6cbe93 100644--- a/litellm/llms/vertex_ai/image_edit/vertex_imagen_transformation.py+++ b/litellm/llms/vertex_ai/image_edit/vertex_imagen_transformation.py@@ -150,6 +150,8 @@ class VertexAIImagenImageEditConfig(BaseImageEditConfig, VertexLLM):headers: dict,) -> Tuple[Dict[str, Any], Optional[RequestFiles]]:# Prepare reference images in the correct Imagen format+ if image is None:+ raise ValueError("Vertex AI Imagen image edit requires at least one reference image.")reference_images = self._prepare_reference_images(image, image_edit_optional_request_params)if not reference_images:raise ValueError("Vertex AI Imagen image edit requires at least one reference image.")