fix: cot agent chinese json bug (#18073)

Co-authored-by: huangzhuo <huangzhuo1@xiaomi.com>
This commit is contained in:
huangzhuo1949 2025-04-15 15:36:44 +08:00 committed by GitHub
parent 05b8b2a30c
commit 5dd9acbe44
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -191,7 +191,7 @@ class CotAgentRunner(BaseAgentRunner, ABC):
# action is final answer, return final answer directly
try:
if isinstance(scratchpad.action.action_input, dict):
final_answer = json.dumps(scratchpad.action.action_input)
final_answer = json.dumps(scratchpad.action.action_input, ensure_ascii=False)
elif isinstance(scratchpad.action.action_input, str):
final_answer = scratchpad.action.action_input
else: