-
Notifications
You must be signed in to change notification settings - Fork 2
chore: remove unused files and implement new scorers #56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,7 +4,7 @@ import { GoogleGenerativeAIProviderMetadata } from '@ai-sdk/google'; | |
| import { googleTools } from '@ai-sdk/google/internal'; | ||
| import { Agent } from '@mastra/core/agent'; | ||
|
|
||
| import { BatchPartsProcessor, TokenLimiterProcessor, UnicodeNormalizer } from '@mastra/core/processors'; | ||
| import { TokenLimiterProcessor, UnicodeNormalizer } from '@mastra/core/processors'; | ||
|
||
| import type { RequestContext } from '@mastra/core/request-context'; | ||
| import { | ||
| createAnswerRelevancyScorer, | ||
|
|
@@ -14,7 +14,7 @@ import { PGVECTOR_PROMPT } from "@mastra/pg"; | |
| import { google, googleAI, googleAI3, googleAIFlashLite } from '../config/google'; | ||
| import { log } from '../config/logger'; | ||
| import { pgMemory, pgQueryTool } from '../config/pg-storage'; | ||
| import { researchCompletenessScorer, sourceDiversityScorer, summaryQualityScorer } from '../scorers/custom-scorers'; | ||
|
|
||
| import { mdocumentChunker } from '../tools/document-chunking.tool'; | ||
| import { evaluateResultTool } from '../tools/evaluateResultTool'; | ||
| import { extractLearningsTool } from '../tools/extractLearningsTool'; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,7 +5,7 @@ import type { RequestContext } from '@mastra/core/request-context'; | |
| import { googleAI } from '../config/google'; | ||
| import { log } from '../config/logger'; | ||
| import { pgMemory } from '../config/pg-storage'; | ||
| import { summaryQualityScorer } from '../scorers'; | ||
|
|
||
| import { TokenLimiterProcessor } from '@mastra/core/processors'; | ||
|
|
||
| export type UserTier = 'free' | 'pro' | 'enterprise' | ||
|
|
@@ -122,10 +122,7 @@ Tailor your editing style to the content type: | |
| memory: pgMemory, | ||
| tools: [], | ||
| scorers: { | ||
| summaryQuality: { | ||
| scorer: summaryQualityScorer, | ||
| sampling: { type: 'ratio', rate: 0.6 }, | ||
| } | ||
|
|
||
| }, | ||
|
Comment on lines
124
to
126
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial Empty scorers configuration - consider cleanup. The scorers configuration is now empty following the removal of 🤖 Prompt for AI Agents |
||
| workflows: {}, | ||
| maxRetries: 5, | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,6 +1,7 @@ | ||||||||||||||||||||||||
| import { Agent } from "@mastra/core/agent"; | ||||||||||||||||||||||||
| import { googleAI, pgMemory } from "../config"; | ||||||||||||||||||||||||
| import { csvValidityScorer } from "../scorers"; | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| import type { GoogleGenerativeAIProviderOptions } from "@ai-sdk/google"; | ||||||||||||||||||||||||
| import type { RequestContext } from "@mastra/core/request-context"; | ||||||||||||||||||||||||
| import { TokenLimiterProcessor } from "@mastra/core/processors"; | ||||||||||||||||||||||||
|
|
@@ -146,10 +147,8 @@ IMPORTANT: Only return the CSV string including the header row. Do not include a | |||||||||||||||||||||||
| memory: pgMemory, | ||||||||||||||||||||||||
| tools: {}, | ||||||||||||||||||||||||
| scorers: { | ||||||||||||||||||||||||
| csvValidity: { | ||||||||||||||||||||||||
| scorer: csvValidityScorer, | ||||||||||||||||||||||||
| sampling: { type: 'ratio', rate: 1.0 }, | ||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||
|
Comment on lines
149
to
152
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial Remove extra whitespace in empty scorers object. The scorers configuration is now empty following the removal of Apply this diff to remove the extra blank line: scorers: {
-
-
+
},📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||
| workflows: {}, | ||||||||||||||||||||||||
| maxRetries: 5, | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,7 +3,7 @@ import { Agent } from '@mastra/core/agent'; | |
|
|
||
| import { googleAIFlashLite } from '../config/google.js'; | ||
| import { pgMemory } from '../config/pg-storage.js'; | ||
| import { taskCompletionScorer } from '../scorers'; | ||
|
|
||
| import { activeDistTag, pnpmBuild, pnpmChangesetPublish, pnpmChangesetStatus } from '../tools/pnpm-tool'; | ||
| import type { GoogleGenerativeAIProviderOptions } from '@ai-sdk/google'; | ||
| import type { RequestContext } from '@mastra/core/request-context'; | ||
|
|
@@ -196,10 +196,7 @@ export const danePackagePublisher = new Agent({ | |
| }, | ||
| // options: { tracingPolicy: { internal: InternalSpans.AGENT } }, | ||
| scorers: { | ||
| taskCompletion: { | ||
| scorer: taskCompletionScorer, | ||
| sampling: { type: 'ratio', rate: 0.4 }, | ||
| }, | ||
|
|
||
| }, | ||
|
Comment on lines
198
to
200
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial Empty scorers configuration - consider cleanup. The scorers configuration is now empty following the removal of 🤖 Prompt for AI Agents |
||
| outputProcessors: [new TokenLimiterProcessor(1048576)] | ||
| }); | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -3,12 +3,6 @@ import { TokenLimiterProcessor, UnicodeNormalizer } from '@mastra/core/processor | |||||||||||||||||||||||||||||||||||||||
| import { PGVECTOR_PROMPT } from "@mastra/pg" | ||||||||||||||||||||||||||||||||||||||||
| import { googleAI, googleAIFlashLite, pgMemory, pgQueryTool } from '../config' | ||||||||||||||||||||||||||||||||||||||||
| import { log } from '../config/logger' | ||||||||||||||||||||||||||||||||||||||||
| import { | ||||||||||||||||||||||||||||||||||||||||
| financialDataScorer, | ||||||||||||||||||||||||||||||||||||||||
| responseQualityScorer, | ||||||||||||||||||||||||||||||||||||||||
| sourceDiversityScorer, | ||||||||||||||||||||||||||||||||||||||||
| taskCompletionScorer, | ||||||||||||||||||||||||||||||||||||||||
| } from '../scorers' | ||||||||||||||||||||||||||||||||||||||||
| import { alphaVantageStockTool } from '../tools/alpha-vantage.tool' | ||||||||||||||||||||||||||||||||||||||||
| import { chartDataProcessorTool, chartGeneratorTool, chartTypeAdvisorTool } from '../tools/financial-chart-tools' | ||||||||||||||||||||||||||||||||||||||||
| import { | ||||||||||||||||||||||||||||||||||||||||
|
|
@@ -513,18 +507,7 @@ Return comprehensive chart package: | |||||||||||||||||||||||||||||||||||||||
| options: { | ||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||
| scorers: { | ||||||||||||||||||||||||||||||||||||||||
| taskCompletion: { | ||||||||||||||||||||||||||||||||||||||||
| scorer: taskCompletionScorer, | ||||||||||||||||||||||||||||||||||||||||
| sampling: { type: 'ratio', rate: 0.5 }, | ||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||
| sourceDiversity: { | ||||||||||||||||||||||||||||||||||||||||
| scorer: sourceDiversityScorer, | ||||||||||||||||||||||||||||||||||||||||
| sampling: { type: 'ratio', rate: 0.3 }, | ||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||
| financialData: { | ||||||||||||||||||||||||||||||||||||||||
| scorer: financialDataScorer, | ||||||||||||||||||||||||||||||||||||||||
| sampling: { type: 'ratio', rate: 0.6 }, | ||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
507
to
511
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial Remove empty Both memory: pgMemory,
- options: {
- },
- scorers: {
-
- },
inputProcessors: [📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||
| inputProcessors: [ | ||||||||||||||||||||||||||||||||||||||||
| new UnicodeNormalizer({ | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,7 +2,7 @@ import { Agent } from '@mastra/core/agent' | |
| import { googleAI, googleAIFlashLite, googleAIPro } from '../config/google' | ||
| import { log } from '../config/logger' | ||
| import { pgMemory } from '../config/pg-storage' | ||
| import { researchCompletenessScorer, structureScorer, summaryQualityScorer } from '../scorers' | ||
|
|
||
| import type { GoogleGenerativeAIProviderOptions } from '@ai-sdk/google' | ||
| import type { RequestContext } from '@mastra/core/request-context' | ||
| import { TokenLimiterProcessor } from '@mastra/core/processors' | ||
|
|
@@ -107,18 +107,7 @@ export const reportAgent = new Agent({ | |
| memory: pgMemory, | ||
| options: {}, | ||
| scorers: { | ||
| researchCompleteness: { | ||
| scorer: researchCompletenessScorer, | ||
| sampling: { type: 'ratio', rate: 0.8 }, | ||
| }, | ||
| summaryQuality: { | ||
| scorer: summaryQualityScorer, | ||
| sampling: { type: 'ratio', rate: 0.6 }, | ||
| }, | ||
| structure: { | ||
| scorer: structureScorer, | ||
| sampling: { type: 'ratio', rate: 1.0 }, | ||
| }, | ||
|
|
||
| }, | ||
|
Comment on lines
109
to
111
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial Empty scorers configuration - consider cleanup. The scorers configuration is now empty following the removal of multiple scorers ( 🤖 Prompt for AI Agents |
||
| tools: {}, | ||
| workflows: {}, | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -4,10 +4,6 @@ import { googleTools } from '@ai-sdk/google/internal'; | |||||||||||||||||||||||||||
| import { Agent } from '@mastra/core/agent'; | ||||||||||||||||||||||||||||
| import { TokenLimiterProcessor, UnicodeNormalizer } from '@mastra/core/processors'; | ||||||||||||||||||||||||||||
| import type { RequestContext } from '@mastra/core/request-context'; | ||||||||||||||||||||||||||||
| import { | ||||||||||||||||||||||||||||
| createAnswerRelevancyScorer, | ||||||||||||||||||||||||||||
| createToxicityScorer | ||||||||||||||||||||||||||||
| } from '@mastra/evals/scorers/prebuilt'; | ||||||||||||||||||||||||||||
| import { PGVECTOR_PROMPT } from "@mastra/pg"; | ||||||||||||||||||||||||||||
| import { google, googleAI, googleAIFlashLite } from '../config/google'; | ||||||||||||||||||||||||||||
| import { log } from '../config/logger'; | ||||||||||||||||||||||||||||
|
|
@@ -208,14 +204,7 @@ export const researchAgent = new Agent({ | |||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||
| memory: pgMemory, | ||||||||||||||||||||||||||||
| scorers: { | ||||||||||||||||||||||||||||
| relevancy: { | ||||||||||||||||||||||||||||
| scorer: createAnswerRelevancyScorer({ model: googleAIFlashLite }), | ||||||||||||||||||||||||||||
| sampling: { type: "ratio", rate: 0.5 } | ||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||
| safety: { | ||||||||||||||||||||||||||||
| scorer: createToxicityScorer({ model: googleAIFlashLite }), | ||||||||||||||||||||||||||||
| sampling: { type: "ratio", rate: 0.3 } | ||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||
|
Comment on lines
206
to
208
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial Consider removing the empty The memory: pgMemory,
- scorers: {
-
- },
maxRetries: 5,📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||
| maxRetries: 5, | ||||||||||||||||||||||||||||
| //voice: gvoice, | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
This file was deleted.
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,9 @@ | ||||||
| # Evals | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Replace H1 heading with H2. Per coding guidelines, H1 headings should not be used as they will be generated from the title. Use Apply this diff: -# Evals
+## Evals📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
|
|
||||||
| This folder contains evaluation helpers and prebuilt scorers aligned with Mastra's evals reference. | ||||||
|
|
||||||
| Purpose: Provide scorer utils, prebuilt scorers (bias, completeness, prompt-alignment, tool-call-accuracy, noise-sensitivity), and runEvals helper exports for local experiments and CI tests. | ||||||
|
|
||||||
| Guidelines: | ||||||
| - Use `createScorer` and `runEvals` from `@mastra/core/evals` when building scorers. | ||||||
| - Keep prebuilt scorers small and well-tested; use judge (LLM) configuration for LLM-based scorers. | ||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹 Nitpick | 🔵 Trivial
Empty scorers configuration - consider cleanup.
The scorers configuration is now empty, consistent with the PR's goal to remove scorer integrations. Consider removing the empty
scorersproperty entirely if it's not required, or add a comment indicating this is intentional if it serves as a placeholder for future scorers.🤖 Prompt for AI Agents