better-chatbot / src /lib /ai /tools /visualization /create-pie-chart.ts
Bot
Initial commit for HF Spaces
05c5ed5
Raw
History Blame Contribute Delete
406 Bytes
import { tool as createTool } from "ai";
import { z } from "zod";
export const createPieChartTool = createTool({
description: "Create a pie chart",
inputSchema: z.object({
data: z.array(z.object({ label: z.string(), value: z.number() })),
title: z.string(),
description: z.string().nullable(),
unit: z.string().nullable(),
}),
execute: async () => {
return "Success";
},
});