feat: 公司支持多模型提供商与会话消歧选型

This commit is contained in:
2026-09-20 16:35:06 +08:00
parent d7e4a987c1
commit 9350323ff2
30 changed files with 1031 additions and 448 deletions
+10 -5
View File
@@ -64,7 +64,10 @@ class MemoryRepository(ABC):
class LlmRuntimeCache(ABC):
@abstractmethod
async def get(
self, company_id: int, model: str | None = None
self,
company_id: int,
provider_id: int | None = None,
model: str | None = None,
) -> LlmRuntimeConfig | None: ...
@abstractmethod
@@ -73,11 +76,10 @@ class LlmRuntimeCache(ABC):
company_id: int,
config: LlmRuntimeConfig,
ttl_seconds: int,
model: str | None = None,
) -> None: ...
@abstractmethod
async def delete(self, company_id: int, model: str | None = None) -> None: ...
async def delete(self, company_id: int) -> None: ...
class LlmRuntimeGateway(ABC):
@@ -85,7 +87,10 @@ class LlmRuntimeGateway(ABC):
@abstractmethod
async def fetch(
self, company_id: int, model: str | None = None
self,
company_id: int,
provider_id: int | None = None,
model: str | None = None,
) -> LlmRuntimeConfig | None: ...
@@ -101,5 +106,5 @@ class ChatStreamer(ABC):
user_text: str,
system_prompt: str,
tools: list[Any] | None = None,
max_tool_result_chars: int = 8000,
max_tool_result_chars: int = 4000,
) -> AsyncIterator[StreamEvent]: ...