Spaces:
Sleeping
Sleeping
adrianpierce
commited on
Commit
•
b7ee1cf
1
Parent(s):
5ff038b
Update app.py
Browse files
app.py
CHANGED
@@ -48,16 +48,11 @@ user_inputs = {
|
|
48 |
|
49 |
|
50 |
def generate_recipe(user_inputs):
|
51 |
-
context = """Provide me a recipe based on the user input.
|
52 |
-
- recipe name
|
53 |
-
- serving size
|
54 |
-
- time to make
|
55 |
-
- ingredients list
|
56 |
-
- instructions
|
57 |
Output this in a valid JSON object with the following properties:
|
58 |
recipe_name (string): the name of the recipe
|
59 |
-
recipe_serving_size (string): the serving size of the recipe (example: "
|
60 |
-
recipe_time (string): the amount of time required to make the recipe (example: "
|
61 |
recipe_ingredients (string): python list of ingredients required to make the recipe
|
62 |
recipe_instructions (string): python list of instructions to make the recipe
|
63 |
"""
|
@@ -82,6 +77,12 @@ if st.session_state.gpt_response is not None:
|
|
82 |
st.text(loaded_recipe['recipe_serving_size'])
|
83 |
st.text(loaded_recipe['recipe_time'])
|
84 |
st.subheader("Ingredients:")
|
85 |
-
|
|
|
|
|
|
|
86 |
st.subheader("Instructions:")
|
87 |
-
|
|
|
|
|
|
|
|
48 |
|
49 |
|
50 |
def generate_recipe(user_inputs):
|
51 |
+
context = """Provide me a recipe based on the user input.
|
|
|
|
|
|
|
|
|
|
|
52 |
Output this in a valid JSON object with the following properties:
|
53 |
recipe_name (string): the name of the recipe
|
54 |
+
recipe_serving_size (string): the serving size of the recipe (example: "4 people")
|
55 |
+
recipe_time (string): the amount of time required to make the recipe (example: "60 minutes (Preparation: 20 minutes, Baking: 40 minutes)")
|
56 |
recipe_ingredients (string): python list of ingredients required to make the recipe
|
57 |
recipe_instructions (string): python list of instructions to make the recipe
|
58 |
"""
|
|
|
77 |
st.text(loaded_recipe['recipe_serving_size'])
|
78 |
st.text(loaded_recipe['recipe_time'])
|
79 |
st.subheader("Ingredients:")
|
80 |
+
md_ingredients = ''
|
81 |
+
for ingredient in loaded_recipe['recipe_ingredients']:
|
82 |
+
md_ingredients += "- " + ingredient + "\n"
|
83 |
+
st.markdown(md_ingredients)
|
84 |
st.subheader("Instructions:")
|
85 |
+
md_instructions = ''
|
86 |
+
for instruction in loaded_recipe['recipe_instructions']:
|
87 |
+
md_instructions += "- " + instruction + "\n"
|
88 |
+
st.markdown(md_instructions)
|