mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-24 14:25:00 +00:00
new json schema for multi-file edits
This commit is contained in:
parent
25444bbe9e
commit
04d0f95af9
2 changed files with 14 additions and 9 deletions
|
@ -729,7 +729,8 @@ class Coder:
|
||||||
return None, err
|
return None, err
|
||||||
|
|
||||||
def parse_partial_args(self):
|
def parse_partial_args(self):
|
||||||
# dump(self.partial_response_function_call)
|
dump(self.partial_response_function_call)
|
||||||
|
|
||||||
data = self.partial_response_function_call.get("arguments")
|
data = self.partial_response_function_call.get("arguments")
|
||||||
if not data:
|
if not data:
|
||||||
return
|
return
|
||||||
|
|
|
@ -2,6 +2,7 @@ import os
|
||||||
|
|
||||||
from aider import diffs
|
from aider import diffs
|
||||||
|
|
||||||
|
from ..dump import dump
|
||||||
from .base_coder import Coder
|
from .base_coder import Coder
|
||||||
from .func_prompts import FunctionPrompts
|
from .func_prompts import FunctionPrompts
|
||||||
|
|
||||||
|
@ -13,19 +14,21 @@ class FunctionCoder(Coder):
|
||||||
description="create or update a file",
|
description="create or update a file",
|
||||||
parameters=dict(
|
parameters=dict(
|
||||||
type="object",
|
type="object",
|
||||||
|
required=["explanation", "files_to_update"],
|
||||||
properties=dict(
|
properties=dict(
|
||||||
items=dict(
|
explanation=dict(
|
||||||
|
type="string",
|
||||||
|
description=(
|
||||||
|
"Explanation of the changes to be made to the code (future tense,"
|
||||||
|
" markdown format)"
|
||||||
|
),
|
||||||
|
),
|
||||||
|
files_to_update=dict(
|
||||||
type="array",
|
type="array",
|
||||||
items=dict(
|
items=dict(
|
||||||
type="object",
|
type="object",
|
||||||
required=["explanation", "file_path", "file_content"],
|
required=["file_path", "file_content"],
|
||||||
properties=dict(
|
properties=dict(
|
||||||
explanation=dict(
|
|
||||||
type="string",
|
|
||||||
description=(
|
|
||||||
"Explanation of the changes to be made to the code (markdown format)"
|
|
||||||
),
|
|
||||||
),
|
|
||||||
file_path=dict(
|
file_path=dict(
|
||||||
type="string",
|
type="string",
|
||||||
description="Path of file to write",
|
description="Path of file to write",
|
||||||
|
@ -56,6 +59,7 @@ class FunctionCoder(Coder):
|
||||||
|
|
||||||
def modify_incremental_response(self):
|
def modify_incremental_response(self):
|
||||||
args = self.parse_partial_args()
|
args = self.parse_partial_args()
|
||||||
|
dump(args)
|
||||||
if not args:
|
if not args:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue