Adapters
Attachment adapters for uploading files, handling lifecycle events, and bringing app-owned content into assistant-ui composers and messages.
API Reference
AttachmentAdapter
AttachmentAdapteraccept: stringadd: (state: { file: File; }) => Promise<PendingAttachment> | AsyncGenerator<PendingAttachment, void>remove: (attachment: Attachment) => Promise<void>send: (attachment: PendingAttachment) => Promise<CompleteAttachment>
CloudFileAttachmentAdapter
CloudFileAttachmentAdapterconstructor?: (cloud: AssistantCloud) => CloudFileAttachmentAdapteraccept?: stringadd?: ({ file, }: { file: File; }) => AsyncGenerator<PendingAttachment, void>remove?: (attachment: Attachment) => Promise<void>send?: (attachment: PendingAttachment) => Promise<CompleteAttachment>
CompositeAttachmentAdapter
CompositeAttachmentAdapterconstructor?: (adapters: AttachmentAdapter[]) => CompositeAttachmentAdapteraccept?: stringadd?: (state: { file: File }) => Promise<PendingAttachment> | AsyncGenerator<PendingAttachment, void, any>send?: (attachment: PendingAttachment) => Promise<CompleteAttachment>remove?: (attachment: Attachment) => Promise<void>
SimpleImageAttachmentAdapter
SimpleImageAttachmentAdapteraccept?: stringadd?: (state: { file: File }) => Promise<PendingAttachment>send?: (attachment: PendingAttachment) => Promise<CompleteAttachment>remove?: () => Promise<void>
SimpleTextAttachmentAdapter
SimpleTextAttachmentAdapteraccept?: stringadd?: (state: { file: File }) => Promise<PendingAttachment>send?: (attachment: PendingAttachment) => Promise<CompleteAttachment>remove?: () => Promise<void>