Browse Source

Update error message to indicate task completion

lime_ning 7 months ago
parent
commit
6b9fbd76a2
1 changed files with 1 additions and 1 deletions
  1. 1 1
      code/chapter1/FirstAgentTest.py

+ 1 - 1
code/chapter1/FirstAgentTest.py

@@ -174,7 +174,7 @@ for i in range(5): # 设置最大循环次数
     # 3.3. 解析并执行行动
     action_match = re.search(r"Action: (.*)", llm_output, re.DOTALL)
     if not action_match:
-        print("解析错误:模型输出中未找到 Action。")
+        print(f"任务完成: {llm_output.strip()}")
         break
     action_str = action_match.group(1).strip()