refactor(hermes_cli): nous_subscription/keepalive — reuse _norm, trim padding
This commit is contained in:
@@ -67,7 +67,6 @@ def _interval_seconds(value: Optional[int]) -> int:
|
||||
return int(value)
|
||||
except (TypeError, ValueError):
|
||||
return NOUS_AUTH_KEEPALIVE_INTERVAL_SECONDS
|
||||
|
||||
raw = _nous_config().get(NOUS_AUTH_KEEPALIVE_INTERVAL_CONFIG_KEY)
|
||||
if raw is None or (isinstance(raw, str) and not raw.strip()):
|
||||
return NOUS_AUTH_KEEPALIVE_INTERVAL_SECONDS
|
||||
|
||||
@@ -157,15 +157,15 @@ def _select_nous(config: Dict[str, object], key: str) -> None:
|
||||
section.pop("use_gateway", None)
|
||||
|
||||
|
||||
def _provider_is_nous(config: Dict[str, object]) -> bool:
|
||||
model_cfg = config.get("model")
|
||||
return isinstance(model_cfg, dict) and str(model_cfg.get("provider") or "").strip().lower() == "nous"
|
||||
|
||||
|
||||
def _norm(value: object, default: str = "") -> str:
|
||||
return str(value or default).strip().lower()
|
||||
|
||||
|
||||
def _provider_is_nous(config: Dict[str, object]) -> bool:
|
||||
model_cfg = config.get("model")
|
||||
return isinstance(model_cfg, dict) and _norm(model_cfg.get("provider")) == "nous"
|
||||
|
||||
|
||||
def _toolset_enabled(config: Dict[str, object], toolset_key: str) -> bool:
|
||||
"""True when some platform's configured toolsets cover every tool of ``toolset_key``."""
|
||||
from toolsets import resolve_toolset
|
||||
|
||||
Reference in New Issue
Block a user