mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-05-02 04:12:45 +02:00
improve fault tolerance when try to stop in ask_human action
This commit is contained in:
parent
b80f8c4f9a
commit
d16bafe428
1 changed files with 1 additions and 1 deletions
|
|
@ -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:"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue