From acea6646f003885687e67fca736de8b58bfc4929 Mon Sep 17 00:00:00 2001 From: Zhicheng Zhang Date: Wed, 1 Nov 2023 10:24:01 +0800 Subject: [PATCH] update to pydantic 2.0 --- modelscope_agent/tools/tool.py | 2 +- requirements.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modelscope_agent/tools/tool.py b/modelscope_agent/tools/tool.py index 121eb7e05..0fa626698 100644 --- a/modelscope_agent/tools/tool.py +++ b/modelscope_agent/tools/tool.py @@ -58,7 +58,7 @@ def __init__(self, cfg={}): except ValidationError: raise ValueError(f'Error when parsing parameters of {self.name}') - self._str = self.tool_schema.json(ensure_ascii=False) + self._str = self.tool_schema.model_dump_json() def __call__(self, remote=False, *args, **kwargs): if self.is_remote_tool or remote: diff --git a/requirements.txt b/requirements.txt index 8f4f04615..bef530b3e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -8,7 +8,7 @@ ms-swift openai opencv-python Pillow -pydantic==1.10.8 +pydantic>=2.0.0 pytest python-dotenv soundfile