Skip to contents

Quick focus group runner with safe defaults and cost controls

Usage

fg_quick(
  topic,
  participants = 6,
  flow = c("desire_based", "round_robin", "probabilistic"),
  model_config = NULL,
  seed = NULL,
  mode = c("quick", "pro"),
  msg_mode = c("roleflip", "flat"),
  verbose = TRUE,
  max_participant_responses = NULL
)

Arguments

topic

Character. Focus group topic.

participants

Integer. Number of participants (excluding moderator). Default 6.

flow

Character. Turn-taking flow: one of "desire_based", "round_robin", "probabilistic".

model_config

Optional `LLMR::llm_config`. If `NULL`, uses OpenAI gpt-4o-mini with small caps.

seed

Optional integer. Seeds R's RNG (speaker selection and other in-package sampling); it does NOT make the LLM output reproducible, since at `temperature > 0` the provider samples server-side.

mode

Character. Currently informational ("quick" or "pro"). Default "quick".

msg_mode

How each agent's turn is presented to the model. `"roleflip"` (default) puts the agent's own prior turns in the assistant role and others' in labeled user messages (reduces self-repetition); `"flat"` is the legacy single-user-message transcript.

verbose

Logical. Print progress.

max_participant_responses

Optional integer. Maximum participant responses per moderator question before the moderator advances.

Value

A list with elements: `transcript` (data frame), `summary` (character), `participants` (list), `totals` (list), `config_meta` (list), and `focus_group` (the `FocusGroup` object).

Details

Creates agents, a compact script, runs the simulation, and returns a structured result.

Examples

if (FALSE) { # \dontrun{
Sys.setenv(OPENAI_API_KEY = "...")
res <- fg_quick("Library funding priorities", participants = 4)
head(res$transcript)
cat(res$summary)
} # }