ai2_kit.core.artifact module#
- class ai2_kit.core.artifact.Artifact(*, key: Optional[str] = None, executor: Optional[str] = None, url: str, format: Optional[str] = None, includes: Optional[str] = None, attrs: dict = {})[source]#
Bases:
BaseModel
- attrs: dict#
- executor: Optional[str]#
- format: Optional[str]#
- includes: Optional[str]#
- key: Optional[str]#
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'attrs': FieldInfo(annotation=dict, required=False, default={}), 'executor': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'format': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'includes': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'key': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'url': FieldInfo(annotation=str, required=True)}#
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- classmethod of(url: str, key: Optional[str] = None, executor: Optional[str] = None, includes: Optional[str] = None, attrs: Optional[dict] = None, format: Optional[str] = None)[source]#
Create an Artifact instance. Use this instead of __init__ to avoid type error of pydantic This method should be deprecated.
- to_dict() ArtifactDict [source]#
Convert to a dict representation. Use this when you need to run a remote function call as pydantic model is not pickleable.
- url: str#
- class ai2_kit.core.artifact.ArtifactDict[source]#
Bases:
TypedDict
A dict representation of Artifact. Use this when you need to run a remote function call as pydantic model is not pickleable.
referrer is not included in this dict as it is not pickleable.
- attrs: dict#
- executor: Optional[str]#
- format: Optional[str]#
- includes: Optional[str]#
- key: Optional[str]#
- url: str#