Files
agents-from-scratch-ts/python/tools/default/calendar_tools.py
T
2025-04-29 14:58:04 -07:00

18 lines
764 B
Python

from datetime import datetime
from langchain_core.tools import tool
@tool
def schedule_meeting(
attendees: list[str], subject: str, duration_minutes: int, preferred_day: datetime, start_time: int
) -> str:
"""Schedule a calendar meeting."""
# Placeholder response - in real app would check calendar and schedule
date_str = preferred_day.strftime("%A, %B %d, %Y")
return f"Meeting '{subject}' scheduled on {date_str} at {start_time} for {duration_minutes} minutes with {len(attendees)} attendees"
@tool
def check_calendar_availability(day: str) -> str:
"""Check calendar availability for a given day."""
# Placeholder response - in real app would check actual calendar
return f"Available times on {day}: 9:00 AM, 2:00 PM, 4:00 PM"