avoid deref missing func

This commit is contained in:
Paul Gauthier 2024-08-14 11:26:47 -07:00
parent 94a26019bd
commit 2eb1946909

View file

@ -1291,10 +1291,11 @@ class Coder:
show_func_err = None
show_content_err = None
try:
self.partial_response_function_call = (
completion.choices[0].message.tool_calls[0].function
)
dump(str(self.partial_response_function_call))
if completion.choices[0].message.tool_calls:
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