Merge pull request #1209 from iorisa/fixbug/rsp_none

fixbug: action return None
This commit is contained in:
Alexander Wu 2024-04-18 20:09:10 +08:00 committed by GitHub
commit f2ec6787c1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -406,7 +406,7 @@ class Role(SerializationMixin, ContextMixin, BaseModel):
elif isinstance(response, Message):
msg = response
else:
msg = Message(content=response, role=self.profile, cause_by=self.rc.todo, sent_from=self)
msg = Message(content=response or "", role=self.profile, cause_by=self.rc.todo, sent_from=self)
self.rc.memory.add(msg)
return msg