AIMessageAttachment

class AIMessageAttachment(val kind: AIMessageAttachment.Kind, val uri: Uri? = null, val bitmap: ImageBitmap? = null, val name: String? = null, val size: Long? = null, val mimeType: String? = null, val extraData: Map<String, Any?> = emptyMap())

Something a message carries besides its text, such as an image or a file.

Parameters

kind

What kind of attachment it is.

uri

Where it is: on the web, or on this device, such as a content:// URI the person picked.

bitmap

The image itself when the app holds it, such as a photo the person just took. It shows rather than the one at uri. Pass a small one, the size it shows at: it stays in memory while the conversation shows it.

name

Its name, such as the file's.

size

Its size, in bytes.

mimeType

Its media type, such as application/pdf. Without it, the type comes from the extension of its name or URI.

extraData

Data of its own, such as what an attachment of a kind of your own needs.

Constructors

Link copied to clipboard
constructor(kind: AIMessageAttachment.Kind, uri: Uri? = null, bitmap: ImageBitmap? = null, name: String? = null, size: Long? = null, mimeType: String? = null, extraData: Map<String, Any?> = emptyMap())

Types

Link copied to clipboard
object Companion
Link copied to clipboard
value class Kind(val rawValue: String)

What kind of attachment it is. It is an open set: compare against the kinds you know and give the rest a fallback.

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val name: String?
Link copied to clipboard
val size: Long?
Link copied to clipboard
val uri: Uri?

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun toString(): String