rebuild(llm): add audited model connectivity tests

This commit is contained in:
leefer
2026-07-30 10:25:07 +08:00
parent d8f0dd930c
commit 08f69b0641
9 changed files with 197 additions and 8 deletions
@@ -290,6 +290,13 @@ class ModelPoolService:
raise BusinessError("model_not_configured", "智能解读服务尚未配置。")
return ModelRuntimeConfig(primary=primary, fallback=fallback)
def runtime_model(self, model_id: int) -> ModelPoolRecord:
with self._database.read() as connection:
record = self._repository.get(connection, model_id)
if record is None:
raise BusinessError("model_not_found", "模型不存在。")
return record
def decrypt_api_key(self, record: ModelPoolRecord) -> str:
return self._cipher.decrypt(record.encrypted_api_key)