hd-hg commited on
Commit
7b5e051
·
verified ·
1 Parent(s): 89fbacc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -17
app.py CHANGED
@@ -14,17 +14,13 @@ from Gradio_UI import GradioUI
14
 
15
  @tool
16
  def extract_recipe_details(url: str) -> Dict[str, Any]:
17
- """
18
- Extracts ingredients, instructions, and nutritional information from a recipe webpage.
19
-
20
- Args:
21
- url (str): The complete URL of the recipe webpage to scrape. This should be a valid HTTP/HTTPS URL pointing to a recipe page.
22
-
23
  Returns:
24
- Dict[str, Any]: A dictionary containing the following keys:
25
- - ingredients: List of recipe ingredients
26
- - instructions: List of recipe preparation steps
27
- - nutritional_benefits: String containing nutritional information
28
  """
29
  try:
30
  headers = {"User-Agent": "Mozilla/5.0"}
@@ -81,14 +77,13 @@ def extract_recipe_details(url: str) -> Dict[str, Any]:
81
 
82
  @tool
83
  def get_healthy_cheat_meal(diet_type: str) -> List[Dict[str, Any]]:
84
- """
85
- Searches the internet for healthy sweet dish recipes and extracts ingredients, instructions, and nutrition.
86
-
87
- Args:
88
- diet_type (str): The diet category (e.g., Keto, Paleo, Vegan, Vegetarian, Non-Vegetarian).
89
-
90
  Returns:
91
- List[Dict[str, Any]]: A list of recipe dictionaries.
92
  """
93
  query = f"healthy {diet_type} sweet dish recipe with ingredients, instructions, and nutrition facts"
94
 
 
14
 
15
  @tool
16
  def extract_recipe_details(url: str) -> Dict[str, Any]:
17
+ """Extract recipe details including ingredients, instructions, and nutrition from a webpage.
18
+
19
+ url:
20
+ The complete URL of the recipe webpage to scrape.
21
+
 
22
  Returns:
23
+ A dictionary containing ingredients list, cooking instructions, and nutritional information.
 
 
 
24
  """
25
  try:
26
  headers = {"User-Agent": "Mozilla/5.0"}
 
77
 
78
  @tool
79
  def get_healthy_cheat_meal(diet_type: str) -> List[Dict[str, Any]]:
80
+ """Search and extract healthy sweet dish recipes based on diet type.
81
+
82
+ diet_type:
83
+ The specific diet category (e.g., Keto, Paleo, Vegan, Vegetarian, Non-Vegetarian).
84
+
 
85
  Returns:
86
+ A list of recipe dictionaries containing recipe details and instructions.
87
  """
88
  query = f"healthy {diet_type} sweet dish recipe with ingredients, instructions, and nutrition facts"
89