sync: 鍚屾灞€鍩熺綉鏈€鏂颁唬鐮?(source master @ b69568e4)

This commit is contained in:
gozeros committed 2026-10-21 14:51:31 +08:00
1 parent 4f7f07504a
commit 8bc8b0e082
1651 files changed
+278599 -11416

No files matched your search

@@ -0,0 +1,48 @@
"""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,
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