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
remove deprecated pydantic class Config (#12528)
William Easton75d68a47d0db
diff --git a/litellm/google_genai/main.py b/litellm/google_genai/main.pyindex 2e80549f7a0..cf9724adfe2 100644--- a/litellm/google_genai/main.py+++ b/litellm/google_genai/main.py@@ -1,10 +1,10 @@import asyncioimport contextvarsfrom functools import partial-from typing import TYPE_CHECKING, Any, Dict, Iterator, Optional, Union+from typing import TYPE_CHECKING, Any, ClassVar, Dict, Iterator, Optional, Unionimport httpx-from pydantic import BaseModel+from pydantic import BaseModel, ConfigDictimport litellmfrom litellm.constants import request_timeout@@ -39,6 +39,8 @@ base_llm_http_handler = BaseLLMHTTPHandler()class GenerateContentSetupResult(BaseModel):"""Internal Type - Result of setting up a generate content call"""+ model_config: ClassVar[ConfigDict] = ConfigDict(arbitrary_types_allowed=True)+model: strrequest_body: Dict[str, Any]custom_llm_provider: str@@ -48,9 +50,6 @@ class GenerateContentSetupResult(BaseModel):litellm_logging_obj: LiteLLMLoggingObjlitellm_call_id: Optional[str]- class Config:- arbitrary_types_allowed = True-class GenerateContentHelper:"""Helper class for Google GenAI generate content operations"""diff --git a/litellm/integrations/deepeval/types.py b/litellm/integrations/deepeval/types.pyindex 321bd962f83..afaf4436db9 100644--- a/litellm/integrations/deepeval/types.py+++ b/litellm/integrations/deepeval/types.py@@ -1,7 +1,7 @@# Duplicate -> https://github.com/confident-ai/deepeval/blob/main/deepeval/tracing/api.pyfrom enum import Enum-from typing import Any, Dict, List, Optional, Union, Literal-from pydantic import BaseModel, Field+from typing import Any, ClassVar, Dict, List, Optional, Union, Literal+from pydantic import BaseModel, Field, ConfigDictclass SpanApiType(Enum):@@ -21,6 +21,8 @@ class TraceSpanApiStatus(Enum):class BaseApiSpan(BaseModel):+ model_config: ClassVar[ConfigDict] = ConfigDict(use_enum_values=True)+uuid: strname: Optional[str] = Nonestatus: TraceSpanApiStatus@@ -40,9 +42,6 @@ class BaseApiSpan(BaseModel):cost_per_input_token: Optional[float] = Field(None, alias="costPerInputToken")cost_per_output_token: Optional[float] = Field(None, alias="costPerOutputToken")- class Config:- use_enum_values = True-class TraceApi(BaseModel):uuid: strdiff --git a/litellm/types/mcp_server/tool_registry.py b/litellm/types/mcp_server/tool_registry.pyindex f2c1cf1a30b..36c0919282a 100644--- a/litellm/types/mcp_server/tool_registry.py+++ b/litellm/types/mcp_server/tool_registry.py@@ -1,17 +1,16 @@-from typing import Any, Callable, Dict, List, Optional+from typing import Any, Callable, ClassVar, Dict, List, Optional-from pydantic import BaseModel+from pydantic import BaseModel, ConfigDictclass MCPTool(BaseModel):++ model_config: ClassVar[ConfigDict] = ConfigDict(arbitrary_types_allowed=True)name: strdescription: strinput_schema: Dict[str, Any]handler: Callable- class Config:- arbitrary_types_allowed = True-class ToolSchema(BaseModel):name: str