update and cleanup repo
This commit is contained in:
@@ -34,8 +34,6 @@ def _provider_config_map(config: dict) -> dict[str, Any]:
|
||||
return {}
|
||||
|
||||
provider_cfg = config.get("plugin")
|
||||
if not isinstance(provider_cfg, dict):
|
||||
provider_cfg = config.get("provider")
|
||||
return provider_cfg if isinstance(provider_cfg, dict) else {}
|
||||
|
||||
|
||||
@@ -100,34 +98,14 @@ def _resolve_startup_instance_text(
|
||||
return ", ".join(_extract_configured_instance_names(configured_entry))
|
||||
|
||||
|
||||
def has_store_subtype(cfg: dict, subtype: str) -> bool:
|
||||
store_cfg = cfg.get("store")
|
||||
if not isinstance(store_cfg, dict):
|
||||
return False
|
||||
bucket = store_cfg.get(subtype)
|
||||
if not isinstance(bucket, dict):
|
||||
return False
|
||||
return any(isinstance(value, dict) and bool(value) for value in bucket.values())
|
||||
|
||||
|
||||
def has_provider(cfg: dict, name: str) -> bool:
|
||||
provider_cfg = cfg.get("plugin")
|
||||
if not isinstance(provider_cfg, dict):
|
||||
provider_cfg = cfg.get("provider")
|
||||
if not isinstance(provider_cfg, dict):
|
||||
return False
|
||||
block = provider_cfg.get(str(name).strip().lower())
|
||||
return isinstance(block, dict) and bool(block)
|
||||
|
||||
|
||||
def has_tool(cfg: dict, name: str) -> bool:
|
||||
tool_cfg = cfg.get("tool")
|
||||
if not isinstance(tool_cfg, dict):
|
||||
return False
|
||||
block = tool_cfg.get(str(name).strip().lower())
|
||||
return isinstance(block, dict) and bool(block)
|
||||
|
||||
|
||||
def ping_url(url: str, timeout: float = 3.0) -> tuple[bool, str]:
|
||||
try:
|
||||
from API.HTTP import HTTPClient
|
||||
|
||||
Reference in New Issue
Block a user