user

fun user(parts: List<ContentPart>)(source)

Adds a user message to the prompt with optional attachments.

User messages represent input from the user to the language model. This method supports adding parts of the message such as text content or attachments.

Parameters

parts

Parts of the user message


fun user(content: String)(source)

Adds a user message to the prompt.

User messages represent input from the user to the language model. This method supports adding text content.

Parameters

content

Content of the user message


fun user(block: ContentPartsBuilder.() -> Unit)(source)

Adds a user message to the prompt with attachments.

User messages represent input from the user to the language model. This method allows adding parts of the message such as text content or attachments using a ContentPartsBuilder.

Example:``` user { test("Image 1:") image("photo1.jpg") test("Image 2:") image("photo3.jpg") }

Parameters

block

Lambda to configure attachments using ContentPartsBuilder


fun user(content: String, block: ContentPartsBuilder.() -> Unit)(source)

Deprecated

Use user(block: ContentPartsBuilder.() -> Unit instead.

Adds a user message to the prompt with optional attachments.

User messages represent input from the user to the language model. This method supports adding text content.

Parameters

content

Content of the user message

block

Lambda to configure attachments using ContentPartsBuilder


fun user(content: String, attachments: List<ContentPart> = emptyList())(source)

Deprecated

Use user(block: ContentPartsBuilder.() -> Unit instead.

Adds a user message to the prompt with optional attachments.

User messages represent input from the user to the language model. This method supports adding text content.

Parameters

content

Content of the user message

attachments

Attachments to be added to the message