Skip to content

Commit b9b85e1

Browse files
committed
recipe prompt change
added title state change the recipe prompt
1 parent cf9d1c0 commit b9b85e1

File tree

1 file changed

+15
-4
lines changed
  • typescript-sdk/integrations/adk-middleware/examples/shared_state

1 file changed

+15
-4
lines changed

typescript-sdk/integrations/adk-middleware/examples/shared_state/agent.py

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ class Recipe(BaseModel):
6969
def generate_recipe(
7070
tool_context: ToolContext,
7171
skill_level: str,
72-
special_preferences: str = "",
72+
title: str,
73+
special_preferences: List[str] = [],
7374
cooking_time: str = "",
7475
ingredients: List[dict] = [],
7576
instructions: List[str] = [],
@@ -79,14 +80,20 @@ def generate_recipe(
7980
Generate or update a recipe using the provided recipe data.
8081
8182
Args:
83+
"title": {
84+
"type": "string",
85+
"description": "**REQUIRED** - The title of the recipe."
86+
},
8287
"skill_level": {
8388
"type": "string",
8489
"enum": ["Beginner","Intermediate","Advanced"],
8590
"description": "**REQUIRED** - The skill level required for the recipe. Must be one of the predefined skill levels (Beginner, Intermediate, Advanced)."
8691
},
8792
"special_preferences": {
88-
"type": "string",
89-
"description": "**OPTIONAL** - Special dietary preferences for the recipe as comma-separated values. Example: 'High Protein, Low Carb, Gluten Free'. Leave empty or omit if no special preferences."
93+
"type": "array",
94+
"items": {"type": "string"},
95+
"enum": ["High Protein","Low Carb","Spicy","Budget-Friendly","One-Pot Meal","Vegetarian","Vegan"],
96+
"description": "**OPTIONAL** - Special dietary preferences for the recipe as comma-separated values. Example: 'High Protein, Low Carb, Gluten Free'. Leave empty array if no special preferences."
9097
},
9198
"cooking_time": {
9299
"type": "string",
@@ -123,6 +130,7 @@ def generate_recipe(
123130

124131
# Create RecipeData object to validate structure
125132
recipe = {
133+
"title": title,
126134
"skill_level": skill_level,
127135
"special_preferences": special_preferences ,
128136
"cooking_time": cooking_time ,
@@ -161,6 +169,7 @@ def on_before_agent(callback_context: CallbackContext):
161169
if "recipe" not in callback_context.state:
162170
# Initialize with default recipe
163171
default_recipe = {
172+
"title": "Make Your Recipe",
164173
"skill_level": "Beginner",
165174
"special_preferences": [],
166175
"cooking_time": '15 min',
@@ -222,10 +231,12 @@ def before_model_modifier(
222231
3. When modifying an existing recipe, include the changes parameter to describe what was modified
223232
4. Be creative and helpful in generating complete, practical recipes
224233
5. After using the tool, provide a brief summary of what you created or changed
234+
6. If user ask to improve the recipe then add more ingredients and make it healthier
235+
7. When you see the 'Recipe generated successfully' confirmation message, wish the user well with their cooking by telling them to enjoy their dish.
225236
226237
Examples of when to use the tool:
227238
- "Create a pasta recipe" → Use tool with skill_level, ingredients, instructions
228-
- "Make it vegetarian" → Use tool with special_preferences="vegetarian" and changes describing the modification
239+
- "Make it vegetarian" → Use tool with special_preferences=["vegetarian"] and changes describing the modification
229240
- "Add some herbs" → Use tool with updated ingredients and changes describing the addition
230241
231242
Always provide complete, practical recipes that users can actually cook.

0 commit comments

Comments
 (0)