Files
lpt-meta/docs/diagrams/recall-ai/overview.mmd
T

35 lines
2.0 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
%%{init: {"flowchart": {"wrappingWidth": 680}}}%%
flowchart TB
%% 依据:lpt-fe RecallWorkspace.vue#ask/readRequest、useAiTask.ts#run;lpt-be AiTaskController#submit、
%% RecallAiService#submit/prepare/succeed/fail、AiTaskRunner、RecallHintAiTaskHandler#execute、
%% RecallAiClient#submit/await、RecallAiResultValidator#validate;lpt-ai routes/ai.ts、task-queue.ts#runTask。
%% 只画主干;组参、提示词、校验与失败回传分别见后续图。
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
F["「入口」点「提示」或「主动查漏」<br/>POST /ai/tasks"]:::api
B["「用」RecallAiService#submit<br/>读回忆、组参、落 ai_tasks"]:::use
Q["「用」AiTaskRunner → 类型 handler<br/>提交 lpt-ai /ai/tasks"]:::use
A["「用」lpt-ai runTask<br/>prompt → LLM → 逐阶段校验"]:::use
R["「用」lpt-be await 轮询<br/>validator 复核后落 result 或 error"]:::use
G["「取」前端轮询读取<br/>展示结果或失败文案"]:::take
F --> B --> Q --> A --> R --> G
S["「源」review_recalls.document_json<br/>回忆文档;参考资料在创建时冻结"]:::origin
S -.-> B
T["「源」ai_tasks<br/>状态、result_payload、errorCode / errorMessage"]:::origin
R -.-> T
N1["「说明」提交幂等:同一 requestId 复用已有 taskNum"]:::note
B -.-> N1
N2["「说明」LEAF / TREE 提示会并入导图,并写 provenance 标记"]:::note
G -.-> N2
N3["「说明」HINT 的 parentId 作用域与失败子原因已修,见 retry / defect 图"]:::note
A -.-> N3