sendFiles

abstract suspend fun sendFiles(files: List<File>, message: String? = null): Result<ConversationEntry>

Sends one or more file attachments in this conversation, with an optional text message.

All files are uploaded and sent as a single conversation entry. Each entry in files must be a File on the local filesystem. When using the Android file picker, copy each content URI to a temporary file before calling this method.

The maximum number of files that can be sent in a single call is controlled by Configuration.attachmentConfiguration and defaults to MAX_ATTACHMENTS. If any upload fails, the entire send is aborted and no message is sent.

Return

Result.Success with the sent ConversationEntry, or Result.Error on failure.

Parameters

files

The Files to upload and send. Must contain between 1 and the configured maximum number of files (defaults to MAX_ATTACHMENTS).

message

Optional text to include alongside the attachments.