Component
Attributes
attribute__slots__= ('id', 'name', 'strict', 'spec', 'yaml_path', 'registry', '_initial_data')attributespecS= specattributespec_typetype[S]attributeyaml_path= yaml_pathattributestrict= strictattributeregistry= registryattributeid= self.generate_id()attributename= self.spec.nameattributefull_namestrFunctions
func__init____init__(self, /, spec, registry, *, initial_data=None, yaml_path=None, strict=False) -> NoneparamselfparamspecSparamregistryRegistryparaminitial_datadict[str, Any] | None= Noneparamyaml_pathstr | None= Noneparamstrictbool= FalseReturns
Nonefunc__repr____repr__(self) -> strparamselfReturns
strfuncfrom_dictfrom_dict(cls, /, data, registry, *, yaml_path=None, strict=False, **kwargs) -> SelfCreate 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
paramclsparamdatadict[str, Any]paramregistryRegistryparamyaml_pathstr | None= Noneparamstrictbool= FalseparamkwargsAny= {}Returns
Selffuncfrom_yaml_pathfrom_yaml_path(cls, /, yaml_path, registry, *, strict=True, **kwargs) -> ComponentTCreate 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 | PathparamregistryRegistryparamstrictbool= TrueparamkwargsAny= {}Returns
ComponentTfuncgenerate_idgenerate_id(self) -> UUIDparamselfReturns
UUIDfunccreate_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)
paramclsparambase_spec_classtype[S]parampluginsSequence[Plugin]paramdatadict[str, Any]Returns
type[S]funcprint_specprint_spec(self, /, initial=False) -> NonePrint the tool node specification in YAML format. Args: raw (bool): If True, print the raw declaration; otherwise, print the validated spec.
paramselfparaminitialbool= FalseReturns
NoneLast updated on