feat(roundtable): 第三步「数据入库」由结构化输出智能体自行调用技能
- 入库改为让 roundtable-structure 走完整 agent 运行时(ingest run policy) 自行挑选/读取/调用入库技能并传入 taskId,不再前端代调演示 - 新增 /api/flow-extract/ingest-eligibility(智能体判断当前业务场景是否有 合适入库技能,决定入库按钮是否显示)+ /api/multi-agent/structure/init - 入库前判断是否已生成流程图:无则发起「是否先生成流程图」用户协助 - 「知识库入库」更名为「数据入库」 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
a85d2480b4
commit
03c155f8a7
10 files changed
+507
-80
No files matched your search
@@ -885,3 +885,29 @@ export async function initSummaryThread(
|
||||
const json = (await res.json()) as { agent_name: string; thread_id: string };
|
||||
return { agentName: json.agent_name, threadId: json.thread_id };
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a thread for the Step 3「入库」structure agent (`roundtable-structure`,
|
||||
* a built-in singleton — the same agent that extracts the flowchart, but this run
|
||||
* uses the `ingest` run policy so its attached ingest skill actually executes).
|
||||
* Run it afterwards with {@link streamMultiAgent} (`agentType: "special"`,
|
||||
* `agentName: "roundtable-structure"`, `dAgentThreadId: { [agentName]: threadId }`):
|
||||
* the agent picks the suitable ingest skill (its name may contain「六步法」), reads
|
||||
* its SKILL.md and calls it — passing the taskId + summary report + structured flow.
|
||||
*/
|
||||
export async function initStructureThread(
|
||||
options: { signal?: AbortSignal } = {},
|
||||
): Promise<ReportThreadResponse> {
|
||||
const res = await apiFetch(`${getBackendBaseURL()}/api/multi-agent/structure/init`, {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: "{}",
|
||||
signal: options.signal,
|
||||
});
|
||||
if (!res.ok) {
|
||||
const text = await res.text().catch(() => "");
|
||||
throw new Error(`init structure thread failed (${res.status}): ${text}`);
|
||||
}
|
||||
const json = (await res.json()) as { agent_name: string; thread_id: string };
|
||||
return { agentName: json.agent_name, threadId: json.thread_id };
|
||||
}
|
||||
Reference in new issue
Block a user