Update pages/trabajos.py
Browse files- pages/trabajos.py +10 -5
pages/trabajos.py
CHANGED
|
@@ -1,10 +1,10 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
-
from utils.data_manager import flujo_laboratorio
|
| 3 |
|
| 4 |
def show():
|
| 5 |
-
st.title("馃Ψ Gesti贸n de Trabajos de Laboratorio")
|
| 6 |
flujo_laboratorio()
|
| 7 |
-
|
|
|
|
| 8 |
st.session_state['mostrar_chat'] = False
|
| 9 |
|
| 10 |
def mostrar_chat():
|
|
@@ -30,14 +30,19 @@ if 'mostrar_chat' not in st.session_state:
|
|
| 30 |
margin-right: 10px;
|
| 31 |
}
|
| 32 |
</style>
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
""",
|
| 34 |
unsafe_allow_html=True
|
| 35 |
)
|
| 36 |
|
| 37 |
-
if st.button("
|
| 38 |
mostrar_chat()
|
| 39 |
|
| 40 |
if st.session_state['mostrar_chat']:
|
|
|
|
| 41 |
st.markdown("### Chat con Asistente")
|
| 42 |
pregunta_usuario = st.text_input("Escribe tu pregunta aqu铆:")
|
| 43 |
if st.button("Enviar Pregunta"):
|
|
@@ -46,6 +51,6 @@ if 'mostrar_chat' not in st.session_state:
|
|
| 46 |
"", # No se necesita texto preprocesado en este caso
|
| 47 |
st.session_state['modelo'],
|
| 48 |
st.session_state['temperatura'],
|
| 49 |
-
st.session_state.get('assistant_id', '')
|
| 50 |
)
|
| 51 |
st.markdown(f"**Asistente**: {respuesta}")
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
+
from utils.data_manager import flujo_laboratorio, obtener_respuesta
|
| 3 |
|
| 4 |
def show():
|
|
|
|
| 5 |
flujo_laboratorio()
|
| 6 |
+
|
| 7 |
+
if 'mostrar_chat' not in st.session_state:
|
| 8 |
st.session_state['mostrar_chat'] = False
|
| 9 |
|
| 10 |
def mostrar_chat():
|
|
|
|
| 30 |
margin-right: 10px;
|
| 31 |
}
|
| 32 |
</style>
|
| 33 |
+
<button class="assistant-button" onclick="window.location.href='#assistant_chat'">
|
| 34 |
+
<img src='https://img2.gratispng.com/20180808/cxq/kisspng-robotics-science-computer-icons-robot-technology-robo-to-logo-svg-png-icon-free-download-45527-5b6baa46a5e322.4713113715337825986795.jpg' alt='icon' width='20' height='20'/>
|
| 35 |
+
Hablar con Asistente
|
| 36 |
+
</button>
|
| 37 |
""",
|
| 38 |
unsafe_allow_html=True
|
| 39 |
)
|
| 40 |
|
| 41 |
+
if st.button("Mostrar Chat", key="assistant_button"):
|
| 42 |
mostrar_chat()
|
| 43 |
|
| 44 |
if st.session_state['mostrar_chat']:
|
| 45 |
+
st.markdown("<div id='assistant_chat'></div>", unsafe_allow_html=True)
|
| 46 |
st.markdown("### Chat con Asistente")
|
| 47 |
pregunta_usuario = st.text_input("Escribe tu pregunta aqu铆:")
|
| 48 |
if st.button("Enviar Pregunta"):
|
|
|
|
| 51 |
"", # No se necesita texto preprocesado en este caso
|
| 52 |
st.session_state['modelo'],
|
| 53 |
st.session_state['temperatura'],
|
| 54 |
+
st.session_state.get('assistant_id', 'asst_KngkX6sbRccg5a6fcnDHO06R')
|
| 55 |
)
|
| 56 |
st.markdown(f"**Asistente**: {respuesta}")
|