Something went wrong. Try again.
Parametric learning in your code harness.
Something went wrong. Try again.
12345678910111213import type { Message } from "../types.ts";
/** * For harnesses that cannot be seeded with prior messages: prefix the new * input with the conversation so far as a transcript. */export function withTranscript(history: Message[], input: string): string { const turns = history.filter((m) => (m.role === "user" || m.role === "assistant") && m.content); if (turns.length === 0) return input; const transcript = turns.map((m) => `${m.role === "user" ? "User" : "Assistant"}: ${m.content}`).join("\n\n"); return `<conversation_so_far>\n${transcript}\n</conversation_so_far>\n\n${input}`;}