Image

@SerialName(value = "image")
@Serializable
data class Image(val source: ImageSource) : ContentPart

An image content part.

Samples

val imageParts = listOf<ContentPart>(
    ContentPart.Image(ImageSource.FilePath("path/to/file.png", mimeType = MimeType.Image.Png)), // Load image from path with base64.
    ContentPart.Image(ImageSource.Url("https://imageurl.domain/image.png")) // Send image url to API.
)

Constructors

Link copied to clipboard
constructor(source: ImageSource)

Properties

Link copied to clipboard

The image source (URL, bytes, or file path).