feat: +auto append agent metadata

This commit is contained in:
莘权 马 2024-05-09 20:28:33 +08:00
parent 9be140a421
commit 1e6e9d3103

View file

@ -449,6 +449,8 @@ class Role(SerializationMixin, ContextMixin, BaseModel):
if not self.rc.env:
# If env does not exist, do not publish the message
return
if isinstance(msg, AIMessage) and not msg.agent:
msg.with_agent(self._setting)
self.rc.env.publish_message(msg)
def put_message(self, message):