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: correct indentation from commit suggestions and add missing Optional import
Chesars9463de0c6629
diff --git a/litellm/proxy/batches_endpoints/endpoints.py b/litellm/proxy/batches_endpoints/endpoints.pyindex 58c8e2d4d0c..cdee69f2b30 100644--- a/litellm/proxy/batches_endpoints/endpoints.py+++ b/litellm/proxy/batches_endpoints/endpoints.py@@ -257,7 +257,7 @@ async def create_batch( # noqa: PLR0915file_id=response.output_file_id, model=model_param)- if hasattr(response, "error_file_id") and response.error_file_id:+ if hasattr(response, "error_file_id") and response.error_file_id:response.error_file_id = encode_file_id_with_model(file_id=response.error_file_id, model=model_param)diff --git a/tests/litellm/proxy/test_batch_x_litellm_model_encoding.py b/tests/litellm/proxy/test_batch_x_litellm_model_encoding.pyindex 5150b57568b..521a3632dcb 100644--- a/tests/litellm/proxy/test_batch_x_litellm_model_encoding.py+++ b/tests/litellm/proxy/test_batch_x_litellm_model_encoding.py@@ -5,6 +5,7 @@ Verifies that create_batch encodes response IDs with model info so thatretrieve_batch can route back to the correct provider/credentials."""+from typing import Optionalfrom unittest.mock import AsyncMock, MagicMock, patchimport pytest