Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard

Represents the current caret position in the text being built.

Functions

Link copied to clipboard
fun attachment(attachment: AttachmentSource, cacheControl: CacheControl? = null)
Link copied to clipboard
fun audio(audio: AttachmentSource.Audio, cacheControl: CacheControl? = null)

Adds AttachmentSource.Audio to the list of parts.

fun audio(url: String, cacheControl: CacheControl? = null)

Adds AttachmentSource.Audio with AttachmentContent.URL content from the provided URL.

fun audio(path: Path, cacheControl: CacheControl? = null)

Adds AttachmentSource.Audio with AttachmentContent.Binary.Bytes content from the provided local file path.

Link copied to clipboard
fun binaryFile(path: Path, mimeType: String)

Adds AttachmentSource.File with AttachmentContent.Binary.Bytes content from the provided local file path.

Link copied to clipboard
fun br()

Adds two consecutive newline characters to the text content.

Link copied to clipboard
open override fun build(): List<MessagePart.RequestPart>
Link copied to clipboard
fun file(file: AttachmentSource.File, cacheControl: CacheControl? = null)

Adds AttachmentSource.File to the list of parts.

fun file(url: String, mimeType: String)

Adds AttachmentSource.File with AttachmentContent.URL content from the provided URL.

Link copied to clipboard
fun image(image: AttachmentSource.Image, cacheControl: CacheControl? = null)

Adds AttachmentSource.Image to the list of parts.

fun image(url: String, cacheControl: CacheControl? = null)

Adds AttachmentSource.Image with AttachmentContent.URL content from the provided URL.

fun image(path: Path, cacheControl: CacheControl? = null)

Adds AttachmentSource.Image with AttachmentContent.Binary.Bytes content from the provided local file path.

Link copied to clipboard
fun newline()

Appends a newline character to the underlying text builder.

Link copied to clipboard
open operator fun String.not()

Defines a custom operator function for the String class. This unary not operator (!) is invoked on a String instance and performs a custom action defined by the text function.

Link copied to clipboard
fun TextContentBuilderBase<*>.numbered(startLineNumber: Int = 1, body: TextContentBuilderBase<*>.() -> Unit): TextContentBuilderBase<*>

Extension function for TextContentBuilder that adds line numbering to the content.

Link copied to clipboard
fun padding(padding: String, body: TextContentBuilder.() -> Unit)

Adds padding to each line of the content produced by the provided builder block.

Link copied to clipboard

Adds MessagePart to the list of parts.

Link copied to clipboard
fun text(cacheControl: CacheControl? = null, init: TextContentBuilder.() -> Unit)

fun text(text: String, cacheControl: CacheControl)

Adds MessagePart.Text to the list of parts.

open fun text(text: String)

Appends the given text to the current content.

Link copied to clipboard

Extension function to add text content to a TextContentBuilder.

Link copied to clipboard
fun textFile(path: Path, mimeType: String)

Adds AttachmentSource.File with AttachmentContent.PlainText content from the provided local file path.

Link copied to clipboard

Adds the given text to the content. If the caret is not at the beginning of the line, a newline is added before appending the text.

Link copied to clipboard
fun toolResult(id: String? = null, tool: String, output: String, isError: Boolean = false)
Link copied to clipboard
open operator fun String.unaryPlus()

Adds the given string as a new line of text to the content being built by the TextContentBuilder.

Link copied to clipboard
fun video(video: AttachmentSource.Video, cacheControl: CacheControl? = null)

Adds AttachmentSource.Video to the list of parts.

fun video(url: String, cacheControl: CacheControl? = null)

Adds AttachmentSource.Video with AttachmentContent.URL content from the provided URL.

fun video(path: Path, cacheControl: CacheControl? = null)

Adds AttachmentSource.Video with AttachmentContent.Binary.Bytes content from the provided local file path.