Learn R Programming

rtemis.llm (version 0.8.1)

map: Map

Description

Map

Usage

map(x, f, ...)

Value

A list of Message objects (for LLM) or list of lists of Message objects (for Agent).

Arguments

x

A character vector or list to map over.

f

An LLM or Agent object.

...

Additional arguments passed to generate().

Author

EDG

Details

Use responses to retrieve just the content from the assistant messages, or reasoning to retrieve the reasoning traces (if enabled).

Examples

Run this code
# Requires running Ollama server and gemma4:e4b model
if (FALSE) {
  llm <- create_Ollama(
    "gemma4:e4b",
    system_prompt = "Convert color to hex code using the format #FFFFFF"
  )
  x <- c("ocean teal", "california poppy orange", "bougainvillea pink")
  hex <- map(x, llm)
  hex
}

Run the code above in your browser using DataLab