mirror of
https://github.com/langgenius/dify.git
synced 2024-11-16 19:59:50 +08:00
5e6fc58db3
Co-authored-by: JzoNg <jzongcode@gmail.com>
19 lines
437 B
Python
19 lines
437 B
Python
from pydantic import BaseModel
|
|
|
|
from .segments import Segment
|
|
|
|
|
|
class SegmentGroup(BaseModel):
|
|
segments: list[Segment]
|
|
|
|
@property
|
|
def text(self):
|
|
return ''.join([segment.text for segment in self.segments])
|
|
|
|
@property
|
|
def log(self):
|
|
return ''.join([segment.log for segment in self.segments])
|
|
|
|
@property
|
|
def markdown(self):
|
|
return ''.join([segment.markdown for segment in self.segments]) |