mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-24 22:34:59 +00:00
renamed func -> wholefile_func
This commit is contained in:
parent
fa1158d8a8
commit
985e362544
4 changed files with 10 additions and 9 deletions
|
@ -1,6 +1,6 @@
|
||||||
from .base_coder import Coder
|
from .base_coder import Coder
|
||||||
from .editblock_coder import EditBlockCoder
|
from .editblock_coder import EditBlockCoder
|
||||||
from .func_coder import FunctionCoder
|
|
||||||
from .wholefile_coder import WholeFileCoder
|
from .wholefile_coder import WholeFileCoder
|
||||||
|
from .wholefile_func_coder import WholeFileFunctionCoder
|
||||||
|
|
||||||
__all__ = [Coder, EditBlockCoder, WholeFileCoder, FunctionCoder]
|
__all__ = [Coder, EditBlockCoder, WholeFileCoder, WholeFileFunctionCoder]
|
||||||
|
|
|
@ -49,7 +49,7 @@ class Coder:
|
||||||
openai_api_base="https://api.openai.com/v1",
|
openai_api_base="https://api.openai.com/v1",
|
||||||
**kwargs,
|
**kwargs,
|
||||||
):
|
):
|
||||||
from . import EditBlockCoder, FunctionCoder, WholeFileCoder
|
from . import EditBlockCoder, WholeFileCoder, WholeFileFunctionCoder
|
||||||
|
|
||||||
openai.api_key = openai_api_key
|
openai.api_key = openai_api_key
|
||||||
openai.api_base = openai_api_base
|
openai.api_base = openai_api_base
|
||||||
|
@ -70,8 +70,8 @@ class Coder:
|
||||||
return EditBlockCoder(main_model, io, **kwargs)
|
return EditBlockCoder(main_model, io, **kwargs)
|
||||||
elif edit_format == "whole":
|
elif edit_format == "whole":
|
||||||
return WholeFileCoder(main_model, io, **kwargs)
|
return WholeFileCoder(main_model, io, **kwargs)
|
||||||
elif edit_format == "func":
|
elif edit_format == "whole-func":
|
||||||
return FunctionCoder(main_model, io, **kwargs)
|
return WholeFileFunctionCoder(main_model, io, **kwargs)
|
||||||
else:
|
else:
|
||||||
raise ValueError(f"Unknown edit format {edit_format}")
|
raise ValueError(f"Unknown edit format {edit_format}")
|
||||||
|
|
||||||
|
|
|
@ -5,10 +5,10 @@ from aider import diffs
|
||||||
|
|
||||||
from ..dump import dump # noqa: F401
|
from ..dump import dump # noqa: F401
|
||||||
from .base_coder import Coder
|
from .base_coder import Coder
|
||||||
from .func_prompts import FunctionPrompts
|
from .wholefile_func_prompts import WholeFileFunctionPrompts
|
||||||
|
|
||||||
|
|
||||||
class FunctionCoder(Coder):
|
class WholeFileFunctionCoder(Coder):
|
||||||
functions = [
|
functions = [
|
||||||
dict(
|
dict(
|
||||||
name="write_file",
|
name="write_file",
|
||||||
|
@ -47,7 +47,7 @@ class FunctionCoder(Coder):
|
||||||
]
|
]
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
self.gpt_prompts = FunctionPrompts()
|
self.gpt_prompts = WholeFileFunctionPrompts()
|
||||||
super().__init__(*args, **kwargs)
|
super().__init__(*args, **kwargs)
|
||||||
|
|
||||||
def update_cur_messages(self, content, edited):
|
def update_cur_messages(self, content, edited):
|
|
@ -3,7 +3,7 @@
|
||||||
from .prompts_base import EditorPrompts
|
from .prompts_base import EditorPrompts
|
||||||
|
|
||||||
|
|
||||||
class FunctionPrompts(EditorPrompts):
|
class WholeFileFunctionPrompts(EditorPrompts):
|
||||||
main_system = """Act as an expert software developer.
|
main_system = """Act as an expert software developer.
|
||||||
Take requests for changes to the supplied code.
|
Take requests for changes to the supplied code.
|
||||||
If the request is ambiguous, ask questions.
|
If the request is ambiguous, ask questions.
|
||||||
|
@ -21,6 +21,7 @@ NEVER return code outside the `write_file` function.
|
||||||
|
|
||||||
redacted_edit_message = "No changes are needed."
|
redacted_edit_message = "No changes are needed."
|
||||||
|
|
||||||
|
# TODO: make this optional, since this Coder doesn't use it
|
||||||
repo_content_prefix = (
|
repo_content_prefix = (
|
||||||
"Below here are summaries of other files! Do not propose changes to these *read-only*"
|
"Below here are summaries of other files! Do not propose changes to these *read-only*"
|
||||||
" files without asking me first.\n"
|
" files without asking me first.\n"
|
Loading…
Add table
Add a link
Reference in a new issue