Liman

Component

Attributes

attribute__slots__
= ('id', 'name', 'strict', 'spec', 'yaml_path', 'registry', '_initial_data')
attributespecS
= spec
attributespec_typetype[S]
attributeyaml_path
= yaml_path
attributestrict
= strict
attributeregistry
= registry
attributeid
= self.generate_id()
attributename
= self.spec.name
attributefull_namestr

Functions

func__init____init__(self, /, spec, registry, *, initial_data=None, yaml_path=None, strict=False) -> None
paramself
paramspecS
paramregistryRegistry
paraminitial_datadict[str, Any] | None
= None
paramyaml_pathstr | None
= None
paramstrictbool
= False

Returns

None
func__repr____repr__(self) -> str
paramself

Returns

str
funcfrom_dictfrom_dict(cls, /, data, registry, *, yaml_path=None, strict=False, **kwargs) -> Self

Create a Component from a dict spec

Args: data (dict[str, Any]): Dictionary containing the BaseNode spec. yaml_path (str | None): Path to the YAML file if the data is loaded from a YAML file. strict (bool): Whether to enforce strict validation of the spec and other internal checks. **kwargs: Additional keyword arguments specific to the subclass.

Returns: Component: An instance of initialized Component

paramcls
paramdatadict[str, Any]
paramregistryRegistry
paramyaml_pathstr | None
= None
paramstrictbool
= False
paramkwargsAny
= {}

Returns

Self
funcfrom_yaml_pathfrom_yaml_path(cls, /, yaml_path, registry, *, strict=True, **kwargs) -> ComponentT

Create a Component from a YAML file.

Args: yaml_path (str | Path): Path to the YAML file. registry (Registry): Registry instance for plugins.

Returns: Component: An instance of Component initialized with the YAML data.

paramclstype[ComponentT]
paramyaml_pathstr | Path
paramregistryRegistry
paramstrictbool
= True
paramkwargsAny
= {}

Returns

ComponentT
funcgenerate_idgenerate_id(self) -> UUID
paramself

Returns

UUID
funccreate_extended_speccreate_extended_spec(cls, /, base_spec_class, plugins, data) -> type[S]

Create extended spec class with plugin fields and validate data.

Returns: Tuple of (ExtendedSpecClass, validated_data)

paramcls
parambase_spec_classtype[S]
parampluginsSequence[Plugin]
paramdatadict[str, Any]

Returns

type[S]
funcprint_specprint_spec(self, /, initial=False) -> None

Print the tool node specification in YAML format. Args: raw (bool): If True, print the raw declaration; otherwise, print the validated spec.

paramself
paraminitialbool
= False

Returns

None

Last updated on