mirror of
https://github.com/ThearchyHelios/AgentLab.git
synced 2026-11-18 08:51:58 +00:00
对话式入口:说需求,不用碰画布
阶段③。画布是给编排的人用的——15 种节点、每种十几个配置项,那是把控制权 交到手里的代价。但多数时候人要的只是一个答案:"MES 不合格数据里记录最多的 工厂是哪个",不关心它是 input→agent→output 还是别的什么。 这一页把图藏起来:你问,它自己接数据源、建流程、跑完、给结论。图仍然真实 存在(可以展开看"它是怎么做的",也能一键放到画布继续改),只是不再是必经之路。 默认路由也改到这里,画布退到第二项。 ## 状态分开放 新建 store/chat.ts 而不是复用 studio store:画布那套状态(选中节点、脏标记、 校验问题)在这里一个都用不上,混进去只会让两边互相牵制——对话页跑一次图就把 人家画布上没保存的东西冲掉,那是灾难。 ## 事件翻译成人话 Copilot 的操作流和运行事件都不直接暴露。add_node → "正在搭建流程…(3 步)", tool.start(db_query) → "查询数据",tool.end 里的 row_count 追加成"· 246 行"。 SQL 原文折叠在步骤里,想看能点开——不给看和硬塞给人看都不对。 等待期间显示模型的思考(复用上一轮加的 thinking 事件),这是 40 秒建图过程里 唯一能看的东西。 ## 人工介入就地处理 停在审批时直接在对话流里渲染 ApprovalCard(上一轮导出的),处理完自动重新 接上事件流看后续,不用切去别的页面再切回来。 ## 起始建议用真实表名 空状态不写死示例,而是读真实数据源的表名造建议——用户一眼看到的是自己的数据。 没有数据源时直接指路"设置 → 数据源",而不是给一个点了没反应的输入框。 ## 实测 按 store 的同样调用顺序跑完整链路:建图 44 秒(其中 39 秒是模型在想, 期间有心跳和 plan 摘要顶着)→ 3 步图 → agent 先查表结构再聚合 → "记录最多的工厂是上海头枕(工厂编码 1051),共 190470 条记录。"
This commit is contained in:
@@ -77,6 +77,19 @@ export const api = {
|
||||
},
|
||||
|
||||
// ---- 运行 ----
|
||||
datasources: {
|
||||
list: () => get<any[]>('/datasources'),
|
||||
kinds: () => get<any>('/datasources/kinds'),
|
||||
create: (body: any) => post<any>('/datasources', body),
|
||||
update: (id: string, body: any) => patch<any>(`/datasources/${id}`, body),
|
||||
remove: (id: string) => del(`/datasources/${id}`),
|
||||
test: (id: string) => post<any>(`/datasources/${id}/test`, {}),
|
||||
introspect: (id: string, schema?: string) =>
|
||||
post<any>(`/datasources/${id}/introspect${schema ? `?schema=${encodeURIComponent(schema)}` : ''}`, {}),
|
||||
schema: (id: string, table?: string) =>
|
||||
get<any>(`/datasources/${id}/schema${table ? `?table=${encodeURIComponent(table)}` : ''}`),
|
||||
},
|
||||
|
||||
runs: {
|
||||
list: (params?: { workflow_id?: string; status?: string; limit?: number }) => {
|
||||
const q = new URLSearchParams(
|
||||
|
||||
Reference in New Issue
Block a user