Content Builder
class 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)
}
}
}Content copied to clipboard
Functions
Link copied to clipboard
Appends an InputImagePart referencing the image by URL.
Link copied to clipboard
Appends an InputImagePart referencing an image already uploaded to the Files API.
Link copied to clipboard
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
Appends an InputTextPart.