From 87c912087cff635543f5da80229a77ff3cfdb224 Mon Sep 17 00:00:00 2001 From: glide-the <2533736852@qq.com> Date: Thu, 7 Mar 2024 13:54:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dglm3=20agent=E8=A2=AB?= =?UTF-8?q?=E6=B3=A8=E9=87=8A=E7=9A=84agent=E4=BC=9A=E8=AF=9D=E6=96=87?= =?UTF-8?q?=E6=9C=AC=E7=BB=93=E6=9E=84=E8=A7=A3=E6=9E=90=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=20=E7=9C=8B=E8=B5=B7=E6=9D=A5=E8=BE=93=E5=87=BA=E7=9A=84?= =?UTF-8?q?=E6=96=87=E6=9C=AC=E5=8D=A0=E4=BD=8D=E7=AC=A6=E5=A6=82=E4=B8=8B?= =?UTF-8?q?=EF=BC=8C=E7=9B=AE=E5=89=8D=E8=A7=A3=E6=9E=90=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E6=98=AF=E6=9C=89=E9=97=AE=E9=A2=98=E7=9A=84=20Thought=20<|ass?= =?UTF-8?q?istant|>=20Action\r=20```python=20tool=5Fcall(action=5Finput)?= =?UTF-8?q?=20```<|observation|>?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/agent/agent_factory/agents_registry.py | 5 +++-- server/pydantic_types.py | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/server/agent/agent_factory/agents_registry.py b/server/agent/agent_factory/agents_registry.py index be77bd2f..9fae0969 100644 --- a/server/agent/agent_factory/agents_registry.py +++ b/server/agent/agent_factory/agents_registry.py @@ -9,6 +9,7 @@ from langchain_core.prompts import ChatPromptTemplate from langchain_core.tools import BaseTool from server.agent.agent_factory import ( create_structured_qwen_chat_agent) +from server.agent.agent_factory.glm3_agent import create_structured_glm3_chat_agent def agents_registry( @@ -23,8 +24,8 @@ def agents_registry( # Write any optimized method here. if "glm3" in llm.model_name.lower(): # An optimized method of langchain Agent that uses the glm3 series model - # agent = create_structured_glm3_chat_agent(llm=llm, tools=tools) - pass + agent = create_structured_glm3_chat_agent(llm=llm, tools=tools) + # pass elif "qwen" in llm.model_name.lower(): agent = create_structured_qwen_chat_agent(llm=llm, tools=tools) else: diff --git a/server/pydantic_types.py b/server/pydantic_types.py index 78e754e6..af532414 100644 --- a/server/pydantic_types.py +++ b/server/pydantic_types.py @@ -1,6 +1,7 @@ from langchain_core.pydantic_v1 import * from pydantic.fields import FieldInfo from pydantic.schema import model_schema +from pydantic.typing import typing # from pydantic.v1 import * # from pydantic.v1.fields import FieldInfo