larimei commited on
Commit
db088a7
1 Parent(s): 68331a9

updated recipeAI return

Browse files
Files changed (1) hide show
  1. app.py +7 -3
app.py CHANGED
@@ -40,7 +40,7 @@ def getRecipe(meal):
40
 
41
  json_formatted_str = json.dumps(json_object["hits"][0], indent=2) #nur das erste der 20 aus der liste
42
 
43
- #print(json_formatted_str)
44
  #print(json_object)
45
 
46
  #whole response
@@ -49,8 +49,12 @@ def getRecipe(meal):
49
  #just one result
50
  #return json_object["hits"][0]
51
 
52
- #just one result
53
- return json_object["hits"][0]["recipe"]["ingredientLines"]
 
 
 
 
54
 
55
  title = "Recipifier"
56
  description = "blablabla"
 
40
 
41
  json_formatted_str = json.dumps(json_object["hits"][0], indent=2) #nur das erste der 20 aus der liste
42
 
43
+ print(json_formatted_str)
44
  #print(json_object)
45
 
46
  #whole response
 
49
  #just one result
50
  #return json_object["hits"][0]
51
 
52
+ returnString = "This is " + json_object["hits"][0]["recipe"]["label"] + ". \n\n It is Made out of following ingredients: \n\n"
53
+ for line in json_object["hits"][0]["recipe"]["ingredientLines"]:
54
+ returnString += line + "\n"
55
+ returnString += "\n You can make it yourself by following the steps of this instruction: " + json_object["hits"][0]["recipe"]["url"]
56
+
57
+ return returnString
58
 
59
  title = "Recipifier"
60
  description = "blablabla"