import { Judge, JudgeContext } from './types.js'; import { ToolCallScorerConfig, ToolCallScorerOptions } from '../internal/toolCallScorer.js'; import { HarnessMetadata } from '../harness.js'; import './judgeHarness.js'; import '@vitest-evals/core'; import '../internal/scoring.js'; import '../internal/matchers.js'; /** * Expected tool-call shape accepted by `ToolCallJudge()`. * * @example * ```ts * const expectedTools: ToolCallJudgeExpectedTool[] = [ * "lookupInvoice", * { name: "createRefund", arguments: { invoiceId: "inv_123" } }, * ]; * ``` */ type ToolCallJudgeExpectedTool = string | { name: string; arguments?: unknown; }; /** * Configuration for the deterministic tool-call judge. * * @example * ```ts * const judge = ToolCallJudge({ * ordered: true, * allowExtra: false, * }); * ``` */ interface ToolCallJudgeConfig extends ToolCallScorerConfig { } /** * Matcher context accepted by `ToolCallJudge()`. * * @example * ```ts * await expect(result).toSatisfyJudge(ToolCallJudge(), { * expectedTools: ["lookupInvoice", "createRefund"], * }); * ``` */ interface ToolCallJudgeOptions extends JudgeContext, Omit { expectedTools?: ToolCallJudgeExpectedTool[]; } /** * Creates a deterministic judge that checks expected tool calls. * * @param config - Matching behavior shared by every assessment from this judge. * * @example * ```ts * describeEval("refund agent", { * harness: refundHarness, * judges: [ToolCallJudge({ ordered: true })], * }, (it) => { * it("creates a refund after lookup", async ({ run }) => { * await run("Refund invoice inv_123", { * metadata: { * expectedTools: ["lookupInvoice", "createRefund"], * }, * }); * }); * }); * ``` */ declare function ToolCallJudge(config?: ToolCallJudgeConfig): Judge; export { ToolCallJudge, type ToolCallJudgeConfig, type ToolCallJudgeExpectedTool, type ToolCallJudgeOptions };