AttachmentRuntime state and actions for reading attachment data and controlling files inside assistant-ui messages and composers.
API Reference
AttachmentRuntime
AttachmentRuntimepath: AttachmentRuntimePath & { attachmentSource: TSource }ref: stringthreadSelector: AttachmentRuntime["path"]["threadSelector"]type: "main"
attachmentSource: "message" | "edit-composer"attachmentSelector: AttachmentRuntime["path"]["attachmentSelector"]type: "index"index: number
source: TSourcegetState: () => AttachmentState & { source: TSource; }remove: () => Promise<void>subscribe: (callback: () => void) => Unsubscribe
AttachmentState
AttachmentStateid: stringtype: "image" | "document" | "file" | (string & {})name: stringcontentType?: stringfile?: FilelastModified: numberThe **`lastModified`** read-only property of the File interface provides the last modified date of the file as the number of milliseconds since the Unix epoch (January 1, 1970 at midnight). Files without a known last modified date return the current date. MDN Reference
name: stringThe **`name`** read-only property of the File interface returns the name of the file represented by a File object. For security reasons, the path is excluded from this property. MDN Reference
webkitRelativePath: stringThe **`webkitRelativePath`** read-only property of the File interface contains a string which specifies the file's path relative to the directory selected by the user in an <input> element with its webkitdirectory attribute set. MDN Reference
size: numbertype: stringarrayBuffer: () => Promise<ArrayBuffer>bytes: () => Promise<Uint8Array<ArrayBuffer>>slice: (start?: number, end?: number, contentType?: string) => Blobstream: () => ReadableStream<Uint8Array<ArrayBuffer>>text: () => Promise<string>
content?: ThreadUserMessagePart[]status: CompleteAttachmentStatustype: "complete"
source: "thread-composer"