mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-01 10:14:59 +00:00
refactor: Extract reasoning content removal to helper method
This commit is contained in:
parent
586af2a435
commit
cddc67ad69
1 changed files with 5 additions and 3 deletions
|
@ -1382,12 +1382,10 @@ class Coder:
|
||||||
|
|
||||||
self.partial_response_content = self.get_multi_response_content_in_progress(True)
|
self.partial_response_content = self.get_multi_response_content_in_progress(True)
|
||||||
|
|
||||||
# ai: make a helper method...
|
self.partial_response_content = self.remove_reasoning_content(
|
||||||
self.partial_response_content = self.main_model.remove_reasoning_content(
|
|
||||||
self.partial_response_content,
|
self.partial_response_content,
|
||||||
self.reasoning_tag_name,
|
self.reasoning_tag_name,
|
||||||
)
|
)
|
||||||
# ... ai!
|
|
||||||
self.multi_response_content = ""
|
self.multi_response_content = ""
|
||||||
|
|
||||||
###
|
###
|
||||||
|
@ -1835,6 +1833,10 @@ class Coder:
|
||||||
def render_incremental_response(self, final):
|
def render_incremental_response(self, final):
|
||||||
return self.get_multi_response_content_in_progress()
|
return self.get_multi_response_content_in_progress()
|
||||||
|
|
||||||
|
def remove_reasoning_content(self, content, reasoning_tag_name):
|
||||||
|
"""Remove reasoning content from the model's response."""
|
||||||
|
return self.main_model.remove_reasoning_content(content, reasoning_tag_name)
|
||||||
|
|
||||||
def calculate_and_show_tokens_and_cost(self, messages, completion=None):
|
def calculate_and_show_tokens_and_cost(self, messages, completion=None):
|
||||||
prompt_tokens = 0
|
prompt_tokens = 0
|
||||||
completion_tokens = 0
|
completion_tokens = 0
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue