(config)
| 69 | |
| 70 | |
| 71 | def build_tool(config) -> Tool: |
| 72 | tool = Tool( |
| 73 | "google_places", |
| 74 | "Look up for information about places and locations", |
| 75 | name_for_model="google_places", |
| 76 | description_for_model=( |
| 77 | "A tool that query the Google Places API. " |
| 78 | "Useful for when you need to validate or " |
| 79 | "discover addressed from ambiguous text. " |
| 80 | "Input should be a search query." |
| 81 | ), |
| 82 | logo_url="https://your-app-url.com/.well-known/logo.png", |
| 83 | contact_email="hello@contact.com", |
| 84 | legal_info_url="hello@legal.com" |
| 85 | ) |
| 86 | api_wrapper = GooglePlacesAPIWrapper(config["subscription_key"]) |
| 87 | |
| 88 | @tool.get("/search_places") |
| 89 | def search_places(query : str): |
| 90 | """Run Places search.""" |
| 91 | return str(api_wrapper.run(query)) |
| 92 | |
| 93 | return tool |
nothing calls this directly
no test coverage detected