fix(tools): clarify chart data format
Agent CI/CD / docker-image (push) Successful in 49s
Agent CI/CD / deploy-fallback-log (push) Has been skipped

This commit is contained in:
2026-06-10 16:19:39 +08:00
parent d1b91a4b1e
commit cf6cada538
+8 -3
View File
@@ -1,7 +1,8 @@
import { tool } from "@opencode-ai/plugin";
export default tool({
description: "在前端对话界面中渲染图表。",
description:
"在前端对话界面中渲染图表。折线图/柱状图必须使用 x_data 作为横轴标签,series[].data 作为同长度的一维数值数组,不要把折线数据写成 ECharts 的 [x, y] 二维点数组。",
args: {
reason: tool.schema
.string()
@@ -11,12 +12,16 @@ export default tool({
.enum(["line", "bar", "pie"])
.optional()
.describe("Chart type."),
x_data: tool.schema.array(tool.schema.string()).describe("X-axis labels."),
x_data: tool.schema
.array(tool.schema.string())
.describe("X-axis labels. For line charts, put time/category labels here."),
series: tool.schema
.array(
tool.schema.object({
name: tool.schema.string(),
data: tool.schema.array(tool.schema.number()),
data: tool.schema
.array(tool.schema.number())
.describe("Y values only. Must align by index with x_data."),
type: tool.schema.enum(["line", "bar"]).optional(),
}),
)