MCPcopy Create free account
hub / github.com/OpenBMB/BMTools / build_tool

Function build_tool

bmtools/tools/google_places/api.py:71–93  ·  view source on GitHub ↗
(config)

Source from the content-addressed store, hash-verified

69
70
71def 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

Callers

nothing calls this directly

Calls 2

ToolClass · 0.50

Tested by

no test coverage detected