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

class SimpleTool(Tool):
    name = "give_celebrity_advice"
    description = "Give a web search term based on a vague party description to find a suitable celebrity."
    inputs = {"party_description":{"type":"string","description":"A vague description of the party."}}
    output_type = "string"

    def forward(self, party_description: str) -> str:
        """
        Give a web search term based on a vague party description to find a suitable celebrity.
        Args:
            party_description: A vague description of the party.
        """
        if "hero" in party_description:
            return "Someone who became very famous in the last year for doing a selfless act"
        elif "villain" in party_description:
            return "Someone who is currently the most famous dark metal rock star"
        else:
            return "Someone who has recently become famous for a very funny reason"