Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -129,17 +129,14 @@ with chat_container:
|
|
| 129 |
for role, content in st.session_state.messages:
|
| 130 |
with st.chat_message(role):
|
| 131 |
st.markdown(content)
|
| 132 |
-
|
| 133 |
-
col1, col2 = st.columns([4, 1])
|
| 134 |
-
|
| 135 |
# User input at the bottom
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
#
|
| 142 |
-
user_input = st.text_input("Type your message here:", key="user_message")
|
| 143 |
|
| 144 |
# If user submits a message
|
| 145 |
if user_input:
|
|
|
|
| 129 |
for role, content in st.session_state.messages:
|
| 130 |
with st.chat_message(role):
|
| 131 |
st.markdown(content)
|
| 132 |
+
|
|
|
|
|
|
|
| 133 |
# User input at the bottom
|
| 134 |
+
# 🔹 **Fixed Bottom User Input**
|
| 135 |
+
user_input = st.text_input("Type your message here:", key="user_message")
|
| 136 |
+
if st.button("🆕 New Chat"):
|
| 137 |
+
st.session_state.session_id = str(uuid.uuid4()) # Generate new session
|
| 138 |
+
st.session_state.messages = [] # Clear chat history
|
| 139 |
+
st.rerun() # Refresh the app
|
|
|
|
| 140 |
|
| 141 |
# If user submits a message
|
| 142 |
if user_input:
|