🌟 The Multi-Agent Framework: First AI Software Company, Towards Natural Language Programming
improve fault tolerance when try to stop in ask_human action
黄伟韬d16bafe428da
diff --git a/metagpt/roles/di/role_zero.py b/metagpt/roles/di/role_zero.pyindex 9baafb9b2..ca854fa60 100644--- a/metagpt/roles/di/role_zero.py+++ b/metagpt/roles/di/role_zero.py@@ -537,7 +537,7 @@ class RoleZero(Role):command_output = await self._end()elif cmd["command_name"] == "RoleZero.ask_human":human_response = await self.ask_human(**cmd["args"])- if human_response[len("Human response:") :].strip().lower() in ["<stop>", "stop"]:+ if human_response.strip().lower().endswith(("stop", "<stop>")):human_response += "The user has asked me to stop because I have encountered a problem."self.rc.memory.add(UserMessage(content=human_response, cause_by=RunCommand))end_output = "\nCommand end executed:"