createJudgeScorer (judge.ts)

open-multi-agent · ai

Builds LLM judge scorer: constructs prompts, parses verdicts, manages aborts/deadlines for eval.

// Source: https://github.com/open-multi-agent/open-multi-agent | License: MIT | Copyright Shenzhen YuanASI Technology Co., Ltd. and open-multi-agent contributors
// Provided via justclaw.it.com; keep this notice with the code.
import { z, type ZodSchema } from 'zod'
import type { AgentConfig, CostEstimateContext, TokenUsage } from '../types.js'
import {
  buildStructuredOutputInstruction,
  extractJSON,
  validateOutput,
} from '../agent/structured-output.js'
import {
  attachScoreCostInputs,
  defineScorer,
  scoreCostInputs,
  type ScoreCostInput,
  type Scorer,
  type ScorerContext,
} from './scorer.js'

export interface JudgeScorerOptions {
  readonly name: string
  readonly version?: string
  readonly judges: readonly AgentConfig[]
  readonly quorum?: number
  readonly verdictSchema?

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search 40K more like it.

Get a free API key