Something went wrong. Try again.
Parametric learning in your code harness.
Something went wrong. Try again.
123456789101112131415161718192021222324// A harness that answers from a script instead of a model. For tests and for// exercising a machine's plumbing without spending on inference.
import type { Harness, HarnessRequest } from "../harness.ts";import type { HarnessResult } from "../types.ts";
export function scriptedHarness(reply: (request: HarnessRequest) => string | Promise<string>, name = "scripted"): Harness { return { name, async run(request): Promise<HarnessResult> { const output = await reply(request); return { trajectory: [ { role: "user", content: request.input }, { role: "assistant", content: output }, ], output, model: request.model, stopReason: "stop", }; }, };}