File size: 795 Bytes
3ef6c79
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 = "suggest_menu"
    description = "Suggests a menu based on the occassion."
    inputs = {"occassion":{"type":"string","description":"The type of occassion for the party."}}
    output_type = "string"

    def forward(self, occassion: str) -> str:
      """
      Suggests a menu based on the occassion.
      Args:
        occassion: The type of occassion for the party.
      """
      if occassion == "casual":
        return "Pizza, snacks and drinks."
      elif occassion == "formal":
        return "3-course dinner with wine and dessert."
      elif occassion == "superhero":
        return "Buffet with high energy and healthy food."
      else:
        return "Custom menu for the bulter."