mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-28 15:01:34 +08:00
fix(tui): address startup provider review
This commit is contained in:
@@ -560,14 +560,17 @@ def resolve_skin() -> dict:
|
||||
|
||||
|
||||
def _resolve_model() -> str:
|
||||
env = os.environ.get("HERMES_MODEL", "") or os.environ.get("HERMES_INFERENCE_MODEL", "")
|
||||
env = (
|
||||
os.environ.get("HERMES_MODEL", "")
|
||||
or os.environ.get("HERMES_INFERENCE_MODEL", "")
|
||||
).strip()
|
||||
if env:
|
||||
return env
|
||||
m = _load_cfg().get("model", "")
|
||||
if isinstance(m, dict):
|
||||
return m.get("default", "")
|
||||
return str(m.get("default", "") or "").strip()
|
||||
if isinstance(m, str) and m:
|
||||
return m
|
||||
return m.strip()
|
||||
return "anthropic/claude-sonnet-4"
|
||||
|
||||
|
||||
@@ -773,6 +776,8 @@ def _apply_model_switch(sid: str, session: dict, raw_input: str) -> dict:
|
||||
# original one persisted in config or env.
|
||||
if result.target_provider:
|
||||
os.environ["HERMES_INFERENCE_PROVIDER"] = result.target_provider
|
||||
if os.environ.get("HERMES_TUI_PROVIDER"):
|
||||
os.environ["HERMES_TUI_PROVIDER"] = result.target_provider
|
||||
if persist_global:
|
||||
_persist_model_switch(result)
|
||||
return {"value": result.new_model, "warning": result.warning_message or ""}
|
||||
|
||||
Reference in New Issue
Block a user