tushar310 commited on
Commit
895f545
·
1 Parent(s): f7c2c68
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -10,6 +10,9 @@ if "openai_model" not in st.session_state:
10
  # if "messages" not in st.session_state:
11
  # st.session_state.messages = []
12
 
 
 
 
13
  for message in st.session_state.messages:
14
  with st.chat_message(message["role"]):
15
  st.markdown(message["content"])
@@ -45,5 +48,3 @@ if prompt := st.chat_input("What is up?"):
45
  message_placeholder.markdown(full_response)
46
  st.session_state.messages.append({"role": "assistant", "content": full_response})
47
 
48
- if "messages" not in st.session_state or st.sidebar.button("Clear message history"):
49
- st.session_state["messages"] = [{"role": "assistant", "content": "How can I help you?"}]
 
10
  # if "messages" not in st.session_state:
11
  # st.session_state.messages = []
12
 
13
+ if "messages" not in st.session_state or st.sidebar.button("Clear message history"):
14
+ st.session_state["messages"] = [{"role": "assistant", "content": "How can I help you?"}]
15
+
16
  for message in st.session_state.messages:
17
  with st.chat_message(message["role"]):
18
  st.markdown(message["content"])
 
48
  message_placeholder.markdown(full_response)
49
  st.session_state.messages.append({"role": "assistant", "content": full_response})
50