mirror of
https://github.com/langchain-ai/agents-from-scratch-ts.git
synced 2026-07-01 21:34:00 -04:00
18 lines
764 B
Python
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"
|