refactor: Modify reasoning content removal method to update partial_response_content directly

This commit is contained in:
Paul Gauthier 2025-03-07 17:32:57 -08:00 committed by Paul Gauthier (aider)
parent cddc67ad69
commit 08401aff26
2 changed files with 10 additions and 10 deletions

View file

@ -59,6 +59,7 @@ class TestReasoning(unittest.TestCase):
self.assertIn(main_content, output)
# Verify that partial_response_content only contains the main content
coder.remove_reasoning_content()
self.assertEqual(coder.partial_response_content.strip(), main_content.strip())
# Ensure proper order: reasoning first, then main content
@ -168,12 +169,10 @@ class TestReasoning(unittest.TestCase):
)
# Verify that partial_response_content only contains the main content
coder.remove_reasoning_content()
expected_content = "Final answer after reasoning"
self.assertEqual(coder.partial_response_content.strip(), expected_content)
# Verify that partial_response_content only contains the main content
self.assertEqual(coder.partial_response_content.strip(), "Final answer after reasoning")
def test_send_with_think_tags(self):
"""Test that <think> tags are properly processed and formatted."""
# Setup IO with no pretty
@ -240,6 +239,7 @@ class TestReasoning(unittest.TestCase):
)
# Verify that partial_response_content only contains the main content
coder.remove_reasoning_content()
self.assertEqual(coder.partial_response_content.strip(), main_content.strip())
def test_send_with_think_tags_stream(self):