mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-06-08 15:05:17 +02:00
feat: Add tags to enable custom message classification
This commit is contained in:
parent
2adcefc298
commit
bc97b709bb
1 changed files with 10 additions and 0 deletions
|
|
@ -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):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue