Process response class for managing chat processing
process.Rd
Process response class for managing chat processing
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:
Extracting responses via
texts()
Accessing chat objects via
chats()
Tracking progress via
progress()
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()
}