🌟 The Multi-Agent Framework: First AI Software Company, Towards Natural Language Programming
pre-commit format
yzlin4b09ffd2f533
diff --git a/metagpt/actions/debug_code.py b/metagpt/actions/debug_code.pyindex 74a188e9f..e5e0ac5d4 100644--- a/metagpt/actions/debug_code.py+++ b/metagpt/actions/debug_code.py@@ -104,7 +104,6 @@ class DebugCode(BaseWriteAnalysisCode):logger.info(f"reflection is {resp}")return resp-async def run(self,context: List[Message] = None,diff --git a/tests/metagpt/actions/test_debug_code.py b/tests/metagpt/actions/test_debug_code.pyindex 675c07f78..262f2e60d 100644--- a/tests/metagpt/actions/test_debug_code.py+++ b/tests/metagpt/actions/test_debug_code.py@@ -8,13 +8,13 @@ import pytestfrom metagpt.actions.debug_code import DebugCode, messages_to_strfrom metagpt.schema import Message-ErrorStr = '''Tested passed:+ErrorStr = """Tested passed:Tests failed:assert sort_array([1, 5, 2, 3, 4]) == [1, 2, 3, 4, 5] # output: [1, 2, 4, 3, 5]-'''+"""-CODE = '''+CODE = """def sort_array(arr):# Helper function to count the number of ones in the binary representationdef count_ones(n):@@ -27,7 +27,7 @@ def sort_array(arr):return sorted_arr```-'''+"""DebugContext = '''Solve the problem in Python:def sort_array(arr):@@ -42,13 +42,16 @@ def sort_array(arr):>>> sort_array([1, 0, 2, 3, 4]) [0, 1, 2, 3, 4]"""'''++@pytest.mark.asyncioasync def test_debug_code():debug_context = Message(content=DebugContext)new_code = await DebugCode().run(context=debug_context, code=CODE, runtime_result=ErrorStr)assert "def sort_array(arr)" in new_code-++def test_messages_to_str():debug_context = Message(content=DebugContext)msg_str = messages_to_str([debug_context])- assert "user: Solve the problem in Python" in msg_str\ No newline at end of file+ assert "user: Solve the problem in Python" in msg_str