Skip to main content
Artifact builders live in aion.core and are shared across all frameworks. Use them to construct a2a.types.Artifact objects before passing them to emit_artifact() or thread.post().

url_artifact

Build an artifact referencing a remote file by URL. Returns: a2a.types.Artifact with a single FilePart (FileWithUri).

file_artifact

Build an artifact carrying inline file content as bytes. Returns: a2a.types.Artifact with a single FilePart (FileWithBytes). Raises: TypeError if data is not bytes.
The optional file_action parameter accepts a FileActionPayload from aion.core.a2a. The builder attaches it to the file part and declares the Messaging extension on the artifact.

File retention

With FILE_STORAGE_BACKEND=aion, the SDK uploads inline files as protected agent artifacts. Without a FileActionPayload, the SDK requests 30-day retention. An action with an omitted or None deadline requests indefinite storage.
Use a future UTC deadline. The low-level AionFileClient follows the File Service contract: an absent deadline means indefinite storage. The 30-day default belongs to the SDK’s automatic Aion file provider, not the File Service or other storage providers. Download links expire separately, normally after one hour. A file action does not renew an existing URL or grant. Without a file backend, the builder keeps content inline and does not establish a storage deadline.

data_artifact

Build an artifact carrying structured JSON data. Returns: a2a.types.Artifact with a single DataPart (Protobuf Value).

Full Example

What these builders return is passed to emit_artifact(), documented under the framework you are writing for.