mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-24 22:34:59 +00:00
Raise ValueError if gpt makes an unknown function_call
This commit is contained in:
parent
4eee71b956
commit
a1909611d9
2 changed files with 10 additions and 2 deletions
|
@ -392,7 +392,10 @@ class Coder:
|
|||
|
||||
if self.partial_response_function_call:
|
||||
args = self.parse_partial_args()
|
||||
content = args["explanation"]
|
||||
if args:
|
||||
content = args["explanation"]
|
||||
else:
|
||||
content = ""
|
||||
elif self.partial_response_content:
|
||||
content = self.partial_response_content
|
||||
else:
|
||||
|
@ -535,6 +538,8 @@ class Coder:
|
|||
return interrupted
|
||||
|
||||
def show_send_output(self, completion, silent):
|
||||
# dump(completion)
|
||||
|
||||
show_func_err = None
|
||||
show_content_err = None
|
||||
try:
|
||||
|
|
|
@ -105,8 +105,11 @@ class WholeFileFunctionCoder(Coder):
|
|||
return "\n".join(show_diff)
|
||||
|
||||
def update_files(self):
|
||||
args = self.parse_partial_args()
|
||||
name = self.partial_response_function_call.get("name")
|
||||
if name and name != "write_file":
|
||||
raise ValueError(f'Unknown function_call name="{name}", use name="write_file"')
|
||||
|
||||
args = self.parse_partial_args()
|
||||
if not args:
|
||||
return
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue