Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -56,12 +56,12 @@ def submit_input():
|
|
56 |
st.session_state["input"] = ""
|
57 |
|
58 |
# Chat input (without button, submit on "Enter")
|
59 |
-
st.text_input("
|
60 |
|
61 |
# Display chat history in a chatbox style
|
62 |
st.subheader("Chat History")
|
63 |
for role, text in st.session_state['chat_history']:
|
64 |
if role == "You":
|
65 |
-
st.markdown(f"<div style='text-align: right; color:
|
66 |
else:
|
67 |
st.markdown(f"<div style='text-align: left; color: green;'>{role}: {text}</div>", unsafe_allow_html=True)
|
|
|
56 |
st.session_state["input"] = ""
|
57 |
|
58 |
# Chat input (without button, submit on "Enter")
|
59 |
+
st.text_input("Enter your message:", key="input", on_change=submit_input)
|
60 |
|
61 |
# Display chat history in a chatbox style
|
62 |
st.subheader("Chat History")
|
63 |
for role, text in st.session_state['chat_history']:
|
64 |
if role == "You":
|
65 |
+
st.markdown(f"<div style='text-align: right; color: red;'>{role}: {text}</div>", unsafe_allow_html=True)
|
66 |
else:
|
67 |
st.markdown(f"<div style='text-align: left; color: green;'>{role}: {text}</div>", unsafe_allow_html=True)
|