fix tool_inputs parse error in message that in CoT(ReAct) agent mode (#2949)

This commit is contained in:
listeng 2024-03-26 11:05:10 +08:00 • committed by GitHub
commit d70bd4aaa4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 4 deletions

View file

@ -182,7 +182,7 @@ class AssistantCotApplicationRunner(BaseAssistantApplicationRunner):
delta=LLMResultChunkDelta(
index=0,
message=AssistantPromptMessage(
content=json.dumps(chunk)
content=json.dumps(chunk, ensure_ascii=False) # if ensure_ascii=True, the text in webui maybe garbled text
),
usage=None
)
@ -667,4 +667,4 @@ class AssistantCotApplicationRunner(BaseAssistantApplicationRunner):
try:
return json.dumps(tools, ensure_ascii=False)
except json.JSONDecodeError:
return json.dumps(tools)
return json.dumps(tools)