mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-06-30 21:59:46 +02:00
refactor(model-connections): remove unused fields and update verification logic
This commit is contained in:
parent
3ba92dca13
commit
7926814070
7 changed files with 2 additions and 35 deletions
|
|
@ -75,7 +75,6 @@ def materialize_global_model_catalog(
|
|||
conn = native_connection_from_config(config)
|
||||
conn["scope"] = "GLOBAL"
|
||||
conn["enabled"] = True
|
||||
conn["last_status"] = "OK"
|
||||
key = _connection_key(conn)
|
||||
connection_id = connection_id_by_key.get(key)
|
||||
if connection_id is None:
|
||||
|
|
@ -105,7 +104,6 @@ def materialize_global_model_catalog(
|
|||
"supports_tools": bool(config.get("supports_tools", False)),
|
||||
"supports_image_generation": role == "image_gen",
|
||||
"capabilities_override": {},
|
||||
"embedding_dimension": None,
|
||||
"enabled": True,
|
||||
"billing_tier": config.get("billing_tier", "free"),
|
||||
"catalog": _catalog_metadata(config),
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ from __future__ import annotations
|
|||
import contextlib
|
||||
import logging
|
||||
from dataclasses import dataclass
|
||||
from datetime import UTC, datetime
|
||||
from typing import Any
|
||||
|
||||
import anyio
|
||||
|
|
@ -186,14 +185,6 @@ async def verify_connection(conn: Connection) -> VerifyResult:
|
|||
return VerifyResult("UNREACHABLE", False, _docker_hint(base_url, exc))
|
||||
|
||||
|
||||
async def persist_verification(conn: Connection) -> VerifyResult:
|
||||
result = await verify_connection(conn)
|
||||
conn.last_verified_at = datetime.now(UTC)
|
||||
conn.last_status = result.status
|
||||
conn.last_error = "" if result.ok else result.message
|
||||
return result
|
||||
|
||||
|
||||
def _discovery_error_message(conn: Connection, exc: httpx.HTTPError) -> str:
|
||||
base_url = _base_url_or_default(conn)
|
||||
if isinstance(exc, httpx.HTTPStatusError):
|
||||
|
|
@ -494,7 +485,6 @@ __all__ = [
|
|||
"VerifyResult",
|
||||
"derive_capabilities",
|
||||
"discover_models",
|
||||
"persist_verification",
|
||||
"test_model",
|
||||
"verify_connection",
|
||||
]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue