mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-03 02:11:48 +00:00
fix: resolve 'auto' provider properly via credential detection
'auto' doesn't always mean openrouter — it could be nous, zai, kimi-coding, etc. depending on configured credentials. Reverted the hardcoded mapping and now both CLI and gateway call resolve_provider() to detect the actual active provider when 'auto' is set. Falls back to openrouter only if resolution fails.
This commit is contained in:
parent
7ad6fc8a40
commit
34792dd907
3 changed files with 27 additions and 4 deletions
|
|
@ -124,10 +124,13 @@ def curated_models_for_provider(provider: Optional[str]) -> list[tuple[str, str]
|
|||
|
||||
|
||||
def normalize_provider(provider: Optional[str]) -> str:
|
||||
"""Normalize provider aliases to Hermes' canonical provider ids."""
|
||||
"""Normalize provider aliases to Hermes' canonical provider ids.
|
||||
|
||||
Note: ``"auto"`` passes through unchanged — use
|
||||
``hermes_cli.auth.resolve_provider()`` to resolve it to a concrete
|
||||
provider based on credentials and environment.
|
||||
"""
|
||||
normalized = (provider or "openrouter").strip().lower()
|
||||
if normalized == "auto":
|
||||
return "openrouter"
|
||||
return _PROVIDER_ALIASES.get(normalized, normalized)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue