Building a judge prompt that scores a model answer against a reference.
Codejavascript
function buildJudgePrompt(question, reference, answer) {
return `You are grading an answer.
Question: ${question}
Reference answer: ${reference}
Return a score from 1 to 5.`;
}
const prompt = buildJudgePrompt(q, ref, candidate);