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

Function evaluateWithJudge

tests/judgeConsistencyComplex.test.ts:28–47  ·  view source on GitHub ↗

* High Complexity Judge Consistency Tests * * These tests verify that judges handle very complex scenarios: * - Architectural refactors (class → function) * - Cross-cutting concerns (logging added everywhere) * - Async refactoring (sync → async) * * These tests are more intensive and should b

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

Source from the content-addressed store, hash-verified

26 */
27
28async function evaluateWithJudge(
29 judge: Judge,
30 systemPrompt: string,
31 userPrompt: string,
32): Promise<ScoreResult> {
33 try {
34 const { object } = await generateObject({
35 model: judge.model,
36 schema: scoreResultSchema,
37 system: systemPrompt,
38 temperature: 0,
39 prompt: userPrompt,
40 });
41
42 return object;
43 } catch (error) {
44 const message = error instanceof Error ? error.message : String(error);
45 throw new Error(`Judge evaluation failed: ${message}`);
46 }
47}
48
49function createDiffComparisonPrompt(
50 diffPair: DiffPair,

Callers 1

testConsistencyFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected