From 8de76e4a7b5b724e090fb8d5284e812228a00bbf Mon Sep 17 00:00:00 2001 From: yumoqing Date: Sat, 5 Sep 2026 11:06:42 +0800 Subject: [PATCH] =?UTF-8?q?feat(platform=5Fability):=20apply=5Fllm=5Fconfi?= =?UTF-8?q?g=E5=8A=A0=E8=83=BD=E5=8A=9B=E5=88=86=E7=B1=BB=E7=A1=AC?= =?UTF-8?q?=E6=A0=A1=E9=AA=8C=E2=80=94=E2=80=94=E6=9C=AA=E7=99=BB=E8=AE=B0?= =?UTF-8?q?=E8=83=BD=E5=8A=9B=E6=8B=92=E7=BB=9D=E8=90=BD=E5=BA=93(?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E8=A7=84=E5=88=99:=E5=85=88=E5=8A=A0?= =?UTF-8?q?=E5=88=86=E7=B1=BB=E5=86=8D=E9=85=8D=E6=A8=A1=E5=9E=8B,?= =?UTF-8?q?=E9=98=B2LLM=E9=9D=99=E9=BB=98=E5=A1=9E=E8=BF=91=E4=BC=BC?= =?UTF-8?q?=E5=88=86=E7=B1=BB)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pipeline_platform/platform_ability.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/pipeline_platform/platform_ability.py b/pipeline_platform/platform_ability.py index fad90a7..90527c1 100644 --- a/pipeline_platform/platform_ability.py +++ b/pipeline_platform/platform_ability.py @@ -316,6 +316,21 @@ async def _h_apply_llm_config(sor, params, ctx): if not models: return "spec.models 为空——文档里没有可配置的模型?" + # 能力分类校验(2026-09-05 用户定夺的规则):模型能力必须是字典已登记的 + # 分类;不存在则拒绝落库——先加能力分类(appcodes_kv llm_capability, + # 含种子/提示词/端点注释四处同步),再配模型。防 LLM 静默塞进近似分类。 + recs = await sor.sqlExe( + "SELECT k FROM appcodes_kv WHERE parentid='llm_capability'", {}) + await sor.sqlExe("COMMIT", {}) + known_caps = set(getattr(r, "k", "") for r in (recs or [])) + unknown = sorted(set( + (m.get("capability") or "t2t").strip() for m in models) - known_caps) + if unknown: + return ("能力分类未登记,拒绝落库:%s。请先在能力分类字典" + "(appcodes_kv parentid=llm_capability,含种子数据/提取提示词/" + "模型列表端点注释同步)中添加该分类,再重新执行本工具。" + "现有分类:%s" % ("、".join(unknown), "、".join(sorted(known_caps)))) + from appPublic.uniqueID import getID # 1. 供应商:按名称复用