AudioContentBuilder

DSL builder for constructing AudioContent instances.

Required

  • data - The base64-encoded audio data

  • mimeType - The MIME type of the audio (e.g., "audio/wav", "audio/mpeg")

Optional

Example usage in sampling messages:

createMessageRequest {
maxTokens = 100
messages {
userAudio {
data = "UklGRiQAAABXQVZFZm10IBAAAAABAAEA..."
mimeType = "audio/wav"
}
}
}

Example with annotations:

userAudio {
data = base64EncodedAudioData
mimeType = "audio/mpeg"
annotations(Annotations(priority = 0.7))
}

See also

Properties

Link copied to clipboard
var data: String?

The base64-encoded audio data. This is a required field.

Link copied to clipboard

The MIME type of the audio (e.g., "audio/wav", "audio/mpeg"). 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.