feat/enhance the multi-modal support (#8818)

This commit is contained in:
-LAN- 2024-10-21 10:43:49 +08:00 committed by GitHub
commit e61752bd3a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
267 changed files with 6263 additions and 3523 deletions

View file

@ -0,0 +1,22 @@
from .segments import Segment
from .types import SegmentType
class SegmentGroup(Segment):
value_type: SegmentType = SegmentType.GROUP
value: list[Segment]
@property
def text(self):
return "".join([segment.text for segment in self.value])
@property
def log(self):
return "".join([segment.log for segment in self.value])
@property
def markdown(self):
return "".join([segment.markdown for segment in self.value])
def to_object(self):
return [segment.to_object() for segment in self.value]