Ver Fonte

Merge pull request #164 from sunpcm/patch-2

fix: 修复REFLECT_PROMPT_TEMPLATE代码块标识和代码里标识重复问题
jjyaoao há 7 meses atrás
pai
commit
e46b26f883

+ 1 - 3
code/chapter4/Reflection.py

@@ -84,9 +84,7 @@ REFINE_PROMPT_TEMPLATE = """
 {task}
 
 # 你上一轮尝试的代码:
-```python
 {last_code_attempt}
-```
 
 # 评审员的反馈:
 {feedback}
@@ -138,7 +136,7 @@ class ReflectionAgent:
             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:

+ 0 - 1
docs/chapter4/Chapter4-Building-Classic-Agent-Paradigms.md

@@ -1021,7 +1021,6 @@ You are a senior Python programmer. You are optimizing your code based on feedba
 {task}
 
 # Your Previous Code Attempt:
-```
 {last_code_attempt}
 Reviewer's Feedback:
 {feedback}

+ 0 - 1
docs/chapter4/第四章 智能体经典范式构建.md

@@ -1023,7 +1023,6 @@ REFINE_PROMPT_TEMPLATE = """
 {task}
 
 # 你上一轮尝试的代码:
-```
 {last_code_attempt}
 评审员的反馈:
 {feedback}