talltree commited on
Commit
31652af
β€’
1 Parent(s): 9d73031

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -6
app.py CHANGED
@@ -7,7 +7,8 @@ from rag_chain.chain import get_rag_chain
7
  # Streamlit page configuration
8
  st.set_page_config(page_title="Tall Tree Integrated Health",
9
  page_icon="πŸ’¬",
10
- layout="centered")
 
11
 
12
  # Streamlit CSS configuration
13
 
@@ -16,7 +17,7 @@ with open("styles/styles.css") as css:
16
 
17
  # Error message templates
18
  base_error_message = (
19
- "Oops! Something went wrong while processing your request:\n\n{}\n\n"
20
  "Please refresh the page or try again later.\n\n"
21
  "If the error persists, please contact us at "
22
  "[Tall Tree Health](https://www.talltreehealth.ca/contact-us)."
@@ -39,7 +40,7 @@ def get_chain_and_memory():
39
  return get_rag_chain(model_name="gpt-4", temperature=0.2)
40
 
41
  except Exception as e:
42
- st.warning(base_error_message.format(e), icon="πŸ™")
43
  st.stop()
44
 
45
 
@@ -58,11 +59,12 @@ with st.container(border=False):
58
  # Set the welcome message
59
  st.markdown(
60
  "Hello there! πŸ‘‹ Need help finding the right service or practitioner? Let our AI-powered assistant give you a hand.\n\n"
61
- "To get started, please select your preferred location and enter your message. "
62
  )
63
  location = st.radio(
64
  "**Our Locations**:",
65
- ["Cordova Bay - Victoria", "James Bay - Victoria", "Comercial Drive - Vancouver"],
 
66
  index=None, horizontal=False,
67
  )
68
 
@@ -79,6 +81,7 @@ if location:
79
  ChatMessage(role="user", content=user_input))
80
  prompt = f"{user_input}\nLocation: {location}"
81
 
 
82
  # Display previous messages
83
 
84
  user_avatar = "images/user.png"
@@ -111,7 +114,7 @@ if prompt:
111
  st.warning(openai_api_error_message, icon="πŸ™")
112
  st.stop()
113
  except Exception as e:
114
- st.warning(base_error_message.format(e), icon="πŸ™")
115
  st.stop()
116
  message_placeholder.markdown(partial_message)
117
 
 
7
  # Streamlit page configuration
8
  st.set_page_config(page_title="Tall Tree Integrated Health",
9
  page_icon="πŸ’¬",
10
+ layout="centered",
11
+ initial_sidebar_state="collapsed")
12
 
13
  # Streamlit CSS configuration
14
 
 
17
 
18
  # Error message templates
19
  base_error_message = (
20
+ "Oops! Something went wrong while processing your request. "
21
  "Please refresh the page or try again later.\n\n"
22
  "If the error persists, please contact us at "
23
  "[Tall Tree Health](https://www.talltreehealth.ca/contact-us)."
 
40
  return get_rag_chain(model_name="gpt-4", temperature=0.2)
41
 
42
  except Exception as e:
43
+ st.warning(base_error_message, icon="πŸ™")
44
  st.stop()
45
 
46
 
 
59
  # Set the welcome message
60
  st.markdown(
61
  "Hello there! πŸ‘‹ Need help finding the right service or practitioner? Let our AI-powered assistant give you a hand.\n\n"
62
+ "To get started, please select your preferred location and share details about your symptoms or needs. "
63
  )
64
  location = st.radio(
65
  "**Our Locations**:",
66
+ ["Cordova Bay - Victoria", "James Bay - Victoria",
67
+ "Comercial Drive - Vancouver"],
68
  index=None, horizontal=False,
69
  )
70
 
 
81
  ChatMessage(role="user", content=user_input))
82
  prompt = f"{user_input}\nLocation: {location}"
83
 
84
+
85
  # Display previous messages
86
 
87
  user_avatar = "images/user.png"
 
114
  st.warning(openai_api_error_message, icon="πŸ™")
115
  st.stop()
116
  except Exception as e:
117
+ st.warning(base_error_message, icon="πŸ™")
118
  st.stop()
119
  message_placeholder.markdown(partial_message)
120