From 2eb1946909f553804c3dc53ae52985fc263dbf0c Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Wed, 14 Aug 2024 11:26:47 -0700 Subject: [PATCH] avoid deref missing func --- aider/coders/base_coder.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/aider/coders/base_coder.py b/aider/coders/base_coder.py index d82254c97..b4fb86a48 100755 --- a/aider/coders/base_coder.py +++ b/aider/coders/base_coder.py @@ -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