FilePart

data class FilePart(val id: String, val mimeType: String, val remoteId: String? = null, val url: String? = null, val data: String? = null, val filename: String? = null) : UiPart

A binary attachment on a user message -- an image, a document.

Exactly one of url and data is the payload in practice, but the protocol permits either alongside a bare remoteId, so all three are optional here and a renderer resolves whichever it finds. Constructing one with none of the three is what the protocol forbids.

Constructors

Link copied to clipboard
constructor(id: String, mimeType: String, remoteId: String? = null, url: String? = null, data: String? = null, filename: String? = null)

Properties

Link copied to clipboard
val data: String?
Link copied to clipboard
Link copied to clipboard
open override val id: String

Stable across the whole life of the part, including while it streams.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val url: String?