/** * Exports a before/after pair as a suite somebody else's harness can run. * * `trazum eval` answers "does the model still say the same thing?" — semantic * agreement, measured against the model's own variance. That is the question * Trazum is qualified to ask, and it is not the question a team actually needs * answered before shipping. *Their* question is whether the classifier still * hits 94%, whether the JSON still parses, whether the refusal rate moved. Those * are assertions about their task, and Trazum has no business inventing them. * * So this hands over the part it *can* build correctly — a suite in which the * only variable is the prompt, with both versions and every case already wired * — and leaves the assertions where they belong. * * ## Why JSON rather than YAML * * promptfoo reads `promptfooconfig.json` as readily as the YAML. This package * has no dependencies and is not going to acquire a YAML emitter, and a * hand-rolled one would be a quoting bug waiting for the first prompt * containing a colon, a tab, or a line ending in a space. `JSON.stringify` * escapes everything correctly, and JSON is a subset of YAML, so the file can * be renamed if somebody prefers. */ export interface PromptfooExport { /** The config, ready for `JSON.stringify`. */ config: Record; /** Things the reader has to know before trusting the run. */ warnings: PromptfooWarning[]; } export type PromptfooWarning = /** `${x}` or `{x}`: promptfoo substitutes `{{x}}` and will leave these alone. */ { kind: 'unsupported-placeholder'; detail: string; } /** More than one distinct placeholder, and one value per case to fill them. */ | { kind: 'multiple-placeholders'; detail: string; } /** The provider has no promptfoo id here, so the model string is a guess. */ | { kind: 'unmapped-provider'; detail: string; } /** No placeholder at all: the case is appended, as `trazum eval` does. */ | { kind: 'appended-input'; detail: string; }; export interface PromptfooOptions { /** Model id from Trazum's catalogue, mapped to a promptfoo provider. */ model?: string; /** Rule level used to produce the optimised prompt, for the label. */ level?: string; } export declare function toPromptfoo(original: string, optimized: string, cases: readonly string[], options?: PromptfooOptions): PromptfooExport; //# sourceMappingURL=promptfoo.d.ts.map