Mapu25 commited on
Commit
1bf5e43
·
verified ·
1 Parent(s): 590db40

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -4
app.py CHANGED
@@ -150,13 +150,22 @@ def generar_link_primo(consulta):
150
  return f"{base_url}?{urllib.parse.urlencode(params)}"
151
 
152
  # 🤖 Función principal
 
 
 
 
 
 
 
 
153
  def responder(mensaje, historial):
154
  mensaje = mensaje.lower().strip()
155
 
 
 
156
  saludo = ""
157
  respuesta = ""
158
 
159
- # 👋 SALUDO
160
  if any(s in mensaje for s in ["hola", "buenas", "buenos días", "buenas tardes"]):
161
  saludo = "¡Hola! 😊\n\n"
162
 
@@ -180,8 +189,8 @@ def responder(mensaje, historial):
180
  if any(p in mensaje for p in ["horario", "hora", "abren", "cierran", "trabajan"]):
181
  respuesta += """📚 Nuestro horario es:
182
 
183
- Campus Tecnológico: Lunes a viernes 7am - 7pm / Sábados 8am - 12m
184
- Casa Lemaitre: Lunes a jueves 7am - 5pm / Viernes 7am - 6pm / Sábado 8am - 2pm
185
 
186
  """
187
 
@@ -226,7 +235,7 @@ Casa Lemaitre: Lunes a jueves 7am - 5pm / Viernes 7am - 6pm / Sábado 8am - 2pm
226
 
227
  👉 [Ir al catálogo](https://primo.utb.edu.co/discovery/search?vid=57UTB_INST:57UTB_INST)
228
 
229
- 🎥 Video guía:
230
  👉 [Ver video](https://www.youtube.com/watch?v=ahmo6iLG2Es&t=141s)
231
 
232
  """
 
150
  return f"{base_url}?{urllib.parse.urlencode(params)}"
151
 
152
  # 🤖 Función principal
153
+ def dividir_intenciones(texto):
154
+ separadores = [" y ", ",", " tambien ", " también "]
155
+
156
+ for sep in separadores:
157
+ if sep in texto:
158
+ return [t.strip() for t in texto.split(sep)]
159
+
160
+ return [texto]
161
  def responder(mensaje, historial):
162
  mensaje = mensaje.lower().strip()
163
 
164
+ partes = dividir_intenciones(mensaje) #
165
+
166
  saludo = ""
167
  respuesta = ""
168
 
 
169
  if any(s in mensaje for s in ["hola", "buenas", "buenos días", "buenas tardes"]):
170
  saludo = "¡Hola! 😊\n\n"
171
 
 
189
  if any(p in mensaje for p in ["horario", "hora", "abren", "cierran", "trabajan"]):
190
  respuesta += """📚 Nuestro horario es:
191
 
192
+ Campus Tecnológico: Lunes a viernes: 7am - 7pm / Sábados: 8am - 12m
193
+ Casa Lemaitre: Lunes a jueves: 7am - 5pm / Viernes: 7am - 6pm / Sábado: 8am - 2pm
194
 
195
  """
196
 
 
235
 
236
  👉 [Ir al catálogo](https://primo.utb.edu.co/discovery/search?vid=57UTB_INST:57UTB_INST)
237
 
238
+ 🎥 Video guía (minuto 2:21):
239
  👉 [Ver video](https://www.youtube.com/watch?v=ahmo6iLG2Es&t=141s)
240
 
241
  """