fix tool_inputs parse error in message that in CoT(ReAct) agent mode (#2949)
This commit is contained in:
parent
8e05261588
commit
d70bd4aaa4
2 changed files with 8 additions and 4 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue