mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-01 18:25:00 +00:00
style: Apply linter formatting to base_coder.py
This commit is contained in:
parent
f3b9831a0c
commit
7a098ce740
1 changed files with 14 additions and 13 deletions
|
@ -1391,7 +1391,7 @@ class Coder:
|
||||||
self.multi_response_content = ""
|
self.multi_response_content = ""
|
||||||
|
|
||||||
print()
|
print()
|
||||||
print("="*20)
|
print("=" * 20)
|
||||||
dump(self.partial_response_content)
|
dump(self.partial_response_content)
|
||||||
|
|
||||||
self.io.tool_output()
|
self.io.tool_output()
|
||||||
|
@ -1695,25 +1695,25 @@ class Coder:
|
||||||
def replace_reasoning_tags(self, text, tag_name):
|
def replace_reasoning_tags(self, text, tag_name):
|
||||||
"""
|
"""
|
||||||
Replace opening and closing reasoning tags with standard formatting.
|
Replace opening and closing reasoning tags with standard formatting.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
text (str): The text containing the tags
|
text (str): The text containing the tags
|
||||||
tag_name (str): The name of the tag to replace
|
tag_name (str): The name of the tag to replace
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
str: Text with reasoning tags replaced with standard format
|
str: Text with reasoning tags replaced with standard format
|
||||||
"""
|
"""
|
||||||
if not text:
|
if not text:
|
||||||
return text
|
return text
|
||||||
|
|
||||||
# Replace opening tag
|
# Replace opening tag
|
||||||
text = re.sub(f"<{tag_name}>", REASONING_START, text)
|
text = re.sub(f"<{tag_name}>", REASONING_START, text)
|
||||||
|
|
||||||
# Replace closing tag
|
# Replace closing tag
|
||||||
text = re.sub(f"</{tag_name}>", REASONING_END, text)
|
text = re.sub(f"</{tag_name}>", REASONING_END, text)
|
||||||
|
|
||||||
return text
|
return text
|
||||||
|
|
||||||
def show_send_output(self, completion):
|
def show_send_output(self, completion):
|
||||||
if self.verbose:
|
if self.verbose:
|
||||||
print(completion)
|
print(completion)
|
||||||
|
@ -1757,12 +1757,13 @@ class Coder:
|
||||||
show_resp = self.render_incremental_response(True)
|
show_resp = self.render_incremental_response(True)
|
||||||
|
|
||||||
if reasoning_content:
|
if reasoning_content:
|
||||||
formatted_reasoning = self.replace_reasoning_tags(
|
formatted_reasoning = (
|
||||||
f"<{REASONING_TAG}>\n\n"
|
self.replace_reasoning_tags(
|
||||||
+ reasoning_content
|
f"<{REASONING_TAG}>\n\n" + reasoning_content + f"\n\n</{REASONING_TAG}>",
|
||||||
+ f"\n\n</{REASONING_TAG}>",
|
REASONING_TAG,
|
||||||
REASONING_TAG
|
)
|
||||||
) + "\n\n"
|
+ "\n\n"
|
||||||
|
)
|
||||||
show_resp = formatted_reasoning + show_resp
|
show_resp = formatted_reasoning + show_resp
|
||||||
|
|
||||||
self.io.assistant_output(show_resp, pretty=self.show_pretty())
|
self.io.assistant_output(show_resp, pretty=self.show_pretty())
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue