Download tests/fixtures/plugins/example-dashboard/dashboard/plugin_api.py from SaylorTwift/hermes-agent: direct link, hf CLI and curl.
- Browser
- Download file 1.06 kB
-
https://huggingface.co/SaylorTwift/hermes-agent/resolve/main/tests/fixtures/plugins/example-dashboard/dashboard/plugin_api.py
- Command line
-
hf download hf://SaylorTwift/hermes-agent/tests/fixtures/plugins/example-dashboard/dashboard/plugin_api.py
-
curl -L -o plugin_api.py https://huggingface.co/SaylorTwift/hermes-agent/resolve/main/tests/fixtures/plugins/example-dashboard/dashboard/plugin_api.py
1.06 kB
| """Example dashboard plugin — backend API routes (test fixture). | |
| This plugin lives under ``tests/fixtures/plugins/`` so it is NOT shipped as | |
| part of the bundled-plugins set; a stock hermes-agent install does not see | |
| an "Example" tab in its sidebar. The ``_install_example_plugin`` pytest | |
| fixture in ``tests/hermes_cli/test_web_server.py`` copies this directory | |
| into ``$HERMES_HOME/plugins/example-dashboard/`` and forces the dashboard | |
| plugin discovery cache to rescan, so tests that need a stable, side-effect- | |
| free GET endpoint to verify plugin API auth + static-asset behaviour can | |
| hit ``/api/plugins/example/hello`` (and ``/dashboard-plugins/example/ | |
| manifest.json``) without depending on any production-facing plugin. | |
| Mounted at /api/plugins/example/ by the dashboard plugin system. | |
| """ | |
| from fastapi import APIRouter | |
| router = APIRouter() | |
| async def hello(): | |
| """Simple greeting endpoint to demonstrate plugin API routes.""" | |
| return {"message": "Hello from the example plugin!", "plugin": "example", "version": "1.0.0"} | |