mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-06 12:45:00 +00:00
refactor: Remove unused parameter from remove_reasoning_content function
This commit is contained in:
parent
4858749a20
commit
9aacf5c7db
2 changed files with 2 additions and 8 deletions
|
@ -31,6 +31,7 @@ from aider.models import RETRY_TIMEOUT
|
||||||
from aider.reasoning_tags import (
|
from aider.reasoning_tags import (
|
||||||
REASONING_TAG,
|
REASONING_TAG,
|
||||||
format_reasoning_content,
|
format_reasoning_content,
|
||||||
|
remove_reasoning_content,
|
||||||
replace_reasoning_tags,
|
replace_reasoning_tags,
|
||||||
)
|
)
|
||||||
from aider.repo import ANY_GIT_ERROR, GitRepo
|
from aider.repo import ANY_GIT_ERROR, GitRepo
|
||||||
|
@ -1830,12 +1831,9 @@ class Coder:
|
||||||
def remove_reasoning_content(self):
|
def remove_reasoning_content(self):
|
||||||
"""Remove reasoning content from the model's response."""
|
"""Remove reasoning content from the model's response."""
|
||||||
|
|
||||||
from aider.reasoning_tags import remove_reasoning_content
|
|
||||||
|
|
||||||
self.partial_response_content = remove_reasoning_content(
|
self.partial_response_content = remove_reasoning_content(
|
||||||
self.partial_response_content,
|
self.partial_response_content,
|
||||||
self.reasoning_tag_name,
|
self.reasoning_tag_name,
|
||||||
self.main_model.remove_reasoning,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
def calculate_and_show_tokens_and_cost(self, messages, completion=None):
|
def calculate_and_show_tokens_and_cost(self, messages, completion=None):
|
||||||
|
|
|
@ -11,21 +11,17 @@ REASONING_START = "> Thinking ..."
|
||||||
REASONING_END = "> ... done thinking.\n\n------"
|
REASONING_END = "> ... done thinking.\n\n------"
|
||||||
|
|
||||||
|
|
||||||
def remove_reasoning_content(res, reasoning_tag=None, model_remove_reasoning=None):
|
def remove_reasoning_content(res, reasoning_tag):
|
||||||
"""
|
"""
|
||||||
Remove reasoning content from text based on tags.
|
Remove reasoning content from text based on tags.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
res (str): The text to process
|
res (str): The text to process
|
||||||
reasoning_tag (str): The tag name to remove
|
reasoning_tag (str): The tag name to remove
|
||||||
model_remove_reasoning (str): Fallback tag name from model settings
|
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
str: Text with reasoning content removed
|
str: Text with reasoning content removed
|
||||||
"""
|
"""
|
||||||
if not reasoning_tag:
|
|
||||||
reasoning_tag = model_remove_reasoning
|
|
||||||
|
|
||||||
if not reasoning_tag:
|
if not reasoning_tag:
|
||||||
return res
|
return res
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue