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: add type hints for APIError and AnthropicError status codes
Krrish Dholakia1affd4e2ca8d
diff --git a/litellm/exceptions.py b/litellm/exceptions.pyindex 197e64c7589..0abe3e33afb 100644--- a/litellm/exceptions.py+++ b/litellm/exceptions.py@@ -543,7 +543,7 @@ class InternalServerError(openai.InternalServerError): # type: ignoreclass APIError(openai.APIError): # type: ignoredef __init__(self,- status_code,+ status_code: int,message,llm_provider,model,@@ -754,7 +754,7 @@ class MockException(openai.APIError):# used for testingdef __init__(self,- status_code,+ status_code: int,message,llm_provider,model,diff --git a/litellm/llms/anthropic.py b/litellm/llms/anthropic.pyindex 2221a3d73f0..e3bc595dd4e 100644--- a/litellm/llms/anthropic.py+++ b/litellm/llms/anthropic.py@@ -72,7 +72,7 @@ class AnthropicConstants(Enum):class AnthropicError(Exception):- def __init__(self, status_code, message):+ def __init__(self, status_code: int, message):self.status_code = status_codeself.message: str = messageself.request = httpx.Request(