Sessions and UI
Attachments
Upload the bytes, then send the reference.
Upload a file to the session, then attach the returned reference to a message.
const ref = await client.blobs.upload({
sessionId, // required: a blob is scoped to one session
data: base64, // no data-URL prefix; 8 MiB cap on the decoded bytes
contentType: "application/pdf",
name: "report.pdf" // optional label
})
await client.sessions.send({
id: sessionId,
message: "Compare this report with the launch-plan source. What changed?",
attachments: [ref]
})The ref is content-addressed, so uploading identical bytes twice is one blob.
Images and text-shaped documents (PDF, plain text, CSV, JSON, Markdown) are accepted. An image or a PDF is rendered to the model as a native file part; a text document is rendered inline.
Unsupported content types are rejected at upload. If an attached reference cannot be read during a turn, a visible marker records the failure. Model support for file types still depends on the provider and model you select.
Sending a message exactly once, with the idempotencyKey on sessions.send, is on
enqueue and steer. The
create-side key is on
sessions.