annotations

fun annotations(annotations: Annotations)(source)

Sets optional annotations for the content.

Annotations provide additional metadata about the content such as audience, priority, and last modification time.

Example:

userText {
text = "Hello"
annotations(Annotations(priority = 0.8))
}

Parameters

annotations

The Annotations instance


fun annotations(audience: List<Role>? = null, priority: Double? = null, lastModified: String? = null)(source)

Sets optional annotations for the content with individual parameters.

Example with all parameters:

userText {
text = "Important update"
annotations(
audience = listOf(Role.User, Role.Assistant),
priority = 0.8,
lastModified = "2025-01-12T15:00:58Z"
)
}

Parameters

audience

The intended audience for this content (list of Role)

priority

Priority hint for this content (0.0 to 1.0)

lastModified

ISO 8601 timestamp of the last modification

See also