Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -36,6 +36,7 @@ user_input = st.chat_input("Ask Digital Ink..")
|
|
36 |
if user_input:
|
37 |
# Add user message to chat history
|
38 |
st.session_state.messages.append({"role": "user", "content": user_input})
|
|
|
39 |
|
40 |
# Generate response from chatbot
|
41 |
context = [msg['content'] for msg in st.session_state.messages]
|
@@ -43,6 +44,8 @@ if user_input:
|
|
43 |
|
44 |
# Add assistant response to chat history
|
45 |
st.session_state.messages.append({"role": "assistant", "content": response})
|
|
|
|
|
46 |
|
47 |
# Redisplay chat history
|
48 |
st.experimental_rerun()
|
|
|
36 |
if user_input:
|
37 |
# Add user message to chat history
|
38 |
st.session_state.messages.append({"role": "user", "content": user_input})
|
39 |
+
st.chat_state.chat_message("user").markdown(user_input)
|
40 |
|
41 |
# Generate response from chatbot
|
42 |
context = [msg['content'] for msg in st.session_state.messages]
|
|
|
44 |
|
45 |
# Add assistant response to chat history
|
46 |
st.session_state.messages.append({"role": "assistant", "content": response})
|
47 |
+
with st.chat_message("assistant"):
|
48 |
+
st.markdown(response)
|
49 |
|
50 |
# Redisplay chat history
|
51 |
st.experimental_rerun()
|