Merge pull request #701 from iorisa/fixbug/error_cause_by

fixbug: an unexpected UserRequirement type message is thrown when there is nothing to do.
This commit is contained in:
geekan 2024-01-07 13:23:11 +08:00 committed by GitHub
commit f445dacb8a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -418,7 +418,7 @@ class Role(SerializationMixin, is_polymorphic_base=True):
Use llm to select actions in _think dynamically
"""
actions_taken = 0
rsp = Message(content="No actions taken yet") # will be overwritten after Role _act
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()