@@ -37,5 +37,73 @@ export const mastra = new Mastra({
37
37
} ,
38
38
} ) ,
39
39
} ) ,
40
+ shared_state : new Agent ( {
41
+ name : "shared_state" ,
42
+ instructions : `
43
+ You are a helpful assistant for creating recipes.
44
+
45
+ IMPORTANT:
46
+ 1. Create a recipe using the existing ingredients and instructions. Make sure the recipe is complete.
47
+ 2. For ingredients, append new ingredients to the existing ones.
48
+ 3. For instructions, append new steps to the existing ones.
49
+ 4. 'ingredients' is always an array of objects with 'icon', 'name', and 'amount' fields
50
+ 5. 'instructions' is always an array of strings
51
+
52
+ If you have just created or modified the recipe, just answer in one sentence what you did. dont describe the recipe, just say what you did.
53
+ ` ,
54
+ model : openai ( "gpt-4o" ) ,
55
+ memory : new Memory ( {
56
+ storage : new LibSQLStore ( { url : "file::memory:" } ) ,
57
+ options : {
58
+ workingMemory : {
59
+ enabled : true ,
60
+ schema : z . object ( {
61
+ recipe : z . object ( {
62
+ skill_level : z
63
+ . enum ( [ "Beginner" , "Intermediate" , "Advanced" ] )
64
+ . describe ( "The skill level required for the recipe" ) ,
65
+ special_preferences : z
66
+ . array (
67
+ z . enum ( [
68
+ "High Protein" ,
69
+ "Low Carb" ,
70
+ "Spicy" ,
71
+ "Budget-Friendly" ,
72
+ "One-Pot Meal" ,
73
+ "Vegetarian" ,
74
+ "Vegan" ,
75
+ ] ) ,
76
+ )
77
+ . describe ( "A list of special preferences for the recipe" ) ,
78
+ cooking_time : z
79
+ . enum ( [ "5 min" , "15 min" , "30 min" , "45 min" , "60+ min" ] )
80
+ . describe ( "The cooking time of the recipe" ) ,
81
+ ingredients : z
82
+ . array (
83
+ z . object ( {
84
+ icon : z
85
+ . string ( )
86
+ . describe (
87
+ "The icon emoji (not emoji code like '\x1f35e', but the actual emoji like 🥕) of the ingredient" ,
88
+ ) ,
89
+ name : z . string ( ) . describe ( "The name of the ingredient" ) ,
90
+ amount : z . string ( ) . describe ( "The amount of the ingredient" ) ,
91
+ } ) ,
92
+ )
93
+ . describe (
94
+ "Entire list of ingredients for the recipe, including the new ingredients and the ones that are already in the recipe" ,
95
+ ) ,
96
+ instructions : z
97
+ . array ( z . string ( ) )
98
+ . describe (
99
+ "Entire list of instructions for the recipe, including the new instructions and the ones that are already there" ,
100
+ ) ,
101
+ changes : z . string ( ) . describe ( "A description of the changes made to the recipe" ) ,
102
+ } ) ,
103
+ } ) ,
104
+ } ,
105
+ } ,
106
+ } ) ,
107
+ } ) ,
40
108
} ,
41
109
} ) ;
0 commit comments