File size: 1,231 Bytes
024678c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
from smolagents import Tool
from typing import Any, Optional

class SimpleTool(Tool):
    name = "suggest_menu"
    description = "Suggests a menu based on the occations."
    inputs = {'occation': {'type': 'string', 'description': 'The type of occation for the party. allowed values are: - "casual": Menu for casual party. - "formal": Menu for formal party. - "superhero": Menu for superhero party. - "custom"" Custom menu.'}}
    output_type = "string"

    def forward(self, occation: str) -> str:
        """

        Suggests a menu based on the occations.

        Args:

            occation (str): The type of occation for the party. allowed values are:

                - "casual": Menu for casual party.

                - "formal": Menu for formal party.

                - "superhero": Menu for superhero party.

                - "custom"" Custom menu.

        """
        if occation == "casual":
            return "Pizza, snacks, and drinks"
        if occation == "formal":
            return "3-couse dinner with wine and dessert."
        if occation == "superhero":
            return "Buffet with high-energy and healthy food."
        else :
            return "Custom menu for the butler."