export type GetApiTakoV1BetaChartInsightsArgs = {card_id: string}; export type GetApiTakoV1BetaChartInsightsOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Analyze a Tako Knowledge Card and get AI-generated insights. Returns plain-text observations about trends, growth rates, comparisons, and anomalies in the data. Use this after Knowledge Search to extract key takeaways from a chart. Requires a card_id from a previous Knowledge Search or Create Card response. * * GET /tako/v1/beta/chart_insights */ export const getApiTakoV1BetaChartInsights = async (args: GetApiTakoV1BetaChartInsightsArgs, options?: GetApiTakoV1BetaChartInsightsOptions) => { const {baseUrl = "https://api.orthogonal.com/mpp", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.card_id != null) query.append("card_id", String(args.card_id)) const url = `${baseUrl.replace(/\/+$/, '')}/tako/v1/beta/chart_insights${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };