mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-31 01:35:00 +00:00
refactor: Improve reasoning tag handling in base_coder.py
This commit is contained in:
parent
e5ca79cd51
commit
30a630412d
1 changed files with 5 additions and 6 deletions
|
@ -1758,12 +1758,9 @@ class Coder:
|
|||
|
||||
if reasoning_content:
|
||||
formatted_reasoning = (
|
||||
self.replace_reasoning_tags(
|
||||
f"<{REASONING_TAG}>\n\n" + reasoning_content + f"\n\n</{REASONING_TAG}>",
|
||||
REASONING_TAG,
|
||||
)
|
||||
+ "\n\n"
|
||||
f"<{REASONING_TAG}>\n\n" + reasoning_content + f"\n\n</{REASONING_TAG}>"
|
||||
)
|
||||
formatted_reasoning = self.replace_reasoning_tags(formatted_reasoning, REASONING_TAG) + "\n\n"
|
||||
show_resp = formatted_reasoning + show_resp
|
||||
|
||||
self.io.assistant_output(show_resp, pretty=self.show_pretty())
|
||||
|
@ -1844,7 +1841,9 @@ class Coder:
|
|||
|
||||
def live_incremental_response(self, final):
|
||||
show_resp = self.render_incremental_response(final)
|
||||
# convert the tags to START/END ai!
|
||||
# Apply any reasoning tag formatting
|
||||
if self.got_reasoning_content:
|
||||
show_resp = self.replace_reasoning_tags(show_resp, REASONING_TAG)
|
||||
self.mdstream.update(show_resp, final=final)
|
||||
|
||||
def render_incremental_response(self, final):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue