mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-12 19:59:03 +08:00
fix(variables): NoneVariable should inherit from NoneSegment. (#6584)
This commit is contained in:
parent
8123a00e97
commit
85a883e281
@ -2,17 +2,10 @@ from enum import Enum
|
||||
|
||||
|
||||
class SegmentType(str, Enum):
|
||||
STRING = 'string'
|
||||
NUMBER = 'number'
|
||||
FILE = 'file'
|
||||
|
||||
SECRET = 'secret'
|
||||
|
||||
OBJECT = 'object'
|
||||
|
||||
ARRAY = 'array'
|
||||
ARRAY_STRING = 'array[string]'
|
||||
ARRAY_NUMBER = 'array[number]'
|
||||
ARRAY_OBJECT = 'array[object]'
|
||||
ARRAY_FILE = 'array[file]'
|
||||
NONE = 'none'
|
||||
NUMBER = 'number'
|
||||
STRING = 'string'
|
||||
SECRET = 'secret'
|
||||
ARRAY = 'array'
|
||||
OBJECT = 'object'
|
||||
FILE = 'file'
|
||||
|
@ -6,7 +6,7 @@ from pydantic import Field
|
||||
from core.file.file_obj import FileVar
|
||||
from core.helper import encrypter
|
||||
|
||||
from .segments import Segment, StringSegment
|
||||
from .segments import NoneSegment, Segment, StringSegment
|
||||
from .types import SegmentType
|
||||
|
||||
|
||||
@ -83,6 +83,6 @@ class SecretVariable(StringVariable):
|
||||
return encrypter.obfuscated_token(self.value)
|
||||
|
||||
|
||||
class NoneVariable(Variable):
|
||||
class NoneVariable(NoneSegment, Variable):
|
||||
value_type: SegmentType = SegmentType.NONE
|
||||
value: None = None
|
Loading…
x
Reference in New Issue
Block a user