bhulston commited on
Commit
3cbe532
1 Parent(s): b5e58aa

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -1
app.py CHANGED
@@ -60,8 +60,12 @@ units = st.slider(
60
  # with st.chat_message(message["role"]):
61
  # st.markdown(message["content"])
62
 
 
 
 
 
63
  assistant = st.chat_message("assistant")
64
- assistant.write("How can I help you today?")
65
 
66
  def assistant_response(response):
67
  message_placeholder = assistant.empty()
@@ -77,6 +81,8 @@ def assistant_response(response):
77
  # Add assistant response to chat history
78
  st.session_state.messages.append({"role": "assistant", "content": full_response})
79
 
 
 
80
  if prompt := st.chat_input("What kind of class are you looking for?"):
81
  with st.chat_message("user"):
82
  st.markdown(prompt)
 
60
  # with st.chat_message(message["role"]):
61
  # st.markdown(message["content"])
62
 
63
+ for message in st.session_state.messages:
64
+ with st.chat_message(message["role"]):
65
+ st.markdown(message["content"])
66
+
67
  assistant = st.chat_message("assistant")
68
+ initial_message = "How can I help you today?"
69
 
70
  def assistant_response(response):
71
  message_placeholder = assistant.empty()
 
81
  # Add assistant response to chat history
82
  st.session_state.messages.append({"role": "assistant", "content": full_response})
83
 
84
+ assistant_response(initial_message)
85
+
86
  if prompt := st.chat_input("What kind of class are you looking for?"):
87
  with st.chat_message("user"):
88
  st.markdown(prompt)