A set of evaluation prompt templates (faithfulness, relevance, coherence, safety, tool-use) that implement a `JudgmentTemplate` interface with `buildPrompt` and `parseResponse` methods, returning structured JSON judgments with score, reasoning, confidence, and metadata.
Input validation — 500K character length limit and required field checks enforced per template
Score normalization — safeScore clamps and validates scores to 0–1, defaults to 0.5
Quick Start
typescript
import { FaithfulnessTemplate } from "@reaatech/llm-judge-templates";const template = new FaithfulnessTemplate();const prompt = template.buildPrompt({ query: "What is the capital of France?", response: "The capital of France is Paris.", context: "Paris is the capital and most populous city of France.",});// prompt = { system: "...", user: "..." }const parsed = template.parseResponse(`{ "score": 1.0, "reasoning": "All claims are supported by the source material.", "confidence": 0.95}`);console.log(parsed.score, parsed.confidence);// 1.0, 0.95