Skip to contents

Map

Usage

map(x, f, ...)

Arguments

x

A character vector or list to map over.

f

An LLM or Agent object.

...

Additional arguments passed to generate().

Value

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

Details

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

Author

EDG

Examples

# Requires running Ollama server and gemma4:e4b model
if (FALSE) { # \dontrun{
  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
} # }