From f36ca8086e0aa807a3f1d4046e7e2ca148dab069 Mon Sep 17 00:00:00 2001 From: JoshuaL3000 <112940391+JoshuaL3000@users.noreply.github.com> Date: Mon, 21 Oct 2024 17:33:25 +0800 Subject: [PATCH] Fix llm not recognizing pydantic tool definition for dict types (#782) * Update src/tools.py pydantic imports to use v1 from v2 Signed-off-by: JoshuaL3000 --- comps/agent/langchain/src/tools.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/comps/agent/langchain/src/tools.py b/comps/agent/langchain/src/tools.py index ff3918cc9..5ac0906db 100644 --- a/comps/agent/langchain/src/tools.py +++ b/comps/agent/langchain/src/tools.py @@ -8,7 +8,7 @@ import yaml from langchain.tools import BaseTool, StructuredTool from langchain_community.agent_toolkits.load_tools import load_tools -from pydantic import BaseModel, Field, create_model +from pydantic.v1 import BaseModel, Field, create_model def generate_request_function(url):