25 lines
2.7 KiB
Plaintext
25 lines
2.7 KiB
Plaintext
%%{init: {"flowchart": {"wrappingWidth": 680}}}%%
|
||
flowchart TB
|
||
%% 依据:lpt-ai src/llm/recall.ts recallHintRules(3 条常量)、recallPrompt()、task-queue.ts#callOptionsFor。
|
||
%% 文案为源码原文,仅插入换行。校验与已定位缺陷见 retry 图。
|
||
|
||
classDef src fill:#ffe1e1,stroke:#c0392b,stroke-width:3.5px,color:#7b1414
|
||
classDef api fill:#e8f0fe,stroke:#1a56b0,stroke-width:1.2px,color:#111
|
||
classDef take fill:#e7f6ea,stroke:#2e8b57,stroke-width:1.2px,color:#14532d
|
||
classDef use fill:#f3f0fb,stroke:#6b4fa0,stroke-width:1.2px,color:#3b2a63
|
||
classDef origin fill:#fff3cd,stroke:#b8860b,stroke-dasharray:4 3,color:#664d03
|
||
classDef note fill:#f7f7f7,stroke:#999,stroke-dasharray:4 3,color:#333
|
||
classDef warn fill:#ffe1e1,stroke:#c0392b,stroke-width:2.2px,color:#7b1414
|
||
|
||
S["「入口」system = 公共 10 条 + recallHintRules 3 条"]:::api
|
||
H1["1. HINT: kind=HINT,findings=[],analysisStatus=PARTIAL。<br/>assessments可为空数组,只保留实际判定,不为未选单位补全判断;<br/>若提供提示引用单位的判定,必须为ANALYZED,<br/>不能引用EXCLUDED/UNANALYZED或APPLICATION。"]:::use
|
||
H2["2. hints:[{id,form:"KEYWORD"#124;"QUESTION"#124;"LEAF"#124;"TREE",<br/>clue:string(不超过120字符),anchorNodeId:string|null,<br/>nodes:[{id,parentId:string|null,text:string(不超过80字符)}],<br/>citations:[{unitId,start,end,quote}]}]。"]:::use
|
||
H3["3. 仅用户选择 hintForm,不逐级解锁、不缩小范围。<br/>最多3项,每项至少1引文。<br/>KEYWORD/QUESTION nodes=[] 且 anchorNodeId=null;<br/>LEAF 恰好1节点且 anchorNodeId 必填;TREE 单根无环小树且 anchorNodeId 必填。<br/>anchorNodeId 必须是本次 expression 中已存在的节点 id(可直接是根节点),<br/>表示提示挂在该节点下,不得新造。<br/>parentId 只能引用同一条提示自己的 nodes 内的节点 id,不得引用 expression 中的节点;<br/>每条提示必须有且只有1个 parentId=null 的根,其余节点沿 parentId 连到该根。<br/>全部nodes最多5,节点与item id稳定非空唯一。<br/>没有可靠线索可返回空hints与限制,不假称成功。"]:::use
|
||
|
||
S --> H1 --> H2 --> H3 --> MSG["「源」user 消息<br/>type=recall-hint,其余字段同公共入参"]:::origin
|
||
|
||
OPT["「说明」chat 调用参数<br/>temperature=0.2、max_tokens=4096<br/>reasoning_effort 按非 system 字符数分档:<br/><500 none;≥500 low;≥2000 high;≥8000 max"]:::note
|
||
OPT -.-> S
|
||
X["「说明」HINT 的「提示结构」校验与失败阶段见 retry 图,<br/>已定位缺陷见 defect 图"]:::note
|
||
H2 -.-> X
|