Attachment Store Protocol • AI Agent SDK
AttachmentStoreProtocol: Seam for a gateway-managed attachment store (Issue #5207).
AttachmentStoreProtocol
Defined in the protocols module.
AI Agent
Seam for a gateway-managed attachment store (Issue #5207).
Large files cannot ride inline inside a single `message frame (bounded by max_payload), so they are streamed as chunks into a store keyed by a reserved ref_id (reserve → put chunk at offset → close), then referenced from :class:AttachmentRef`. The contract lives in core so every client and implementation agree on one shape; the concrete durable store (filesystem / object store) is a wrapper/bot concern, kept out of the dependency-free core.
Methods
Reserve an entry for an incoming file and return its `ref_id`.
Write `data at offset for the reserved ref_id`.
Finalize the upload and return the resulting :class:AttachmentRef.
Open the stored attachment for reading (outbound download).
Source
View on GitHubpraisonaiagents/gateway/protocols.py at line 748