mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-05 20:25:01 +00:00
refactor: Update reasoning content formatting with improved XML-like tags
This commit is contained in:
parent
5093b18ecc
commit
01454674c8
1 changed files with 12 additions and 3 deletions
|
@ -1390,6 +1390,10 @@ class Coder:
|
||||||
)
|
)
|
||||||
self.multi_response_content = ""
|
self.multi_response_content = ""
|
||||||
|
|
||||||
|
print()
|
||||||
|
print("="*20)
|
||||||
|
dump(self.partial_response_content)
|
||||||
|
|
||||||
self.io.tool_output()
|
self.io.tool_output()
|
||||||
|
|
||||||
self.show_usage_report()
|
self.show_usage_report()
|
||||||
|
@ -1731,7 +1735,12 @@ class Coder:
|
||||||
show_resp = self.render_incremental_response(True)
|
show_resp = self.render_incremental_response(True)
|
||||||
|
|
||||||
if reasoning_content:
|
if reasoning_content:
|
||||||
show_resp = REASONING_START + reasoning_content + REASONING_END + show_resp
|
show_resp = (
|
||||||
|
f"<{REASONING_TAG}>\n\n"
|
||||||
|
+ reasoning_content
|
||||||
|
+ f"\n\n</{REASONING_TAG}>\n\n"
|
||||||
|
+ show_resp
|
||||||
|
)
|
||||||
|
|
||||||
self.io.assistant_output(show_resp, pretty=self.show_pretty())
|
self.io.assistant_output(show_resp, pretty=self.show_pretty())
|
||||||
|
|
||||||
|
@ -1771,7 +1780,7 @@ class Coder:
|
||||||
reasoning_content = chunk.choices[0].delta.reasoning_content
|
reasoning_content = chunk.choices[0].delta.reasoning_content
|
||||||
if reasoning_content:
|
if reasoning_content:
|
||||||
if not self.got_reasoning_content:
|
if not self.got_reasoning_content:
|
||||||
text += REASONING_START
|
text += f"<{REASONING_TAG}>\n\n"
|
||||||
text += reasoning_content
|
text += reasoning_content
|
||||||
self.got_reasoning_content = True
|
self.got_reasoning_content = True
|
||||||
received_content = True
|
received_content = True
|
||||||
|
@ -1782,7 +1791,7 @@ class Coder:
|
||||||
content = chunk.choices[0].delta.content
|
content = chunk.choices[0].delta.content
|
||||||
if content:
|
if content:
|
||||||
if self.got_reasoning_content and not self.ended_reasoning_content:
|
if self.got_reasoning_content and not self.ended_reasoning_content:
|
||||||
text += f"{REASONING_END}</{REASONING_TAG}>\n\n"
|
text += f"\n\n</{REASONING_TAG}>\n\n"
|
||||||
self.ended_reasoning_content = True
|
self.ended_reasoning_content = True
|
||||||
|
|
||||||
text += content
|
text += content
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue