ContentBuilder

DSL for building the multimodal content of a single message or tool output.

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

Example:

client.createResponse {
params { model = ChatModel.DEEPSEEK_FLASH }
input {
user {
text("What is in this image?")
image("https://example.com/cat.jpg", ImageDetail.LOW)
}
}
}

Constructors

Link copied to clipboard
constructor()

Functions

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

Appends an InputImagePart referencing the image by URL.

Link copied to clipboard
fun imageFile(fileId: String)

Appends an InputImagePart referencing an image already uploaded to the Files API.

Link copied to clipboard
fun outputText(text: String)

Appends an OutputTextPart, the shape an assistant turn comes back in.

Link copied to clipboard

Appends a ready-made content part.

Link copied to clipboard
fun text(text: String)

Appends an InputTextPart.