hienbm commited on
Commit
b13ca23
·
verified ·
1 Parent(s): d1ec332

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -12
app.py CHANGED
@@ -80,19 +80,12 @@ def get_response(user_query, chat_history):
80
 
81
  return response
82
 
83
- # Create columns for user input and clear chat button
84
- input_col, button_col = st.columns([4, 1])
85
 
86
- # User input
87
- with input_col:
88
- user_query = st.chat_input("Type your message here...")
89
-
90
- # Clear chat history if button is pressed
91
- with button_col:
92
- if st.button("Clear Chat"):
93
- st.session_state.chat_history = [
94
- AIMessage(content="Hello, how can I help you?"),
95
- ]
96
 
97
  # Display chat history
98
  for message in st.session_state.chat_history:
 
80
 
81
  return response
82
 
 
 
83
 
84
+ # Initialize session state
85
+ if "chat_history" not in st.session_state:
86
+ st.session_state.chat_history = [
87
+ AIMessage(content="Hello, how can I help you?"),
88
+ ]
 
 
 
 
 
89
 
90
  # Display chat history
91
  for message in st.session_state.chat_history: