import { GraphyAiSdk } from '@graphysdk/agents-sdk';
import type { GraphConfig } from '@graphysdk/core';
const ai = new GraphyAiSdk({
apiKey: process.env.GRAPHY_API_KEY,
baseUrl: 'https://agents.graphy.dev',
});
const config: GraphConfig = {
type: 'column',
data: {
columns: [
{ key: 'month', label: 'Month' },
{ key: 'revenue', label: 'Revenue' },
],
rows: [
{ month: 'Jan', revenue: 100 },
{ month: 'Feb', revenue: 140 },
{ month: 'Mar', revenue: 220 },
{ month: 'Apr', revenue: 130 },
],
},
};
const result = await ai.generateAnnotations({
config,
userPrompt: 'Highlight the March peak and add a tooltip explaining it',
});
console.log(result.config.annotations); // Annotations applied to the chart