Download api/core/variables/segment_group.py from Underground-Digital/Workflow-Engine: direct link, hf CLI and curl.
- Browser
- Download file 560 Bytes
-
https://huggingface.co/spaces/Underground-Digital/Workflow-Engine/resolve/main/api/core/variables/segment_group.py
- Command line
-
hf download hf://spaces/Underground-Digital/Workflow-Engine/api/core/variables/segment_group.py
-
curl -L -o segment_group.py https://huggingface.co/spaces/Underground-Digital/Workflow-Engine/resolve/main/api/core/variables/segment_group.py
560 Bytes
| from .segments import Segment | |
| from .types import SegmentType | |
| class SegmentGroup(Segment): | |
| value_type: SegmentType = SegmentType.GROUP | |
| value: list[Segment] | |
| def text(self): | |
| return "".join([segment.text for segment in self.value]) | |
| def log(self): | |
| return "".join([segment.log for segment in self.value]) | |
| 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] | |