feat: complete image console and add verified REST and MCP workflows

This commit is contained in:
2026-11-04 00:41:54 +08:00
parent 3140cd51d2
commit bef8af53ed
48 changed files with 5167 additions and 1176 deletions
+38
View File
@@ -0,0 +1,38 @@
"""适配器注册表。"""
from __future__ import annotations
from .agnes import AgnesAdapter
from .base import Capabilities, ImageResult, ProviderAdapter, ProviderConfig, ProviderError
from .openai_compat import OpenAICompatAdapter
ADAPTERS: dict[str, type[ProviderAdapter]] = {
OpenAICompatAdapter.name: OpenAICompatAdapter,
AgnesAdapter.name: AgnesAdapter,
}
ADAPTER_LABELS = {
"openai_compat": "OpenAI 兼容",
"agnes": "Agnes 原生",
}
def get_adapter(cfg: ProviderConfig) -> ProviderAdapter:
cls = ADAPTERS.get(cfg.adapter)
if cls is None:
raise ProviderError(f"不支持的适配器类型: {cfg.adapter}", status=400)
return cls(cfg)
__all__ = [
"ADAPTERS",
"ADAPTER_LABELS",
"AgnesAdapter",
"Capabilities",
"ImageResult",
"OpenAICompatAdapter",
"ProviderAdapter",
"ProviderConfig",
"ProviderError",
"get_adapter",
]