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: 'sales', label: 'Sales' },
{ key: 'region', label: 'Region' },
],
rows: [
{ month: 'Jan', sales: 100, region: 'North' },
{ month: 'Feb', sales: 120, region: 'South' },
{ month: 'Mar', sales: 115, region: 'North' },
],
},
};
const result = await ai.generateSuggestions({
config,
userPrompt: 'Show me interesting trends',
});
for (const suggestion of result.suggestions) {
console.log(`${suggestion.chartType}: ${suggestion.summary}`);
}