Update app.py
Browse files
app.py
CHANGED
@@ -80,17 +80,19 @@ def get_response(user_query, chat_history):
|
|
80 |
|
81 |
return response
|
82 |
|
83 |
-
#
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
|
|
88 |
|
89 |
# Clear chat history if button is pressed
|
90 |
-
|
91 |
-
st.
|
92 |
-
|
93 |
-
|
|
|
94 |
|
95 |
# Display chat history
|
96 |
for message in st.session_state.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:
|