@mastra/evals 0.0.1-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (88) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/LICENSE +44 -0
  3. package/dist/evals.cjs.development.js +1510 -0
  4. package/dist/evals.cjs.development.js.map +1 -0
  5. package/dist/evals.cjs.production.min.js +2 -0
  6. package/dist/evals.cjs.production.min.js.map +1 -0
  7. package/dist/evals.esm.js +1497 -0
  8. package/dist/evals.esm.js.map +1 -0
  9. package/dist/evaluation.d.ts +3 -0
  10. package/dist/evaluation.d.ts.map +1 -0
  11. package/dist/index.d.ts +3 -0
  12. package/dist/index.d.ts.map +1 -0
  13. package/dist/index.js +8 -0
  14. package/dist/judge/index.d.ts +6 -0
  15. package/dist/judge/index.d.ts.map +1 -0
  16. package/dist/metrics/answer-relevancy/index.d.ts +17 -0
  17. package/dist/metrics/answer-relevancy/index.d.ts.map +1 -0
  18. package/dist/metrics/answer-relevancy/metricJudge.d.ts +11 -0
  19. package/dist/metrics/answer-relevancy/metricJudge.d.ts.map +1 -0
  20. package/dist/metrics/answer-relevancy/prompts.d.ts +15 -0
  21. package/dist/metrics/answer-relevancy/prompts.d.ts.map +1 -0
  22. package/dist/metrics/completeness/index.d.ts +12 -0
  23. package/dist/metrics/completeness/index.d.ts.map +1 -0
  24. package/dist/metrics/content-similarity/index.d.ts +11 -0
  25. package/dist/metrics/content-similarity/index.d.ts.map +1 -0
  26. package/dist/metrics/context-position/index.d.ts +15 -0
  27. package/dist/metrics/context-position/index.d.ts.map +1 -0
  28. package/dist/metrics/context-position/metricJudge.d.ts +14 -0
  29. package/dist/metrics/context-position/metricJudge.d.ts.map +1 -0
  30. package/dist/metrics/context-position/prompts.d.ts +16 -0
  31. package/dist/metrics/context-position/prompts.d.ts.map +1 -0
  32. package/dist/metrics/context-precision/index.d.ts +15 -0
  33. package/dist/metrics/context-precision/index.d.ts.map +1 -0
  34. package/dist/metrics/context-precision/metricJudge.d.ts +15 -0
  35. package/dist/metrics/context-precision/metricJudge.d.ts.map +1 -0
  36. package/dist/metrics/context-precision/prompts.d.ts +16 -0
  37. package/dist/metrics/context-precision/prompts.d.ts.map +1 -0
  38. package/dist/metrics/difference/index.d.ts +9 -0
  39. package/dist/metrics/difference/index.d.ts.map +1 -0
  40. package/dist/metrics/index.d.ts +10 -0
  41. package/dist/metrics/index.d.ts.map +1 -0
  42. package/dist/metrics/keyword-coverage/index.d.ts +9 -0
  43. package/dist/metrics/keyword-coverage/index.d.ts.map +1 -0
  44. package/dist/metrics/prompt-alignment/index.d.ts +17 -0
  45. package/dist/metrics/prompt-alignment/index.d.ts.map +1 -0
  46. package/dist/metrics/prompt-alignment/metricJudge.d.ts +11 -0
  47. package/dist/metrics/prompt-alignment/metricJudge.d.ts.map +1 -0
  48. package/dist/metrics/prompt-alignment/prompts.d.ts +13 -0
  49. package/dist/metrics/prompt-alignment/prompts.d.ts.map +1 -0
  50. package/dist/metrics/tone/index.d.ts +10 -0
  51. package/dist/metrics/tone/index.d.ts.map +1 -0
  52. package/dist/metrics/types.d.ts +12 -0
  53. package/dist/metrics/types.d.ts.map +1 -0
  54. package/jest.config.ts +19 -0
  55. package/package.json +51 -0
  56. package/src/evaluation.test.ts +32 -0
  57. package/src/evaluation.ts +20 -0
  58. package/src/index.ts +2 -0
  59. package/src/judge/index.ts +13 -0
  60. package/src/metrics/answer-relevancy/index.test.ts +193 -0
  61. package/src/metrics/answer-relevancy/index.ts +80 -0
  62. package/src/metrics/answer-relevancy/metricJudge.ts +49 -0
  63. package/src/metrics/answer-relevancy/prompts.ts +179 -0
  64. package/src/metrics/completeness/index.test.ts +96 -0
  65. package/src/metrics/completeness/index.ts +112 -0
  66. package/src/metrics/content-similarity/index.test.ts +107 -0
  67. package/src/metrics/content-similarity/index.ts +41 -0
  68. package/src/metrics/context-position/index.test.ts +292 -0
  69. package/src/metrics/context-position/index.ts +63 -0
  70. package/src/metrics/context-position/metricJudge.ts +54 -0
  71. package/src/metrics/context-position/prompts.ts +123 -0
  72. package/src/metrics/context-precision/index.test.ts +249 -0
  73. package/src/metrics/context-precision/index.ts +62 -0
  74. package/src/metrics/context-precision/metricJudge.ts +55 -0
  75. package/src/metrics/context-precision/prompts.ts +111 -0
  76. package/src/metrics/difference/index.test.ts +116 -0
  77. package/src/metrics/difference/index.ts +31 -0
  78. package/src/metrics/index.ts +9 -0
  79. package/src/metrics/keyword-coverage/index.test.ts +114 -0
  80. package/src/metrics/keyword-coverage/index.ts +47 -0
  81. package/src/metrics/prompt-alignment/index.test.ts +46 -0
  82. package/src/metrics/prompt-alignment/index.ts +66 -0
  83. package/src/metrics/prompt-alignment/metricJudge.ts +41 -0
  84. package/src/metrics/prompt-alignment/prompts.ts +102 -0
  85. package/src/metrics/tone/index.test.ts +123 -0
  86. package/src/metrics/tone/index.ts +47 -0
  87. package/src/metrics/types.ts +13 -0
  88. package/tsconfig.json +10 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"evals.cjs.development.js","sources":["../src/evaluation.ts","../src/judge/index.ts","../src/metrics/answer-relevancy/prompts.ts","../src/metrics/answer-relevancy/metricJudge.ts","../src/metrics/answer-relevancy/index.ts","../src/metrics/completeness/index.ts","../src/metrics/content-similarity/index.ts","../src/metrics/context-position/prompts.ts","../src/metrics/context-position/metricJudge.ts","../src/metrics/context-position/index.ts","../src/metrics/context-precision/prompts.ts","../src/metrics/context-precision/metricJudge.ts","../src/metrics/context-precision/index.ts","../src/metrics/difference/index.ts","../src/metrics/keyword-coverage/index.ts","../src/metrics/prompt-alignment/prompts.ts","../src/metrics/prompt-alignment/metricJudge.ts","../src/metrics/prompt-alignment/index.ts","../src/metrics/tone/index.ts"],"sourcesContent":["import { AvailableHooks, executeHook } from '@mastra/core';\nimport { type Agent, type Metric } from '@mastra/core';\n\nexport async function evaluate<T extends Agent>(agent: T, input: Parameters<T['generate']>[0], metric: Metric) {\n const agentOutput = await agent.generate(input);\n\n const metricResult = await metric.measure({\n input: input.toString(),\n output: agentOutput.text,\n });\n\n // capture infomration about the evaluation\n executeHook(AvailableHooks.ON_EVALUATION, {\n input: input.toString(),\n output: agentOutput.text,\n result: metricResult,\n });\n\n return metricResult;\n}\n","import { Agent, ModelConfig } from '@mastra/core';\n\nexport abstract class MastraAgentJudge {\n protected readonly agent: Agent;\n\n constructor(name: string, instructions: string, model: ModelConfig) {\n this.agent = new Agent({\n name: `Mastra Eval Judge ${model.provider} ${name}`,\n instructions: instructions,\n model,\n });\n }\n}\n","export const ANSWER_RELEVANCY_AGENT_INSTRUCTIONS = `You are a balanced and nuanced answer relevancy evaluator. Your job is to determine if LLM outputs are relevant to the input, including handling partially relevant or uncertain cases.\n\nKey Principles:\n1. Evaluate whether the output addresses what the input is asking for\n2. Consider both direct answers and related context\n3. Prioritize relevance to the input over correctness\n4. Recognize that responses can be partially relevant\n5. Empty inputs or error messages should always be marked as \"no\"`;\n\nexport function generateEvaluationStatementsPrompt({ output }: { output: string }) {\n return `Given the text, break it down into meaningful statements while preserving context and relationships.\nDon't split too aggressively.\n\nSplit compound statements particularly when they:\n- Are joined by \"and\"\n- Contain multiple distinct facts or claims\n- Have multiple descriptive elements about the subject\n\n\nHandle special cases:\n- A single word answer should be treated as a complete statement\n- Error messages should be treated as a single statement\n- Empty strings should return an empty list\n- When splitting text, keep related information together\n\nExample:\nExample text: Look! A bird! Birds are an interesting animal.\n\n{{\n \"statements\": [\"Look!\", \"A bird!\", \"Birds are interesting animals.\"]\n}}\n\nPlease return only JSON format with \"statements\" array.\nReturn empty list for empty input.\n\nText:\n${output}\n\nJSON:\n`;\n}\n\nexport function generateEvaluatePrompt({ input, statements }: { input: string; statements: string[] }) {\n return `Evaluate each statement's relevance to the input question, considering direct answers, related context, and uncertain cases.\n\n Return JSON with array of verdict objects. Each verdict must include:\n - \"verdict\": \"yes\", \"no\", or \"unsure\"\n - \"reason\": Clear explanation of the verdict\n - Exact match between number of verdicts and statements\n\n Verdict Guidelines:\n - \"yes\": Statement explicitly and directly answers the input question\n * Contains specific answer to the question asked (e.g., \"The color of the sky is blue\")\n * States explicit relationship between key concepts (e.g., \"X is the CEO of company Y\")\n * Can stand alone as a complete answer\n * Contains appropriate question-type response (e.g., location for \"where\", person for \"who\")\n\n - \"unsure\": Statement shows partial relevance when it:\n * Contains topic-related administrative/governance terms without direct answer\n * Mentions locations or entities related to the answer without specifying their role\n * References functions or characteristics typically associated with the answer\n * Is incorrect but shows understanding of the question\n * Uses importance indicators (\"main\", \"primary\", \"major\") with relevant concepts\n * Includes indirect references to the answer (e.g., \"where the president works\")\n * Contains multiple relevant concepts but lacks explicit relationship between them\n * Demonstrates understanding of question domain without providing specific answer\n\n - \"no\": Statement lacks meaningful connection to question when it:\n * Contains no concepts related to the question type or domain\n * Only mentions the broader topic without relevant details (e.g., \"the country has nice weather\")\n * Provides general descriptions without addressing the specific question\n * Contains purely tangential information about the subject\n * Consists of empty or meaningless content\n * Discusses characteristics unrelated to the question type (e.g., describing cuisine when asked about geography)\n * Note: Assessment is about topical relationship, not factual accuracy\n\n REMEMBER: A statmenent does not have to be correct, it just has to be relevant.\n If the statement contains words or phrases that are relevant to the input, it is partially relevant.\n If the statement is a direct answer to the input, it is relevant.\n If the statement is completely unrelated to the input or contains nothing, it is not relevant.\n DO NOT MAKE A JUDGEMENT ON THE CORRECTNESS OF THE STATEMENT, JUST THE RELEVANCY.\n\n\n Example:\n Input: \"What color is the sky during daytime?\"\n Statements: [\n \"The sky is blue during daytime\",\n \"The sky is full of clouds\", \n \"I had breakfast today\",\n \"Blue is a beautiful color\",\n \"Many birds fly in the sky\",\n \"\",\n \"The sky is purple during daytime\",\n ]\n JSON:\n {{\n \"verdicts\": [\n {{\n \"verdict\": \"yes\",\n \"reason\": \"This statement explicitly answers what color the sky is during daytime\"\n }},\n {{\n \"verdict\": \"unsure\",\n \"reason\": \"This statement describes the sky but doesn't address its color\"\n }},\n {{\n \"verdict\": \"no\",\n \"reason\": \"This statement about breakfast is completely unrelated to the sky\"\n }},\n {{\n \"verdict\": \"unsure\",\n \"reason\": \"This statement about blue is related to color but doesn't address the sky\"\n }},\n {{\n \"verdict\": \"unsure\",\n \"reason\": \"This statement is about the sky but doesn't address its color\"\n }},\n {{\n \"verdict\": \"no\",\n \"reason\": \"This statement is empty\"\n }},\n {{\n \"verdict\": \"unsure\",\n \"reason\": \"This statement is incorrect but contains relevant information and still addresses the question\"\n }}\n ]\n }}\n\n Input:\n ${input}\n\n Statements:\n ${statements.join('\\n')}\n\n JSON:\n `;\n}\n\nexport function generateReasonPrompt({\n score,\n reasons,\n input,\n output,\n}: {\n score: number;\n reasons: string[];\n input: string;\n output: string;\n}) {\n return `Explain the irrelevancy score (0-10) for the LLM's response using this context:\n Context:\n Input: ${input}\n Output: ${output}\n Score: ${score}\n Irrelevancy Reasons: ${reasons.join('\\n')}\n \n Rules:\n - Explain score based on mix of direct answers and related context\n - Consider both full and partial relevance\n - Keep explanation concise and focused\n - Use given score, don't recalculate\n - Don't judge factual correctness\n - Explain both relevant and irrelevant aspects\n - For mixed responses, explain the balance\n\n Format:\n {\n \"reason\": \"The score is {score} because {explanation of overall relevance}\"\n }\n\n Example Responses:\n {\n \"reason\": \"The score is 7 because while the first statement directly answers the question, the additional context is only partially relevant\"\n }\n {\n \"reason\": \"The score is 3 because while the answer discusses the right topic, it doesn't directly address the question\"\n }\n `;\n}\n","import { ModelConfig } from '@mastra/core';\nimport { z } from 'zod';\n\nimport { MastraAgentJudge } from '../../judge';\n\nimport {\n generateEvaluatePrompt,\n generateReasonPrompt,\n ANSWER_RELEVANCY_AGENT_INSTRUCTIONS,\n generateEvaluationStatementsPrompt,\n} from './prompts';\n\nexport class AnswerRelevancyJudge extends MastraAgentJudge {\n constructor(model: ModelConfig) {\n super('Answer Relevancy', ANSWER_RELEVANCY_AGENT_INSTRUCTIONS, model);\n }\n\n async evaluate(input: string, actualOutput: string): Promise<{ verdict: string; reason: string }[]> {\n const statementPrompt = generateEvaluationStatementsPrompt({ output: actualOutput });\n const statements = await this.agent.generate(statementPrompt, {\n output: z.object({\n statements: z.array(z.string()),\n }),\n });\n const prompt = generateEvaluatePrompt({ input, statements: statements.object.statements });\n const result = await this.agent.generate(prompt, {\n output: z.object({\n verdicts: z.array(\n z.object({\n verdict: z.string(),\n reason: z.string(),\n }),\n ),\n }),\n });\n\n return result.object.verdicts;\n }\n\n async getReason(input: string, actualOutput: string, score: number, reasons: string[]): Promise<string> {\n const prompt = generateReasonPrompt({ input, output: actualOutput, reasons, score });\n const result = await this.agent.generate(prompt, {\n output: z.object({\n reason: z.string(),\n }),\n });\n return result.object.reason;\n }\n}\n","import { Metric, MetricResult, ModelConfig } from '@mastra/core';\n\nimport { AnswerRelevancyJudge } from './metricJudge';\n\nexport class AnswerRelevancyMetric extends Metric {\n private judge: AnswerRelevancyJudge;\n private uncertaintyWeight: number;\n private scale: number;\n\n constructor(\n model: ModelConfig,\n {\n uncertaintyWeight,\n scale,\n }: {\n uncertaintyWeight: number;\n scale: number;\n } = {\n uncertaintyWeight: 0.3,\n scale: 10,\n },\n ) {\n super();\n\n this.uncertaintyWeight = uncertaintyWeight;\n this.judge = new AnswerRelevancyJudge(model);\n this.scale = scale;\n }\n\n async measure({ input, output }: { input: string; output: string }): Promise<MetricResult> {\n const verdicts = await this.judge.evaluate(input, output);\n const score = this.calculateScore(verdicts);\n\n const reason = await this.generateReason(input, output, score, verdicts);\n\n return {\n score,\n reason,\n };\n }\n\n private async generateReason(\n input: string,\n output: string,\n score: number,\n verdicts: {\n verdict: string;\n reason: string;\n }[],\n ): Promise<string> {\n const reasonsForVerdicts: string[] = [];\n for (const { verdict, reason } of verdicts || []) {\n if (verdict.trim().toLowerCase() === 'no') {\n reasonsForVerdicts.push(reason);\n }\n }\n\n const reason = await this.judge.getReason(input, output, score, reasonsForVerdicts);\n return reason;\n }\n\n private calculateScore(evaluation: { verdict: string; reason: string }[]): number {\n const numberOfVerdicts = evaluation?.length || 0;\n if (numberOfVerdicts === 0) {\n return 1;\n }\n\n let relevancyCount = 0;\n for (const { verdict } of evaluation) {\n if (verdict.trim().toLowerCase() === 'yes') {\n relevancyCount++;\n } else if (verdict.trim().toLowerCase() === 'unsure') {\n relevancyCount += this.uncertaintyWeight;\n }\n }\n\n const score = relevancyCount / numberOfVerdicts;\n return Math.round(score * this.scale);\n }\n}\n","import { Metric } from '@mastra/core';\nimport nlp from 'compromise';\n\nimport { MetricScoringResult } from '../types';\n\nexport class CompletenessMetric extends Metric {\n async measure({ input, output }: { input: string; output: string }): Promise<MetricScoringResult> {\n // Handle null/undefined inputs\n if (input === null || input === undefined || output === null || output === undefined) {\n throw new Error('Inputs cannot be null or undefined');\n }\n\n // Trim both inputs\n input = input.trim();\n output = output.trim();\n\n const inputDoc = nlp(input);\n const outputDoc = nlp(output);\n\n // Extract and log elements\n const inputElements = this.extractElements(inputDoc);\n const outputElements = this.extractElements(outputDoc);\n // Maybe we need a more sophisticated matching approach\n const coverage = this.calculateCoverage(inputElements, outputElements);\n\n return {\n score: coverage,\n details: `Completeness score: ${(coverage * 100).toFixed(1)}%`,\n confidence: 0.8,\n metrics: {\n inputElements,\n outputElements,\n missingElements: inputElements.filter(e => !outputElements.includes(e)),\n elementCounts: {\n input: inputElements.length,\n output: outputElements.length,\n },\n },\n };\n }\n\n private extractElements(doc: any): string[] {\n // Get more specific elements and ensure they're arrays\n const nouns = doc.nouns().out('array') || [];\n const verbs = doc.verbs().toInfinitive().out('array') || [];\n const topics = doc.topics().out('array') || [];\n const terms = doc.terms().out('array') || [];\n\n // Helper function to clean and split terms\n const cleanAndSplitTerm = (term: string): string[] => {\n // First normalize the string\n const normalized = this.normalizeString(term);\n\n // Split on word boundaries and filter out empty strings\n return normalized\n .replace(/([a-z])([A-Z])/g, '$1 $2') // Split camelCase\n .replace(/[^a-z0-9]+/g, ' ') // Replace non-alphanumeric with spaces\n .trim()\n .split(/\\s+/)\n .filter(word => word.length > 0);\n };\n\n // Process all elements\n const processedTerms = [\n ...nouns.flatMap(cleanAndSplitTerm),\n ...verbs.flatMap(cleanAndSplitTerm),\n ...topics.flatMap(cleanAndSplitTerm),\n ...terms.flatMap(cleanAndSplitTerm),\n ];\n\n // Remove duplicates\n return [...new Set(processedTerms)];\n }\n\n private normalizeString(str: string): string {\n // Remove diacritics and convert to lowercase\n return str\n .normalize('NFD')\n .replace(/[\\u0300-\\u036f]/g, '')\n .toLowerCase();\n }\n\n private calculateCoverage(original: string[], simplified: string[]): number {\n if (original.length === 0) {\n return simplified.length === 0 ? 1 : 0;\n }\n\n // Exact matching for short words (3 chars or less), substring matching for longer words\n const covered = original.filter(element =>\n simplified.some(s => {\n const elem = this.normalizeString(element);\n const simp = this.normalizeString(s);\n\n // For short words (3 chars or less), require exact match\n if (elem.length <= 3) {\n return elem === simp;\n }\n\n // For longer words, require substantial overlap (more than 60% of the longer word)\n const longer = elem.length > simp.length ? elem : simp;\n const shorter = elem.length > simp.length ? simp : elem;\n\n if (longer.includes(shorter)) {\n return shorter.length / longer.length > 0.6;\n }\n\n return false;\n }),\n );\n return covered.length / original.length;\n }\n}\n","import { Metric } from '@mastra/core';\nimport stringSimilarity from 'string-similarity';\n\nimport { MetricOptions, MetricScoringResult } from '../types';\n\nexport class ContentSimilarityMetric extends Metric {\n private options: MetricOptions;\n\n constructor(options: MetricOptions = {}) {\n super();\n this.options = {\n ignoreCase: true,\n ignoreWhitespace: true,\n ...options,\n };\n }\n\n async measure({ input, output }: { input: string; output: string }): Promise<MetricScoringResult> {\n let processedInput = input;\n let processedOutput = output;\n\n if (this.options.ignoreCase) {\n processedInput = processedInput.toLowerCase();\n processedOutput = processedOutput.toLowerCase();\n }\n\n if (this.options.ignoreWhitespace) {\n processedInput = processedInput.replace(/\\s+/g, ' ').trim();\n processedOutput = processedOutput.replace(/\\s+/g, ' ').trim();\n }\n\n const similarity = stringSimilarity.compareTwoStrings(processedInput, processedOutput);\n\n return {\n score: similarity,\n details: `Content similarity: ${(similarity * 100).toFixed(1)}%`,\n confidence: 0.9,\n metrics: { similarity },\n };\n }\n}\n","export const CONTEXT_POSITION_AGENT_INSTRUCTIONS = `You are a balanced and nuanced context position evaluator. Your job is to determine if retrieved context nodes are relevant to generating the expected output, with special attention to their ordering.\n\nKey Principles:\n1. Evaluate whether each context node contributes to understanding the expected output - both directly AND indirectly\n2. Consider all forms of relevance:\n - Direct definitions or explanations\n - Supporting evidence or examples\n - Related characteristics or behaviors\n - Real-world applications or effects\n3. Pay attention to the position of relevant information\n4. Recognize that earlier positions should contain more relevant information\n5. Be inclusive rather than exclusive in determining relevance - if the information supports or reinforces the output in any way, consider it relevant\n6. Empty or error nodes should be marked as not relevant`;\n\nexport function generateEvaluatePrompt({\n input,\n output,\n context,\n}: {\n input: string;\n output: string;\n context: string[];\n}) {\n return `Given the input, output, and context, evaluate each context piece's relevance by generating a list of JSON objects.\n\n**\nIMPORTANT: Your response must be in JSON format with a 'verdicts' key containing a list. Each verdict must have only two fields: \\`verdict\\` with either 'yes' or 'no', and \\`reason\\` explaining the verdict. Your reason should include relevant quotes from the context.\n\nExample Context: [\"The Sun is a star\", \"Stars produce their own light\", \"The Moon reflects sunlight\"]\nExample Query: \"What is the Sun?\"\nExample Expected Response: \"The Sun is a star that produces light.\"\n\nConsider context relevant if it:\n- Directly addresses the input\n- Provides examples or instances that help explain the concept\n- Offers related information that helps build understanding\n- Contains partial information that contributes to the response\n- Demonstrates or validates characteristics mentioned in the output\n- Shows real-world applications or effects of the concept\n- Reinforces or provides evidence for any part of the output\n- Helps establish credibility or understanding of the subject\n- Describes the actions the subject can perform\n\nA context piece should be considered relevant if it contributes ANY supporting information or evidence, even if indirect.\n\nExample:\n{\n \"verdicts\": [\n {\n \"verdict\": \"yes\",\n \"reason\": \"The context 'The Sun is a star' directly defines what the Sun is.\"\n },\n {\n \"verdict\": \"yes\",\n \"reason\": \"The context 'Stars produce their own light' is relevant as it describes a key characteristic of stars, which includes the Sun.\"\n },\n {\n \"verdict\": \"no\",\n \"reason\": \"The context 'The Moon reflects sunlight' is not relevant to defining what the Sun is.\"\n }\n ] \n}\n\nThe number of verdicts MUST MATCH the number of context pieces exactly.\n**\n\nInput:\n${input}\n\nOutput:\n${output}\n\nContext:\n${context}\n\nJSON:\n`;\n}\n\nexport function generateReasonPrompt({\n input,\n output,\n verdicts,\n score,\n}: {\n input: string;\n output: string;\n verdicts: Array<{ verdict: string; reason: string }>;\n score: number;\n}) {\n return `Given the input, output, verdicts, and position score, provide a BRIEF explanation for the score. Focus on both relevance and positioning of the context.\n The retrieved contexts is a list containing \\`verdict\\` ('yes' or 'no' for relevance), \\`reason\\` (explaining the verdict) and \\`node\\` (the context text). Contexts are listed in their ranking order.\n\n**\nIMPORTANT: Return only JSON format with a single 'reason' key explaining the score.\nExample JSON:\n{\n \"reason\": \"The score is <score> because <explanation>.\"\n}\n\nGuidelines:\n- Don't mention 'verdict' - refer to relevant/irrelevant nodes instead\n- Use information from the \\`reason\\` field, not the field itself\n- Reference node positions (first, second, etc.) when explaining relevance\n- For perfect scores (10.0), emphasize both relevance and optimal ordering\n- Always reference the ranking order when discussing relevance\n**\n\nPosition Score:\n${score}\n\nInput:\n${input}\n\nOutput:\n${output}\n\nContext:\n${verdicts}\n\nJSON:\n`;\n}\n","import { ModelConfig } from '@mastra/core';\nimport { z } from 'zod';\n\nimport { MastraAgentJudge } from '../../judge';\n\nimport { CONTEXT_POSITION_AGENT_INSTRUCTIONS, generateEvaluatePrompt, generateReasonPrompt } from './prompts';\n\nexport class ContextPositionJudge extends MastraAgentJudge {\n constructor(model: ModelConfig) {\n super('Context Position', CONTEXT_POSITION_AGENT_INSTRUCTIONS, model);\n }\n\n async evaluate(\n input: string,\n actualOutput: string,\n retrievalContext: string[],\n ): Promise<{ verdict: string; reason: string }[]> {\n const prompt = generateEvaluatePrompt({\n input,\n output: actualOutput,\n context: retrievalContext,\n });\n const result = await this.agent.generate(prompt, {\n output: z.object({\n verdicts: z.array(\n z.object({\n verdict: z.string(),\n reason: z.string(),\n }),\n ),\n }),\n });\n\n return result.object.verdicts;\n }\n\n async getReason(\n input: string,\n actualOutput: string,\n score: number,\n verdicts: {\n verdict: string;\n reason: string;\n }[],\n ): Promise<string> {\n const prompt = generateReasonPrompt({ input, output: actualOutput, verdicts, score });\n const result = await this.agent.generate(prompt, {\n output: z.object({\n reason: z.string(),\n }),\n });\n return result.object.reason;\n }\n}\n","import { Metric, MetricResult, ModelConfig } from '@mastra/core';\n\nimport { ContextPositionJudge } from './metricJudge';\n\nexport class ContextPositionMetric extends Metric {\n private judge: ContextPositionJudge;\n private scale: number;\n\n constructor(model: ModelConfig, { scale = 10 }: { scale?: number } = {}) {\n super();\n this.judge = new ContextPositionJudge(model);\n this.scale = scale;\n }\n\n async measure({\n input,\n output,\n context,\n }: {\n input: string;\n output: string;\n context: string[];\n }): Promise<MetricResult> {\n const verdicts = await this.judge.evaluate(input, output, context);\n const score = this.calculateScore(verdicts);\n const reason = await this.judge.getReason(input, output, score, verdicts);\n\n return {\n score,\n reason,\n };\n }\n\n private calculateScore(verdicts: { verdict: string; reason: string }[]): number {\n const totalVerdicts = verdicts?.length || 0;\n if (totalVerdicts === 0) {\n return 0;\n }\n\n // Convert to binary scores (1 for yes, 0 for no)\n const binaryScores = verdicts.map(v => (v.verdict.trim().toLowerCase() === 'yes' ? 1 : 0));\n\n let weightedSum = 0;\n let maxPossibleSum = 0; // Track the maximum possible sum for normalization\n\n // Calculate position-weighted scores\n binaryScores.forEach((isRelevant, index) => {\n const positionWeight = 1 / (index + 1);\n if (isRelevant) {\n weightedSum += positionWeight;\n }\n maxPossibleSum += positionWeight; // Add to max possible sum regardless of relevance\n });\n\n if (weightedSum === 0) {\n return 0;\n }\n\n // Normalize against the maximum possible score\n const finalScore = (weightedSum / maxPossibleSum) * this.scale;\n return finalScore;\n }\n}\n","export const CONTEXT_PRECISION_AGENT_INSTRUCTIONS = `You are a balanced and nuanced context precision evaluator. Your job is to determine if retrieved context nodes are relevant to generating the expected output.\n\nKey Principles:\n1. Evaluate whether each context node was useful in generating the expected output\n2. Consider both direct and indirect relevance\n3. Prioritize usefulness over completeness\n4. Recognize that some nodes may be partially relevant\n5. Empty or error nodes should be marked as not relevant`;\n\nexport function generateEvaluatePrompt({\n input,\n output,\n context,\n}: {\n input: string;\n output: string;\n context: string[];\n}) {\n return `Given the input, output, and context, evaluate each context piece's relevance by generating a list of JSON objects.\n\n**\nIMPORTANT: Your response must be in JSON format with a 'verdicts' key containing a list. Each verdict must have only two fields: \\`verdict\\` with either 'yes' or 'no', and \\`reason\\` explaining the verdict. Your reason should include relevant quotes from the context.\n\nExample Context: [\"The Sun is a star\", \"Stars produce their own light\", \"The Moon reflects sunlight\"]\nExample Query: \"What is the Sun?\"\nExample Expected Response: \"The Sun is a star that produces light.\"\n\nExample:\n{\n \"verdicts\": [\n {\n \"verdict\": \"yes\",\n \"reason\": \"The context 'The Sun is a star' directly defines what the Sun is.\"\n },\n {\n \"verdict\": \"yes\",\n \"reason\": \"The context 'Stars produce their own light' is relevant as it describes a key characteristic of stars, which includes the Sun.\"\n },\n {\n \"verdict\": \"no\",\n \"reason\": \"The context 'The Moon reflects sunlight' is not relevant to defining what the Sun is.\"\n }\n ] \n}\n\nConsider context relevant if it:\n- Directly addresses the query\n- Provides examples or instances that help explain the concept\n- Offers related information that helps build understanding\n- Contains partial information that contributes to the response\n\nThe number of verdicts MUST MATCH the number of context pieces exactly.\n**\n\nInput:\n${input}\n\nOutput:\n${output}\n\nContext:\n${context}\n\nJSON:\n`;\n}\n\nexport function generateReasonPrompt({\n input,\n output,\n verdicts,\n score,\n}: {\n input: string;\n output: string;\n verdicts: Array<{ verdict: string; reason: string }>;\n score: number;\n}) {\n return `Given the input, output, verdicts, and precision score, provide a BRIEF explanation for the score. Explain both its strengths and limitations.\nThe retrieved contexts is a list containing \\`verdict\\` ('yes' or 'no' for relevance), \\`reason\\` (explaining the verdict) and \\`node\\` (the context text). Contexts are listed in their ranking order.\n\n**\nIMPORTANT: Return only JSON format with a single 'reason' key explaining the score.\nExample JSON:\n{\n \"reason\": \"The score is <score> because <explanation>.\"\n}\n\nGuidelines:\n- Don't mention 'verdict' - refer to relevant/irrelevant nodes instead\n- Use information from the \\`reason\\` field, not the field itself\n- Reference node positions (first, second, etc.) when explaining relevance\n- For perfect scores (10.0), emphasize both relevance and optimal ordering\n- Always reference the ranking order when discussing relevance\n**\n\nPrecision Score:\n${score}\n\nInput:\n${input}\n\nOutput:\n${output}\n\nContext:\n${verdicts}\n\nJSON:\n`;\n}\n","import { ModelConfig } from '@mastra/core';\nimport { z } from 'zod';\n\nimport { MastraAgentJudge } from '../../judge';\n\nimport './prompts';\nimport { CONTEXT_PRECISION_AGENT_INSTRUCTIONS, generateEvaluatePrompt, generateReasonPrompt } from './prompts';\n\nexport class ContextPrecisionJudge extends MastraAgentJudge {\n constructor(model: ModelConfig) {\n super('Context Precision', CONTEXT_PRECISION_AGENT_INSTRUCTIONS, model);\n }\n\n async evaluate(\n input: string,\n actualOutput: string,\n retrievalContext: string[],\n ): Promise<{ verdict: string; reason: string }[]> {\n const prompt = generateEvaluatePrompt({\n input,\n output: actualOutput,\n context: retrievalContext,\n });\n const result = await this.agent.generate(prompt, {\n output: z.object({\n verdicts: z.array(\n z.object({\n verdict: z.string(),\n reason: z.string(),\n }),\n ),\n }),\n });\n\n return result.object.verdicts;\n }\n\n async getReason(\n input: string,\n actualOutput: string,\n score: number,\n verdicts: {\n verdict: string;\n reason: string;\n }[],\n ): Promise<string> {\n const prompt = generateReasonPrompt({ input, output: actualOutput, verdicts, score });\n const result = await this.agent.generate(prompt, {\n output: z.object({\n reason: z.string(),\n }),\n });\n return result.object.reason;\n }\n}\n","import { Metric, MetricResult, ModelConfig } from '@mastra/core';\n\nimport { ContextPrecisionJudge } from './metricJudge';\n\nexport class ContextPrecisionMetric extends Metric {\n private judge: ContextPrecisionJudge;\n private scale: number;\n\n constructor(model: ModelConfig, { scale = 10 }: { scale?: number } = {}) {\n super();\n this.judge = new ContextPrecisionJudge(model);\n this.scale = scale;\n }\n\n async measure({\n input,\n output,\n context,\n }: {\n input: string;\n output: string;\n context: string[];\n }): Promise<MetricResult> {\n const verdicts = await this.judge.evaluate(input, output, context);\n const score = this.calculateScore(verdicts);\n const reason = await this.judge.getReason(input, output, score, verdicts);\n\n return {\n score,\n reason,\n };\n }\n\n private calculateScore(verdicts: { verdict: string; reason: string }[]): number {\n const totalVerdicts = verdicts?.length || 0;\n if (totalVerdicts === 0) {\n return 0;\n }\n\n // Convert to binary scores (1 for yes, 0 for no)\n const binaryScores = verdicts.map(v => (v.verdict.trim().toLowerCase() === 'yes' ? 1 : 0));\n\n let weightedPrecisionSum = 0;\n let relevantCount = 0;\n\n // Calculate weighted precision at each position\n binaryScores.forEach((isRelevant, index) => {\n if (isRelevant) {\n relevantCount++;\n const currentPrecision = relevantCount / (index + 1);\n weightedPrecisionSum += currentPrecision * isRelevant;\n }\n });\n\n if (relevantCount === 0) {\n return 0;\n }\n\n const finalScore = weightedPrecisionSum / relevantCount;\n return finalScore * this.scale;\n }\n}\n","import { Metric } from '@mastra/core';\nimport { SequenceMatcher } from 'difflib';\n\nimport { MetricScoringResult } from '../types';\n\nexport class DifferenceMetric extends Metric {\n async measure({ input, output }: { input: string; output: string }): Promise<MetricScoringResult> {\n const matcher = new SequenceMatcher(null, input, output);\n const ratio = matcher.ratio();\n\n // Get detailed operations\n const ops = matcher.getOpcodes();\n const changes = ops.filter(([op]) => op !== 'equal').length;\n\n // Calculate confidence based on text length difference\n const maxLength = Math.max(input.length, output.length);\n const lengthDiff = maxLength > 0 ? Math.abs(input.length - output.length) / maxLength : 0;\n const confidence = 1 - lengthDiff;\n\n return {\n score: ratio,\n details: `Difference score: ${(ratio * 100).toFixed(1)}% with ${changes} changes`,\n confidence,\n metrics: {\n ratio,\n changes,\n lengthDiff,\n },\n };\n }\n}\n","import { Metric } from '@mastra/core';\nimport keyword_extractor from 'keyword-extractor';\n\nimport { MetricScoringResult } from '../types';\n\nexport class KeywordCoverageMetric extends Metric {\n async measure({ input, output }: { input: string; output: string }): Promise<MetricScoringResult> {\n // Handle empty strings case\n if (!input && !output) {\n return {\n score: 1,\n details: 'Keyword coverage: 100.0% (0/0 keywords)',\n confidence: 0.85,\n metrics: {\n totalKeywords: 0,\n matchedKeywords: 0,\n },\n };\n }\n\n const extractKeywords = (text: string) => {\n return keyword_extractor.extract(text, {\n language: 'english',\n remove_digits: true,\n return_changed_case: true,\n remove_duplicates: true,\n });\n };\n\n const referenceKeywords = new Set(extractKeywords(input));\n const responseKeywords = new Set(extractKeywords(output));\n\n const matchedKeywords = [...referenceKeywords].filter(k => responseKeywords.has(k));\n const totalKeywords = referenceKeywords.size;\n const coverage = totalKeywords > 0 ? matchedKeywords.length / totalKeywords : 0;\n\n return {\n score: coverage,\n details: `Keyword coverage: ${(coverage * 100).toFixed(1)}% (${matchedKeywords.length}/${referenceKeywords.size} keywords)`,\n confidence: 0.85,\n metrics: {\n totalKeywords: referenceKeywords.size,\n matchedKeywords: matchedKeywords.length,\n },\n };\n }\n}\n","export const PROMPT_ALIGNMENT_AGENT_INSTRUCTIONS = `You are a strict and thorough prompt alignment evaluator. Your job is to determine if LLM outputs follow their given prompt instructions exactly.\n\nKey Principles:\n1. Be EXTRA STRICT in your evaluation in regards to whether the instructions are followed exactly.\n2. Only give a \"yes\" verdict if an instruction is COMPLETELY followed\n3. Any partial compliance should be marked as \"no\"\n4. Provide clear, specific reasons for any \"no\" verdicts\n5. Focus solely on instruction compliance, not output quality\n\nRemember:\n- Each instruction must be evaluated independently\n- Verdicts must be either \"yes\" or \"no\" - no in-between\n- Reasons are required only for \"no\" verdicts\n- The number of verdicts must match the number of instructions exactly`;\n\nexport function generateEvaluatePrompt({\n instructions,\n input,\n output,\n}: {\n instructions: string[];\n input: string;\n output: string;\n}) {\n return `For the provided list of prompt instructions, determine whether each instruction has been followed in the LLM output.\nMake sure to judge the output on each instruction independently. Do not let instructions be influenced by other instructions.\nGenerate a list of verdicts in JSON format, where each verdict must have:\n- \"verdict\": Strictly \"yes\" or \"no\"\n- \"reason\": Give a reason for the verdict\n\nBe EXTRA STRICT in your evaluation. Only give \"yes\" if the instruction is followed COMPLETELY.\nEvaluate the output EXACTLY as written - consider every character, space, and case\n\nExample:\nInput: \"describe the sky\"\nOutput: \"the sky is Blue today\"\nInstructions: [\"Start sentences with capital letters\", \"Use proper English\"]\n\n{\n \"verdicts\": [\n {\n \"verdict\": \"no\",\n \"reason\": \"The sentence 'the sky is Blue' starts with lowercase 't'\"\n },\n {\n \"verdict\": \"no\",\n \"reason\": \"Improper capitalization: 'Blue' is capitalized mid-sentence\"\n }\n ]\n}\n\nPrompt Instructions:\n${instructions.join('\\n')}\n\nInput:\n${input}\n\nLLM Actual Output:\n${output}\n\nJSON:`;\n}\n\nexport function generateReasonPrompt({\n input,\n output,\n score,\n reasons,\n}: {\n input: string;\n output: string;\n score: number;\n reasons: string[];\n}) {\n return `Explain the instruction following score (0-10) for the LLM's response using this context:\n Context:\n Input: ${input}\n Output: ${output}\n Score: ${score}\n Failure Reasons: ${reasons.join('\\n')}\n\n Rules (follow these rules exactly. do not deviate):\n - Keep your response concise and to the point.\n - Do not change score from what is given.\n - Do not make judgements on inputs or outputs (factual correctness, quality, etc).\n - If there are failure reasons given, explain why the score is not higher.\n \n\n Output format:\n {\n \"reason\": \"The score is {score} because {explanation of instruction following}\"\n }\n \n Example Responses:\n {\n \"reason\": \"The score is 10 because the output follows the instructions exactly\"\n }\n {\n \"reason\": \"The score is 0 because the output does not follow the instructions\"\n }\n `;\n}\n","import { ModelConfig } from '@mastra/core';\nimport { z } from 'zod';\n\nimport { MastraAgentJudge } from '../../judge';\n\nimport { generateEvaluatePrompt, generateReasonPrompt, PROMPT_ALIGNMENT_AGENT_INSTRUCTIONS } from './prompts';\n\nexport class PromptAlignmentJudge extends MastraAgentJudge {\n constructor(model: ModelConfig) {\n super('Prompt Alignment', PROMPT_ALIGNMENT_AGENT_INSTRUCTIONS, model);\n }\n\n async evaluate(\n input: string,\n actualOutput: string,\n instructions: string[],\n ): Promise<{ verdict: string; reason: string }[]> {\n const prompt = generateEvaluatePrompt({ input, output: actualOutput, instructions });\n const result = await this.agent.generate(prompt, {\n output: z.object({\n verdicts: z.array(\n z.object({\n verdict: z.string(),\n reason: z.string(),\n }),\n ),\n }),\n });\n return result.object.verdicts;\n }\n\n async getReason(input: string, actualOutput: string, score: number, reasons: string[]): Promise<string> {\n const prompt = generateReasonPrompt({ input, output: actualOutput, reasons, score });\n const result = await this.agent.generate(prompt, {\n output: z.object({\n reason: z.string(),\n }),\n });\n return result.object.reason;\n }\n}\n","import { Metric, MetricResult, ModelConfig } from '@mastra/core';\n\nimport { PromptAlignmentJudge } from './metricJudge';\n\nexport class PromptAlignmentMetric extends Metric {\n private instructions: string[];\n private judge: PromptAlignmentJudge;\n private scale: number;\n\n constructor(model: ModelConfig, { instructions, scale = 10 }: { instructions: string[]; scale?: number }) {\n super();\n\n this.instructions = instructions;\n this.judge = new PromptAlignmentJudge(model);\n this.scale = scale;\n }\n\n async measure({ input, output }: { input: string; output: string }): Promise<MetricResult> {\n const verdicts = await this.judge.evaluate(input, output, this.instructions);\n const score = this.calculateScore(verdicts);\n\n const reason = await this.generateReason(input, output, score, verdicts);\n\n return {\n score,\n reason,\n };\n }\n\n private async generateReason(\n input: string,\n output: string,\n score: number,\n verdicts: {\n verdict: string;\n reason: string;\n }[],\n ): Promise<string> {\n const reasonsForVerdicts: string[] = [];\n for (const { verdict, reason } of verdicts || []) {\n if (verdict.trim().toLowerCase() === 'no') {\n reasonsForVerdicts.push(reason);\n }\n }\n\n const reason = await this.judge.getReason(input, output, score, reasonsForVerdicts);\n return reason;\n }\n\n private calculateScore(evaluation: { verdict: string; reason: string }[]): number {\n const numberOfVerdicts = evaluation?.length || 0;\n if (numberOfVerdicts === 0) {\n return 1;\n }\n\n let alignmentCount = 0;\n for (const { verdict } of evaluation!) {\n if (verdict.trim().toLowerCase() !== 'no') {\n alignmentCount++;\n }\n }\n\n const score = alignmentCount / numberOfVerdicts;\n return score * this.scale;\n }\n}\n","import { Metric } from '@mastra/core';\nimport Sentiment from 'sentiment';\n\nimport { MetricScoringResult } from '../types';\n\nexport class ToneConsistencyMetric extends Metric {\n private sentiment = new Sentiment();\n\n async measure({ input, output }: { input: string; output: string }): Promise<MetricScoringResult> {\n const responseSentiment = this.sentiment.analyze(input);\n\n if (output) {\n // Compare sentiment with reference\n const referenceSentiment = this.sentiment.analyze(output);\n const sentimentDiff = Math.abs(responseSentiment.comparative - referenceSentiment.comparative);\n const normalizedScore = Math.max(0, 1 - sentimentDiff);\n\n return {\n score: normalizedScore,\n details: `Tone consistency: ${(normalizedScore * 100).toFixed(1)}%`,\n confidence: 0.75,\n metrics: {\n responseSentiment: responseSentiment.comparative,\n referenceSentiment: referenceSentiment.comparative,\n difference: sentimentDiff,\n },\n };\n }\n\n // Evaluate sentiment stability across response\n const sentences = input.match(/[^.!?]+[.!?]+/g) || [input];\n const sentiments = sentences.map(s => this.sentiment.analyze(s).comparative);\n const avgSentiment = sentiments.reduce((a, b) => a + b, 0) / sentiments.length;\n const variance = sentiments.reduce((sum, s) => sum + Math.pow(s - avgSentiment, 2), 0) / sentiments.length;\n const stability = Math.max(0, 1 - variance);\n\n return {\n score: stability,\n details: `Tone stability: ${(stability * 100).toFixed(1)}%`,\n confidence: 0.7,\n metrics: {\n avgSentiment,\n sentimentVariance: variance,\n },\n };\n }\n}\n"],"names":["evaluate","_x","_x2","_x3","_evaluate","apply","arguments","_asyncToGenerator","_regeneratorRuntime","mark","_callee","agent","input","metric","agentOutput","metricResult","wrap","_callee$","_context","prev","next","generate","sent","measure","toString","output","text","executeHook","AvailableHooks","ON_EVALUATION","result","abrupt","stop","MastraAgentJudge","name","instructions","model","Agent","provider","ANSWER_RELEVANCY_AGENT_INSTRUCTIONS","generateEvaluationStatementsPrompt","_ref","generateEvaluatePrompt","_ref2","statements","join","generateReasonPrompt","_ref3","score","reasons","AnswerRelevancyJudge","_MastraAgentJudge","call","_inheritsLoose","_proto","prototype","actualOutput","statementPrompt","prompt","z","object","array","string","verdicts","verdict","reason","getReason","_getReason","_callee2","_callee2$","_context2","_x4","_x5","_x6","AnswerRelevancyMetric","_Metric","_temp","_this","uncertaintyWeight","scale","judge","_measure","calculateScore","generateReason","_generateReason","reasonsForVerdicts","_iterator","_step","_step$value","_reason","_createForOfIteratorHelperLoose","done","value","trim","toLowerCase","push","evaluation","numberOfVerdicts","length","relevancyCount","_iterator2","_step2","Math","round","Metric","CompletenessMetric","inputDoc","outputDoc","inputElements","outputElements","coverage","undefined","Error","nlp","extractElements","calculateCoverage","details","toFixed","confidence","metrics","missingElements","filter","e","includes","elementCounts","doc","nouns","out","verbs","toInfinitive","topics","terms","cleanAndSplitTerm","term","normalized","normalizeString","replace","split","word","processedTerms","concat","flatMap","Set","str","normalize","original","simplified","_this2","covered","element","some","s","elem","simp","longer","shorter","ContentSimilarityMetric","options","_extends","ignoreCase","ignoreWhitespace","processedInput","processedOutput","similarity","stringSimilarity","compareTwoStrings","CONTEXT_POSITION_AGENT_INSTRUCTIONS","context","ContextPositionJudge","retrievalContext","_x7","ContextPositionMetric","_ref$scale","totalVerdicts","binaryScores","map","v","weightedSum","maxPossibleSum","forEach","isRelevant","index","positionWeight","finalScore","CONTEXT_PRECISION_AGENT_INSTRUCTIONS","ContextPrecisionJudge","ContextPrecisionMetric","weightedPrecisionSum","relevantCount","currentPrecision","DifferenceMetric","matcher","ratio","ops","changes","maxLength","lengthDiff","SequenceMatcher","getOpcodes","op","max","abs","KeywordCoverageMetric","extractKeywords","referenceKeywords","responseKeywords","matchedKeywords","totalKeywords","keyword_extractor","extract","language","remove_digits","return_changed_case","remove_duplicates","k","has","size","PROMPT_ALIGNMENT_AGENT_INSTRUCTIONS","PromptAlignmentJudge","PromptAlignmentMetric","alignmentCount","ToneConsistencyMetric","_len","args","Array","_key","sentiment","Sentiment","responseSentiment","referenceSentiment","sentimentDiff","normalizedScore","sentences","sentiments","avgSentiment","variance","stability","analyze","comparative","difference","match","reduce","a","b","sum","pow","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A,EAAA,CAAA;AAAA,UAAA,KAAA,KAAA;YAAA,OAAAzN,QAAA,CAAAc,IAAA,EAAA,CAAA;AAAA,SAAA;AAAA,OAAA,EAAAtB,OAAA,EAAA,IAAA,CAAA,CAAA;KACF,CAAA,CAAA,CAAA;IAAA,SArCKa,OAAOA,CAAAtB,EAAA,EAAA;AAAA,MAAA,OAAAgF,QAAA,CAAA5E,KAAA,CAAA,IAAA,EAAAC,SAAA,CAAA,CAAA;AAAA,KAAA;AAAA,IAAA,OAAPiB,OAAO,CAAA;AAAA,GAAA,EAAA,CAAA;AAAA,EAAA,OAAAsM,qBAAA,CAAA;AAAA,CAAA,CAH4BrH,WAAM;;;;;;;;;;;;;"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@mastra/core"),t=require("zod"),n=require("compromise"),r=require("string-similarity"),o=require("difflib"),i=require("keyword-extractor"),a=require("sentiment");function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function c(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,o)}function u(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){c(i,r,o,a,s,"next",e)}function s(e){c(i,r,o,a,s,"throw",e)}a(void 0)}))}}function l(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return s(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function h(){return h=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},h.apply(null,arguments)}function p(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,f(e,t)}function d(){d=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(e,t,n){e[t]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function u(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,n){return e[t]=n}}function l(e,t,n,r){var i=Object.create((t&&t.prototype instanceof g?t:g).prototype),a=new z(r||[]);return o(i,"_invoke",{value:O(e,n,a)}),i}function h(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=l;var p="suspendedStart",f="suspendedYield",v="executing",m="completed",y={};function g(){}function w(){}function x(){}var b={};u(b,a,(function(){return this}));var E=Object.getPrototypeOf,S=E&&E(E(R([])));S&&S!==n&&r.call(S,a)&&(b=S);var T=x.prototype=g.prototype=Object.create(b);function j(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function k(e,t){function n(o,i,a,s){var c=h(e[o],e,i);if("throw"!==c.type){var u=c.arg,l=u.value;return l&&"object"==typeof l&&r.call(l,"__await")?t.resolve(l.__await).then((function(e){n("next",e,a,s)}),(function(e){n("throw",e,a,s)})):t.resolve(l).then((function(e){u.value=e,a(u)}),(function(e){return n("throw",e,a,s)}))}s(c.arg)}var i;o(this,"_invoke",{value:function(e,r){function o(){return new t((function(t,o){n(e,r,t,o)}))}return i=i?i.then(o,o):o()}})}function O(t,n,r){var o=p;return function(i,a){if(o===v)throw Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:e,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var c=C(s,r);if(c){if(c===y)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=v;var u=h(t,n,r);if("normal"===u.type){if(o=r.done?m:f,u.arg===y)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(o=m,r.method="throw",r.arg=u.arg)}}}function C(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,C(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),y;var i=h(o,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,y;var a=i.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,y):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,y)}function M(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function L(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function z(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(M,this),this.reset(!0)}function R(t){if(t||""===t){var n=t[a];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function n(){for(;++o<t.length;)if(r.call(t,o))return n.value=t[o],n.done=!1,n;return n.value=e,n.done=!0,n};return i.next=i}}throw new TypeError(typeof t+" is not iterable")}return w.prototype=x,o(T,"constructor",{value:x,configurable:!0}),o(x,"constructor",{value:w,configurable:!0}),w.displayName=u(x,c,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===w||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,x):(e.__proto__=x,u(e,c,"GeneratorFunction")),e.prototype=Object.create(T),e},t.awrap=function(e){return{__await:e}},j(k.prototype),u(k.prototype,s,(function(){return this})),t.AsyncIterator=k,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new k(l(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},j(T),u(T,c,"Generator"),u(T,a,(function(){return this})),u(T,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=R,z.prototype={constructor:z,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(L),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function o(r,o){return s.type="throw",s.arg=t,n.next=r,o&&(n.method="next",n.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),u=r.call(a,"finallyLoc");if(c&&u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),L(n),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;L(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:R(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),y}},t}function f(e,t){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},f(e,t)}function v(){return(v=u(d().mark((function t(n,r,o){var i,a;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n.generate(r);case 2:return i=t.sent,t.next=5,o.measure({input:r.toString(),output:i.text});case 5:return a=t.sent,e.executeHook(e.AvailableHooks.ON_EVALUATION,{input:r.toString(),output:i.text,result:a}),t.abrupt("return",a);case 8:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var m=function(t,n,r){this.agent=void 0,this.agent=new e.Agent({name:"Mastra Eval Judge "+r.provider+" "+t,instructions:n,model:r})},y=function(e){function n(t){return e.call(this,"Answer Relevancy",'You are a balanced and nuanced answer relevancy evaluator. Your job is to determine if LLM outputs are relevant to the input, including handling partially relevant or uncertain cases.\n\nKey Principles:\n1. Evaluate whether the output addresses what the input is asking for\n2. Consider both direct answers and related context\n3. Prioritize relevance to the input over correctness\n4. Recognize that responses can be partially relevant\n5. Empty inputs or error messages should always be marked as "no"',t)||this}p(n,e);var r=n.prototype;return r.evaluate=function(){var e=u(d().mark((function e(n,r){var o,i;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o='Given the text, break it down into meaningful statements while preserving context and relationships.\nDon\'t split too aggressively.\n\nSplit compound statements particularly when they:\n- Are joined by "and"\n- Contain multiple distinct facts or claims\n- Have multiple descriptive elements about the subject\n\n\nHandle special cases:\n- A single word answer should be treated as a complete statement\n- Error messages should be treated as a single statement\n- Empty strings should return an empty list\n- When splitting text, keep related information together\n\nExample:\nExample text: Look! A bird! Birds are an interesting animal.\n\n{{\n "statements": ["Look!", "A bird!", "Birds are interesting animals."]\n}}\n\nPlease return only JSON format with "statements" array.\nReturn empty list for empty input.\n\nText:\n'+{output:r}.output+"\n\nJSON:\n",e.next=3,this.agent.generate(o,{output:t.z.object({statements:t.z.array(t.z.string())})});case 3:return i='Evaluate each statement\'s relevance to the input question, considering direct answers, related context, and uncertain cases.\n\n Return JSON with array of verdict objects. Each verdict must include:\n - "verdict": "yes", "no", or "unsure"\n - "reason": Clear explanation of the verdict\n - Exact match between number of verdicts and statements\n\n Verdict Guidelines:\n - "yes": Statement explicitly and directly answers the input question\n * Contains specific answer to the question asked (e.g., "The color of the sky is blue")\n * States explicit relationship between key concepts (e.g., "X is the CEO of company Y")\n * Can stand alone as a complete answer\n * Contains appropriate question-type response (e.g., location for "where", person for "who")\n\n - "unsure": Statement shows partial relevance when it:\n * Contains topic-related administrative/governance terms without direct answer\n * Mentions locations or entities related to the answer without specifying their role\n * References functions or characteristics typically associated with the answer\n * Is incorrect but shows understanding of the question\n * Uses importance indicators ("main", "primary", "major") with relevant concepts\n * Includes indirect references to the answer (e.g., "where the president works")\n * Contains multiple relevant concepts but lacks explicit relationship between them\n * Demonstrates understanding of question domain without providing specific answer\n\n - "no": Statement lacks meaningful connection to question when it:\n * Contains no concepts related to the question type or domain\n * Only mentions the broader topic without relevant details (e.g., "the country has nice weather")\n * Provides general descriptions without addressing the specific question\n * Contains purely tangential information about the subject\n * Consists of empty or meaningless content\n * Discusses characteristics unrelated to the question type (e.g., describing cuisine when asked about geography)\n * Note: Assessment is about topical relationship, not factual accuracy\n\n REMEMBER: A statmenent does not have to be correct, it just has to be relevant.\n If the statement contains words or phrases that are relevant to the input, it is partially relevant.\n If the statement is a direct answer to the input, it is relevant.\n If the statement is completely unrelated to the input or contains nothing, it is not relevant.\n DO NOT MAKE A JUDGEMENT ON THE CORRECTNESS OF THE STATEMENT, JUST THE RELEVANCY.\n\n\n Example:\n Input: "What color is the sky during daytime?"\n Statements: [\n "The sky is blue during daytime",\n "The sky is full of clouds", \n "I had breakfast today",\n "Blue is a beautiful color",\n "Many birds fly in the sky",\n "",\n "The sky is purple during daytime",\n ]\n JSON:\n {{\n "verdicts": [\n {{\n "verdict": "yes",\n "reason": "This statement explicitly answers what color the sky is during daytime"\n }},\n {{\n "verdict": "unsure",\n "reason": "This statement describes the sky but doesn\'t address its color"\n }},\n {{\n "verdict": "no",\n "reason": "This statement about breakfast is completely unrelated to the sky"\n }},\n {{\n "verdict": "unsure",\n "reason": "This statement about blue is related to color but doesn\'t address the sky"\n }},\n {{\n "verdict": "unsure",\n "reason": "This statement is about the sky but doesn\'t address its color"\n }},\n {{\n "verdict": "no",\n "reason": "This statement is empty"\n }},\n {{\n "verdict": "unsure",\n "reason": "This statement is incorrect but contains relevant information and still addresses the question"\n }}\n ]\n }}\n\n Input:\n '+(a={input:n,statements:e.sent.object.statements}).input+"\n\n Statements:\n "+a.statements.join("\n")+"\n\n JSON:\n ",e.next=7,this.agent.generate(i,{output:t.z.object({verdicts:t.z.array(t.z.object({verdict:t.z.string(),reason:t.z.string()}))})});case 7:return e.abrupt("return",e.sent.object.verdicts);case 9:case"end":return e.stop()}var a}),e,this)})));return function(t,n){return e.apply(this,arguments)}}(),r.getReason=function(){var e=u(d().mark((function e(n,r,o,i){var a;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a="Explain the irrelevancy score (0-10) for the LLM's response using this context:\n Context:\n Input: "+(s={input:n,output:r,reasons:i,score:o}).input+"\n Output: "+s.output+"\n Score: "+s.score+"\n Irrelevancy Reasons: "+s.reasons.join("\n")+'\n \n Rules:\n - Explain score based on mix of direct answers and related context\n - Consider both full and partial relevance\n - Keep explanation concise and focused\n - Use given score, don\'t recalculate\n - Don\'t judge factual correctness\n - Explain both relevant and irrelevant aspects\n - For mixed responses, explain the balance\n\n Format:\n {\n "reason": "The score is {score} because {explanation of overall relevance}"\n }\n\n Example Responses:\n {\n "reason": "The score is 7 because while the first statement directly answers the question, the additional context is only partially relevant"\n }\n {\n "reason": "The score is 3 because while the answer discusses the right topic, it doesn\'t directly address the question"\n }\n ',e.next=3,this.agent.generate(a,{output:t.z.object({reason:t.z.string()})});case 3:return e.abrupt("return",e.sent.object.reason);case 5:case"end":return e.stop()}var s}),e,this)})));return function(t,n,r,o){return e.apply(this,arguments)}}(),n}(m),g=function(e){function t(t,n){var r,o=void 0===n?{uncertaintyWeight:.3,scale:10}:n,i=o.uncertaintyWeight,a=o.scale;return(r=e.call(this)||this).judge=void 0,r.uncertaintyWeight=void 0,r.scale=void 0,r.uncertaintyWeight=i,r.judge=new y(t),r.scale=a,r}p(t,e);var n=t.prototype;return n.measure=function(){var e=u(d().mark((function e(t){var n,r,o,i;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.input,r=t.output,e.next=3,this.judge.evaluate(n,r);case 3:return i=this.calculateScore(o=e.sent),e.next=7,this.generateReason(n,r,i,o);case 7:return e.abrupt("return",{score:i,reason:e.sent});case 9:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),n.generateReason=function(){var e=u(d().mark((function e(t,n,r,o){var i,a,s,c,u;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(i=[],a=l(o||[]);!(s=a()).done;)u=(c=s.value).reason,"no"===c.verdict.trim().toLowerCase()&&i.push(u);return e.next=4,this.judge.getReason(t,n,r,i);case 4:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)})));return function(t,n,r,o){return e.apply(this,arguments)}}(),n.calculateScore=function(e){var t=(null==e?void 0:e.length)||0;if(0===t)return 1;for(var n,r=0,o=l(e);!(n=o()).done;){var i=n.value.verdict;"yes"===i.trim().toLowerCase()?r++:"unsure"===i.trim().toLowerCase()&&(r+=this.uncertaintyWeight)}return Math.round(r/t*this.scale)},t}(e.Metric),w=function(e){function t(){return e.apply(this,arguments)||this}p(t,e);var r=t.prototype;return r.measure=function(){var e=u(d().mark((function e(t){var r,o,i,a,s,c,u;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=t.output,null!=(r=t.input)&&null!=o){e.next=3;break}throw new Error("Inputs cannot be null or undefined");case 3:return r=r.trim(),o=o.trim(),i=n(r),a=n(o),s=this.extractElements(i),c=this.extractElements(a),u=this.calculateCoverage(s,c),e.abrupt("return",{score:u,details:"Completeness score: "+(100*u).toFixed(1)+"%",confidence:.8,metrics:{inputElements:s,outputElements:c,missingElements:s.filter((function(e){return!c.includes(e)})),elementCounts:{input:s.length,output:c.length}}});case 11:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),r.extractElements=function(e){var t=this,n=e.nouns().out("array")||[],r=e.verbs().toInfinitive().out("array")||[],o=e.topics().out("array")||[],i=e.terms().out("array")||[],a=function(e){return t.normalizeString(e).replace(/([a-z])([A-Z])/g,"$1 $2").replace(/[^a-z0-9]+/g," ").trim().split(/\s+/).filter((function(e){return e.length>0}))},s=[].concat(n.flatMap(a),r.flatMap(a),o.flatMap(a),i.flatMap(a));return[].concat(new Set(s))},r.normalizeString=function(e){return e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase()},r.calculateCoverage=function(e,t){var n=this;return 0===e.length?0===t.length?1:0:e.filter((function(e){return t.some((function(t){var r=n.normalizeString(e),o=n.normalizeString(t);if(r.length<=3)return r===o;var i=r.length>o.length?r:o,a=r.length>o.length?o:r;return!!i.includes(a)&&a.length/i.length>.6}))})).length/e.length},t}(e.Metric),x=function(e){function t(t){var n;return void 0===t&&(t={}),(n=e.call(this)||this).options=void 0,n.options=h({ignoreCase:!0,ignoreWhitespace:!0},t),n}return p(t,e),t.prototype.measure=function(){var e=u(d().mark((function e(t){var n,o,i;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.input,o=t.output,this.options.ignoreCase&&(n=n.toLowerCase(),o=o.toLowerCase()),this.options.ignoreWhitespace&&(n=n.replace(/\s+/g," ").trim(),o=o.replace(/\s+/g," ").trim()),i=r.compareTwoStrings(n,o),e.abrupt("return",{score:i,details:"Content similarity: "+(100*i).toFixed(1)+"%",confidence:.9,metrics:{similarity:i}});case 7:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t}(e.Metric),b=function(e){function n(t){return e.call(this,"Context Position","You are a balanced and nuanced context position evaluator. Your job is to determine if retrieved context nodes are relevant to generating the expected output, with special attention to their ordering.\n\nKey Principles:\n1. Evaluate whether each context node contributes to understanding the expected output - both directly AND indirectly\n2. Consider all forms of relevance:\n - Direct definitions or explanations\n - Supporting evidence or examples\n - Related characteristics or behaviors\n - Real-world applications or effects\n3. Pay attention to the position of relevant information\n4. Recognize that earlier positions should contain more relevant information\n5. Be inclusive rather than exclusive in determining relevance - if the information supports or reinforces the output in any way, consider it relevant\n6. Empty or error nodes should be marked as not relevant",t)||this}p(n,e);var r=n.prototype;return r.evaluate=function(){var e=u(d().mark((function e(n,r,o){var i;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i='Given the input, output, and context, evaluate each context piece\'s relevance by generating a list of JSON objects.\n\n**\nIMPORTANT: Your response must be in JSON format with a \'verdicts\' key containing a list. Each verdict must have only two fields: `verdict` with either \'yes\' or \'no\', and `reason` explaining the verdict. Your reason should include relevant quotes from the context.\n\nExample Context: ["The Sun is a star", "Stars produce their own light", "The Moon reflects sunlight"]\nExample Query: "What is the Sun?"\nExample Expected Response: "The Sun is a star that produces light."\n\nConsider context relevant if it:\n- Directly addresses the input\n- Provides examples or instances that help explain the concept\n- Offers related information that helps build understanding\n- Contains partial information that contributes to the response\n- Demonstrates or validates characteristics mentioned in the output\n- Shows real-world applications or effects of the concept\n- Reinforces or provides evidence for any part of the output\n- Helps establish credibility or understanding of the subject\n- Describes the actions the subject can perform\n\nA context piece should be considered relevant if it contributes ANY supporting information or evidence, even if indirect.\n\nExample:\n{\n "verdicts": [\n {\n "verdict": "yes",\n "reason": "The context \'The Sun is a star\' directly defines what the Sun is."\n },\n {\n "verdict": "yes",\n "reason": "The context \'Stars produce their own light\' is relevant as it describes a key characteristic of stars, which includes the Sun."\n },\n {\n "verdict": "no",\n "reason": "The context \'The Moon reflects sunlight\' is not relevant to defining what the Sun is."\n }\n ] \n}\n\nThe number of verdicts MUST MATCH the number of context pieces exactly.\n**\n\nInput:\n'+(a={input:n,output:r,context:o}).input+"\n\nOutput:\n"+a.output+"\n\nContext:\n"+a.context+"\n\nJSON:\n",e.next=3,this.agent.generate(i,{output:t.z.object({verdicts:t.z.array(t.z.object({verdict:t.z.string(),reason:t.z.string()}))})});case 3:return e.abrupt("return",e.sent.object.verdicts);case 5:case"end":return e.stop()}var a}),e,this)})));return function(t,n,r){return e.apply(this,arguments)}}(),r.getReason=function(){var e=u(d().mark((function e(n,r,o,i){var a;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a="Given the input, output, verdicts, and position score, provide a BRIEF explanation for the score. Focus on both relevance and positioning of the context.\n The retrieved contexts is a list containing `verdict` ('yes' or 'no' for relevance), `reason` (explaining the verdict) and `node` (the context text). Contexts are listed in their ranking order.\n\n**\nIMPORTANT: Return only JSON format with a single 'reason' key explaining the score.\nExample JSON:\n{\n \"reason\": \"The score is <score> because <explanation>.\"\n}\n\nGuidelines:\n- Don't mention 'verdict' - refer to relevant/irrelevant nodes instead\n- Use information from the `reason` field, not the field itself\n- Reference node positions (first, second, etc.) when explaining relevance\n- For perfect scores (10.0), emphasize both relevance and optimal ordering\n- Always reference the ranking order when discussing relevance\n**\n\nPosition Score:\n"+(s={input:n,output:r,verdicts:i,score:o}).score+"\n\nInput:\n"+s.input+"\n\nOutput:\n"+s.output+"\n\nContext:\n"+s.verdicts+"\n\nJSON:\n",e.next=3,this.agent.generate(a,{output:t.z.object({reason:t.z.string()})});case 3:return e.abrupt("return",e.sent.object.reason);case 5:case"end":return e.stop()}var s}),e,this)})));return function(t,n,r,o){return e.apply(this,arguments)}}(),n}(m),E=function(e){function t(t,n){var r,o=(void 0===n?{}:n).scale,i=void 0===o?10:o;return(r=e.call(this)||this).judge=void 0,r.scale=void 0,r.judge=new b(t),r.scale=i,r}p(t,e);var n=t.prototype;return n.measure=function(){var e=u(d().mark((function e(t){var n,r,o,i,a;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.input,r=t.output,o=t.context,e.next=3,this.judge.evaluate(n,r,o);case 3:return a=this.calculateScore(i=e.sent),e.next=7,this.judge.getReason(n,r,a,i);case 7:return e.abrupt("return",{score:a,reason:e.sent});case 9:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),n.calculateScore=function(e){if(0===((null==e?void 0:e.length)||0))return 0;var t=e.map((function(e){return"yes"===e.verdict.trim().toLowerCase()?1:0})),n=0,r=0;return t.forEach((function(e,t){var o=1/(t+1);e&&(n+=o),r+=o})),0===n?0:n/r*this.scale},t}(e.Metric),S=function(e){function n(t){return e.call(this,"Context Precision","You are a balanced and nuanced context precision evaluator. Your job is to determine if retrieved context nodes are relevant to generating the expected output.\n\nKey Principles:\n1. Evaluate whether each context node was useful in generating the expected output\n2. Consider both direct and indirect relevance\n3. Prioritize usefulness over completeness\n4. Recognize that some nodes may be partially relevant\n5. Empty or error nodes should be marked as not relevant",t)||this}p(n,e);var r=n.prototype;return r.evaluate=function(){var e=u(d().mark((function e(n,r,o){var i;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i='Given the input, output, and context, evaluate each context piece\'s relevance by generating a list of JSON objects.\n\n**\nIMPORTANT: Your response must be in JSON format with a \'verdicts\' key containing a list. Each verdict must have only two fields: `verdict` with either \'yes\' or \'no\', and `reason` explaining the verdict. Your reason should include relevant quotes from the context.\n\nExample Context: ["The Sun is a star", "Stars produce their own light", "The Moon reflects sunlight"]\nExample Query: "What is the Sun?"\nExample Expected Response: "The Sun is a star that produces light."\n\nExample:\n{\n "verdicts": [\n {\n "verdict": "yes",\n "reason": "The context \'The Sun is a star\' directly defines what the Sun is."\n },\n {\n "verdict": "yes",\n "reason": "The context \'Stars produce their own light\' is relevant as it describes a key characteristic of stars, which includes the Sun."\n },\n {\n "verdict": "no",\n "reason": "The context \'The Moon reflects sunlight\' is not relevant to defining what the Sun is."\n }\n ] \n}\n\nConsider context relevant if it:\n- Directly addresses the query\n- Provides examples or instances that help explain the concept\n- Offers related information that helps build understanding\n- Contains partial information that contributes to the response\n\nThe number of verdicts MUST MATCH the number of context pieces exactly.\n**\n\nInput:\n'+(a={input:n,output:r,context:o}).input+"\n\nOutput:\n"+a.output+"\n\nContext:\n"+a.context+"\n\nJSON:\n",e.next=3,this.agent.generate(i,{output:t.z.object({verdicts:t.z.array(t.z.object({verdict:t.z.string(),reason:t.z.string()}))})});case 3:return e.abrupt("return",e.sent.object.verdicts);case 5:case"end":return e.stop()}var a}),e,this)})));return function(t,n,r){return e.apply(this,arguments)}}(),r.getReason=function(){var e=u(d().mark((function e(n,r,o,i){var a;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a="Given the input, output, verdicts, and precision score, provide a BRIEF explanation for the score. Explain both its strengths and limitations.\nThe retrieved contexts is a list containing `verdict` ('yes' or 'no' for relevance), `reason` (explaining the verdict) and `node` (the context text). Contexts are listed in their ranking order.\n\n**\nIMPORTANT: Return only JSON format with a single 'reason' key explaining the score.\nExample JSON:\n{\n \"reason\": \"The score is <score> because <explanation>.\"\n}\n\nGuidelines:\n- Don't mention 'verdict' - refer to relevant/irrelevant nodes instead\n- Use information from the `reason` field, not the field itself\n- Reference node positions (first, second, etc.) when explaining relevance\n- For perfect scores (10.0), emphasize both relevance and optimal ordering\n- Always reference the ranking order when discussing relevance\n**\n\nPrecision Score:\n"+(s={input:n,output:r,verdicts:i,score:o}).score+"\n\nInput:\n"+s.input+"\n\nOutput:\n"+s.output+"\n\nContext:\n"+s.verdicts+"\n\nJSON:\n",e.next=3,this.agent.generate(a,{output:t.z.object({reason:t.z.string()})});case 3:return e.abrupt("return",e.sent.object.reason);case 5:case"end":return e.stop()}var s}),e,this)})));return function(t,n,r,o){return e.apply(this,arguments)}}(),n}(m),T=function(e){function t(t,n){var r,o=(void 0===n?{}:n).scale,i=void 0===o?10:o;return(r=e.call(this)||this).judge=void 0,r.scale=void 0,r.judge=new S(t),r.scale=i,r}p(t,e);var n=t.prototype;return n.measure=function(){var e=u(d().mark((function e(t){var n,r,o,i,a;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.input,r=t.output,o=t.context,e.next=3,this.judge.evaluate(n,r,o);case 3:return a=this.calculateScore(i=e.sent),e.next=7,this.judge.getReason(n,r,a,i);case 7:return e.abrupt("return",{score:a,reason:e.sent});case 9:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),n.calculateScore=function(e){if(0===((null==e?void 0:e.length)||0))return 0;var t=e.map((function(e){return"yes"===e.verdict.trim().toLowerCase()?1:0})),n=0,r=0;return t.forEach((function(e,t){e&&(r++,n+=r/(t+1)*e)})),0===r?0:n/r*this.scale},t}(e.Metric),j=function(e){function t(){return e.apply(this,arguments)||this}return p(t,e),t.prototype.measure=function(){var e=u(d().mark((function e(t){var n,r,i,a,s,c,u,l,h;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=new o.SequenceMatcher(null,n=t.input,r=t.output),a=i.ratio(),s=i.getOpcodes(),c=s.filter((function(e){return"equal"!==e[0]})).length,u=Math.max(n.length,r.length),l=u>0?Math.abs(n.length-r.length)/u:0,h=1-l,e.abrupt("return",{score:a,details:"Difference score: "+(100*a).toFixed(1)+"% with "+c+" changes",confidence:h,metrics:{ratio:a,changes:c,lengthDiff:l}});case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),t}(e.Metric),k=function(e){function t(){return e.apply(this,arguments)||this}return p(t,e),t.prototype.measure=function(){var e=u(d().mark((function e(t){var n,r,o,a,s,c,u,l;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.output,(n=t.input)||r){e.next=3;break}return e.abrupt("return",{score:1,details:"Keyword coverage: 100.0% (0/0 keywords)",confidence:.85,metrics:{totalKeywords:0,matchedKeywords:0}});case 3:return o=function(e){return i.extract(e,{language:"english",remove_digits:!0,return_changed_case:!0,remove_duplicates:!0})},a=new Set(o(n)),s=new Set(o(r)),c=[].concat(a).filter((function(e){return s.has(e)})),e.abrupt("return",{score:l=(u=a.size)>0?c.length/u:0,details:"Keyword coverage: "+(100*l).toFixed(1)+"% ("+c.length+"/"+a.size+" keywords)",confidence:.85,metrics:{totalKeywords:a.size,matchedKeywords:c.length}});case 10:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),t}(e.Metric);function O(e){var t=e.input,n=e.output;return'For the provided list of prompt instructions, determine whether each instruction has been followed in the LLM output.\nMake sure to judge the output on each instruction independently. Do not let instructions be influenced by other instructions.\nGenerate a list of verdicts in JSON format, where each verdict must have:\n- "verdict": Strictly "yes" or "no"\n- "reason": Give a reason for the verdict\n\nBe EXTRA STRICT in your evaluation. Only give "yes" if the instruction is followed COMPLETELY.\nEvaluate the output EXACTLY as written - consider every character, space, and case\n\nExample:\nInput: "describe the sky"\nOutput: "the sky is Blue today"\nInstructions: ["Start sentences with capital letters", "Use proper English"]\n\n{\n "verdicts": [\n {\n "verdict": "no",\n "reason": "The sentence \'the sky is Blue\' starts with lowercase \'t\'"\n },\n {\n "verdict": "no",\n "reason": "Improper capitalization: \'Blue\' is capitalized mid-sentence"\n }\n ]\n}\n\nPrompt Instructions:\n'+e.instructions.join("\n")+"\n\nInput:\n"+t+"\n\nLLM Actual Output:\n"+n+"\n\nJSON:"}var C=function(e){function n(t){return e.call(this,"Prompt Alignment",'You are a strict and thorough prompt alignment evaluator. Your job is to determine if LLM outputs follow their given prompt instructions exactly.\n\nKey Principles:\n1. Be EXTRA STRICT in your evaluation in regards to whether the instructions are followed exactly.\n2. Only give a "yes" verdict if an instruction is COMPLETELY followed\n3. Any partial compliance should be marked as "no"\n4. Provide clear, specific reasons for any "no" verdicts\n5. Focus solely on instruction compliance, not output quality\n\nRemember:\n- Each instruction must be evaluated independently\n- Verdicts must be either "yes" or "no" - no in-between\n- Reasons are required only for "no" verdicts\n- The number of verdicts must match the number of instructions exactly',t)||this}p(n,e);var r=n.prototype;return r.evaluate=function(){var e=u(d().mark((function e(n,r,o){var i;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=O({input:n,output:r,instructions:o}),e.next=3,this.agent.generate(i,{output:t.z.object({verdicts:t.z.array(t.z.object({verdict:t.z.string(),reason:t.z.string()}))})});case 3:return e.abrupt("return",e.sent.object.verdicts);case 5:case"end":return e.stop()}}),e,this)})));return function(t,n,r){return e.apply(this,arguments)}}(),r.getReason=function(){var e=u(d().mark((function e(n,r,o,i){var a;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a="Explain the instruction following score (0-10) for the LLM's response using this context:\n Context:\n Input: "+(s={input:n,output:r,reasons:i,score:o}).input+"\n Output: "+s.output+"\n Score: "+s.score+"\n Failure Reasons: "+s.reasons.join("\n")+'\n\n Rules (follow these rules exactly. do not deviate):\n - Keep your response concise and to the point.\n - Do not change score from what is given.\n - Do not make judgements on inputs or outputs (factual correctness, quality, etc).\n - If there are failure reasons given, explain why the score is not higher.\n \n\n Output format:\n {\n "reason": "The score is {score} because {explanation of instruction following}"\n }\n \n Example Responses:\n {\n "reason": "The score is 10 because the output follows the instructions exactly"\n }\n {\n "reason": "The score is 0 because the output does not follow the instructions"\n }\n ',e.next=3,this.agent.generate(a,{output:t.z.object({reason:t.z.string()})});case 3:return e.abrupt("return",e.sent.object.reason);case 5:case"end":return e.stop()}var s}),e,this)})));return function(t,n,r,o){return e.apply(this,arguments)}}(),n}(m),M=function(e){function t(t,n){var r,o=n.instructions,i=n.scale,a=void 0===i?10:i;return(r=e.call(this)||this).instructions=void 0,r.judge=void 0,r.scale=void 0,r.instructions=o,r.judge=new C(t),r.scale=a,r}p(t,e);var n=t.prototype;return n.measure=function(){var e=u(d().mark((function e(t){var n,r,o,i;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.input,r=t.output,e.next=3,this.judge.evaluate(n,r,this.instructions);case 3:return i=this.calculateScore(o=e.sent),e.next=7,this.generateReason(n,r,i,o);case 7:return e.abrupt("return",{score:i,reason:e.sent});case 9:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),n.generateReason=function(){var e=u(d().mark((function e(t,n,r,o){var i,a,s,c,u;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(i=[],a=l(o||[]);!(s=a()).done;)u=(c=s.value).reason,"no"===c.verdict.trim().toLowerCase()&&i.push(u);return e.next=4,this.judge.getReason(t,n,r,i);case 4:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)})));return function(t,n,r,o){return e.apply(this,arguments)}}(),n.calculateScore=function(e){var t=(null==e?void 0:e.length)||0;if(0===t)return 1;for(var n,r=0,o=l(e);!(n=o()).done;)"no"!==n.value.verdict.trim().toLowerCase()&&r++;return r/t*this.scale},t}(e.Metric),L=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return(t=e.call.apply(e,[this].concat(r))||this).sentiment=new a,t}return p(t,e),t.prototype.measure=function(){var e=u(d().mark((function e(t){var n,r,o,i,a,s,c,u,l,h,p,f=this;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.output,o=this.sentiment.analyze(n=t.input),!r){e.next=7;break}return i=this.sentiment.analyze(r),a=Math.abs(o.comparative-i.comparative),s=Math.max(0,1-a),e.abrupt("return",{score:s,details:"Tone consistency: "+(100*s).toFixed(1)+"%",confidence:.75,metrics:{responseSentiment:o.comparative,referenceSentiment:i.comparative,difference:a}});case 7:return c=n.match(/[^.!?]+[.!?]+/g)||[n],u=c.map((function(e){return f.sentiment.analyze(e).comparative})),l=u.reduce((function(e,t){return e+t}),0)/u.length,h=u.reduce((function(e,t){return e+Math.pow(t-l,2)}),0)/u.length,p=Math.max(0,1-h),e.abrupt("return",{score:p,details:"Tone stability: "+(100*p).toFixed(1)+"%",confidence:.7,metrics:{avgSentiment:l,sentimentVariance:h}});case 13:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t}(e.Metric);exports.AnswerRelevancyMetric=g,exports.CompletenessMetric=w,exports.ContentSimilarityMetric=x,exports.ContextPositionMetric=E,exports.ContextPrecisionMetric=T,exports.DifferenceMetric=j,exports.KeywordCoverageMetric=k,exports.PromptAlignmentMetric=M,exports.ToneConsistencyMetric=L,exports.evaluate=function(e,t,n){return v.apply(this,arguments)};
2
+ //# sourceMappingURL=evals.cjs.production.min.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"evals.cjs.production.min.js","sources":["../src/evaluation.ts","../src/judge/index.ts","../src/metrics/answer-relevancy/metricJudge.ts","../src/metrics/answer-relevancy/prompts.ts","../src/metrics/answer-relevancy/index.ts","../src/metrics/completeness/index.ts","../src/metrics/content-similarity/index.ts","../src/metrics/context-position/metricJudge.ts","../src/metrics/context-position/prompts.ts","../src/metrics/context-position/index.ts","../src/metrics/context-precision/metricJudge.ts","../src/metrics/context-precision/prompts.ts","../src/metrics/context-precision/index.ts","../src/metrics/difference/index.ts","../src/metrics/keyword-coverage/index.ts","../src/metrics/prompt-alignment/prompts.ts","../src/metrics/prompt-alignment/metricJudge.ts","../src/metrics/prompt-alignment/index.ts","../src/metrics/tone/index.ts"],"sourcesContent":["import { AvailableHooks, executeHook } from '@mastra/core';\nimport { type Agent, type Metric } from '@mastra/core';\n\nexport async function evaluate<T extends Agent>(agent: T, input: Parameters<T['generate']>[0], metric: Metric) {\n const agentOutput = await agent.generate(input);\n\n const metricResult = await metric.measure({\n input: input.toString(),\n output: agentOutput.text,\n });\n\n // capture infomration about the evaluation\n executeHook(AvailableHooks.ON_EVALUATION, {\n input: input.toString(),\n output: agentOutput.text,\n result: metricResult,\n });\n\n return metricResult;\n}\n","import { Agent, ModelConfig } from '@mastra/core';\n\nexport abstract class MastraAgentJudge {\n protected readonly agent: Agent;\n\n constructor(name: string, instructions: string, model: ModelConfig) {\n this.agent = new Agent({\n name: `Mastra Eval Judge ${model.provider} ${name}`,\n instructions: instructions,\n model,\n });\n }\n}\n","import { ModelConfig } from '@mastra/core';\nimport { z } from 'zod';\n\nimport { MastraAgentJudge } from '../../judge';\n\nimport {\n generateEvaluatePrompt,\n generateReasonPrompt,\n ANSWER_RELEVANCY_AGENT_INSTRUCTIONS,\n generateEvaluationStatementsPrompt,\n} from './prompts';\n\nexport class AnswerRelevancyJudge extends MastraAgentJudge {\n constructor(model: ModelConfig) {\n super('Answer Relevancy', ANSWER_RELEVANCY_AGENT_INSTRUCTIONS, model);\n }\n\n async evaluate(input: string, actualOutput: string): Promise<{ verdict: string; reason: string }[]> {\n const statementPrompt = generateEvaluationStatementsPrompt({ output: actualOutput });\n const statements = await this.agent.generate(statementPrompt, {\n output: z.object({\n statements: z.array(z.string()),\n }),\n });\n const prompt = generateEvaluatePrompt({ input, statements: statements.object.statements });\n const result = await this.agent.generate(prompt, {\n output: z.object({\n verdicts: z.array(\n z.object({\n verdict: z.string(),\n reason: z.string(),\n }),\n ),\n }),\n });\n\n return result.object.verdicts;\n }\n\n async getReason(input: string, actualOutput: string, score: number, reasons: string[]): Promise<string> {\n const prompt = generateReasonPrompt({ input, output: actualOutput, reasons, score });\n const result = await this.agent.generate(prompt, {\n output: z.object({\n reason: z.string(),\n }),\n });\n return result.object.reason;\n }\n}\n","export const ANSWER_RELEVANCY_AGENT_INSTRUCTIONS = `You are a balanced and nuanced answer relevancy evaluator. Your job is to determine if LLM outputs are relevant to the input, including handling partially relevant or uncertain cases.\n\nKey Principles:\n1. Evaluate whether the output addresses what the input is asking for\n2. Consider both direct answers and related context\n3. Prioritize relevance to the input over correctness\n4. Recognize that responses can be partially relevant\n5. Empty inputs or error messages should always be marked as \"no\"`;\n\nexport function generateEvaluationStatementsPrompt({ output }: { output: string }) {\n return `Given the text, break it down into meaningful statements while preserving context and relationships.\nDon't split too aggressively.\n\nSplit compound statements particularly when they:\n- Are joined by \"and\"\n- Contain multiple distinct facts or claims\n- Have multiple descriptive elements about the subject\n\n\nHandle special cases:\n- A single word answer should be treated as a complete statement\n- Error messages should be treated as a single statement\n- Empty strings should return an empty list\n- When splitting text, keep related information together\n\nExample:\nExample text: Look! A bird! Birds are an interesting animal.\n\n{{\n \"statements\": [\"Look!\", \"A bird!\", \"Birds are interesting animals.\"]\n}}\n\nPlease return only JSON format with \"statements\" array.\nReturn empty list for empty input.\n\nText:\n${output}\n\nJSON:\n`;\n}\n\nexport function generateEvaluatePrompt({ input, statements }: { input: string; statements: string[] }) {\n return `Evaluate each statement's relevance to the input question, considering direct answers, related context, and uncertain cases.\n\n Return JSON with array of verdict objects. Each verdict must include:\n - \"verdict\": \"yes\", \"no\", or \"unsure\"\n - \"reason\": Clear explanation of the verdict\n - Exact match between number of verdicts and statements\n\n Verdict Guidelines:\n - \"yes\": Statement explicitly and directly answers the input question\n * Contains specific answer to the question asked (e.g., \"The color of the sky is blue\")\n * States explicit relationship between key concepts (e.g., \"X is the CEO of company Y\")\n * Can stand alone as a complete answer\n * Contains appropriate question-type response (e.g., location for \"where\", person for \"who\")\n\n - \"unsure\": Statement shows partial relevance when it:\n * Contains topic-related administrative/governance terms without direct answer\n * Mentions locations or entities related to the answer without specifying their role\n * References functions or characteristics typically associated with the answer\n * Is incorrect but shows understanding of the question\n * Uses importance indicators (\"main\", \"primary\", \"major\") with relevant concepts\n * Includes indirect references to the answer (e.g., \"where the president works\")\n * Contains multiple relevant concepts but lacks explicit relationship between them\n * Demonstrates understanding of question domain without providing specific answer\n\n - \"no\": Statement lacks meaningful connection to question when it:\n * Contains no concepts related to the question type or domain\n * Only mentions the broader topic without relevant details (e.g., \"the country has nice weather\")\n * Provides general descriptions without addressing the specific question\n * Contains purely tangential information about the subject\n * Consists of empty or meaningless content\n * Discusses characteristics unrelated to the question type (e.g., describing cuisine when asked about geography)\n * Note: Assessment is about topical relationship, not factual accuracy\n\n REMEMBER: A statmenent does not have to be correct, it just has to be relevant.\n If the statement contains words or phrases that are relevant to the input, it is partially relevant.\n If the statement is a direct answer to the input, it is relevant.\n If the statement is completely unrelated to the input or contains nothing, it is not relevant.\n DO NOT MAKE A JUDGEMENT ON THE CORRECTNESS OF THE STATEMENT, JUST THE RELEVANCY.\n\n\n Example:\n Input: \"What color is the sky during daytime?\"\n Statements: [\n \"The sky is blue during daytime\",\n \"The sky is full of clouds\", \n \"I had breakfast today\",\n \"Blue is a beautiful color\",\n \"Many birds fly in the sky\",\n \"\",\n \"The sky is purple during daytime\",\n ]\n JSON:\n {{\n \"verdicts\": [\n {{\n \"verdict\": \"yes\",\n \"reason\": \"This statement explicitly answers what color the sky is during daytime\"\n }},\n {{\n \"verdict\": \"unsure\",\n \"reason\": \"This statement describes the sky but doesn't address its color\"\n }},\n {{\n \"verdict\": \"no\",\n \"reason\": \"This statement about breakfast is completely unrelated to the sky\"\n }},\n {{\n \"verdict\": \"unsure\",\n \"reason\": \"This statement about blue is related to color but doesn't address the sky\"\n }},\n {{\n \"verdict\": \"unsure\",\n \"reason\": \"This statement is about the sky but doesn't address its color\"\n }},\n {{\n \"verdict\": \"no\",\n \"reason\": \"This statement is empty\"\n }},\n {{\n \"verdict\": \"unsure\",\n \"reason\": \"This statement is incorrect but contains relevant information and still addresses the question\"\n }}\n ]\n }}\n\n Input:\n ${input}\n\n Statements:\n ${statements.join('\\n')}\n\n JSON:\n `;\n}\n\nexport function generateReasonPrompt({\n score,\n reasons,\n input,\n output,\n}: {\n score: number;\n reasons: string[];\n input: string;\n output: string;\n}) {\n return `Explain the irrelevancy score (0-10) for the LLM's response using this context:\n Context:\n Input: ${input}\n Output: ${output}\n Score: ${score}\n Irrelevancy Reasons: ${reasons.join('\\n')}\n \n Rules:\n - Explain score based on mix of direct answers and related context\n - Consider both full and partial relevance\n - Keep explanation concise and focused\n - Use given score, don't recalculate\n - Don't judge factual correctness\n - Explain both relevant and irrelevant aspects\n - For mixed responses, explain the balance\n\n Format:\n {\n \"reason\": \"The score is {score} because {explanation of overall relevance}\"\n }\n\n Example Responses:\n {\n \"reason\": \"The score is 7 because while the first statement directly answers the question, the additional context is only partially relevant\"\n }\n {\n \"reason\": \"The score is 3 because while the answer discusses the right topic, it doesn't directly address the question\"\n }\n `;\n}\n","import { Metric, MetricResult, ModelConfig } from '@mastra/core';\n\nimport { AnswerRelevancyJudge } from './metricJudge';\n\nexport class AnswerRelevancyMetric extends Metric {\n private judge: AnswerRelevancyJudge;\n private uncertaintyWeight: number;\n private scale: number;\n\n constructor(\n model: ModelConfig,\n {\n uncertaintyWeight,\n scale,\n }: {\n uncertaintyWeight: number;\n scale: number;\n } = {\n uncertaintyWeight: 0.3,\n scale: 10,\n },\n ) {\n super();\n\n this.uncertaintyWeight = uncertaintyWeight;\n this.judge = new AnswerRelevancyJudge(model);\n this.scale = scale;\n }\n\n async measure({ input, output }: { input: string; output: string }): Promise<MetricResult> {\n const verdicts = await this.judge.evaluate(input, output);\n const score = this.calculateScore(verdicts);\n\n const reason = await this.generateReason(input, output, score, verdicts);\n\n return {\n score,\n reason,\n };\n }\n\n private async generateReason(\n input: string,\n output: string,\n score: number,\n verdicts: {\n verdict: string;\n reason: string;\n }[],\n ): Promise<string> {\n const reasonsForVerdicts: string[] = [];\n for (const { verdict, reason } of verdicts || []) {\n if (verdict.trim().toLowerCase() === 'no') {\n reasonsForVerdicts.push(reason);\n }\n }\n\n const reason = await this.judge.getReason(input, output, score, reasonsForVerdicts);\n return reason;\n }\n\n private calculateScore(evaluation: { verdict: string; reason: string }[]): number {\n const numberOfVerdicts = evaluation?.length || 0;\n if (numberOfVerdicts === 0) {\n return 1;\n }\n\n let relevancyCount = 0;\n for (const { verdict } of evaluation) {\n if (verdict.trim().toLowerCase() === 'yes') {\n relevancyCount++;\n } else if (verdict.trim().toLowerCase() === 'unsure') {\n relevancyCount += this.uncertaintyWeight;\n }\n }\n\n const score = relevancyCount / numberOfVerdicts;\n return Math.round(score * this.scale);\n }\n}\n","import { Metric } from '@mastra/core';\nimport nlp from 'compromise';\n\nimport { MetricScoringResult } from '../types';\n\nexport class CompletenessMetric extends Metric {\n async measure({ input, output }: { input: string; output: string }): Promise<MetricScoringResult> {\n // Handle null/undefined inputs\n if (input === null || input === undefined || output === null || output === undefined) {\n throw new Error('Inputs cannot be null or undefined');\n }\n\n // Trim both inputs\n input = input.trim();\n output = output.trim();\n\n const inputDoc = nlp(input);\n const outputDoc = nlp(output);\n\n // Extract and log elements\n const inputElements = this.extractElements(inputDoc);\n const outputElements = this.extractElements(outputDoc);\n // Maybe we need a more sophisticated matching approach\n const coverage = this.calculateCoverage(inputElements, outputElements);\n\n return {\n score: coverage,\n details: `Completeness score: ${(coverage * 100).toFixed(1)}%`,\n confidence: 0.8,\n metrics: {\n inputElements,\n outputElements,\n missingElements: inputElements.filter(e => !outputElements.includes(e)),\n elementCounts: {\n input: inputElements.length,\n output: outputElements.length,\n },\n },\n };\n }\n\n private extractElements(doc: any): string[] {\n // Get more specific elements and ensure they're arrays\n const nouns = doc.nouns().out('array') || [];\n const verbs = doc.verbs().toInfinitive().out('array') || [];\n const topics = doc.topics().out('array') || [];\n const terms = doc.terms().out('array') || [];\n\n // Helper function to clean and split terms\n const cleanAndSplitTerm = (term: string): string[] => {\n // First normalize the string\n const normalized = this.normalizeString(term);\n\n // Split on word boundaries and filter out empty strings\n return normalized\n .replace(/([a-z])([A-Z])/g, '$1 $2') // Split camelCase\n .replace(/[^a-z0-9]+/g, ' ') // Replace non-alphanumeric with spaces\n .trim()\n .split(/\\s+/)\n .filter(word => word.length > 0);\n };\n\n // Process all elements\n const processedTerms = [\n ...nouns.flatMap(cleanAndSplitTerm),\n ...verbs.flatMap(cleanAndSplitTerm),\n ...topics.flatMap(cleanAndSplitTerm),\n ...terms.flatMap(cleanAndSplitTerm),\n ];\n\n // Remove duplicates\n return [...new Set(processedTerms)];\n }\n\n private normalizeString(str: string): string {\n // Remove diacritics and convert to lowercase\n return str\n .normalize('NFD')\n .replace(/[\\u0300-\\u036f]/g, '')\n .toLowerCase();\n }\n\n private calculateCoverage(original: string[], simplified: string[]): number {\n if (original.length === 0) {\n return simplified.length === 0 ? 1 : 0;\n }\n\n // Exact matching for short words (3 chars or less), substring matching for longer words\n const covered = original.filter(element =>\n simplified.some(s => {\n const elem = this.normalizeString(element);\n const simp = this.normalizeString(s);\n\n // For short words (3 chars or less), require exact match\n if (elem.length <= 3) {\n return elem === simp;\n }\n\n // For longer words, require substantial overlap (more than 60% of the longer word)\n const longer = elem.length > simp.length ? elem : simp;\n const shorter = elem.length > simp.length ? simp : elem;\n\n if (longer.includes(shorter)) {\n return shorter.length / longer.length > 0.6;\n }\n\n return false;\n }),\n );\n return covered.length / original.length;\n }\n}\n","import { Metric } from '@mastra/core';\nimport stringSimilarity from 'string-similarity';\n\nimport { MetricOptions, MetricScoringResult } from '../types';\n\nexport class ContentSimilarityMetric extends Metric {\n private options: MetricOptions;\n\n constructor(options: MetricOptions = {}) {\n super();\n this.options = {\n ignoreCase: true,\n ignoreWhitespace: true,\n ...options,\n };\n }\n\n async measure({ input, output }: { input: string; output: string }): Promise<MetricScoringResult> {\n let processedInput = input;\n let processedOutput = output;\n\n if (this.options.ignoreCase) {\n processedInput = processedInput.toLowerCase();\n processedOutput = processedOutput.toLowerCase();\n }\n\n if (this.options.ignoreWhitespace) {\n processedInput = processedInput.replace(/\\s+/g, ' ').trim();\n processedOutput = processedOutput.replace(/\\s+/g, ' ').trim();\n }\n\n const similarity = stringSimilarity.compareTwoStrings(processedInput, processedOutput);\n\n return {\n score: similarity,\n details: `Content similarity: ${(similarity * 100).toFixed(1)}%`,\n confidence: 0.9,\n metrics: { similarity },\n };\n }\n}\n","import { ModelConfig } from '@mastra/core';\nimport { z } from 'zod';\n\nimport { MastraAgentJudge } from '../../judge';\n\nimport { CONTEXT_POSITION_AGENT_INSTRUCTIONS, generateEvaluatePrompt, generateReasonPrompt } from './prompts';\n\nexport class ContextPositionJudge extends MastraAgentJudge {\n constructor(model: ModelConfig) {\n super('Context Position', CONTEXT_POSITION_AGENT_INSTRUCTIONS, model);\n }\n\n async evaluate(\n input: string,\n actualOutput: string,\n retrievalContext: string[],\n ): Promise<{ verdict: string; reason: string }[]> {\n const prompt = generateEvaluatePrompt({\n input,\n output: actualOutput,\n context: retrievalContext,\n });\n const result = await this.agent.generate(prompt, {\n output: z.object({\n verdicts: z.array(\n z.object({\n verdict: z.string(),\n reason: z.string(),\n }),\n ),\n }),\n });\n\n return result.object.verdicts;\n }\n\n async getReason(\n input: string,\n actualOutput: string,\n score: number,\n verdicts: {\n verdict: string;\n reason: string;\n }[],\n ): Promise<string> {\n const prompt = generateReasonPrompt({ input, output: actualOutput, verdicts, score });\n const result = await this.agent.generate(prompt, {\n output: z.object({\n reason: z.string(),\n }),\n });\n return result.object.reason;\n }\n}\n","export const CONTEXT_POSITION_AGENT_INSTRUCTIONS = `You are a balanced and nuanced context position evaluator. Your job is to determine if retrieved context nodes are relevant to generating the expected output, with special attention to their ordering.\n\nKey Principles:\n1. Evaluate whether each context node contributes to understanding the expected output - both directly AND indirectly\n2. Consider all forms of relevance:\n - Direct definitions or explanations\n - Supporting evidence or examples\n - Related characteristics or behaviors\n - Real-world applications or effects\n3. Pay attention to the position of relevant information\n4. Recognize that earlier positions should contain more relevant information\n5. Be inclusive rather than exclusive in determining relevance - if the information supports or reinforces the output in any way, consider it relevant\n6. Empty or error nodes should be marked as not relevant`;\n\nexport function generateEvaluatePrompt({\n input,\n output,\n context,\n}: {\n input: string;\n output: string;\n context: string[];\n}) {\n return `Given the input, output, and context, evaluate each context piece's relevance by generating a list of JSON objects.\n\n**\nIMPORTANT: Your response must be in JSON format with a 'verdicts' key containing a list. Each verdict must have only two fields: \\`verdict\\` with either 'yes' or 'no', and \\`reason\\` explaining the verdict. Your reason should include relevant quotes from the context.\n\nExample Context: [\"The Sun is a star\", \"Stars produce their own light\", \"The Moon reflects sunlight\"]\nExample Query: \"What is the Sun?\"\nExample Expected Response: \"The Sun is a star that produces light.\"\n\nConsider context relevant if it:\n- Directly addresses the input\n- Provides examples or instances that help explain the concept\n- Offers related information that helps build understanding\n- Contains partial information that contributes to the response\n- Demonstrates or validates characteristics mentioned in the output\n- Shows real-world applications or effects of the concept\n- Reinforces or provides evidence for any part of the output\n- Helps establish credibility or understanding of the subject\n- Describes the actions the subject can perform\n\nA context piece should be considered relevant if it contributes ANY supporting information or evidence, even if indirect.\n\nExample:\n{\n \"verdicts\": [\n {\n \"verdict\": \"yes\",\n \"reason\": \"The context 'The Sun is a star' directly defines what the Sun is.\"\n },\n {\n \"verdict\": \"yes\",\n \"reason\": \"The context 'Stars produce their own light' is relevant as it describes a key characteristic of stars, which includes the Sun.\"\n },\n {\n \"verdict\": \"no\",\n \"reason\": \"The context 'The Moon reflects sunlight' is not relevant to defining what the Sun is.\"\n }\n ] \n}\n\nThe number of verdicts MUST MATCH the number of context pieces exactly.\n**\n\nInput:\n${input}\n\nOutput:\n${output}\n\nContext:\n${context}\n\nJSON:\n`;\n}\n\nexport function generateReasonPrompt({\n input,\n output,\n verdicts,\n score,\n}: {\n input: string;\n output: string;\n verdicts: Array<{ verdict: string; reason: string }>;\n score: number;\n}) {\n return `Given the input, output, verdicts, and position score, provide a BRIEF explanation for the score. Focus on both relevance and positioning of the context.\n The retrieved contexts is a list containing \\`verdict\\` ('yes' or 'no' for relevance), \\`reason\\` (explaining the verdict) and \\`node\\` (the context text). Contexts are listed in their ranking order.\n\n**\nIMPORTANT: Return only JSON format with a single 'reason' key explaining the score.\nExample JSON:\n{\n \"reason\": \"The score is <score> because <explanation>.\"\n}\n\nGuidelines:\n- Don't mention 'verdict' - refer to relevant/irrelevant nodes instead\n- Use information from the \\`reason\\` field, not the field itself\n- Reference node positions (first, second, etc.) when explaining relevance\n- For perfect scores (10.0), emphasize both relevance and optimal ordering\n- Always reference the ranking order when discussing relevance\n**\n\nPosition Score:\n${score}\n\nInput:\n${input}\n\nOutput:\n${output}\n\nContext:\n${verdicts}\n\nJSON:\n`;\n}\n","import { Metric, MetricResult, ModelConfig } from '@mastra/core';\n\nimport { ContextPositionJudge } from './metricJudge';\n\nexport class ContextPositionMetric extends Metric {\n private judge: ContextPositionJudge;\n private scale: number;\n\n constructor(model: ModelConfig, { scale = 10 }: { scale?: number } = {}) {\n super();\n this.judge = new ContextPositionJudge(model);\n this.scale = scale;\n }\n\n async measure({\n input,\n output,\n context,\n }: {\n input: string;\n output: string;\n context: string[];\n }): Promise<MetricResult> {\n const verdicts = await this.judge.evaluate(input, output, context);\n const score = this.calculateScore(verdicts);\n const reason = await this.judge.getReason(input, output, score, verdicts);\n\n return {\n score,\n reason,\n };\n }\n\n private calculateScore(verdicts: { verdict: string; reason: string }[]): number {\n const totalVerdicts = verdicts?.length || 0;\n if (totalVerdicts === 0) {\n return 0;\n }\n\n // Convert to binary scores (1 for yes, 0 for no)\n const binaryScores = verdicts.map(v => (v.verdict.trim().toLowerCase() === 'yes' ? 1 : 0));\n\n let weightedSum = 0;\n let maxPossibleSum = 0; // Track the maximum possible sum for normalization\n\n // Calculate position-weighted scores\n binaryScores.forEach((isRelevant, index) => {\n const positionWeight = 1 / (index + 1);\n if (isRelevant) {\n weightedSum += positionWeight;\n }\n maxPossibleSum += positionWeight; // Add to max possible sum regardless of relevance\n });\n\n if (weightedSum === 0) {\n return 0;\n }\n\n // Normalize against the maximum possible score\n const finalScore = (weightedSum / maxPossibleSum) * this.scale;\n return finalScore;\n }\n}\n","import { ModelConfig } from '@mastra/core';\nimport { z } from 'zod';\n\nimport { MastraAgentJudge } from '../../judge';\n\nimport './prompts';\nimport { CONTEXT_PRECISION_AGENT_INSTRUCTIONS, generateEvaluatePrompt, generateReasonPrompt } from './prompts';\n\nexport class ContextPrecisionJudge extends MastraAgentJudge {\n constructor(model: ModelConfig) {\n super('Context Precision', CONTEXT_PRECISION_AGENT_INSTRUCTIONS, model);\n }\n\n async evaluate(\n input: string,\n actualOutput: string,\n retrievalContext: string[],\n ): Promise<{ verdict: string; reason: string }[]> {\n const prompt = generateEvaluatePrompt({\n input,\n output: actualOutput,\n context: retrievalContext,\n });\n const result = await this.agent.generate(prompt, {\n output: z.object({\n verdicts: z.array(\n z.object({\n verdict: z.string(),\n reason: z.string(),\n }),\n ),\n }),\n });\n\n return result.object.verdicts;\n }\n\n async getReason(\n input: string,\n actualOutput: string,\n score: number,\n verdicts: {\n verdict: string;\n reason: string;\n }[],\n ): Promise<string> {\n const prompt = generateReasonPrompt({ input, output: actualOutput, verdicts, score });\n const result = await this.agent.generate(prompt, {\n output: z.object({\n reason: z.string(),\n }),\n });\n return result.object.reason;\n }\n}\n","export const CONTEXT_PRECISION_AGENT_INSTRUCTIONS = `You are a balanced and nuanced context precision evaluator. Your job is to determine if retrieved context nodes are relevant to generating the expected output.\n\nKey Principles:\n1. Evaluate whether each context node was useful in generating the expected output\n2. Consider both direct and indirect relevance\n3. Prioritize usefulness over completeness\n4. Recognize that some nodes may be partially relevant\n5. Empty or error nodes should be marked as not relevant`;\n\nexport function generateEvaluatePrompt({\n input,\n output,\n context,\n}: {\n input: string;\n output: string;\n context: string[];\n}) {\n return `Given the input, output, and context, evaluate each context piece's relevance by generating a list of JSON objects.\n\n**\nIMPORTANT: Your response must be in JSON format with a 'verdicts' key containing a list. Each verdict must have only two fields: \\`verdict\\` with either 'yes' or 'no', and \\`reason\\` explaining the verdict. Your reason should include relevant quotes from the context.\n\nExample Context: [\"The Sun is a star\", \"Stars produce their own light\", \"The Moon reflects sunlight\"]\nExample Query: \"What is the Sun?\"\nExample Expected Response: \"The Sun is a star that produces light.\"\n\nExample:\n{\n \"verdicts\": [\n {\n \"verdict\": \"yes\",\n \"reason\": \"The context 'The Sun is a star' directly defines what the Sun is.\"\n },\n {\n \"verdict\": \"yes\",\n \"reason\": \"The context 'Stars produce their own light' is relevant as it describes a key characteristic of stars, which includes the Sun.\"\n },\n {\n \"verdict\": \"no\",\n \"reason\": \"The context 'The Moon reflects sunlight' is not relevant to defining what the Sun is.\"\n }\n ] \n}\n\nConsider context relevant if it:\n- Directly addresses the query\n- Provides examples or instances that help explain the concept\n- Offers related information that helps build understanding\n- Contains partial information that contributes to the response\n\nThe number of verdicts MUST MATCH the number of context pieces exactly.\n**\n\nInput:\n${input}\n\nOutput:\n${output}\n\nContext:\n${context}\n\nJSON:\n`;\n}\n\nexport function generateReasonPrompt({\n input,\n output,\n verdicts,\n score,\n}: {\n input: string;\n output: string;\n verdicts: Array<{ verdict: string; reason: string }>;\n score: number;\n}) {\n return `Given the input, output, verdicts, and precision score, provide a BRIEF explanation for the score. Explain both its strengths and limitations.\nThe retrieved contexts is a list containing \\`verdict\\` ('yes' or 'no' for relevance), \\`reason\\` (explaining the verdict) and \\`node\\` (the context text). Contexts are listed in their ranking order.\n\n**\nIMPORTANT: Return only JSON format with a single 'reason' key explaining the score.\nExample JSON:\n{\n \"reason\": \"The score is <score> because <explanation>.\"\n}\n\nGuidelines:\n- Don't mention 'verdict' - refer to relevant/irrelevant nodes instead\n- Use information from the \\`reason\\` field, not the field itself\n- Reference node positions (first, second, etc.) when explaining relevance\n- For perfect scores (10.0), emphasize both relevance and optimal ordering\n- Always reference the ranking order when discussing relevance\n**\n\nPrecision Score:\n${score}\n\nInput:\n${input}\n\nOutput:\n${output}\n\nContext:\n${verdicts}\n\nJSON:\n`;\n}\n","import { Metric, MetricResult, ModelConfig } from '@mastra/core';\n\nimport { ContextPrecisionJudge } from './metricJudge';\n\nexport class ContextPrecisionMetric extends Metric {\n private judge: ContextPrecisionJudge;\n private scale: number;\n\n constructor(model: ModelConfig, { scale = 10 }: { scale?: number } = {}) {\n super();\n this.judge = new ContextPrecisionJudge(model);\n this.scale = scale;\n }\n\n async measure({\n input,\n output,\n context,\n }: {\n input: string;\n output: string;\n context: string[];\n }): Promise<MetricResult> {\n const verdicts = await this.judge.evaluate(input, output, context);\n const score = this.calculateScore(verdicts);\n const reason = await this.judge.getReason(input, output, score, verdicts);\n\n return {\n score,\n reason,\n };\n }\n\n private calculateScore(verdicts: { verdict: string; reason: string }[]): number {\n const totalVerdicts = verdicts?.length || 0;\n if (totalVerdicts === 0) {\n return 0;\n }\n\n // Convert to binary scores (1 for yes, 0 for no)\n const binaryScores = verdicts.map(v => (v.verdict.trim().toLowerCase() === 'yes' ? 1 : 0));\n\n let weightedPrecisionSum = 0;\n let relevantCount = 0;\n\n // Calculate weighted precision at each position\n binaryScores.forEach((isRelevant, index) => {\n if (isRelevant) {\n relevantCount++;\n const currentPrecision = relevantCount / (index + 1);\n weightedPrecisionSum += currentPrecision * isRelevant;\n }\n });\n\n if (relevantCount === 0) {\n return 0;\n }\n\n const finalScore = weightedPrecisionSum / relevantCount;\n return finalScore * this.scale;\n }\n}\n","import { Metric } from '@mastra/core';\nimport { SequenceMatcher } from 'difflib';\n\nimport { MetricScoringResult } from '../types';\n\nexport class DifferenceMetric extends Metric {\n async measure({ input, output }: { input: string; output: string }): Promise<MetricScoringResult> {\n const matcher = new SequenceMatcher(null, input, output);\n const ratio = matcher.ratio();\n\n // Get detailed operations\n const ops = matcher.getOpcodes();\n const changes = ops.filter(([op]) => op !== 'equal').length;\n\n // Calculate confidence based on text length difference\n const maxLength = Math.max(input.length, output.length);\n const lengthDiff = maxLength > 0 ? Math.abs(input.length - output.length) / maxLength : 0;\n const confidence = 1 - lengthDiff;\n\n return {\n score: ratio,\n details: `Difference score: ${(ratio * 100).toFixed(1)}% with ${changes} changes`,\n confidence,\n metrics: {\n ratio,\n changes,\n lengthDiff,\n },\n };\n }\n}\n","import { Metric } from '@mastra/core';\nimport keyword_extractor from 'keyword-extractor';\n\nimport { MetricScoringResult } from '../types';\n\nexport class KeywordCoverageMetric extends Metric {\n async measure({ input, output }: { input: string; output: string }): Promise<MetricScoringResult> {\n // Handle empty strings case\n if (!input && !output) {\n return {\n score: 1,\n details: 'Keyword coverage: 100.0% (0/0 keywords)',\n confidence: 0.85,\n metrics: {\n totalKeywords: 0,\n matchedKeywords: 0,\n },\n };\n }\n\n const extractKeywords = (text: string) => {\n return keyword_extractor.extract(text, {\n language: 'english',\n remove_digits: true,\n return_changed_case: true,\n remove_duplicates: true,\n });\n };\n\n const referenceKeywords = new Set(extractKeywords(input));\n const responseKeywords = new Set(extractKeywords(output));\n\n const matchedKeywords = [...referenceKeywords].filter(k => responseKeywords.has(k));\n const totalKeywords = referenceKeywords.size;\n const coverage = totalKeywords > 0 ? matchedKeywords.length / totalKeywords : 0;\n\n return {\n score: coverage,\n details: `Keyword coverage: ${(coverage * 100).toFixed(1)}% (${matchedKeywords.length}/${referenceKeywords.size} keywords)`,\n confidence: 0.85,\n metrics: {\n totalKeywords: referenceKeywords.size,\n matchedKeywords: matchedKeywords.length,\n },\n };\n }\n}\n","export const PROMPT_ALIGNMENT_AGENT_INSTRUCTIONS = `You are a strict and thorough prompt alignment evaluator. Your job is to determine if LLM outputs follow their given prompt instructions exactly.\n\nKey Principles:\n1. Be EXTRA STRICT in your evaluation in regards to whether the instructions are followed exactly.\n2. Only give a \"yes\" verdict if an instruction is COMPLETELY followed\n3. Any partial compliance should be marked as \"no\"\n4. Provide clear, specific reasons for any \"no\" verdicts\n5. Focus solely on instruction compliance, not output quality\n\nRemember:\n- Each instruction must be evaluated independently\n- Verdicts must be either \"yes\" or \"no\" - no in-between\n- Reasons are required only for \"no\" verdicts\n- The number of verdicts must match the number of instructions exactly`;\n\nexport function generateEvaluatePrompt({\n instructions,\n input,\n output,\n}: {\n instructions: string[];\n input: string;\n output: string;\n}) {\n return `For the provided list of prompt instructions, determine whether each instruction has been followed in the LLM output.\nMake sure to judge the output on each instruction independently. Do not let instructions be influenced by other instructions.\nGenerate a list of verdicts in JSON format, where each verdict must have:\n- \"verdict\": Strictly \"yes\" or \"no\"\n- \"reason\": Give a reason for the verdict\n\nBe EXTRA STRICT in your evaluation. Only give \"yes\" if the instruction is followed COMPLETELY.\nEvaluate the output EXACTLY as written - consider every character, space, and case\n\nExample:\nInput: \"describe the sky\"\nOutput: \"the sky is Blue today\"\nInstructions: [\"Start sentences with capital letters\", \"Use proper English\"]\n\n{\n \"verdicts\": [\n {\n \"verdict\": \"no\",\n \"reason\": \"The sentence 'the sky is Blue' starts with lowercase 't'\"\n },\n {\n \"verdict\": \"no\",\n \"reason\": \"Improper capitalization: 'Blue' is capitalized mid-sentence\"\n }\n ]\n}\n\nPrompt Instructions:\n${instructions.join('\\n')}\n\nInput:\n${input}\n\nLLM Actual Output:\n${output}\n\nJSON:`;\n}\n\nexport function generateReasonPrompt({\n input,\n output,\n score,\n reasons,\n}: {\n input: string;\n output: string;\n score: number;\n reasons: string[];\n}) {\n return `Explain the instruction following score (0-10) for the LLM's response using this context:\n Context:\n Input: ${input}\n Output: ${output}\n Score: ${score}\n Failure Reasons: ${reasons.join('\\n')}\n\n Rules (follow these rules exactly. do not deviate):\n - Keep your response concise and to the point.\n - Do not change score from what is given.\n - Do not make judgements on inputs or outputs (factual correctness, quality, etc).\n - If there are failure reasons given, explain why the score is not higher.\n \n\n Output format:\n {\n \"reason\": \"The score is {score} because {explanation of instruction following}\"\n }\n \n Example Responses:\n {\n \"reason\": \"The score is 10 because the output follows the instructions exactly\"\n }\n {\n \"reason\": \"The score is 0 because the output does not follow the instructions\"\n }\n `;\n}\n","import { ModelConfig } from '@mastra/core';\nimport { z } from 'zod';\n\nimport { MastraAgentJudge } from '../../judge';\n\nimport { generateEvaluatePrompt, generateReasonPrompt, PROMPT_ALIGNMENT_AGENT_INSTRUCTIONS } from './prompts';\n\nexport class PromptAlignmentJudge extends MastraAgentJudge {\n constructor(model: ModelConfig) {\n super('Prompt Alignment', PROMPT_ALIGNMENT_AGENT_INSTRUCTIONS, model);\n }\n\n async evaluate(\n input: string,\n actualOutput: string,\n instructions: string[],\n ): Promise<{ verdict: string; reason: string }[]> {\n const prompt = generateEvaluatePrompt({ input, output: actualOutput, instructions });\n const result = await this.agent.generate(prompt, {\n output: z.object({\n verdicts: z.array(\n z.object({\n verdict: z.string(),\n reason: z.string(),\n }),\n ),\n }),\n });\n return result.object.verdicts;\n }\n\n async getReason(input: string, actualOutput: string, score: number, reasons: string[]): Promise<string> {\n const prompt = generateReasonPrompt({ input, output: actualOutput, reasons, score });\n const result = await this.agent.generate(prompt, {\n output: z.object({\n reason: z.string(),\n }),\n });\n return result.object.reason;\n }\n}\n","import { Metric, MetricResult, ModelConfig } from '@mastra/core';\n\nimport { PromptAlignmentJudge } from './metricJudge';\n\nexport class PromptAlignmentMetric extends Metric {\n private instructions: string[];\n private judge: PromptAlignmentJudge;\n private scale: number;\n\n constructor(model: ModelConfig, { instructions, scale = 10 }: { instructions: string[]; scale?: number }) {\n super();\n\n this.instructions = instructions;\n this.judge = new PromptAlignmentJudge(model);\n this.scale = scale;\n }\n\n async measure({ input, output }: { input: string; output: string }): Promise<MetricResult> {\n const verdicts = await this.judge.evaluate(input, output, this.instructions);\n const score = this.calculateScore(verdicts);\n\n const reason = await this.generateReason(input, output, score, verdicts);\n\n return {\n score,\n reason,\n };\n }\n\n private async generateReason(\n input: string,\n output: string,\n score: number,\n verdicts: {\n verdict: string;\n reason: string;\n }[],\n ): Promise<string> {\n const reasonsForVerdicts: string[] = [];\n for (const { verdict, reason } of verdicts || []) {\n if (verdict.trim().toLowerCase() === 'no') {\n reasonsForVerdicts.push(reason);\n }\n }\n\n const reason = await this.judge.getReason(input, output, score, reasonsForVerdicts);\n return reason;\n }\n\n private calculateScore(evaluation: { verdict: string; reason: string }[]): number {\n const numberOfVerdicts = evaluation?.length || 0;\n if (numberOfVerdicts === 0) {\n return 1;\n }\n\n let alignmentCount = 0;\n for (const { verdict } of evaluation!) {\n if (verdict.trim().toLowerCase() !== 'no') {\n alignmentCount++;\n }\n }\n\n const score = alignmentCount / numberOfVerdicts;\n return score * this.scale;\n }\n}\n","import { Metric } from '@mastra/core';\nimport Sentiment from 'sentiment';\n\nimport { MetricScoringResult } from '../types';\n\nexport class ToneConsistencyMetric extends Metric {\n private sentiment = new Sentiment();\n\n async measure({ input, output }: { input: string; output: string }): Promise<MetricScoringResult> {\n const responseSentiment = this.sentiment.analyze(input);\n\n if (output) {\n // Compare sentiment with reference\n const referenceSentiment = this.sentiment.analyze(output);\n const sentimentDiff = Math.abs(responseSentiment.comparative - referenceSentiment.comparative);\n const normalizedScore = Math.max(0, 1 - sentimentDiff);\n\n return {\n score: normalizedScore,\n details: `Tone consistency: ${(normalizedScore * 100).toFixed(1)}%`,\n confidence: 0.75,\n metrics: {\n responseSentiment: responseSentiment.comparative,\n referenceSentiment: referenceSentiment.comparative,\n difference: sentimentDiff,\n },\n };\n }\n\n // Evaluate sentiment stability across response\n const sentences = input.match(/[^.!?]+[.!?]+/g) || [input];\n const sentiments = sentences.map(s => this.sentiment.analyze(s).comparative);\n const avgSentiment = sentiments.reduce((a, b) => a + b, 0) / sentiments.length;\n const variance = sentiments.reduce((sum, s) => sum + Math.pow(s - avgSentiment, 2), 0) / sentiments.length;\n const stability = Math.max(0, 1 - variance);\n\n return {\n score: stability,\n details: `Tone stability: ${(stability * 100).toFixed(1)}%`,\n confidence: 0.7,\n metrics: {\n avgSentiment,\n sentimentVariance: variance,\n },\n };\n }\n}\n"],"names":["_evaluate","_asyncToGenerator","_regeneratorRuntime","mark","_callee","agent","input","metric","agentOutput","metricResult","wrap","_context","prev","next","generate","sent","measure","toString","output","text","executeHook","AvailableHooks","ON_EVALUATION","result","abrupt","stop","apply","this","arguments","MastraAgentJudge","name","instructions","model","Agent","provider","AnswerRelevancyJudge","_MastraAgentJudge","call","_inheritsLoose","_proto","prototype","evaluate","actualOutput","statementPrompt","prompt","z","object","statements","array","string","_ref2","join","verdicts","verdict","reason","_x","_x2","getReason","_getReason","_callee2","score","reasons","_context2","_ref3","_x3","_x4","_x5","_x6","AnswerRelevancyMetric","_Metric","_temp","_this","_ref","uncertaintyWeight","scale","judge","_measure","calculateScore","generateReason","_generateReason","reasonsForVerdicts","_iterator","_step","_step$value","_reason","_createForOfIteratorHelperLoose","done","value","trim","toLowerCase","push","evaluation","numberOfVerdicts","length","_step2","relevancyCount","_iterator2","Math","round","Metric","CompletenessMetric","inputDoc","outputDoc","inputElements","outputElements","coverage","Error","nlp","extractElements","calculateCoverage","details","toFixed","confidence","metrics","missingElements","filter","e","includes","elementCounts","doc","nouns","out","verbs","toInfinitive","topics","terms","cleanAndSplitTerm","term","normalizeString","replace","split","word","processedTerms","concat","flatMap","Set","str","normalize","original","simplified","_this2","element","some","s","elem","simp","longer","shorter","ContentSimilarityMetric","options","_extends","ignoreCase","ignoreWhitespace","processedInput","processedOutput","similarity","stringSimilarity","compareTwoStrings","ContextPositionJudge","retrievalContext","context","_x7","ContextPositionMetric","_ref$scale","binaryScores","map","v","weightedSum","maxPossibleSum","forEach","isRelevant","index","positionWeight","ContextPrecisionJudge","ContextPrecisionMetric","weightedPrecisionSum","relevantCount","DifferenceMetric","matcher","ratio","ops","changes","maxLength","lengthDiff","SequenceMatcher","getOpcodes","max","abs","KeywordCoverageMetric","extractKeywords","referenceKeywords","responseKeywords","matchedKeywords","totalKeywords","keyword_extractor","extract","language","remove_digits","return_changed_case","remove_duplicates","k","has","size","generateEvaluatePrompt","PromptAlignmentJudge","PromptAlignmentMetric","alignmentCount","ToneConsistencyMetric","_len","args","Array","_key","sentiment","Sentiment","responseSentiment","referenceSentiment","sentimentDiff","normalizedScore","sentences","sentiments","avgSentiment","variance","stability","analyze","comparative","difference","match","reduce","a","b","sum","pow","sentimentVariance"],"mappings":"kmQAmBC,SAAAA,IAAA,OAAAA,EAAAC,EAAAC,IAAAC,MAhBM,SA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