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

Function load_single_tools

bmtools/agent/singletool.py:43–63  ·  view source on GitHub ↗
(tool_name, tool_url)

Source from the content-addressed store, hash-verified

41 return all_apis
42
43def load_single_tools(tool_name, tool_url):
44
45 # tool_name, tool_url = "datasette", "https://datasette.io/"
46 # tool_name, tool_url = "klarna", "https://www.klarna.com/"
47 # tool_name, tool_url = 'chemical-prop', "http://127.0.0.1:8079/tools/chemical-prop/"
48 # tool_name, tool_url = 'douban-film', "http://127.0.0.1:8079/tools/douban-film/"
49 # tool_name, tool_url = 'weather', "http://127.0.0.1:8079/tools/weather/"
50 # tool_name, tool_url = 'wikipedia', "http://127.0.0.1:8079/tools/wikipedia/"
51 # tool_name, tool_url = 'wolframalpha', "http://127.0.0.1:8079/tools/wolframalpha/"
52 # tool_name, tool_url = 'klarna', "https://www.klarna.com/"
53
54
55 get_url = tool_url +".well-known/ai-plugin.json"
56 response = requests.get(get_url)
57
58 if response.status_code == 200:
59 tool_config_json = response.json()
60 else:
61 raise RuntimeError("Your URL of the tool is invalid.")
62
63 return tool_name, tool_config_json
64
65
66

Callers 15

test.pyFile · 0.90
test.pyFile · 0.90
test.pyFile · 0.90
test.pyFile · 0.90
test.pyFile · 0.90
test.pyFile · 0.90
test.pyFile · 0.90
test.pyFile · 0.90
test.pyFile · 0.90
test.pyFile · 0.90
test.pyFile · 0.90
test.pyFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected