Skip to contents

Process response class for managing chat processing

Usage

process(
  prompts = list(),
  responses = list(),
  completed = integer(0),
  file = character(0),
  type = NULL,
  progress = logical(0),
  input_type = character(0),
  workers = integer(0),
  beep = logical(0),
  echo = logical(0),
  chat_status = character(0)
)

Arguments

prompts

List of prompts to process

responses

List to store responses

completed

Integer indicating number of completed prompts

file

Path to save state file (.rds)

type

Type specification for structured data extraction

progress

Whether to show progress bars (default: TRUE)

input_type

Type of input ("vector" or "list")

workers

Number of parallel workers

beep

Play sound on completion (default: TRUE)

echo

Whether to echo messages during processing (default: FALSE)

chat_status

Character vector tracking individual chat completion status ("pending", "completed", or "failed")

Value

Returns a "process" object with a collection of prompts and their responses from chat models. The object contains all input parameters as properties and provides access to functions for:

The process object manages prompt processing and tracks completion status.

Examples

if (FALSE) { # ellmer::has_credentials("openai")
# Create chat processor
chat <- seq_chat("openai/gpt-4.1")

# Process prompts
response <- chat$process(
  c(
    "What is R?",
    "Explain base R versus tidyverse",
    "Explain vectors, lists, and data frames"
  )
)

# Return responses
response$texts()

# Return chat objects
response$chats()

# Check progress if interrupted
response$progress()
}