Remove __init__ from all coders and set edit_format and gpt_prompts like ChatCoder

This commit is contained in:
Your Name (aider) 2024-07-28 18:43:14 -03:00
parent 916021bf10
commit 5fcf454968
6 changed files with 5 additions and 21 deletions

View file

@ -9,7 +9,6 @@ from .chat_prompts import ChatPrompts
class ChatCoder(Coder):
edit_format = "chat"
gpt_prompts = ChatPrompts()
def get_edits(self, mode="update"):

View file

@ -14,10 +14,7 @@ from .editblock_prompts import EditBlockPrompts
class EditBlockCoder(Coder):
edit_format = "diff"
def __init__(self, *args, **kwargs):
self.gpt_prompts = EditBlockPrompts()
super().__init__(*args, **kwargs)
gpt_prompts = EditBlockPrompts()
def get_edits(self):
content = self.partial_response_content

View file

@ -5,7 +5,4 @@ from .editblock_fenced_prompts import EditBlockFencedPrompts
class EditBlockFencedCoder(EditBlockCoder):
edit_format = "diff-fenced"
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.gpt_prompts = EditBlockFencedPrompts()
gpt_prompts = EditBlockFencedPrompts()

View file

@ -5,10 +5,7 @@ from .help_prompts import HelpPrompts
class HelpCoder(Coder):
edit_format = "help"
def __init__(self, *args, **kwargs):
self.gpt_prompts = HelpPrompts()
super().__init__(*args, **kwargs)
gpt_prompts = HelpPrompts()
def get_edits(self, mode="update"):
return []

View file

@ -45,10 +45,7 @@ other_hunks_applied = (
class UnifiedDiffCoder(Coder):
edit_format = "udiff"
def __init__(self, *args, **kwargs):
self.gpt_prompts = UnifiedDiffPrompts()
super().__init__(*args, **kwargs)
gpt_prompts = UnifiedDiffPrompts()
def get_edits(self):
content = self.partial_response_content

View file

@ -9,10 +9,7 @@ from .wholefile_prompts import WholeFilePrompts
class WholeFileCoder(Coder):
edit_format = "whole"
def __init__(self, *args, **kwargs):
self.gpt_prompts = WholeFilePrompts()
super().__init__(*args, **kwargs)
gpt_prompts = WholeFilePrompts()
def update_cur_messages(self, edited):
if edited: