Spaces:
Sleeping
Sleeping
| # tools.py | |
| # Additional tools for Alfred the Gala Agent | |
| from smolagents import tool | |
| import datetime | |
| def get_current_time() -> str: | |
| """ | |
| Gets the current date and time. | |
| Use this when you need to know what time it is for scheduling or time-related questions. | |
| Returns: | |
| The current date and time as a formatted string | |
| """ | |
| now = datetime.datetime.now() | |
| return f"Current date and time: {now.strftime('%A, %B %d, %Y at %I:%M %p')}" | |
| def calculate_party_budget( | |
| num_guests: int, | |
| cost_per_guest: float, | |
| venue_cost: float, | |
| entertainment_cost: float | |
| ) -> str: | |
| """ | |
| Calculate the total budget needed for the gala party. | |
| Args: | |
| num_guests: Number of guests attending | |
| cost_per_guest: Cost per guest (food, drinks, favors) | |
| venue_cost: Cost of the venue rental | |
| entertainment_cost: Cost of entertainment (DJ, dancers, etc.) | |
| Returns: | |
| A breakdown of the party budget | |
| """ | |
| guest_total = num_guests * cost_per_guest | |
| total = guest_total + venue_cost + entertainment_cost | |
| return f""" | |
| π GALA BUDGET BREAKDOWN π | |
| βββββββββββββββββββββββββ | |
| Guests: {num_guests} Γ ${cost_per_guest:.2f} = ${guest_total:.2f} | |
| Venue: ${venue_cost:.2f} | |
| Entertainment: ${entertainment_cost:.2f} | |
| βββββββββββββββββββββββββ | |
| TOTAL: ${total:.2f} | |
| """ | |
| def suggest_seating_arrangement(guest_names: str, table_size: int) -> str: | |
| """ | |
| Suggest a seating arrangement for guests. | |
| Args: | |
| guest_names: Comma-separated list of guest names | |
| table_size: Number of seats per table | |
| Returns: | |
| A suggested seating arrangement | |
| """ | |
| guests = [name.strip() for name in guest_names.split(",")] | |
| num_guests = len(guests) | |
| num_tables = (num_guests + table_size - 1) // table_size | |
| arrangement = "πͺ SEATING ARRANGEMENT πͺ\n" | |
| arrangement += "β" * 30 + "\n" | |
| for table_num in range(num_tables): | |
| start_idx = table_num * table_size | |
| end_idx = min(start_idx + table_size, num_guests) | |
| table_guests = guests[start_idx:end_idx] | |
| arrangement += f"\nπ Table {table_num + 1}:\n" | |
| for guest in table_guests: | |
| arrangement += f" β’ {guest}\n" | |
| return arrangement | |
| def dietary_check(dietary_requirement: str) -> str: | |
| """ | |
| Check common dietary requirements and suggest menu options. | |
| Args: | |
| dietary_requirement: The dietary requirement to check (e.g., vegetarian, vegan, gluten-free, halal, kosher) | |
| Returns: | |
| Menu suggestions for the dietary requirement | |
| """ | |
| menus = { | |
| "vegetarian": """ | |
| π₯ VEGETARIAN MENU OPTIONS: | |
| β’ Stuffed bell peppers with quinoa | |
| β’ Mushroom risotto | |
| β’ Caprese salad with fresh mozzarella | |
| β’ Vegetable lasagna | |
| β’ Spinach and ricotta ravioli | |
| """, | |
| "vegan": """ | |
| π± VEGAN MENU OPTIONS: | |
| β’ Grilled vegetable platter | |
| β’ Coconut curry with tofu | |
| β’ Mediterranean mezze board | |
| β’ Mushroom and walnut "meatballs" | |
| β’ Fresh fruit tart with coconut cream | |
| """, | |
| "gluten-free": """ | |
| πΎ GLUTEN-FREE MENU OPTIONS: | |
| β’ Grilled salmon with herb butter | |
| β’ Rice paper spring rolls | |
| β’ Quinoa stuffed tomatoes | |
| β’ Flourless chocolate cake | |
| β’ Fresh fruit platter | |
| """, | |
| "halal": """ | |
| π HALAL MENU OPTIONS: | |
| β’ Lamb kofta with yogurt sauce | |
| β’ Chicken shawarma | |
| β’ Beef kebabs with rice pilaf | |
| β’ Baklava dessert | |
| β’ Fresh salads | |
| """, | |
| "kosher": """ | |
| β‘οΈ KOSHER MENU OPTIONS: | |
| β’ Roasted chicken with vegetables | |
| β’ Gefilte fish appetizer | |
| β’ Matzo ball soup | |
| β’ Brisket with roasted potatoes | |
| β’ Honey cake dessert | |
| """ | |
| } | |
| requirement_lower = dietary_requirement.lower() | |
| if requirement_lower in menus: | |
| return menus[requirement_lower] | |
| else: | |
| return f"I don't have specific menu suggestions for '{dietary_requirement}'. Please consult with the catering team for custom options." |