Spaces:
Runtime error
Runtime error
Update app.py
Browse filesAdded tool create_meal_plan
app.py
CHANGED
|
@@ -8,15 +8,33 @@ from tools.final_answer import FinalAnswerTool
|
|
| 8 |
from Gradio_UI import GradioUI
|
| 9 |
|
| 10 |
# Below is an example of a tool that does nothing. Amaze us with your creativity !
|
| 11 |
-
|
| 12 |
-
def my_cutom_tool(arg1:str, arg2:int)-> str: #it's import to specify the return type
|
| 13 |
#Keep this format for the description / args / args description but feel free to modify the tool
|
| 14 |
-
"""A tool that
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
Args:
|
| 16 |
-
|
| 17 |
-
|
|
|
|
| 18 |
"""
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
|
| 21 |
@tool
|
| 22 |
def get_current_time_in_timezone(timezone: str) -> str:
|
|
|
|
| 8 |
from Gradio_UI import GradioUI
|
| 9 |
|
| 10 |
# Below is an example of a tool that does nothing. Amaze us with your creativity !
|
| 11 |
+
#@tool
|
| 12 |
+
#def my_cutom_tool(arg1:str, arg2:int)-> str: #it's import to specify the return type
|
| 13 |
#Keep this format for the description / args / args description but feel free to modify the tool
|
| 14 |
+
# """A tool that creates a shopping list
|
| 15 |
+
# Args:
|
| 16 |
+
# arg1: the first argument
|
| 17 |
+
# arg2: the second argument
|
| 18 |
+
# """
|
| 19 |
+
# return "What magic will you build ?"
|
| 20 |
+
|
| 21 |
+
|
| 22 |
+
@tool
|
| 23 |
+
def create_meal_plan(days: int, family_size: int, dietary_restrictions: List[str] = None) -> Dict[str, List[str]]:
|
| 24 |
+
"""Creates a meal plan for specified number of days considering family size and restrictions
|
| 25 |
Args:
|
| 26 |
+
days: Number of days to plan for
|
| 27 |
+
family_size: Number of people to cook for
|
| 28 |
+
dietary_restrictions: List of dietary restrictions/preferences
|
| 29 |
"""
|
| 30 |
+
# This would integrate with your LLM to generate meal plans
|
| 31 |
+
# For now returning a simple example structure
|
| 32 |
+
meal_plan = {
|
| 33 |
+
"Monday": ["Vegetarian Pasta", "Grilled Chicken Salad", "Fish Tacos"],
|
| 34 |
+
"Tuesday": ["Oatmeal with Fruit", "Quinoa Bowl", "Stir Fry"]
|
| 35 |
+
}
|
| 36 |
+
return meal_plan
|
| 37 |
+
|
| 38 |
|
| 39 |
@tool
|
| 40 |
def get_current_time_in_timezone(timezone: str) -> str:
|