Spaces:
Configuration error
Configuration error
Download scripts/register_tools.py from D3AMON/hermes-agent: direct link, hf CLI and curl.
- Browser
- Download file 1.34 kB
-
https://huggingface.co/spaces/D3AMON/hermes-agent/resolve/main/scripts/register_tools.py
- Command line
-
hf download hf://spaces/D3AMON/hermes-agent/scripts/register_tools.py
-
curl -L -o register_tools.py https://huggingface.co/spaces/D3AMON/hermes-agent/resolve/main/scripts/register_tools.py
1.34 kB
| import os | |
| import json | |
| # This script would normally interact with the Hermes internal API or config | |
| # For this deployment, we'll ensure the personality and instructions mention these tools | |
| def update_instructions(): | |
| instructions_path = os.path.expanduser("~/.hermes/instructions.md") | |
| os.makedirs(os.path.dirname(instructions_path), exist_ok=True) | |
| tools_desc = """ | |
| # Integrated Free APIs | |
| You have direct access to over 30 free and unlimited APIs from GitHub collections. | |
| Use the `execute_code` tool to call these APIs using the `scripts/free_apis_tool.py` module. | |
| Available APIs: | |
| - weather, cat_fact, dog_fact, joke, ip_info, bitcoin_price, agify, genderize, nationalize, bored, random_user, country_info, dictionary, university_list, zip_code, quote, anime_quote, pokemon, space_news, art_institute_chicago, cocktail, meal, advice, binary, data_usa, ghibli, holiday, open_library, skyscanner, world_bank, nasa, wallhaven, coingecko, binance, exchange_rate. | |
| Example usage in Python: | |
| ```python | |
| from scripts.free_apis_tool import call_free_api | |
| result = call_free_api('weather', params={'latitude': 40.71, 'longitude': -74.01}) | |
| print(result) | |
| ``` | |
| """ | |
| with open(instructions_path, "w") as f: | |
| f.write(tools_desc) | |
| print("Instructions updated with free APIs.") | |
| if __name__ == "__main__": | |
| update_instructions() | |