ai2_kit.core.artifact module#

pydantic model ai2_kit.core.artifact.Artifact[source]#

Bases: BaseModel

Show JSON schema
{
   "title": "Artifact",
   "type": "object",
   "properties": {
      "key": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Key"
      },
      "executor": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Executor"
      },
      "url": {
         "title": "Url",
         "type": "string"
      },
      "format": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Format"
      },
      "includes": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Includes"
      },
      "attrs": {
         "default": {},
         "title": "Attrs",
         "type": "object"
      }
   },
   "additionalProperties": false,
   "required": [
      "url"
   ]
}

Config:
  • extra: str = forbid

Fields:
field attrs: dict = {}#
field executor: str | None = None#
field format: str | None = None#
field includes: str | None = None#
field key: str | None = None#
field url: str [Required]#
join(*paths, **kwargs)[source]#
classmethod of(url: str, key: str | None = None, executor: str | None = None, includes: str | None = None, attrs: dict | None = None, format: str | None = 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.

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: str | None#
format: str | None#
includes: str | None#
key: str | None#
url: str#