system

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

Adds a system message to the prompt.

System messages provide instructions or context to the language model.

Example:

system("You are a helpful assistant.")

Parameters

content

The content of the system message

cacheControl

Optional cache control to apply after this tool definition.


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

Adds a system 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 a system message to the prompt using a TextContentBuilder.

This allows for more complex message construction.

Example:

system {
text("You are a helpful assistant.")
text("Always provide accurate information.")
}

Parameters

init

The initialization block for the TextContentBuilder