This commit is contained in:
Paul Gauthier 2024-08-07 07:37:16 -03:00
parent 492738f325
commit 47295a1545
4 changed files with 32 additions and 18 deletions

View file

@ -1209,8 +1209,12 @@ class Coder:
show_func_err = None
show_content_err = None
try:
self.partial_response_function_call = completion.choices[0].message.function_call
self.partial_response_function_call = (
completion.choices[0].message.tool_calls[0].function
)
dump(str(self.partial_response_function_call))
except AttributeError as func_err:
dump(func_err)
show_func_err = func_err
try:
@ -1219,7 +1223,7 @@ class Coder:
show_content_err = content_err
resp_hash = dict(
function_call=self.partial_response_function_call,
function_call=str(self.partial_response_function_call),
content=self.partial_response_content,
)
resp_hash = hashlib.sha1(json.dumps(resp_hash, sort_keys=True).encode())