assistant

fun assistant(content: String, cacheControl: CacheControl? = null): PromptBuilder(source)

Adds an assistant message to the prompt.

Assistant messages represent responses from the language model.

Example:

assistant("The capital of France is Paris.")

Parameters

content

The content of the assistant message

cacheControl

Optional cache control to apply after this tool definition.


fun assistant(cacheControl: CacheControl? = null, init: TextContentBuilder.() -> Unit): PromptBuilder(source)

Adds an assistant message to the prompt using a TextContentBuilder.

Parameters

cacheControl

Optional cache control to apply after this tool definition.

init

The initialization block for the TextContentBuilder


Adds an assistant message to the prompt using a TextContentBuilder.

This allows for more complex message construction.

Example:

assistant {
text("The capital of France is Paris.")
text("It's known for landmarks like the Eiffel Tower.")
}

Parameters

init

The initialization block for the TextContentBuilder