texts: Extract texts or structured data from a batch result

textsR Documentation

Extract texts or structured data from a batch result

Description

Extract texts or structured data from a batch result

Usage

texts(x, ...)

Arguments

x

A batch object

...

Additional arguments passed to methods

Value

A character vector or list of text responses. If a type specification was provided to the batch, structured data objects will be returned instead.

Examples


# Create a chat processor
chat <- chat_sequential(chat_openai())

# Process a batch of prompts
batch <- chat$batch(list(
  "What is R?",
  "Explain base R versus tidyverse",
  "Explain vectors, lists, and data frames"
))

# Extract text responses
batch$texts()


hellmer documentation built on June 8, 2025, 11:09 a.m.