feat: AI平台适配器(DeepSeek/Kimi/Open余额查询+Minimax骨架)+ capabilities按钮控制,测试17项通过
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user