Commit 149451e5 authored by John Wang's avatar John Wang

Merge branch 'feat/universal-chat' into deploy/dev

# Conflicts:
#	api/core/agent/agent/output_parser/structured_chat.py
parents cb50fd36 5c522e80
......@@ -10,7 +10,7 @@ from langchain.schema import AgentAction, AgentFinish, OutputParserException
class StructuredChatOutputParser(LCStructuredChatOutputParser):
def parse(self, text: str) -> Union[AgentAction, AgentFinish]:
try:
action_match = re.search(r"```(.*)?\n(.*?)```?", text, re.DOTALL)
action_match = re.search(r"```(.*?)\n(.*?)```?", text, re.DOTALL)
if action_match is not None:
response = json.loads(action_match.group(2).strip(), strict=False)
if isinstance(response, list):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment