Skip to content

Commit

Permalink
fix: 修复agent中因为编码导致模型无法识别的问题 (#701)
Browse files Browse the repository at this point in the history
* fix iam sign

* fix ascii problem
  • Loading branch information
ZingLix authored Jul 31, 2024
1 parent 7c90786 commit b06fb71
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def _convert_action_into_message(
additional_kwargs={
"function_call": {
"name": step.tool,
"arguments": json.dumps(step.tool_input),
"arguments": json.dumps(step.tool_input, ensure_ascii=False),
}
},
)
Expand All @@ -83,7 +83,11 @@ def _convert_action_into_message(
if not isinstance(tool_result, dict):
dicts = {"result": tool_result}

messages.append(FunctionMessage(name=step.tool, content=json.dumps(dicts)))
messages.append(
FunctionMessage(
name=step.tool, content=json.dumps(dicts, ensure_ascii=False)
)
)
return messages


Expand Down

0 comments on commit b06fb71

Please sign in to comment.