Skip to content

Commit 4de834a

Browse files
authored
Merge pull request #56 from ssdeanx/develop
chore: remove unused files and implement new scorers
2 parents 2345500 + 36e331e commit 4de834a

39 files changed

Lines changed: 551 additions & 1536 deletions

globalSetup.ts

Lines changed: 0 additions & 5 deletions
This file was deleted.

src/mastra/agents/acpAgent.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
import { Agent } from '@mastra/core/agent';
2-
3-
import { createAnswerRelevancyScorer } from '@mastra/evals/scorers/prebuilt';
4-
52
import { googleAIFlashLite, pgMemory, pgQueryTool } from '../config';
6-
73
import { arxivTool } from '../tools/arxiv.tool';
84
import { csvToJsonTool } from '../tools/csv-to-json.tool';
95
import { createDataDirTool, getDataFileInfoTool, listDataDirTool, moveDataFileTool, searchDataFilesTool, writeDataFileTool } from '../tools/data-file-manager';
@@ -133,9 +129,6 @@ export const acpAgent = new Agent({
133129
outputProcessors: [new TokenLimiterProcessor(1048576)],
134130
workflows: {},
135131
scorers: {
136-
relevancy: {
137-
scorer: createAnswerRelevancyScorer({ model: googleAIFlashLite }),
138-
sampling: { type: "ratio", rate: 0.5 }
139-
}
132+
140133
},
141134
});

src/mastra/agents/businessLegalAgents.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { GoogleGenerativeAIProviderMetadata } from '@ai-sdk/google';
44
import { googleTools } from '@ai-sdk/google/internal';
55
import { Agent } from '@mastra/core/agent';
66

7-
import { BatchPartsProcessor, TokenLimiterProcessor, UnicodeNormalizer } from '@mastra/core/processors';
7+
import { TokenLimiterProcessor, UnicodeNormalizer } from '@mastra/core/processors';
88
import type { RequestContext } from '@mastra/core/request-context';
99
import {
1010
createAnswerRelevancyScorer,
@@ -14,7 +14,7 @@ import { PGVECTOR_PROMPT } from "@mastra/pg";
1414
import { google, googleAI, googleAI3, googleAIFlashLite } from '../config/google';
1515
import { log } from '../config/logger';
1616
import { pgMemory, pgQueryTool } from '../config/pg-storage';
17-
import { researchCompletenessScorer, sourceDiversityScorer, summaryQualityScorer } from '../scorers/custom-scorers';
17+
1818
import { mdocumentChunker } from '../tools/document-chunking.tool';
1919
import { evaluateResultTool } from '../tools/evaluateResultTool';
2020
import { extractLearningsTool } from '../tools/extractLearningsTool';

src/mastra/agents/contentStrategistAgent.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Agent } from '@mastra/core/agent';
22
import { googleAI } from '../config/google';
33
import { pgMemory } from '../config/pg-storage';
44
import { webScraperTool } from '../tools/web-scraper-tool';
5-
import { structureScorer, creativityScorer } from '../scorers';
5+
66
import { chartSupervisorTool } from '../tools/financial-chart-tools';
77
import type { GoogleGenerativeAIProviderOptions } from '@ai-sdk/google';
88
import type { RequestContext } from '@mastra/core/request-context'
@@ -98,14 +98,7 @@ EXAMPLE FLOW:
9898
chartSupervisorTool
9999
},
100100
scorers: {
101-
structure: {
102-
scorer: structureScorer,
103-
sampling: { type: 'ratio', rate: 0.3 },
104-
},
105-
creativity: {
106-
scorer: creativityScorer,
107-
sampling: { type: 'ratio', rate: 0.3 },
108-
},
101+
109102
},
110103
outputProcessors: [new TokenLimiterProcessor(1048576)]
111104
});

src/mastra/agents/copywriterAgent.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
import { log } from '../config/logger'
1111
import { pgMemory } from '../config/pg-storage'
1212
import { googleAIFlashLite } from '../config/google'
13-
import { structureScorer } from '../scorers'
13+
1414
import { chartSupervisorTool } from '../tools/financial-chart-tools'
1515
import type { GoogleGenerativeAIProviderOptions } from '@ai-sdk/google'
1616
import type { RequestContext } from '@mastra/core/request-context'
@@ -137,10 +137,7 @@ Provide the final content in a clear, well-structured format appropriate for the
137137
chartSupervisorTool
138138
},
139139
scorers: {
140-
structure: {
141-
scorer: structureScorer,
142-
sampling: { type: 'ratio', rate: 0.5 },
143-
},
140+
144141
},
145142
workflows: {},
146143
maxRetries: 5,

