init
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
import { tool } from "@opencode-ai/plugin";
|
||||
|
||||
export default tool({
|
||||
description: "Render a chart in the frontend chat UI.",
|
||||
args: {
|
||||
title: tool.schema.string().optional().describe("Chart title."),
|
||||
chart_type: tool.schema
|
||||
.enum(["line", "bar", "pie"])
|
||||
.optional()
|
||||
.describe("Chart type."),
|
||||
x_data: tool.schema.array(tool.schema.string()).describe("X-axis labels."),
|
||||
series: tool.schema
|
||||
.array(
|
||||
tool.schema.object({
|
||||
name: tool.schema.string(),
|
||||
data: tool.schema.array(tool.schema.number()),
|
||||
type: tool.schema.enum(["line", "bar"]).optional(),
|
||||
}),
|
||||
)
|
||||
.describe("Series data."),
|
||||
x_axis_name: tool.schema.string().optional().describe("X-axis display name."),
|
||||
y_axis_name: tool.schema.string().optional().describe("Y-axis display name."),
|
||||
},
|
||||
async execute() {
|
||||
return "图表将在对话中显示。";
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user