use strict for new gpt4o

This commit is contained in:
Paul Gauthier 2024-08-14 11:14:37 -07:00
parent 5c24a06dc8
commit 675263623d
3 changed files with 6 additions and 6 deletions

View file

@ -1031,7 +1031,7 @@ class Coder:
if self.partial_response_function_call:
args = self.parse_partial_args()
if args:
content = args["explanation"]
content = args.get("explanation") or ""
else:
content = ""
elif self.partial_response_content:

View file

@ -1,5 +1,3 @@
import json
from aider import diffs
from ..dump import dump # noqa: F401
@ -14,9 +12,9 @@ class SingleWholeFileFunctionCoder(Coder):
dict(
name="write_file",
description="write new content into the file",
strict=True,
parameters=dict(
type="object",
required=["explanation", "content"],
properties=dict(
explanation=dict(
type="string",
@ -27,9 +25,11 @@ class SingleWholeFileFunctionCoder(Coder):
),
content=dict(
type="string",
description="Content to write to the file",
# description="Content to write to the file",
),
),
required=["explanation", "content"],
additionalProperties=False,
),
),
]

View file

@ -59,7 +59,7 @@ def send_completion(
)
if functions is not None:
kwargs["tools"] = [dict(type="functions", function=functions[0])]
kwargs["tools"] = [dict(type="function", function=functions[0])]
if extra_headers is not None:
kwargs["extra_headers"] = extra_headers
if max_tokens is not None: