feat: AI平台适配器(DeepSeek/Kimi/Open余额查询+Minimax骨架)+ capabilities按钮控制,测试17项通过

This commit is contained in:
gouki
2026-08-02 16:59:25 +00:00
parent f657bfb10b
commit 1e574315bd
5 changed files with 177 additions and 3 deletions
+13
View File
@@ -26,6 +26,7 @@ def register(*sdk_types: str):
def load_all() -> None:
"""导入所有适配器模块以触发注册(幂等)"""
from app.adapters import ( # noqa: F401
ai,
aliyun,
cloudflare,
digitalocean,
@@ -53,6 +54,18 @@ def supported_types() -> list:
return sorted(_REGISTRY.keys())
def sdk_capabilities() -> dict:
"""返回 sdk_type -> capabilities 映射(供前端判断测试/同步按钮)"""
load_all()
result = {}
for sdk_type, cls in _REGISTRY.items():
try:
result[sdk_type] = cls({}).capabilities()
except Exception: # noqa: BLE001
result[sdk_type] = {}
return result
def adapter_meta() -> list:
"""返回所有已注册适配器的元信息(供前端展示所需凭证字段与能力)"""
load_all()