feat: 模型管理独立页与会话级选模型

This commit is contained in:
2026-09-20 15:42:25 +08:00
parent ffb8d5f7dc
commit aac3424911
24 changed files with 845 additions and 523 deletions
+14 -4
View File
@@ -63,20 +63,30 @@ class MemoryRepository(ABC):
class LlmRuntimeCache(ABC):
@abstractmethod
async def get(self, company_id: int) -> LlmRuntimeConfig | None: ...
async def get(
self, company_id: int, model: str | None = None
) -> LlmRuntimeConfig | None: ...
@abstractmethod
async def set(self, company_id: int, config: LlmRuntimeConfig, ttl_seconds: int) -> None: ...
async def set(
self,
company_id: int,
config: LlmRuntimeConfig,
ttl_seconds: int,
model: str | None = None,
) -> None: ...
@abstractmethod
async def delete(self, company_id: int) -> None: ...
async def delete(self, company_id: int, model: str | None = None) -> None: ...
class LlmRuntimeGateway(ABC):
"""从 Server 拉取运行时模型配置(MySQL 真相源)。"""
@abstractmethod
async def fetch(self, company_id: int) -> LlmRuntimeConfig | None: ...
async def fetch(
self, company_id: int, model: str | None = None
) -> LlmRuntimeConfig | None: ...
class ChatStreamer(ABC):