Download hermes_cli/subcommands/fallback.py from SaylorTwift/hermes-agent: direct link, hf CLI and curl.
- Browser
- Download file 1.31 kB
-
https://huggingface.co/SaylorTwift/hermes-agent/resolve/main/hermes_cli/subcommands/fallback.py
- Command line
-
hf download hf://SaylorTwift/hermes-agent/hermes_cli/subcommands/fallback.py
-
curl -L -o fallback.py https://huggingface.co/SaylorTwift/hermes-agent/resolve/main/hermes_cli/subcommands/fallback.py
1.31 kB
| """``hermes fallback`` subcommand parser.""" | |
| from __future__ import annotations | |
| def build_fallback_parser(subparsers) -> None: | |
| """Attach the ``fallback`` subcommand to ``subparsers``.""" | |
| from hermes_cli.fallback_cmd import cmd_fallback | |
| fallback_parser = subparsers.add_parser( | |
| "fallback", help="Manage fallback providers (tried when the primary model fails)", | |
| description="Manage the fallback provider chain. Fallback providers are tried " | |
| "in order when the primary model fails with rate-limit, overload, or " | |
| "connection errors. See: " | |
| "https://hermes-agent.nousresearch.com/docs/user-guide/features/fallback-providers") | |
| fallback_subparsers = fallback_parser.add_subparsers(dest="fallback_command") | |
| fallback_subparsers.add_parser( | |
| "list", aliases=["ls"], help="Show the current fallback chain (default when no subcommand)") | |
| fallback_subparsers.add_parser( | |
| "add", | |
| help="Pick a provider + model (same picker as `hermes model`) and append to the chain") | |
| fallback_subparsers.add_parser( | |
| "remove", aliases=["rm"], help="Pick an entry to delete from the chain") | |
| fallback_subparsers.add_parser("clear", help="Remove all fallback entries") | |
| fallback_parser.set_defaults(func=cmd_fallback) | |