From a26aaa2bdb088b96258817f3dfe9c2410200f80a Mon Sep 17 00:00:00 2001 From: yumoqing Date: Tue, 15 Sep 2026 17:47:27 +0800 Subject: [PATCH] =?UTF-8?q?docs(bidding-skills):=20=E5=88=86=E6=9E=90?= =?UTF-8?q?=E6=8B=86=E8=A7=A3=E6=9C=BA=E5=88=B6=E5=8C=96=E8=AF=B4=E6=98=8E?= =?UTF-8?q?=E2=80=94=E2=80=94analyst=E6=8A=80=E8=83=BDchar=5Frange?= =?UTF-8?q?=E5=88=86=E6=AE=B5=E7=A1=AC=E8=A7=84=E5=88=99(=E5=8F=AA?= =?UTF-8?q?=E8=AF=BB=E6=9C=AC=E5=8C=BA=E9=97=B4=E7=A6=81=E5=85=A8=E9=87=8F?= =?UTF-8?q?=E9=87=8D=E8=AF=BB);bid-orchestration=E6=8A=80=E8=83=BD?= =?UTF-8?q?=E8=AF=B4=E6=98=8E=E6=9C=BA=E5=88=B6=E5=B1=82=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E6=8B=86=E8=A7=A3=E4=B8=8Ecreate=5Fsub=5Ftasks=E5=88=86?= =?UTF-8?q?=E5=B7=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bidding_general/common/bid-orchestration/SKILL.md | 8 +++++--- .../roles/agent.tender_analyst/role/SKILL.md | 6 ++++++ .../platform_general/common/model-onboarding/SKILL.md | 8 ++++---- wwwroot/api/llm_v1/chat/completions.dspy | 3 ++- 4 files changed, 17 insertions(+), 8 deletions(-) diff --git a/skills_library/pipelines/bidding_general/common/bid-orchestration/SKILL.md b/skills_library/pipelines/bidding_general/common/bid-orchestration/SKILL.md index b5e4ad6..4c2fd91 100644 --- a/skills_library/pipelines/bidding_general/common/bid-orchestration/SKILL.md +++ b/skills_library/pipelines/bidding_general/common/bid-orchestration/SKILL.md @@ -29,9 +29,11 @@ tools: [analysis_progress, dispatch_analysis_dim] - 被裁维度会被工具拒绝(裁剪计划是用户确认过的决定,不得绕过); - 已过的上游自动注入任务参数,分析员会先读上游产出再抽取。 3. 派发完当前就绪的维度后完成任务——**不长等**,对账器下轮会再派新编排任务。 -4. **复杂度拆解(2026-09-11)**:某维度工作面过大(如异常招标文档多包件、 - 需分段交叉核对)时,可用 `create_sub_tasks` 把该维度拆成子任务组 - (parent_id 挂编排任务,depends_on 编排先后),拆解标准见技能 `flow-plan` 第五节。 +4. **复杂度拆解(2026-09-11,2026-09-15 机制化)**:招标文件正文超 `bid_split_chars` + 阈值(默认 6 万字)时,**机制层自动把维度拆成 N 个分段子任务并行**(dispatch 与 + 重做派发点都拆,子任务带 char_range 只读本段)——大文件不再出现单体长任务。 + PM 的 `create_sub_tasks` 只用于**非字符数类**复杂度(多包件交叉核对、需分段 + 人工判断等),拆解标准见技能 `flow-plan` 第五节。 ## 编排意图(归你,代码不管的部分) - **指令补充**(dispatch 的 instructions 参数):异常招标文档的特殊交代 diff --git a/skills_library/pipelines/bidding_general/roles/agent.tender_analyst/role/SKILL.md b/skills_library/pipelines/bidding_general/roles/agent.tender_analyst/role/SKILL.md index f6797ff..3926eda 100644 --- a/skills_library/pipelines/bidding_general/roles/agent.tender_analyst/role/SKILL.md +++ b/skills_library/pipelines/bidding_general/roles/agent.tender_analyst/role/SKILL.md @@ -11,6 +11,12 @@ tools: [read_tender_file, list_tender_files, extract_scoring, extract_quals, ext 招标文件分析拆成**四个独立维度**,对账器为每个缺失维度各派一个任务并行执行。 **先看任务参数里的 `analysis_dim`,只做对应维度,不要越维度操作**: +**分段子任务硬规则(2026-09-15 机制拆解配套,违反即返工)**:任务参数带 +`char_range=[start,end]` 时,本任务只负责正文该字符区间——read_tender_file 与 +各 extract_* 工具一律传 offset=start、length=end-start,**禁止读区间外内容、 +禁止全量重读**;产出只写本区间抽到的条目(重复项机制层自动去重)。 +任务标题带「第i/N段」即分段子任务。无 char_range 的任务按全文处理(小文件)。 + - `analysis_dim=scoring` → 用 **extract_scoring** 抽取评分项+得分规则(逐条覆盖评标办法,满分准确,否决项 is_veto=1)。大文件分段(offset 递增),重复项自动去重。 - `analysis_dim=quals` → 用 **extract_quals** 抽取资质清单与要求(原文要求+是否必需)。 - `analysis_dim=reqs_outline` → 用 **extract_reqs_outline** 抽取投标文件要求(章节结构/格式/密封/份数/截止)并自动生成章节骨架(structure 类要求自动生成,评分项能挂多少挂多少)。 diff --git a/skills_library/pipelines/platform_general/common/model-onboarding/SKILL.md b/skills_library/pipelines/platform_general/common/model-onboarding/SKILL.md index 74f68ba..1963f4a 100644 --- a/skills_library/pipelines/platform_general/common/model-onboarding/SKILL.md +++ b/skills_library/pipelines/platform_general/common/model-onboarding/SKILL.md @@ -97,7 +97,7 @@ async def m(): # ② 记账检查(必须做) async with db.sqlorContext("pipeline") as sor: rs = await sor.sqlExe( - "SELECT id, req_tokens, resp_tokens, charge, cost, status, note FROM llm_usage " + "SELECT id, usages, charge, cost, status, note FROM llm_usage " "WHERE model_id=(SELECT id FROM llm_model WHERE name=${n}$ LIMIT 1) " "ORDER BY created_at DESC LIMIT 1", {"n": MODEL}) await sor.sqlExe("COMMIT", {}) @@ -105,9 +105,9 @@ async def m(): print("USAGE_MISSING: 无流水——治理链未生效或结算失败,必须排查") else: u = rs[0] - print("USAGE|status=%s req=%s resp=%s charge=%s cost=%s note=%s" % ( - getattr(u,'status',''), getattr(u,'req_tokens',''), - getattr(u,'resp_tokens',''), getattr(u,'charge',''), + print("USAGE|status=%s usages=%s charge=%s cost=%s note=%s" % ( + getattr(u,'status',''), str(getattr(u,'usages',''))[:120], + getattr(u,'charge',''), getattr(u,'cost',''), str(getattr(u,'note',''))[:60])) rs = await sor.sqlExe("SELECT id, balance FROM llm_account WHERE status='active' " "AND vendor_id=${v}$ LIMIT 5", {"v": vid}) diff --git a/wwwroot/api/llm_v1/chat/completions.dspy b/wwwroot/api/llm_v1/chat/completions.dspy index c0bff86..dda809e 100644 --- a/wwwroot/api/llm_v1/chat/completions.dspy +++ b/wwwroot/api/llm_v1/chat/completions.dspy @@ -60,7 +60,8 @@ try: info.get('created_by', '') or '', payload, model_name=(info.get('model_name') or payload.get('model') or ''), - task_ref=task_ref) + task_ref=task_ref, + project_id=info.get('project_id') or '') try: await record_llm_token_usage(info.get('id', ''), data.get('usage') or {}) except Exception: