sync update from LAN repo (source dhk-1 @ 3b1ec5b4)

This commit is contained in:
gozeros committed 2026-11-05 10:56:34 +08:00
1 parent da6521b6cb
commit 264e2200d6
995 files changed
+148105 -13399

No files matched your search

@@ -0,0 +1,49 @@
"""Persistence contract for administrator-managed model capabilities.
The provider connection details still live in ``config.yaml``. Runtime
capabilities that administrators change from the web UI live here instead so
they are shared by every Gateway worker and survive application restarts.
"""
from __future__ import annotations
from abc import ABC, abstractmethod
from typing import Any
class ModelCapabilityStore(ABC):
"""Global capability settings keyed by the stable configured model name."""
@abstractmethod
async def list_capabilities(self) -> list[dict[str, Any]]:
raise NotImplementedError
@abstractmethod
async def get_capability(self, model_name: str) -> dict[str, Any] | None:
raise NotImplementedError
@abstractmethod
async def set_reasoning_effort_support(
self,
model_name: str,
*,
supports_reasoning_effort: bool,
default_reasoning_effort: str | None = None,
updated_by: str | None = None,
) -> dict[str, Any]:
raise NotImplementedError
@abstractmethod
async def seed_reasoning_effort_support(
self,
model_name: str,
*,
updated_by: str | None = None,
) -> bool:
"""Insert legacy ``true`` only when no authoritative row exists."""
raise NotImplementedError
@abstractmethod
async def delete_capability(self, model_name: str) -> None:
raise NotImplementedError