test_agent / tools /suggest_menu.py
cmncomp's picture
Upload agent
65a0ac6 verified
raw
history blame contribute delete
958 Bytes
from smolagents import Tool
from typing import Any, Optional
class SimpleTool(Tool):
name = "suggest_menu"
description = "Suggest a menu based on the occasion type."
inputs = {'occasion': {'type': 'string', 'description': 'The type of occasion (casual, formal, superhero, or other)'}}
output_type = "string"
def forward(self, occasion: str) -> str:
"""Suggest a menu based on the occasion type.
Args:
occasion: The type of occasion (casual, formal, superhero, or other)
Returns:
A string describing the suggested menu for the occasion
"""
if occasion == "casual":
return "Pizza, snacks, and drinks."
elif occasion == "formal":
return "3-course dinner with wine and dessert."
elif occasion == "superhero":
return "Buffet with high-energy and healthy food."
else:
return "Custom menu for the butler."