Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -53,7 +53,24 @@ st.markdown("""
|
|
| 53 |
color: #000000;
|
| 54 |
margin-bottom: 20px;
|
| 55 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 56 |
</style>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 57 |
""", unsafe_allow_html=True)
|
| 58 |
|
| 59 |
|
|
@@ -105,7 +122,7 @@ for sender, message in st.session_state.chat_history:
|
|
| 105 |
st.markdown(f'<div class="chat-box bot"> {message}</div>', unsafe_allow_html=True)
|
| 106 |
|
| 107 |
|
| 108 |
-
st.text_input("How may I assist you today?: [Press Enter to submit]", key="user_input", on_change=handle_chat)
|
| 109 |
|
| 110 |
# with st.form(key='chat_form'):
|
| 111 |
# user_input = st.text_input("How may I assist you today?", key="user_input")
|
|
@@ -114,3 +131,8 @@ st.text_input("How may I assist you today?: [Press Enter to submit]", key="user_
|
|
| 114 |
# if submit_button and user_input:
|
| 115 |
# handle_chat(user_input)
|
| 116 |
# st.session_state['user_input'] = ''
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 53 |
color: #000000;
|
| 54 |
margin-bottom: 20px;
|
| 55 |
}
|
| 56 |
+
.input-container {
|
| 57 |
+
display: flex;
|
| 58 |
+
align-items: center;
|
| 59 |
+
}
|
| 60 |
+
.input-field {
|
| 61 |
+
flex: 1;
|
| 62 |
+
margin-right: 10px;
|
| 63 |
+
}
|
| 64 |
+
.submit-btn {
|
| 65 |
+
cursor: pointer;
|
| 66 |
+
}
|
| 67 |
</style>
|
| 68 |
+
<script>
|
| 69 |
+
function submitForm() {
|
| 70 |
+
const input = document.getElementById('user_input');
|
| 71 |
+
input.dispatchEvent(new Event('change', { bubbles: true }));
|
| 72 |
+
}
|
| 73 |
+
</script>
|
| 74 |
""", unsafe_allow_html=True)
|
| 75 |
|
| 76 |
|
|
|
|
| 122 |
st.markdown(f'<div class="chat-box bot"> {message}</div>', unsafe_allow_html=True)
|
| 123 |
|
| 124 |
|
| 125 |
+
# st.text_input("How may I assist you today?: [Press Enter to submit]", key="user_input", on_change=handle_chat)
|
| 126 |
|
| 127 |
# with st.form(key='chat_form'):
|
| 128 |
# user_input = st.text_input("How may I assist you today?", key="user_input")
|
|
|
|
| 131 |
# if submit_button and user_input:
|
| 132 |
# handle_chat(user_input)
|
| 133 |
# st.session_state['user_input'] = ''
|
| 134 |
+
|
| 135 |
+
st.markdown('<div class="input-container">', unsafe_allow_html=True)
|
| 136 |
+
st.text_input("How may I assist you today?: [Press Enter to submit]", key="user_input", on_change=handle_chat, placeholder="Type your message here", label_visibility="collapsed")
|
| 137 |
+
st.markdown('<img src="https://example.com/submit.png" class="submit-btn" onclick="submitForm()">', unsafe_allow_html=True)
|
| 138 |
+
st.markdown('</div>', unsafe_allow_html=True)
|