소스 검색

Update error message to indicate task completion

lime_ning 8 달 전
부모
커밋
dc2d5a935a
1개의 변경된 파일과 1개의 추가작업 그리고 1개의 파일을 삭제
  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()