mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-25 06:44: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:
|
if self.partial_response_function_call:
|
||||||
args = self.parse_partial_args()
|
args = self.parse_partial_args()
|
||||||
|
if args:
|
||||||
content = args["explanation"]
|
content = args["explanation"]
|
||||||
|
else:
|
||||||
|
content = ""
|
||||||
elif self.partial_response_content:
|
elif self.partial_response_content:
|
||||||
content = self.partial_response_content
|
content = self.partial_response_content
|
||||||
else:
|
else:
|
||||||
|
@ -535,6 +538,8 @@ class Coder:
|
||||||
return interrupted
|
return interrupted
|
||||||
|
|
||||||
def show_send_output(self, completion, silent):
|
def show_send_output(self, completion, silent):
|
||||||
|
# dump(completion)
|
||||||
|
|
||||||
show_func_err = None
|
show_func_err = None
|
||||||
show_content_err = None
|
show_content_err = None
|
||||||
try:
|
try:
|
||||||
|
|
|
@ -105,8 +105,11 @@ class WholeFileFunctionCoder(Coder):
|
||||||
return "\n".join(show_diff)
|
return "\n".join(show_diff)
|
||||||
|
|
||||||
def update_files(self):
|
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:
|
if not args:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue