mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-19 00:01:29 +00:00
remove deprecated pydantic class Config (#12528)
This commit is contained in:
parent
a1a979fae1
commit
75d68a47d0
3 changed files with 12 additions and 15 deletions
|
|
@ -1,10 +1,10 @@
|
|||
import asyncio
|
||||
import contextvars
|
||||
from functools import partial
|
||||
from typing import TYPE_CHECKING, Any, Dict, Iterator, Optional, Union
|
||||
from typing import TYPE_CHECKING, Any, ClassVar, Dict, Iterator, Optional, Union
|
||||
|
||||
import httpx
|
||||
from pydantic import BaseModel
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
|
||||
import litellm
|
||||
from 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: str
|
||||
request_body: Dict[str, Any]
|
||||
custom_llm_provider: str
|
||||
|
|
@ -48,9 +50,6 @@ class GenerateContentSetupResult(BaseModel):
|
|||
litellm_logging_obj: LiteLLMLoggingObj
|
||||
litellm_call_id: Optional[str]
|
||||
|
||||
class Config:
|
||||
arbitrary_types_allowed = True
|
||||
|
||||
|
||||
class GenerateContentHelper:
|
||||
"""Helper class for Google GenAI generate content operations"""
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
# Duplicate -> https://github.com/confident-ai/deepeval/blob/main/deepeval/tracing/api.py
|
||||
from 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, ConfigDict
|
||||
|
||||
|
||||
class SpanApiType(Enum):
|
||||
|
|
@ -21,6 +21,8 @@ class TraceSpanApiStatus(Enum):
|
|||
|
||||
|
||||
class BaseApiSpan(BaseModel):
|
||||
model_config: ClassVar[ConfigDict] = ConfigDict(use_enum_values=True)
|
||||
|
||||
uuid: str
|
||||
name: Optional[str] = None
|
||||
status: 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: str
|
||||
|
|
|
|||
|
|
@ -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, ConfigDict
|
||||
|
||||
|
||||
class MCPTool(BaseModel):
|
||||
|
||||
model_config: ClassVar[ConfigDict] = ConfigDict(arbitrary_types_allowed=True)
|
||||
name: str
|
||||
description: str
|
||||
input_schema: Dict[str, Any]
|
||||
handler: Callable
|
||||
|
||||
class Config:
|
||||
arbitrary_types_allowed = True
|
||||
|
||||
|
||||
class ToolSchema(BaseModel):
|
||||
name: str
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue