party_Agent / tools /party_time.py
eeenn's picture
Upload 6 files
37947df verified
raw
history blame contribute delete
860 Bytes
from smolagents import tool
import datetime
@tool
def estimate_preparation_time(start_time: str = None) -> str:
"""
Estimates total preparation time for a party and returns when everything will be ready.
Args:
start_time (str, optional): Start time in format HH:MM. Defaults to current time.
"""
tasks = {
"Prepare the drinks": 30,
"Decorate the mansion": 60,
"Set up the menu": 45,
"Prepare the music and playlist": 45,
}
total_minutes = sum(tasks.values())
if start_time:
now = datetime.datetime.strptime(start_time, "%H:%M")
else:
now = datetime.datetime.now()
ready_time = now + datetime.timedelta(minutes=total_minutes)
return f"Total prep time: {total_minutes} minutes. The party will be ready at {ready_time.strftime('%H:%M')}."