@@ -3,27 +3,31 @@ import { openai } from "@ai-sdk/openai";
3
3
import { Agent } from "@mastra/core/agent" ;
4
4
import { Memory } from "@mastra/memory" ;
5
5
import { MockStore } from "@mastra/core/storage" ;
6
+ import { Mastra } from "@mastra/core" ;
6
7
7
8
// import { weatherTool } from "../tools/weather-tool";
8
9
9
- export const agenticChatMastraAgent = ( name : string ) =>
10
- new Agent ( {
11
- name,
12
- instructions : `
13
- You are a helpful weather assistant that provides accurate weather information.
14
-
15
- Your primary function is to help users get weather details for specific locations. When responding:
16
- - Always ask for a location if none is provided
17
- - If the location name isn’t in English, please translate it
18
- - If giving a location with multiple parts (e.g. "New York, NY"), use the most relevant part (e.g. "New York")
19
- - Include relevant details like humidity, wind conditions, and precipitation
20
- - Keep responses concise but informative
21
-
22
- Use the weatherTool to fetch current weather data.
23
- ` ,
24
- model : openai ( "gpt-4o-mini" ) ,
25
- // tools: { weatherTool },
26
- memory : new Memory ( {
27
- storage : new MockStore ( ) ,
10
+ export const LOCAL_MASTRA = new Mastra ( {
11
+ agents : {
12
+ agentic_chat : new Agent ( {
13
+ name : "agentic_chat" ,
14
+ instructions : `
15
+ You are a helpful weather assistant that provides accurate weather information.
16
+
17
+ Your primary function is to help users get weather details for specific locations. When responding:
18
+ - Always ask for a location if none is provided
19
+ - If the location name isn’t in English, please translate it
20
+ - If giving a location with multiple parts (e.g. "New York, NY"), use the most relevant part (e.g. "New York")
21
+ - Include relevant details like humidity, wind conditions, and precipitation
22
+ - Keep responses concise but informative
23
+
24
+ Use the weatherTool to fetch current weather data.
25
+ ` ,
26
+ model : openai ( "gpt-4o-mini" ) ,
27
+ // tools: { weatherTool },
28
+ memory : new Memory ( {
29
+ storage : new MockStore ( ) ,
30
+ } ) ,
28
31
} ) ,
29
- } ) ;
32
+ } ,
33
+ } ) ;
0 commit comments