MCPcopy Create free account
hub / github.com/anomalyco/opencode-bench / evaluateWithJudge

Function evaluateWithJudge

tests/judgeConsistencyMedium.test.ts:38–57  ·  view source on GitHub ↗

* Medium Complexity Judge Consistency Tests * * These tests verify that judges produce consistent scores on more complex scenarios: * - Nested loops with error handling * - State mutations across methods * - Multi-file API changes * - Import reorganizations * * All tests run 3 evaluations an

(
  judge: Judge,
  systemPrompt: string,
  userPrompt: string,
)

Source from the content-addressed store, hash-verified

36 */
37
38async function evaluateWithJudge(
39 judge: Judge,
40 systemPrompt: string,
41 userPrompt: string,
42): Promise<ScoreResult> {
43 try {
44 const { object } = await generateObject({
45 model: judge.model,
46 schema: scoreResultSchema,
47 system: systemPrompt,
48 temperature: 0,
49 prompt: userPrompt,
50 });
51
52 return object;
53 } catch (error) {
54 const message = error instanceof Error ? error.message : String(error);
55 throw new Error(`Judge evaluation failed: ${message}`);
56 }
57}
58
59function createDiffComparisonPrompt(
60 diffPair: DiffPair,

Callers 1

testConsistencyFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected