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
annotations - Content annotations (inherited from MediaContentBuilder)
meta - Additional metadata (inherited from MediaContentBuilder)
Example usage in sampling messages:
createMessageRequest {
maxTokens = 100
messages {
userImage {
data = "iVBORw0KGgoAAAANSUhEUgAAAAEAAAAB..."
mimeType = "image/png"
}
}
}Content copied to clipboard
Example with annotations:
userImage {
data = base64EncodedImageData
mimeType = "image/jpeg"
annotations(Annotations(priority = 0.9))
}Content copied to clipboard
See also
Properties
Functions
Link copied to clipboard
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
Sets optional metadata for the content using a DSL builder.