File size: 884 Bytes
6bcb4d7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
from smolagents import Tool
from typing import Any, Optional

class SimpleTool(Tool):
    name = "give_menu_advice"
    description = "Give menu advice based on a vague occasion description."
    inputs = {"formality":{"type":"string","description":"A vague formality description for the party."}}
    output_type = "string"

    def forward(self, formality: str) -> str:
        """
        Give menu advice based on a vague occasion description.
        Args:
            formality: A vague formality description for the party.
        """
        if "casual" in formality:
            return "Pizza, snacks, and drinks."
        elif "formal" in formality:
            return "3-course dinner with wine and dessert."
        elif "superhero" in formality:
            return "Buffet with high-energy and healthy food."
        else:
            return "Custom menu for the butler."