diff --git a/code/chapter4/Reflection.py b/code/chapter4/Reflection.py index 62c1f93..fdf0d40 100644 --- a/code/chapter4/Reflection.py +++ b/code/chapter4/Reflection.py @@ -84,9 +84,7 @@ def get_last_execution(self) -> str: {task} # 你上一轮尝试的代码: -```python {last_code_attempt} -``` # 评审员的反馈: {feedback} @@ -138,7 +136,7 @@ def run(self, task: str): self.memory.add_record("execution", refined_code) final_code = self.memory.get_last_execution() - print(f"\n--- 任务完成 ---\n最终生成的代码:\n```python\n{final_code}\n```") + print(f"\n--- 任务完成 ---\n最终生成的代码:\n{final_code}") return final_code def _get_llm_response(self, prompt: str) -> str: diff --git "a/docs/chapter4/\347\254\254\345\233\233\347\253\240 \346\231\272\350\203\275\344\275\223\347\273\217\345\205\270\350\214\203\345\274\217\346\236\204\345\273\272.md" "b/docs/chapter4/\347\254\254\345\233\233\347\253\240 \346\231\272\350\203\275\344\275\223\347\273\217\345\205\270\350\214\203\345\274\217\346\236\204\345\273\272.md" index 24440be..49826c2 100644 --- "a/docs/chapter4/\347\254\254\345\233\233\347\253\240 \346\231\272\350\203\275\344\275\223\347\273\217\345\205\270\350\214\203\345\274\217\346\236\204\345\273\272.md" +++ "b/docs/chapter4/\347\254\254\345\233\233\347\253\240 \346\231\272\350\203\275\344\275\223\347\273\217\345\205\270\350\214\203\345\274\217\346\236\204\345\273\272.md" @@ -1023,7 +1023,6 @@ REFINE_PROMPT_TEMPLATE = """ {task} # 你上一轮尝试的代码: -``` {last_code_attempt} 评审员的反馈: {feedback}