mirror of
https://github.com/RYDE-WORK/Langchain-Chatchat.git
synced 2026-01-29 10:13:20 +08:00
修复glm3 agent被注释的agent会话文本结构解析代码
看起来输出的文本占位符如下,目前解析代码是有问题的 Thought <|assistant|> Action\r ```python tool_call(action_input) ```<|observation|>
This commit is contained in:
parent
51301dfe6a
commit
87c912087c
@ -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:
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user