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

@@ -6,7 +6,7 @@ from typing import Any, Dict, List, Optional, Union
from fastapi import File, UploadFile
from dbgpt._private.pydantic import BaseModel, Field
from dbgpt._private.pydantic import BaseModel, ConfigDict, Field
from dbgpt.rag.chunk_manager import ChunkParameters
@@ -60,7 +60,7 @@ class ChatCompletionRequestBody(BaseModel):
"or in full each time. "
"If this parameter is not provided, the default is full return.",
)
enable_vis: str = Field(
enable_vis: bool = Field(
default=True, description="response content whether to output vis label"
)
@@ -267,6 +267,8 @@ class DocumentModel(BaseModel):
class SyncModel(BaseModel):
"""Sync model."""
model_config = ConfigDict(protected_namespaces=())
"""doc_id: doc id"""
doc_id: str = Field(None, description="The doc id")