ogegadavis254 commited on
Commit
8e32a1c
·
verified ·
1 Parent(s): 152dec0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -5
app.py CHANGED
@@ -72,7 +72,7 @@ def get_streamed_response(message, history):
72
  st.sidebar.title("Raxder unofficial AI")
73
  st.sidebar.write("This is NOT an AI Therapist, use it at your OWN RISK! This might be the worst AI you have ever used.")
74
 
75
- history = []
76
  if "history" not in st.session_state:
77
  st.session_state.history = []
78
 
@@ -84,10 +84,8 @@ user_input = st.text_input("You:", key="user_input")
84
  send_button = st.button("Send")
85
 
86
  if send_button and user_input:
87
- history = st.session_state.history
88
- response = get_streamed_response(user_input, history)
89
- history.append((user_input, response))
90
- st.session_state.history = history
91
 
92
  # Display chat history
93
  with chat_placeholder:
 
72
  st.sidebar.title("Raxder unofficial AI")
73
  st.sidebar.write("This is NOT an AI Therapist, use it at your OWN RISK! This might be the worst AI you have ever used.")
74
 
75
+ # Initialize session state for history
76
  if "history" not in st.session_state:
77
  st.session_state.history = []
78
 
 
84
  send_button = st.button("Send")
85
 
86
  if send_button and user_input:
87
+ response = get_streamed_response(user_input, st.session_state.history)
88
+ st.session_state.history.append((user_input, response))
 
 
89
 
90
  # Display chat history
91
  with chat_placeholder: