From 95c2f64c3b969274b33291caf0a2e582d1ac7bac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E8=83=9C?= Date: Sun, 14 Apr 2024 10:36:04 +0800 Subject: [PATCH] Modify the test case of DEBUG_REFLECTION_EXAMPLE --- metagpt/prompts/di/write_analysis_code.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metagpt/prompts/di/write_analysis_code.py b/metagpt/prompts/di/write_analysis_code.py index e5663d498..f8b9a4c42 100644 --- a/metagpt/prompts/di/write_analysis_code.py +++ b/metagpt/prompts/di/write_analysis_code.py @@ -38,7 +38,7 @@ def add(a: int, b: int) -> int: user: Tests failed: assert add(1, 2) == 3 # output: -1 -assert add(1, 2) == 4 # output: -1 +assert add(1, 3) == 4 # output: -2 [reflection on previous impl]: The implementation failed the test cases where the input integers are 1 and 2. The issue arises because the code does not add the two integers together, but instead subtracts the second integer from the first. To fix this issue, we should change the operator from `-` to `+` in the return statement. This will ensure that the function returns the correct output for the given input.