Attachment staging helpers mirroring the Python SDK file APIs.
Summary
Functions
Attaches an Attachment to the supplied ThreadOptions.
Deprecated alias retained for backwards compatibility.
Removes staged files that are not marked as persistent.
Lists staged attachments currently cached.
Lists staged attachments with explicit success/error tuples.
Returns high-level staging metrics including counts and total bytes.
Resets the staging directory and manifest.
Stages a file for future attachment invocation.
Returns the staging directory path.
Functions
@spec attach(Codex.Thread.Options.t(), Codex.Files.Attachment.t()) :: Codex.Thread.Options.t()
Attaches an Attachment to the supplied ThreadOptions.
@spec cleanup!() :: :ok | {:error, term()}
Deprecated alias retained for backwards compatibility.
@spec force_cleanup() :: :ok | {:error, term()}
Removes staged files that are not marked as persistent.
@spec list_staged() :: [Codex.Files.Attachment.t()]
Lists staged attachments currently cached.
@spec list_staged_result() :: {:ok, [Codex.Files.Attachment.t()]} | {:error, term()}
Lists staged attachments with explicit success/error tuples.
Returns high-level staging metrics including counts and total bytes.
@spec reset!() :: :ok | {:error, term()}
Resets the staging directory and manifest.
@spec stage( Path.t(), keyword() ) :: {:ok, Codex.Files.Attachment.t()} | {:error, term()}
Stages a file for future attachment invocation.
Options:
:name- override the attachment name (defaults to the basename ofpath):persist- keep file around indefinitely (default:false):ttl_ms- custom time-to-live for ephemeral attachments. Accepts:infinityor a non-negative integer in milliseconds. Defaults toApplication.get_env/3lookups of:attachment_ttl_msand falls back to 24 hours.
@spec staging_dir() :: Path.t()
Returns the staging directory path.