agentfootprint
Version:
The explainable agent framework — backtrack a wrong answer to the exact context that caused it (evidence, not guesses). Built on footprintjs.
40 lines (39 loc) • 1.6 kB
TypeScript
/**
* Debate — two agents alternate proposing + critiquing, a judge decides.
*
* Paper: "Improving Factuality and Reasoning in Language Models through
* Multiagent Debate" — Du et al., 2023
* (https://arxiv.org/abs/2305.14325).
*
* Pattern: Factory → produces a `Runner` built from
* `Sequence(Proposer → Critic → Judge)` by default, or an
* iterated `Loop(Sequence(…))` when `rounds > 1`.
* Role: patterns/ layer.
* Emits: Everything Sequence + Loop + LLMCall emit.
*/
import type { LLMProvider } from '../provider-contract/types.js';
import type { Runner } from '../core/runner.js';
export interface DebateOptions {
readonly provider: LLMProvider;
readonly model: string;
/** Proposer persona — asserts a position given the question. */
readonly proposerPrompt: string;
/** Critic persona — argues against the proposer's position. */
readonly criticPrompt: string;
/** Judge persona — reads the debate transcript, returns the verdict. */
readonly judgePrompt: string;
/** Rounds of propose+critique before the judge weighs in. Default 1. */
readonly rounds?: number;
readonly temperature?: number;
readonly maxTokens?: number;
readonly name?: string;
readonly id?: string;
}
/**
* Build a Debate Runner. One debate "round" = Proposer → Critic. After
* N rounds, the Judge sees the final exchange and renders the verdict.
* The Judge's output is the Runner's return value.
*/
export declare function debate(opts: DebateOptions): Runner<{
message: string;
}, string>;