Spaces:
Sleeping
Sleeping
Commit
·
5ff038b
1
Parent(s):
39987d9
Update app.py
Browse files
app.py
CHANGED
@@ -69,12 +69,19 @@ def generate_recipe(user_inputs):
|
|
69 |
st.session_state.gpt_response = openai.ChatCompletion.create(
|
70 |
model="gpt-4",
|
71 |
messages=messages,
|
72 |
-
temperature=0.
|
73 |
)
|
74 |
|
75 |
|
76 |
st.button(label='Submit', on_click=generate_recipe, kwargs=dict(user_inputs=user_inputs))
|
77 |
|
78 |
if st.session_state.gpt_response is not None:
|
79 |
-
st.
|
80 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
69 |
st.session_state.gpt_response = openai.ChatCompletion.create(
|
70 |
model="gpt-4",
|
71 |
messages=messages,
|
72 |
+
temperature=0.5
|
73 |
)
|
74 |
|
75 |
|
76 |
st.button(label='Submit', on_click=generate_recipe, kwargs=dict(user_inputs=user_inputs))
|
77 |
|
78 |
if st.session_state.gpt_response is not None:
|
79 |
+
st.divider()
|
80 |
+
loaded_recipe = json.loads(st.session_state.gpt_response['choices'][0]['message']['content'])
|
81 |
+
st.header(loaded_recipe['recipe_name'])
|
82 |
+
st.text(loaded_recipe['recipe_serving_size'])
|
83 |
+
st.text(loaded_recipe['recipe_time'])
|
84 |
+
st.subheader("Ingredients:")
|
85 |
+
st.write(loaded_recipe['recipe_ingredients'])
|
86 |
+
st.subheader("Instructions:")
|
87 |
+
st.write(loaded_recipe['recipe_instructions'])
|