Update app.py
Browse files
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 |
-
#
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
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:
|