Skip to contents

Create a message

Usage

create_message(content, role = "user", ...)

Arguments

content

The content of the message.

role

The role of the message. Can be "user", "system", "assistant". Default is "user".

...

Additional arguments such as images.

Value

A list of messages.

Examples

create_message("Hello", "user")
#> [[1]]
#> [[1]]$role
#> [1] "user"
#> 
#> [[1]]$content
#> [1] "Hello"
#> 
#> 
create_message("Always respond nicely", "system")
#> [[1]]
#> [[1]]$role
#> [1] "system"
#> 
#> [[1]]$content
#> [1] "Always respond nicely"
#> 
#> 
create_message("I am here to help", "assistant")
#> [[1]]
#> [[1]]$role
#> [1] "assistant"
#> 
#> [[1]]$content
#> [1] "I am here to help"
#> 
#>