Theodore1211 commited on
Commit
f3efe74
Β·
1 Parent(s): 6f68631

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -6
app.py CHANGED
@@ -2,12 +2,11 @@ import streamlit as st
2
  import openai
3
  from PIL import Image
4
  import os
5
- api_key = os.environ['open_ai_api']
6
-
7
 
 
8
  openai.api_key = api_key
9
 
10
- st.set_page_config(page_title="App by Adam", page_icon=":fork_and_knife:", layout="wide")
11
 
12
  messages = [
13
  {"role": "system", "content": "you are a nutritionist and professional chef specializing in the Healthy Keto Diet (70 % fat, 20 % protein, 5 % carbs), no or low sugar, no grains, legumes or beans."},
@@ -23,13 +22,19 @@ def chatbot(input):
23
  messages.append({"role": "assistant", "content": reply})
24
  return reply
25
 
26
- st.title("App by Adam")
27
  st.title("Your Healthy Keto expert")
28
 
29
  # Add image to the sidebar
30
- st.sidebar.image("image.jpg", width=150)
 
 
 
 
 
 
31
 
32
- input_text = st.text_input("Ask me about food πŸ”, nutrition πŸ‰, and illness πŸ€•")
33
  if st.button("Send"):
34
  response = chatbot(input_text)
35
  st.write(response)
 
 
2
  import openai
3
  from PIL import Image
4
  import os
 
 
5
 
6
+ api_key = os.environ['open_ai_api']
7
  openai.api_key = api_key
8
 
9
+ st.set_page_config(page_title="App by Adam", page_icon=":fork_and_knife:")
10
 
11
  messages = [
12
  {"role": "system", "content": "you are a nutritionist and professional chef specializing in the Healthy Keto Diet (70 % fat, 20 % protein, 5 % carbs), no or low sugar, no grains, legumes or beans."},
 
22
  messages.append({"role": "assistant", "content": reply})
23
  return reply
24
 
25
+ st.title("Adam")
26
  st.title("Your Healthy Keto expert")
27
 
28
  # Add image to the sidebar
29
+ st.sidebar.image("image.jpg", width=100, use_column_width=True)
30
+
31
+ # Increase font size for better legibility on mobile devices
32
+ st.markdown("<style>body { font-size: 18px; }</style>", unsafe_allow_html=True)
33
+
34
+ # Use a mobile-friendly input method
35
+ input_text = st.selectbox("Ask me about food πŸ”, nutrition πŸ‰, and illness πŸ€•", ["", "food", "nutrition", "illness"])
36
 
 
37
  if st.button("Send"):
38
  response = chatbot(input_text)
39
  st.write(response)
40
+