@@ -5,7 +5,7 @@ import { listEvents } from '../tools/calendar-tool'
55import { execaTool } from '../tools/execa-tool'
66import type { GoogleGenerativeAIProviderOptions } from '@ai-sdk/google'
77import type { RequestContext } from '@mastra/core/request-context'
8- import { TokenLimiterProcessor } from '@mastra/core/processors'
8+ import { BatchPartsProcessor , TokenLimiterProcessor } from '@mastra/core/processors'
99import { webScraperTool } from '../tools'
1010
1111export interface DaneContext {
@@ -41,7 +41,13 @@ export const daneCommitMessage = new Agent({
4141 } ,
4242 model : googleAIFlashLite ,
4343 memory : pgMemory ,
44- outputProcessors : [ new TokenLimiterProcessor ( 1048576 ) ]
44+ outputProcessors : [ new TokenLimiterProcessor ( 128576 ) ,
45+ new BatchPartsProcessor ( {
46+ batchSize : 10 ,
47+ maxWaitTime : 75 ,
48+ emitOnNonText : true
49+ } ) ,
50+ ]
4551} )
4652
4753export const daneIssueLabeler = new Agent ( {
@@ -70,7 +76,13 @@ export const daneIssueLabeler = new Agent({
7076 } ,
7177 model : googleAIFlashLite ,
7278 memory : pgMemory ,
73- outputProcessors : [ new TokenLimiterProcessor ( 1048576 ) ]
79+ outputProcessors : [ new TokenLimiterProcessor ( 128576 ) ,
80+ new BatchPartsProcessor ( {
81+ batchSize : 10 ,
82+ maxWaitTime : 75 ,
83+ emitOnNonText : true
84+ } ) ,
85+ ]
7486} )
7587
7688export const daneLinkChecker = new Agent ( {
@@ -104,7 +116,13 @@ export const daneLinkChecker = new Agent({
104116 } ,
105117 model : googleAIFlashLite ,
106118 memory : pgMemory ,
107- outputProcessors : [ new TokenLimiterProcessor ( 1048576 ) ]
119+ outputProcessors : [ new TokenLimiterProcessor ( 128576 ) ,
120+ new BatchPartsProcessor ( {
121+ batchSize : 10 ,
122+ maxWaitTime : 75 ,
123+ emitOnNonText : true
124+ } ) ,
125+ ]
108126} )
109127
110128export const daneChangeLog = new Agent ( {
@@ -140,7 +158,13 @@ export const daneChangeLog = new Agent({
140158 } ,
141159 model : googleAIFlashLite ,
142160 memory : pgMemory ,
143- outputProcessors : [ new TokenLimiterProcessor ( 1048576 ) ]
161+ outputProcessors : [ new TokenLimiterProcessor ( 128576 ) ,
162+ new BatchPartsProcessor ( {
163+ batchSize : 10 ,
164+ maxWaitTime : 75 ,
165+ emitOnNonText : true
166+ } ) ,
167+ ]
144168} )
145169
146170export const dane = new Agent ( {
@@ -160,40 +184,30 @@ export const dane = new Agent({
160184
161185 # Our tools:
162186
163- ## readPDF
164- Makes you a powerful agent capable of reading PDF files.
165-
166- ## fsTool
167- Makes you a powerful agent capable of reading and writing files to the local filesystem.
168-
169187 ## execaTool
170188 Makes you a powerful agent capabale of executing files on the local system.
171189
172- ## googleSearch
173- Makes you a powerful agent capabale answering all questions by finding the answer on Google search.
174- Pass the query as a JS object. If you have links, ALWAYS CITE YOUR SOURCES.
175-
176190 ## browserTool
177191 Makes you a powerful agent capable of scraping the web. Pass the url as a JS object.
178192
179193 ## listEvents
180194 Makes you a powerful agent capable of listing events on a calendar. When using this tool ONLY RETURN RELEVANT EVENTS.
181195 DO NOT ATTEMPT TO DO ANYTHING MORE.
182196
183- ## imageTool
184- Makes you a powerful agent capable of generating images and saving them to disk. Pass the directory and an image prompt .
197+ ## webScraperTool
198+ Makes you a powerful agent capable of scraping web pages. Use this tool to get information from web pages .
185199
186200 # Rules
187201 * **Tool Efficiency:** Do NOT use the same tool repetitively or back-to-back for the same query.
188- * DO NOT ATTEMPT TO USE GENERAL KNOWLEDGE. Use the 'googleSearch ' tool to find the answer.
202+ * DO NOT ATTEMPT TO USE GENERAL KNOWLEDGE. Use the 'webScraperTool ' tool to find the answer.
189203 * Don't reference tools when you communicate with the user. Do not mention what tools you are using.
190204 * Tell the user what you are doing.
191205 ` ,
192206 providerOptions : {
193207 google : {
194208 thinkingConfig : {
195209 includeThoughts : true ,
196- thinkingLevel : 'high ' ,
210+ thinkingLevel : 'low ' ,
197211 } ,
198212 responseModalities : [ 'TEXT' ] ,
199213 } satisfies GoogleGenerativeAIProviderOptions ,
@@ -208,5 +222,11 @@ export const dane = new Agent({
208222 webScraperTool,
209223 listEvents,
210224 } ,
211- outputProcessors : [ new TokenLimiterProcessor ( 1048576 ) ]
225+ outputProcessors : [ new TokenLimiterProcessor ( 128576 ) ,
226+ new BatchPartsProcessor ( {
227+ batchSize : 10 ,
228+ maxWaitTime : 75 ,
229+ emitOnNonText : true
230+ } ) ,
231+ ]
212232} )
0 commit comments