Perfect7613/codingpartyagent
0
1from smolagents import Tool2from typing import Any, Optional3 4class SimpleTool(Tool):5 name = "catering_service_tool"6 description = "This tool returns the highest-rated catering service in Gotham City."7 inputs = {"query":{"type":"string","description":"A search term for finding catering services."}}8 output_type = "string"9 10 def forward(self, query: str) -> str:11 """12 This tool returns the highest-rated catering service in Gotham City.13 14 Args:15 query: A search term for finding catering services.16 """17 # Example list of catering services and their ratings18 services = {19 "Gotham Catering Co.": 4.9,20 "Wayne Manor Catering": 4.8,21 "Gotham City Events": 4.7,22 }23 24 # Find the highest rated catering service (simulating search query filtering)25 best_service = max(services, key=services.get)26 27 return best_service