Josedcape commited on
Commit
c7d1381
verified
1 Parent(s): b8ec342

Update pages/galatea_asistente.py

Browse files
Files changed (1) hide show
  1. pages/galatea_asistente.py +5 -5
pages/galatea_asistente.py CHANGED
@@ -12,7 +12,7 @@ st.set_page_config(page_title="Galatea Asistente", layout="wide")
12
  # Funci贸n para inicializar el estado de la sesi贸n
13
  def inicializar_estado():
14
  if 'modelo' not in st.session_state:
15
- st.session_state['modelo'] = "gpt-4"
16
  if 'temperatura' not in st.session_state:
17
  st.session_state['temperatura'] = 0.5
18
  if 'mensajes_chat' not in st.session_state:
@@ -54,7 +54,7 @@ def extraer_texto_pdf(ruta_archivo):
54
  return texto
55
 
56
  # Cargar y preprocesar el texto del PDF predefinido
57
- ruta_pdf_predefinido = "assets/instrucciones.pdf" # Actualiza esta ruta con la ruta real de tu archivo PDF
58
  texto_pdf = extraer_texto_pdf(ruta_pdf_predefinido)
59
  st.session_state['texto_preprocesado_pdf'] = texto_pdf
60
 
@@ -77,7 +77,7 @@ def obtener_respuesta(pregunta, contexto):
77
  try:
78
  response = openai.Completion.create(
79
  model=st.session_state['modelo'],
80
- prompt=f"{contexto}\n\nPregunta: {pregunta}\nRespuesta:",
81
  max_tokens=150,
82
  temperature=st.session_state['temperatura']
83
  )
@@ -100,8 +100,8 @@ st.markdown(
100
  position: absolute;
101
  top: 0;
102
  left: 0;
103
- width: 100%;
104
- height: 100%;
105
  object-fit: cover;
106
  z-index: -1;
107
  }
 
12
  # Funci贸n para inicializar el estado de la sesi贸n
13
  def inicializar_estado():
14
  if 'modelo' not in st.session_state:
15
+ st.session_state['modelo'] = "gpt-3.5-turbo"
16
  if 'temperatura' not in st.session_state:
17
  st.session_state['temperatura'] = 0.5
18
  if 'mensajes_chat' not in st.session_state:
 
54
  return texto
55
 
56
  # Cargar y preprocesar el texto del PDF predefinido
57
+ ruta_pdf_predefinido = "/assets/instrucciones.pdf" # Actualiza esta ruta con la ruta real de tu archivo PDF
58
  texto_pdf = extraer_texto_pdf(ruta_pdf_predefinido)
59
  st.session_state['texto_preprocesado_pdf'] = texto_pdf
60
 
 
77
  try:
78
  response = openai.Completion.create(
79
  model=st.session_state['modelo'],
80
+ prompt=f"Eres Galatea, un auxiliar de odontolog铆a en la cl铆nica odontol贸gica Omardent. Resuelve las inquietudes de los pacientes bas谩ndote en el siguiente contexto:\n\n{contexto}\n\nPregunta: {pregunta}\nRespuesta:",
81
  max_tokens=150,
82
  temperature=st.session_state['temperatura']
83
  )
 
100
  position: absolute;
101
  top: 0;
102
  left: 0;
103
+ width: 90%;
104
+ height: 90%;
105
  object-fit: cover;
106
  z-index: -1;
107
  }