feat: Add tags to enable custom message classification

This commit is contained in:
莘权 马 2023-08-22 11:10:08 +08:00
parent 2adcefc298
commit bc97b709bb

View file

@ -45,6 +45,16 @@ class Message:
"content": self.content
}
def add_tag(self, tag):
if self.tags is None:
self.tags = set()
self.tags.add(tag)
def remove_tag(self, tag):
if self.tags is None:
return
self.tags.remove(tag)
@dataclass
class UserMessage(Message):