mirror of
https://github.com/langgenius/dify.git
synced 2025-11-13 09:53:04 +00:00
Signed-off-by: -LAN- <laipz8200@outlook.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
23 lines
583 B
Python
23 lines
583 B
Python
from .segments import Segment
|
|
from .types import SegmentType
|
|
|
|
|
|
class SegmentGroup(Segment):
|
|
value_type: SegmentType = SegmentType.GROUP
|
|
value: list[Segment] = None # type: ignore
|
|
|
|
@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]
|