UserContentBuilder

DSL for building the multimodal content of a single UserMessage.

Appends ContentParts in call order; at least one part is required. Images are only read by both models the API serves.

Example:

client.chat {
user {
text("Compare these two shots")
image("https://example.com/before.jpg")
imageFile("file-api-abc123")
}
}

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
fun image(url: String, detail: ImageDetail? = null)

Appends an ImageUrlPart referencing the image by URL.

Link copied to clipboard
fun imageData(fileData: String, filename: String? = null)

Appends a FilePart carrying the image inline.

Link copied to clipboard
fun imageFile(fileId: String)

Appends a FilePart referencing an image already uploaded to the Files API.

Link copied to clipboard
fun text(text: String)

Appends a TextPart.