UNPKG

@adonis-agora/agent

Version:

Governed, durable-backed AI agent (chat + tool-calling + governance) for AdonisJS — part of the Agora ecosystem.

28 lines • 1.43 kB
import type { ModelProvider } from '../../spi/model-provider.js'; import type { ScorableRun, ScoreResult, Scorer, ScorerKind } from '../types.js'; /** {@link AnswerRelevancyScorer}'s stable name. */ export declare const ANSWER_RELEVANCY_SCORER = "answer-relevancy"; export interface AnswerRelevancyOptions { /** The judge. Deliberately a separate {@link ModelProvider} — nothing forces it to be the model under test. */ model: ModelProvider; /** Override the grading instructions (e.g. to add domain rules the judge must apply). */ systemPrompt?: string; } /** * LLM-as-judge: does the answer address the question that was asked? * * The expensive family, and the reason this module is offline-first — grading a turn costs a whole * model call, so it happens over stored runs on your schedule, not inside the turn where it would * double the latency and the bill of every message a user sends. * * `null` when there is no question or no answer to compare: a judge asked to grade an empty string * will invent a number, and `run-completion` has already scored that run 0. */ export declare class AnswerRelevancyScorer implements Scorer { private readonly options; readonly name = "answer-relevancy"; readonly kind: ScorerKind; constructor(options: AnswerRelevancyOptions); score(run: ScorableRun): Promise<ScoreResult | null>; } //# sourceMappingURL=answer-relevancy.scorer.d.ts.map