assistant

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


fun assistant(parts: List<MessagePart.ResponsePart>, finishReason: String? = null, rawResponse: JsonObject? = null, id: String? = 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

id

Optional unique identifier for the message.


fun assistant(finishReason: String? = null, rawResponse: JsonObject? = null, id: String? = null, init: ResponseMessagePartsBuilder.() -> Unit): PromptBuilder(source)

Adds an assistant message to the prompt using a TextContentBuilder.

Parameters

init

The initialization block for the TextContentBuilder