Update modules/ui.py
Browse files- modules/ui.py +10 -9
modules/ui.py
CHANGED
|
@@ -440,15 +440,16 @@ def display_chatbot_interface(lang_code):
|
|
| 440 |
st.write(user_input)
|
| 441 |
|
| 442 |
# Generar y mostrar respuesta del chatbot
|
| 443 |
-
with
|
| 444 |
-
with st.
|
| 445 |
-
|
| 446 |
-
|
| 447 |
-
|
| 448 |
-
|
| 449 |
-
|
| 450 |
-
|
| 451 |
-
|
|
|
|
| 452 |
# Agregar respuesta del asistente a los mensajes
|
| 453 |
st.session_state.messages.append({"role": "assistant", "content": response})
|
| 454 |
|
|
|
|
| 440 |
st.write(user_input)
|
| 441 |
|
| 442 |
# Generar y mostrar respuesta del chatbot
|
| 443 |
+
with chat_container:
|
| 444 |
+
with st.chat_message("assistant"):
|
| 445 |
+
message_placeholder = st.empty()
|
| 446 |
+
full_response = ""
|
| 447 |
+
|
| 448 |
+
for chunk in get_chatbot_response(st.session_state.chatbot, prompt, lang_code):
|
| 449 |
+
full_response += chunk
|
| 450 |
+
message_placeholder.markdown(full_response + "▌")
|
| 451 |
+
message_placeholder.markdown(full_response)
|
| 452 |
+
|
| 453 |
# Agregar respuesta del asistente a los mensajes
|
| 454 |
st.session_state.messages.append({"role": "assistant", "content": response})
|
| 455 |
|