mirror of
http://112.124.100.131/huang.ze/ebiz-dify-ai.git
synced 2025-12-13 04:46:52 +08:00
fix(segments): Support NoneType. (#6581)
This commit is contained in:
@@ -43,6 +43,23 @@ class Segment(BaseModel):
|
||||
return self.value
|
||||
|
||||
|
||||
class NoneSegment(Segment):
|
||||
value_type: SegmentType = SegmentType.NONE
|
||||
value: None = None
|
||||
|
||||
@property
|
||||
def text(self) -> str:
|
||||
return 'null'
|
||||
|
||||
@property
|
||||
def log(self) -> str:
|
||||
return 'null'
|
||||
|
||||
@property
|
||||
def markdown(self) -> str:
|
||||
return 'null'
|
||||
|
||||
|
||||
class StringSegment(Segment):
|
||||
value_type: SegmentType = SegmentType.STRING
|
||||
value: str
|
||||
|
||||
Reference in New Issue
Block a user