mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-24 22:34:59 +00:00
Removed support for func based coders
This commit is contained in:
parent
3401395e61
commit
fbc4a49c24
4 changed files with 8 additions and 18 deletions
|
@ -58,13 +58,7 @@ class Coder:
|
|||
io,
|
||||
**kwargs,
|
||||
):
|
||||
from . import (
|
||||
EditBlockCoder,
|
||||
EditBlockFunctionCoder,
|
||||
SingleWholeFileFunctionCoder,
|
||||
WholeFileCoder,
|
||||
WholeFileFunctionCoder,
|
||||
)
|
||||
from . import EditBlockCoder, WholeFileCoder
|
||||
|
||||
if not main_model:
|
||||
main_model = models.GPT35_16k
|
||||
|
@ -85,14 +79,6 @@ class Coder:
|
|||
return EditBlockCoder(main_model, io, **kwargs)
|
||||
elif edit_format == "whole":
|
||||
return WholeFileCoder(main_model, io, **kwargs)
|
||||
elif edit_format == "whole-func":
|
||||
return WholeFileFunctionCoder(main_model, io, **kwargs)
|
||||
elif edit_format == "single-whole-func":
|
||||
return SingleWholeFileFunctionCoder(main_model, io, **kwargs)
|
||||
elif edit_format == "diff-func-list":
|
||||
return EditBlockFunctionCoder("list", main_model, io, **kwargs)
|
||||
elif edit_format in ("diff-func", "diff-func-string"):
|
||||
return EditBlockFunctionCoder("string", main_model, io, **kwargs)
|
||||
else:
|
||||
raise ValueError(f"Unknown edit format {edit_format}")
|
||||
|
||||
|
|
|
@ -58,6 +58,7 @@ class EditBlockFunctionCoder(Coder):
|
|||
]
|
||||
|
||||
def __init__(self, code_format, *args, **kwargs):
|
||||
raise RuntimeError("Deprecated, needs to be refactored to support get_edits/apply_edits")
|
||||
self.code_format = code_format
|
||||
|
||||
if code_format == "string":
|
||||
|
@ -91,7 +92,7 @@ class EditBlockFunctionCoder(Coder):
|
|||
res = json.dumps(args, indent=4)
|
||||
return res
|
||||
|
||||
def update_files(self):
|
||||
def _update_files(self):
|
||||
name = self.partial_response_function_call.get("name")
|
||||
|
||||
if name and name != "replace_lines":
|
||||
|
|
|
@ -31,6 +31,7 @@ class SingleWholeFileFunctionCoder(Coder):
|
|||
]
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
raise RuntimeError("Deprecated, needs to be refactored to support get_edits/apply_edits")
|
||||
self.gpt_prompts = SingleWholeFileFunctionPrompts()
|
||||
super().__init__(*args, **kwargs)
|
||||
|
||||
|
@ -94,7 +95,7 @@ class SingleWholeFileFunctionCoder(Coder):
|
|||
|
||||
return "\n".join(show_diff)
|
||||
|
||||
def update_files(self):
|
||||
def _update_files(self):
|
||||
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"')
|
||||
|
|
|
@ -44,6 +44,8 @@ class WholeFileFunctionCoder(Coder):
|
|||
]
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
raise RuntimeError("Deprecated, needs to be refactored to support get_edits/apply_edits")
|
||||
|
||||
self.gpt_prompts = WholeFileFunctionPrompts()
|
||||
super().__init__(*args, **kwargs)
|
||||
|
||||
|
@ -105,7 +107,7 @@ class WholeFileFunctionCoder(Coder):
|
|||
|
||||
return "\n".join(show_diff)
|
||||
|
||||
def update_files(self):
|
||||
def _update_files(self):
|
||||
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"')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue