Update app.py
Browse files
app.py
CHANGED
@@ -420,13 +420,13 @@ def recommendation_node(query):
|
|
420 |
"recipe_time": integer,
|
421 |
"recipe_yields": string,
|
422 |
"recipe_ingredients": list of ingredients,
|
423 |
-
"recipe_instructions": list of
|
424 |
"recipe_image": string,
|
425 |
"blogger": string,
|
426 |
-
"recipe_nutrients": JSON object with key
|
427 |
-
"tags": list of tags related to recipe
|
428 |
} \n
|
429 |
-
Here is the example of
|
430 |
{
|
431 |
"recipe_name": "Asian Potato Salad with Seven Minute Egg",
|
432 |
"recipe_time": 0,
|
@@ -507,13 +507,13 @@ def recommendation_node(query):
|
|
507 |
res = json.loads(content)
|
508 |
script = res['code']
|
509 |
exec(script, globals())
|
510 |
-
filtered_recipes = filter_recipes('
|
511 |
if len(filtered_recipes) > 0:
|
512 |
return filtered_recipes
|
513 |
except Exception as e:
|
514 |
print(e)
|
515 |
if max_tries <= 0:
|
516 |
-
return []
|
517 |
else:
|
518 |
max_tries -= 1
|
519 |
return filtered_recipes
|
|
|
420 |
"recipe_time": integer,
|
421 |
"recipe_yields": string,
|
422 |
"recipe_ingredients": list of ingredients,
|
423 |
+
"recipe_instructions": list of instructions,
|
424 |
"recipe_image": string,
|
425 |
"blogger": string,
|
426 |
+
"recipe_nutrients": JSON object with key-value pairs such as "protein: 10g",
|
427 |
+
"tags": list of tags related to a recipe
|
428 |
} \n
|
429 |
+
Here is the example of a recipe json object from the JSON data: \n
|
430 |
{
|
431 |
"recipe_name": "Asian Potato Salad with Seven Minute Egg",
|
432 |
"recipe_time": 0,
|
|
|
507 |
res = json.loads(content)
|
508 |
script = res['code']
|
509 |
exec(script, globals())
|
510 |
+
filtered_recipes = filter_recipes('my_recipes.json')
|
511 |
if len(filtered_recipes) > 0:
|
512 |
return filtered_recipes
|
513 |
except Exception as e:
|
514 |
print(e)
|
515 |
if max_tries <= 0:
|
516 |
+
return [{"content": "max-retries reach"}]
|
517 |
else:
|
518 |
max_tries -= 1
|
519 |
return filtered_recipes
|