tonyliu404 commited on
Commit
a379ca0
·
verified ·
1 Parent(s): 741d587

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +20 -17
app.py CHANGED
@@ -268,23 +268,26 @@ def display_response(response):
268
  # Convert JSON string to dictionary if necessary
269
  response = json.loads(response)
270
 
271
- stx.scrollableTextbox(f"""
272
- **Name:** {response['name'].capitalize()}
273
- **Preparation Time:** {response['minutes']} minutes
274
- **Description:** {response['description'].capitalize()}
275
- **Tags:** {', '.join(response['tags'])}
276
-
277
- ### Ingredients
278
- {", ".join([ingredient.capitalize() for ingredient in response['ingredients']])}
279
- **Total Ingredients:** {response['n_ingredients']}
280
-
281
- ### Nutrition Information (per serving)
282
- {", ".join(response['formatted_nutrition'])}
283
- **Number of Steps:** {response['n_steps']}
284
-
285
- ### Steps
286
- {chr(10).join([capitalize_after_number(step) for step in response['formatted_steps']])}
287
- """)
 
 
 
288
 
289
  def display_dishes_in_grid(dishes, cols=3):
290
  rows = len(dishes) // cols + int(len(dishes) % cols > 0)
 
268
  # Convert JSON string to dictionary if necessary
269
  response = json.loads(response)
270
 
271
+ stx.scrollableTextbox(
272
+ st.markdown(f"""
273
+ **Name:** {response['name'].capitalize()}
274
+ **Preparation Time:** {response['minutes']} minutes
275
+ **Description:** {response['description'].capitalize()}
276
+ **Tags:** {', '.join(response['tags'])}
277
+
278
+ ### Ingredients
279
+ {", ".join([ingredient.capitalize() for ingredient in response['ingredients']])}
280
+ **Total Ingredients:** {response['n_ingredients']}
281
+
282
+ ### Nutrition Information (per serving)
283
+ {", ".join(response['formatted_nutrition'])}
284
+ **Number of Steps:** {response['n_steps']}
285
+
286
+ ### Steps
287
+ {chr(10).join([capitalize_after_number(step) for step in response['formatted_steps']])}
288
+ """),
289
+ height=800
290
+ )
291
 
292
  def display_dishes_in_grid(dishes, cols=3):
293
  rows = len(dishes) // cols + int(len(dishes) % cols > 0)