feat: add model management endpoints and admin interface for cache status
Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
@@ -198,3 +198,12 @@ def get_model_output_modalities(
|
||||
return json.loads(row[0])
|
||||
except (json.JSONDecodeError, TypeError):
|
||||
return []
|
||||
|
||||
|
||||
def get_cache_status(conn: duckdb.DuckDBPyConnection) -> dict[str, Any]:
|
||||
"""Return cache last update time and model count."""
|
||||
row = conn.execute(
|
||||
"SELECT MAX(fetched_at), COUNT(*) FROM models_cache"
|
||||
).fetchone()
|
||||
last_updated, model_count = (row[0], row[1]) if row else (None, 0)
|
||||
return {"last_updated": last_updated, "model_count": model_count}
|
||||
|
||||
Reference in New Issue
Block a user