src/mastra/agents/csv_to_excalidraw.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { Agent } from "@mastra/core/agent";
22
import { googleAI, pgMemory } from "../config";
3-
import { structureScorer } from "../scorers";
43
import type { GoogleGenerativeAIProviderOptions } from "@ai-sdk/google";
54
import type { RequestContext } from '@mastra/core/request-context'
65
import { TokenLimiterProcessor } from "@mastra/core/processors";
@@ -177,10 +176,7 @@ Structure:
177176
memory: pgMemory,
178177
tools: {},
179178
scorers: {
180-
structure: {
181-
scorer: structureScorer,
182-
sampling: { type: 'ratio', rate: 0.3 },
183-
},
179+
184180
},
185181
workflows: {},
186182
maxRetries: 5,

src/mastra/agents/editorAgent.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import type { RequestContext } from '@mastra/core/request-context';
55
import { googleAI } from '../config/google';
66
import { log } from '../config/logger';
77
import { pgMemory } from '../config/pg-storage';
8-
import { summaryQualityScorer } from '../scorers';
8+
99
import { TokenLimiterProcessor } from '@mastra/core/processors';
1010

1111
export type UserTier = 'free' | 'pro' | 'enterprise'
@@ -122,10 +122,7 @@ Tailor your editing style to the content type:
122122
memory: pgMemory,
123123
tools: [],
124124
scorers: {
125-
summaryQuality: {
126-
scorer: summaryQualityScorer,
127-
sampling: { type: 'ratio', rate: 0.6 },
128-
}
125+
129126
},
130127
workflows: {},
131128
maxRetries: 5,

src/mastra/agents/evaluationAgent.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Agent } from '@mastra/core/agent'
22
import { googleAIFlashLite } from '../config/google'
33
import { log } from '../config/logger'
44
import { pgMemory } from '../config/pg-storage'
5-
import { responseQualityScorer, structureScorer, taskCompletionScorer } from '../scorers'
5+
66
import type { GoogleGenerativeAIProviderOptions } from '@ai-sdk/google'
77
import type { RequestContext } from '@mastra/core/request-context'
88
import { TokenLimiterProcessor } from '@mastra/core/processors'
@@ -129,10 +129,8 @@ For each search result provided, you must determine its relevance to the user's
129129
model: googleAIFlashLite,
130130
memory: pgMemory,
131131
scorers: {
132-
responseQuality: {
133-
scorer: responseQualityScorer,
134-
sampling: { type: 'ratio', rate: 0.5 },
135-
}
132+
133+
136134
},
137135
workflows: {},
138136
maxRetries: 5,

src/mastra/agents/image_to_csv.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { Agent } from "@mastra/core/agent";
22
import { googleAI, pgMemory } from "../config";
3-
import { csvValidityScorer } from "../scorers";
3+
4+
45
import type { GoogleGenerativeAIProviderOptions } from "@ai-sdk/google";
56
import type { RequestContext } from "@mastra/core/request-context";
67
import { TokenLimiterProcessor } from "@mastra/core/processors";
@@ -146,10 +147,8 @@ IMPORTANT: Only return the CSV string including the header row. Do not include a
146147
memory: pgMemory,
147148
tools: {},
148149
scorers: {
149-
csvValidity: {
150-
scorer: csvValidityScorer,
151-
sampling: { type: 'ratio', rate: 1.0 },
152-
},
150+
151+
153152
},
154153
workflows: {},
155154
maxRetries: 5,

src/mastra/agents/learningExtractionAgent.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Agent } from '@mastra/core/agent'
22
import { googleAI } from '../config/google'
33
import { log } from '../config/logger'
44
import { pgMemory } from '../config/pg-storage'
5-
import { structureScorer } from '../scorers'
5+
66
import type { GoogleGenerativeAIProviderOptions } from '@ai-sdk/google'
77
import type { RequestContext } from '@mastra/core/request-context'
88
import { TokenLimiterProcessor } from '@mastra/core/processors'
@@ -64,10 +64,7 @@ export const learningExtractionAgent = new Agent({
6464
model: googleAI,
6565
memory: pgMemory,
6666
scorers: {
67-
structure: {
68-
scorer: structureScorer,
69-
sampling: { type: 'ratio', rate: 0.7 },
70-
},
67+
7168
},
7269
workflows: {},
7370
maxRetries: 5,

0 commit comments

Comments
 (0)