Agents take turns in round-robin order responding to each other. An optional judge agent decides when to stop.
Arguments
- agents
Named list of
Agentobjects participating in the debate.- max_rounds
Integer. Number of full rounds (default 5).
- judge
An optional
Agentthat evaluates each round. IfNULL, the workflow stops aftermax_rounds * length(agents)turns.- state_schema
A WorkflowState or
NULL(uses default).
Value
A compiled GraphRunner.
Examples
if (FALSE) { # \dontrun{
runner <- debate_workflow(
agents = list(
pro = agent("pro", ellmer::chat_anthropic()),
con = agent("con", ellmer::chat_anthropic())
),
max_rounds = 3L
)
result <- runner$invoke(list(messages = list("Is R better than Python?")))
} # }