ImageContentBuilder

DSL builder for constructing ImageContent instances.

Required

  • data - The base64-encoded image data

  • mimeType - The MIME type of the image (e.g., "image/png", "image/jpeg")

Optional

Example usage in sampling messages:

createMessageRequest {
maxTokens = 100
messages {
userImage {
data = "iVBORw0KGgoAAAANSUhEUgAAAAEAAAAB..."
mimeType = "image/png"
}
}
}

Example with annotations:

userImage {
data = base64EncodedImageData
mimeType = "image/jpeg"
annotations(Annotations(priority = 0.9))
}

See also

Properties

Link copied to clipboard
var data: String?

The base64-encoded image data. This is a required field.

Link copied to clipboard

The MIME type of the image (e.g., "image/png", "image/jpeg"). This is a required field.

Functions

Link copied to clipboard
fun annotations(annotations: Annotations)

Sets optional annotations for the content.

fun annotations(audience: List<Role>? = null, priority: Double? = null, lastModified: String? = null)

Sets optional annotations for the content with individual parameters.

Link copied to clipboard
fun meta(block: JsonObjectBuilder.() -> Unit)

Sets optional metadata for the content using a DSL builder.