refactor: Update reasoning tag formatting to use standalone function

This commit is contained in:
Paul Gauthier (aider) 2025-03-07 16:10:49 -08:00
parent e7f16f07f7
commit 4fc1847a70

View file

@ -1808,7 +1808,7 @@ class Coder:
self.live_incremental_response(False) self.live_incremental_response(False)
elif text: elif text:
# Apply reasoning tag formatting # Apply reasoning tag formatting
text = self.replace_reasoning_tags(text) text = replace_reasoning_tags(text, self.reasoning_tag_name)
try: try:
sys.stdout.write(text) sys.stdout.write(text)
except UnicodeEncodeError: except UnicodeEncodeError:
@ -1826,7 +1826,7 @@ class Coder:
def live_incremental_response(self, final): def live_incremental_response(self, final):
show_resp = self.render_incremental_response(final) show_resp = self.render_incremental_response(final)
# Apply any reasoning tag formatting # Apply any reasoning tag formatting
show_resp = self.replace_reasoning_tags(show_resp) show_resp = replace_reasoning_tags(show_resp, self.reasoning_tag_name)
self.mdstream.update(show_resp, final=final) self.mdstream.update(show_resp, final=final)
def render_incremental_response(self, final): def render_incremental_response(self, final):