TextContentBuilder

DSL builder for constructing TextContent instances.

Required

  • text - The text content string

Optional

Example usage in sampling messages:

createMessageRequest {
maxTokens = 100
messages {
userText {
text = "What is the capital of France?"
}
}
}

Example with annotations:

userText {
text = "Important message"
annotations(Annotations(priority = 1.0))
}

See also

Properties

Link copied to clipboard
var text: String?

The text content. 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.