Skip to content

Commit 5ffd030

Browse files
authored
Merge pull request #204 from BowieHsu/main
修改fixs的错误拼写
2 parents 189ddfb + 5254c70 commit 5ffd030

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

XAgent/agent/tool_agent/agent.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ def validate():
117117
validate()
118118
except Exception as e:
119119
messages[0] = change_tool_call_description(messages[0],reverse=True)
120-
tool_call_args = objgenerator.dynamic_json_fixs(
120+
tool_call_args = objgenerator.dynamic_json_fixes(
121121
broken_json=tool_call_args,
122122
function_schema=tool_schema,
123123
messages=messages,

XAgent/ai_functions/request/obj_generator.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def _get_chatcompletion_request_func(self, request_type:str):
8989
self.chatcompletion_request_funcs[request_type] = getattr(module,'chatcompletion_request')
9090
return self.chatcompletion_request_funcs[request_type]
9191

92-
def dynamic_json_fixs(self, broken_json, function_schema, messages: list = [], error_message: str = None):
92+
def dynamic_json_fixes(self, broken_json, function_schema, messages: list = [], error_message: str = None):
9393
"""Attempts to fix invalid json and validate it against the function schema
9494
9595
Args:
@@ -158,7 +158,7 @@ def validate():
158158
if not isinstance(arguments,str):
159159
arguments = json5.dumps(arguments)
160160
# give one opportunity to fix the json string
161-
response = self.dynamic_json_fixs(arguments,function_schema,messages,str(e))
161+
response = self.dynamic_json_fixes(arguments,function_schema,messages,str(e))
162162
arguments = response['choices'][0]['message']['function_call']['arguments']
163163
validate()
164164

0 commit comments

Comments
 (0)