| 41 | return all_apis |
| 42 | |
| 43 | def 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 | |