AttachmentBuilder
A builder for constructing media attachments for prompt messages.
This builder provides a fluent DSL API for creating collections of media content that can be attached to user messages. It supports images, audio files, and documents, enabling rich multimedia content in prompt construction.
Example usage:
val attachments = AttachmentBuilder().apply {
image("screenshot.png")
audio(audioData, "mp3")
document("report.pdf")
}.build()
Content copied to clipboard
This class is part of the new DSL structure for prompt construction. It focuses specifically on building media attachments, while text content is handled by TextContentBuilder. For combining both text and attachments, use ContentBuilderWithAttachment.
See also
for the types of media content supported
for using this builder in prompt construction