Download hermes_cli/proxy/adapters/__init__.py from SaylorTwift/hermes-agent: direct link, hf CLI and curl.
- Browser
- Download file 875 Bytes
-
https://huggingface.co/SaylorTwift/hermes-agent/resolve/main/hermes_cli/proxy/adapters/__init__.py
- Command line
-
hf download hf://SaylorTwift/hermes-agent/hermes_cli/proxy/adapters/__init__.py
-
curl -L -o __init__.py https://huggingface.co/SaylorTwift/hermes-agent/resolve/main/hermes_cli/proxy/adapters/__init__.py
875 Bytes
| """Upstream adapter registry for the local proxy server (see :class:`UpstreamAdapter`).""" | |
| from typing import Dict, Type | |
| from hermes_cli.proxy.adapters.base import UpstreamAdapter | |
| from hermes_cli.proxy.adapters.nous_portal import NousPortalAdapter | |
| from hermes_cli.proxy.adapters.xai import XAIGrokAdapter | |
| # Keyed by the ``hermes proxy start --provider <name>`` value. | |
| ADAPTERS: Dict[str, Type[UpstreamAdapter]] = {"nous": NousPortalAdapter, "xai": XAIGrokAdapter} | |
| def get_adapter(name: str) -> UpstreamAdapter: | |
| """Instantiate an adapter by provider name.""" | |
| key = (name or "").strip().lower() | |
| if key not in ADAPTERS: | |
| available = ", ".join(sorted(ADAPTERS)) or "(none)" | |
| raise ValueError(f"Unknown proxy upstream provider: {name!r}. Available: {available}") | |
| return ADAPTERS[key]() | |
| __all__ = ["UpstreamAdapter", "ADAPTERS", "get_adapter"] | |