Documentation
¶
Overview ¶
Package artifact defines storage for named binary outputs of agents and tools. Implementations live in agentx-contrib; applications own authorization and choose the scope from trusted identity, rather than from model arguments.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNotFound = errors.New("artifact: not found")
ErrNotFound reports an absent artifact in the requested scope.
Functions ¶
This section is empty.
Types ¶
type Artifact ¶
type Artifact struct {
Key
Name string `json:"name,omitempty"`
MediaType string `json:"media_type"`
Data []byte `json:"data"`
Metadata map[string]string `json:"metadata,omitempty"`
}
Artifact holds a binary output and application-owned metadata. It is not a provider file ID or an expiring download URL.
type Key ¶
Key identifies an artifact. Scope and ID are exact, case-sensitive strings. Implementations must not interpret them as filesystem paths.
type Store ¶
type Store interface {
Put(ctx context.Context, value *Artifact) error
Get(ctx context.Context, key Key) (*Artifact, error)
Delete(ctx context.Context, key Key) error
}
Store persists artifacts atomically per key. Put replaces an existing value; applications needing immutable revisions must choose distinct IDs. Get returns ErrNotFound for missing keys. Delete is idempotent. Implementations must be concurrent-safe and must not retain or return mutable aliases. Calls do not provide a transaction across several artifacts.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package artifacttest tests implementations of artifact.Store.
|
Package artifacttest tests implementations of artifact.Store. |