diff --git a/pipeline_platform/platform_ability.py b/pipeline_platform/platform_ability.py index 90527c1..910b632 100644 --- a/pipeline_platform/platform_ability.py +++ b/pipeline_platform/platform_ability.py @@ -35,9 +35,11 @@ PLATFORM_PIPELINE_ID = "platform_general" # 组织门禁:内部 agent 仅 owner 组织的角色可操作(任一 owner.* 角色,含通配) OWNER_ORG = "owner" -# 当前运行时调用链支持的协议(llm_bridge 固定 OpenAI 兼容路径)。 +# 当前运行时调用链支持的协议(模式定义在模型的适配模板/执行器,非供应商): +# openai_compat —— 同步 chat/completions 一次往返 +# dashscope_async —— 异步执行器:提交任务→轮询 query_profile_ids→取结果(2026-09-05) # 其他协议的适配模板会存入 llm_api_profile 备查,但运行时暂不渲染。 -RUNTIME_PROTOCOLS = ("openai_compat",) +RUNTIME_PROTOCOLS = ("openai_compat", "dashscope_async") # ────────────────────── 权限门禁(代码层) ────────────────────── @@ -352,10 +354,10 @@ async def _h_apply_llm_config(sor, params, ctx): merged.append({"base_url": bu, "region": ep.get("region") or "domestic", "timeout": int(_f(ep.get("timeout"), 60))}) added_eps.append(bu) + # 2026-09-05:供应商表不再有 protocol——请求形态由模型挂的适配模板决定 await sor.sqlExe( - "UPDATE llm_vendor SET endpoints=${e}$, protocol=${p}$, updated_at=NOW() " - "WHERE id=${i}$", - {"e": json.dumps(merged, ensure_ascii=False), "p": protocol, "i": vendor_id}) + "UPDATE llm_vendor SET endpoints=${e}$, updated_at=NOW() WHERE id=${i}$", + {"e": json.dumps(merged, ensure_ascii=False), "i": vendor_id}) await sor.sqlExe("COMMIT", {}) vendor_action = "复用供应商 %s(新增端点 %d 个)" % (vendor_id, len(added_eps)) else: @@ -364,7 +366,7 @@ async def _h_apply_llm_config(sor, params, ctx): "region": ep.get("region") or "domestic", "timeout": int(_f(ep.get("timeout"), 60))} for ep in endpoints] await sor.C("llm_vendor", { - "id": vendor_id, "name": vendor_name, "protocol": protocol, + "id": vendor_id, "name": vendor_name, "endpoints": json.dumps(eps_norm, ensure_ascii=False), "description": spec.get("doc_notes", "") or "", "status": "active", "org_id": ctx.get("org_id", "") or "0"})