modify Role._think

This commit is contained in:
yzlin 2024-04-25 16:06:27 +08:00
parent e39f7ff0b1
commit dee1d6fe60
2 changed files with 3 additions and 3 deletions

View file

@ -455,8 +455,8 @@ class Role(SerializationMixin, ContextMixin, BaseModel):
rsp = Message(content="No actions taken yet", cause_by=Action) # will be overwritten after Role _act
while actions_taken < self.rc.max_react_loop:
# think
await self._think()
if self.rc.todo is None:
has_todo = await self._think()
if not has_todo:
break
# act
logger.debug(f"{self._setting}: {self.rc.state=}, will do {self.rc.todo}")

View file

@ -36,7 +36,7 @@ class Command(Enum):
PUBLISH_MESSAGE = CommandDef(
name="publish_message",
signature="publish_message(content: str, send_to: str)",
desc="Publish a message to a team member, use member name to fill send_to args. You may copy the full original content or add additional information from upstream. This will make team members start their work. DONT omit any necessary info such as path, link, environment from original content to team members because you are their sole info source. However, if the original content is long or contains concrete info, you should forward the message using forward_message instead of publishing it.",
desc="Publish a message to a team member, use member name to fill send_to args. You may copy the full original content or add additional information from upstream. This will make team members start their work. DONT omit any necessary info such as path, link, environment from original content to team members because you are their sole info source.",
)
REPLY_TO_HUMAN = CommandDef(
name="reply_to_human",