Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions game.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,16 @@ const openrouter = createOpenRouter({
apiKey: process.env.OPENROUTER_API_KEY,
extraBody: {
reasoning: {
effort: "medium",
effort: "high",
},
},
});

const openrouterJudge = createOpenRouter({
apiKey: process.env.OPENROUTER_API_KEY,
extraBody: {
reasoning: {
effort: "low",
},
},
});
Expand Down Expand Up @@ -204,6 +213,7 @@ export async function callGeneratePrompt(model: Model): Promise<string> {
system,
prompt:
"Generate a single original Quiplash prompt. Be creative and don't repeat common patterns.",
temperature: 1.2,
});

log("INFO", `prompt:${model.name}`, "Raw response", {
Expand All @@ -225,6 +235,7 @@ export async function callGenerateAnswer(
model: openrouter.chat(model.id),
system: `You are playing Quiplash! You'll be given a fill-in-the-blank prompt. Give the FUNNIEST possible answer. Be creative, edgy, unexpected, and concise. Reply with ONLY your answer — no quotes, no explanation, no preamble. Keep it short (under 12 words). Keep it concise and witty.`,
prompt: `Fill in the blank: ${prompt}`,
temperature: 1.3,
});

log("INFO", `answer:${model.name}`, "Raw response", {
Expand All @@ -247,7 +258,8 @@ export async function callVote(
answerB: b.answer,
});
const { text, usage, reasoning } = await generateText({
model: openrouter.chat(voter.id),
model: openrouterJudge.chat(voter.id),
temperature: 0.3,
system: `You are a judge in a comedy game. You'll see a fill-in-the-blank prompt and two answers. Pick which answer is FUNNIER. You MUST respond with exactly "A" or "B" — nothing else.`,
prompt: `Prompt: "${prompt}"\n\nAnswer A: "${a.answer}"\nAnswer B: "${b.answer}"\n\nWhich is funnier? Reply with just A or B.`,
});
Expand Down