Attachment
type Attachment = | { id: string; mime_type: string; name: string; type: 'file'; } | { id: string; mime_type: string; name: string; preview_url: string; type: 'image'; };
Attachment associated with a user message. When passed to sendUserMessage
or
setComposerValue
, it must already be uploaded by your server. We do not currently
support attaching raw Files to a message.
Type Declaration
Section titled “Type Declaration”{ id: string; mime_type: string; name: string; type: 'file';}
id: string;
Server-generated identifier for the uploaded file.
mime_type
Section titled “mime_type”mime_type: string;
MIME type of the file.
name: string;
Original filename shown in the UI.
type: 'file';
{ id: string; mime_type: string; name: string; preview_url: string; type: 'image';}
id: string;
Server-generated identifier for the uploaded image.
mime_type
Section titled “mime_type”mime_type: string;
MIME type of the image.
name: string;
Original filename shown in the UI.
preview_url
Section titled “preview_url”preview_url: string;
URL used to render the image preview in the UI.
type: 'image';