50 lines
1.4 KiB
Python
50 lines
1.4 KiB
Python
"""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
|