fix(chat): 更新工具进度名称
This commit is contained in:
@@ -30,8 +30,8 @@ describe("AgentProgressTimeline", () => {
|
||||
id: "tool",
|
||||
phase: "tool",
|
||||
status: "running",
|
||||
title: "正在调用 dynamic_http_call",
|
||||
detail: "GET /api/v1/network/bottlenecks",
|
||||
title: "正在调用 tjwater_cli",
|
||||
detail: "analysis bottlenecks",
|
||||
startedAt: now - 1200,
|
||||
elapsedMs: 1200,
|
||||
elapsedSnapshotAt: now,
|
||||
@@ -43,7 +43,7 @@ describe("AgentProgressTimeline", () => {
|
||||
expect(screen.getByText(/Agent 过程:/)).toBeInTheDocument();
|
||||
expect(screen.getByText(/耗时 5.0s/)).toBeInTheDocument();
|
||||
expect(screen.getByText("查询后端数据")).toBeInTheDocument();
|
||||
expect(screen.getByText("GET /api/v1/network/bottlenecks")).toBeInTheDocument();
|
||||
expect(screen.getByText("analysis bottlenecks")).toBeInTheDocument();
|
||||
expect(screen.getByText("1.2s")).toBeInTheDocument();
|
||||
});
|
||||
|
||||
@@ -86,7 +86,7 @@ describe("AgentProgressTimeline", () => {
|
||||
id: "tool",
|
||||
phase: "tool",
|
||||
status: "completed",
|
||||
title: "正在调用 dynamic_http_call",
|
||||
title: "正在调用 tjwater_cli",
|
||||
startedAt: Date.now() - 4000,
|
||||
endedAt: Date.now(),
|
||||
},
|
||||
|
||||
@@ -76,7 +76,7 @@ const phaseIcon = (phase: string, status: ChatProgress["status"]) => {
|
||||
|
||||
const formatToolTitle = (item: ChatProgress) => {
|
||||
const text = `${item.title} ${item.detail ?? ""}`;
|
||||
if (text.includes("dynamic_http_call")) return "查询后端数据";
|
||||
if (text.includes("tjwater_cli")) return "查询后端数据";
|
||||
if (text.includes("show_chart")) return "生成图表";
|
||||
if (text.includes("locate_features")) return "地图定位";
|
||||
if (text.includes("view_history")) return "打开历史曲线";
|
||||
|
||||
Reference in New Issue
Block a user