index.ts
1,877 bytes
| 1 | /** |
|---|---|
| 2 | * Versioned prompt templates for every debate stage. |
| 3 | * |
| 4 | * These are the *product* of Roundtable as much as the code is - the debate is |
| 5 | * only as good as the instructions the models receive. They live here, apart |
| 6 | * from orchestration logic, so they can be reviewed, versioned, and A/B'd |
| 7 | * without touching the state machine. |
| 8 | * |
| 9 | * `PROMPT_VERSION` is bumped whenever a template changes in a way that would |
| 10 | * alter model behavior; it is stamped onto stored results so historical debates |
| 11 | * remain interpretable. |
| 12 | */ |
| 13 | export const PROMPT_VERSION = '1.3.0'; |
| 14 | |
| 15 | export { buildAnswerPrompt } from './answer'; |
| 16 | export { buildCritiquePrompt } from './critique'; |
| 17 | export { buildRevisionPrompt } from './revision'; |
| 18 | export { buildConvergencePrompt } from './convergence'; |
| 19 | export { buildSynthesisPrompt } from './synthesis'; |
| 20 | export { buildProvenancePrompt } from './provenance'; |
| 21 | export { buildRepairPrompt } from './repair'; |
| 22 | |
| 23 | /** |
| 24 | * Shared system preamble establishing the ground rules of the roundtable. Every |
| 25 | * stage builds on this so models share a consistent frame. |
| 26 | */ |
| 27 | export const ROUNDTABLE_PREAMBLE = |
| 28 | 'You are one member of an expert roundtable convened to answer a question as ' + |
| 29 | 'accurately and completely as possible. Other independent experts are answering ' + |
| 30 | 'the same question in parallel. The goal is a correct, well-reasoned answer - not ' + |
| 31 | 'winning. Be rigorous, cite concrete reasoning, and concede points that are right.'; |
| 32 | |
| 33 | /** Standard instruction appended to any stage that must return strict JSON. */ |
| 34 | export function jsonInstruction(shape: string): string { |
| 35 | return ( |
| 36 | 'Respond with a SINGLE JSON object and nothing else - no prose, no Markdown ' + |
| 37 | 'code fences, no commentary before or after. The object MUST match this shape ' + |
| 38 | `exactly:\n\n${shape}\n\n` + |
| 39 | 'Use plain double-quoted strings. Do not include trailing commas.' |
| 40 | ); |
| 41 | } |
| 42 | |