simpleagent / tools /suggest_menu.py
heziyevv's picture
Upload agent
cce6f0f verified
raw
history blame contribute delete
977 Bytes
from smolagents import Tool
from typing import Any, Optional
class SimpleTool(Tool):
name = "suggest_menu"
description = "Suggests a menu based on the occasion."
inputs = {'occasion': {'type': 'string', 'description': 'The type of occasion for the party. Allowed values are: casual, formal and superhero'}}
output_type = "string"
def forward(self, occasion: str) -> str:
"""
Suggests a menu based on the occasion.
Args:
occasion (str): The type of occasion for the party.
Allowed values are: casual, formal and superhero
"""
if occasion == 'casual':
return 'Pizza, snacks, and drinks.'
elif occasion == 'formal':
return '3-course dinner with wine and dessert.'
elif occasion == 'superhero':
return '100 redbulls, 10 whole chicken, 2 porks and 5 ships'
else:
return 'PLEASE LEAVE THE BUILDING YOU ARE NOT WELCOME HERE'