File size: 945 Bytes
06e81c4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 = "catering_service_tool"
    description = "This tool returns the highest-rated catering service in Gotham City."
    inputs = {"query":{"type":"string","description":"A search term for finding catering services."}}
    output_type = "string"

    def forward(self, query: str) -> str:
        """
        This tool returns the highest-rated catering service in Gotham City.

        Args:
            query: A search term for finding catering services.
        """
        # Example list of catering services and their ratings
        services = {
            "Gotham Catering Co.": 4.9,
            "Wayne Manor Catering": 4.8,
            "Gotham City Events": 4.7,
        }

        # Find the highest rated catering service (simulating search query filtering)
        best_service = max(services, key=services.get)

        return best_service