diff --git a/src/naliiabot/bot/tools/naliia_tools.py b/src/naliiabot/bot/tools/naliia_tools.py index 770c184..7e2af21 100644 --- a/src/naliiabot/bot/tools/naliia_tools.py +++ b/src/naliiabot/bot/tools/naliia_tools.py @@ -1,5 +1,5 @@ import asyncio -from datetime import datetime +from datetime import datetime, timedelta, timezone from zoneinfo import ZoneInfo @@ -11,7 +11,7 @@ from .schemes import ScheduleSchema TIMEZONE = "America/Bogota" -MCP_SERVER_URL = "http://localhost:8000/mcp" +MCP_SERVER_URL = "http://localhost:8001/mcp" _MCP_CLIENT = Client(MCP_SERVER_URL) @@ -27,6 +27,18 @@ class NaliiaTools: self.schedule_appointment ] + @tool + def get_tomorrow_date() -> str: + """ + Consulta la fecha y hora actual del sistema y calcula la fecha del dia de maƱana. + Retorna la fecha en formato ISO 8601. No se aceptan fechas en el pasado con respecto a esta fecha. + """ + + td = timedelta(days=1) + tomorrow = datetime.now().date + td + + return tomorrow + @tool def get_current_datetime() -> str: """ @@ -47,21 +59,23 @@ class NaliiaTools: """ Permite al Cliente al Agendar una Cita """ - logger.info("Agendando cita.") - logger.info([ - schedule_date, - schedule_time, - service_center, - customer, - professional, - description - ]) + logger.info("Agendando cita...") + if not schedule_date and schedule_time: + return False + + schedule = datetime.combine( + schedule_date, + schedule_time + ).replace( + tzinfo=timezone.utc + ).isoformat() + example_schedule = { 'professional': 6, - 'description': "Bien Bonito Todo!", + 'description': description, 'customer': 4, - 'date': '2026-03-25 14:00', + 'date': schedule, 'service_center': 11 }