mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-24 22:34:59 +00:00
wip
This commit is contained in:
parent
f00a1e827a
commit
a6d80e815e
2 changed files with 9 additions and 8 deletions
|
@ -355,7 +355,10 @@ class Coder:
|
||||||
|
|
||||||
return self.send_new_user_message(inp)
|
return self.send_new_user_message(inp)
|
||||||
|
|
||||||
num_ticks = 4
|
num_ticks = 5
|
||||||
|
|
||||||
|
def get_fence_ticks(self):
|
||||||
|
return "`" * self.num_ticks
|
||||||
|
|
||||||
def fmt_system_reminder(self):
|
def fmt_system_reminder(self):
|
||||||
prompt = self.gpt_prompts.system_reminder
|
prompt = self.gpt_prompts.system_reminder
|
||||||
|
@ -364,18 +367,16 @@ class Coder:
|
||||||
explain = f"""
|
explain = f"""
|
||||||
You *MUST* use {num_ticks} backticks, because some files contain {num_ticks-1} backticks already!"""
|
You *MUST* use {num_ticks} backticks, because some files contain {num_ticks-1} backticks already!"""
|
||||||
|
|
||||||
self.fence_ticks = "`" * num_ticks
|
|
||||||
|
|
||||||
number_mapping = {
|
number_mapping = {
|
||||||
3: "triple",
|
3: "triple",
|
||||||
4: "quadruple",
|
# 4: "quadruple",
|
||||||
5: "quintuple",
|
# 5: "quintuple",
|
||||||
}
|
}
|
||||||
num_ticks_name = number_mapping.get(num_ticks, str(num_ticks))
|
num_ticks_name = number_mapping.get(num_ticks, str(num_ticks))
|
||||||
|
|
||||||
prompt = prompt.format(
|
prompt = prompt.format(
|
||||||
num_ticks=num_ticks_name,
|
num_ticks=num_ticks_name,
|
||||||
fence=self.fence_ticks,
|
fence=self.get_fence_ticks(),
|
||||||
num_ticks_explanation=explain,
|
num_ticks_explanation=explain,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,7 @@ class WholeFileCoder(Coder):
|
||||||
fname = None
|
fname = None
|
||||||
new_lines = []
|
new_lines = []
|
||||||
for i, line in enumerate(lines):
|
for i, line in enumerate(lines):
|
||||||
if line.startswith(self.fence_ticks):
|
if line.startswith(self.get_fence_ticks()):
|
||||||
if fname is not None:
|
if fname is not None:
|
||||||
# ending an existing block
|
# ending an existing block
|
||||||
saw_fname = None
|
saw_fname = None
|
||||||
|
@ -79,7 +79,7 @@ class WholeFileCoder(Coder):
|
||||||
else:
|
else:
|
||||||
# TODO: sense which file it is by diff size
|
# TODO: sense which file it is by diff size
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
f"No filename provided before {self.fence_ticks} in file listing"
|
f"No filename provided before {self.get_fence_ticks()} in file listing"
|
||||||
)
|
)
|
||||||
|
|
||||||
elif fname is not None:
|
elif fname is not None:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue