mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-09-09 12:59:43 +00:00
feat(core): Upgrade pydantic to 2.x (#1428)
This commit is contained in:
@@ -6,7 +6,7 @@ from abc import ABC, abstractmethod
|
||||
from typing import Any, AsyncIterator, Dict
|
||||
|
||||
from dbgpt._private.config import Config
|
||||
from dbgpt._private.pydantic import Extra
|
||||
from dbgpt._private.pydantic import EXTRA_FORBID
|
||||
from dbgpt.app.scene.base import AppScenePromptTemplateAdapter, ChatScene
|
||||
from dbgpt.app.scene.operators.app_operator import (
|
||||
AppChatComposerOperator,
|
||||
@@ -72,11 +72,6 @@ class BaseChat(ABC):
|
||||
# convert system message to human message
|
||||
auto_convert_message: bool = True
|
||||
|
||||
class Config:
|
||||
"""Configuration for this pydantic object."""
|
||||
|
||||
arbitrary_types_allowed = True
|
||||
|
||||
@trace("BaseChat.__init__")
|
||||
def __init__(self, chat_param: Dict):
|
||||
"""Chat Module Initialization
|
||||
@@ -142,12 +137,6 @@ class BaseChat(ABC):
|
||||
self._message_version = chat_param.get("message_version", "v2")
|
||||
self._chat_param = chat_param
|
||||
|
||||
class Config:
|
||||
"""Configuration for this pydantic object."""
|
||||
|
||||
extra = Extra.forbid
|
||||
arbitrary_types_allowed = True
|
||||
|
||||
@property
|
||||
def chat_type(self) -> str:
|
||||
raise NotImplementedError("Not supported for this chat type.")
|
||||
|
Reference in New Issue
Block a user