feat(core): Upgrade pydantic to 2.x (#1428)

This commit is contained in:
Fangyin Cheng
2024-04-20 09:41:16 +08:00
committed by GitHub
parent baa1e3f9f6
commit 57be1ece18
103 changed files with 1146 additions and 534 deletions

View File

@@ -1,6 +1,6 @@
from typing import Generic, List, TypeVar
from dbgpt._private.pydantic import BaseModel, Field
from dbgpt._private.pydantic import BaseModel, ConfigDict, Field
T = TypeVar("T")
@@ -8,6 +8,8 @@ T = TypeVar("T")
class PaginationResult(BaseModel, Generic[T]):
"""Pagination result"""
model_config = ConfigDict(arbitrary_types_allowed=True)
items: List[T] = Field(..., description="The items in the current page")
total_count: int = Field(..., description="Total number of items")
total_pages: int = Field(..., description="total number of pages")