Learn R Programming

openaiRtools (version 0.2.2)

text_content: Create a Text Content Part

Description

Wraps a plain text string into the content-part format required by the multimodal Chat Completions API. Useful when building message content lists manually alongside image parts.

Usage

text_content(text)

Value

A named list: list(type = "text", text = <text>).

Arguments

text

Character. The text string to include in the message content.

See Also

image_from_url, create_multimodal_message

Examples

Run this code
if (FALSE) {
part <- text_content("What do you see in this image?")
# Result: list(type = "text", text = "What do you see in this image?")
}

Run the code above in your browser using DataLab