| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 | from pydantic import Fieldfrom core.helper import encrypterfrom .segments import (    ArrayAnySegment,    ArrayNumberSegment,    ArrayObjectSegment,    ArrayStringSegment,    FileSegment,    FloatSegment,    IntegerSegment,    NoneSegment,    ObjectSegment,    Segment,    StringSegment,)from .types import SegmentTypeclass Variable(Segment):    """    A variable is a segment that has a name.    """    id: str = Field(        default="",        description="Unique identity for variable. It's only used by environment variables now.",    )    name: str    description: str = Field(default="", description="Description of the variable.")class StringVariable(StringSegment, Variable):    passclass FloatVariable(FloatSegment, Variable):    passclass IntegerVariable(IntegerSegment, Variable):    passclass ObjectVariable(ObjectSegment, Variable):    passclass ArrayAnyVariable(ArrayAnySegment, Variable):    passclass ArrayStringVariable(ArrayStringSegment, Variable):    passclass ArrayNumberVariable(ArrayNumberSegment, Variable):    passclass ArrayObjectVariable(ArrayObjectSegment, Variable):    passclass SecretVariable(StringVariable):    value_type: SegmentType = SegmentType.SECRET    @property    def log(self) -> str:        return encrypter.obfuscated_token(self.value)class NoneVariable(NoneSegment, Variable):    value_type: SegmentType = SegmentType.NONE    value: None = Noneclass FileVariable(FileSegment, Variable):    pass
 |