Skip to content

@sqlrooms/vega / createChartImageForMarkdownTool

Function: createChartImageForMarkdownTool()

createChartImageForMarkdownTool<S>(store): Tool<{ documentArtifactId: string; sourceToolCallId?: string; sqlQuery?: string; vegaLiteSpec?: string; format: "svg" | "png"; assetId?: string; alt: string; title?: string; width: number; height: number; pngScale: number; renderTheme: "light" | "dark"; background?: string; }, { success: false; details: string; documentArtifactId: string; error: string; assetId?: undefined; markdown?: undefined; mediaType?: undefined; encoding?: undefined; format?: undefined; renderTheme?: undefined; background?: undefined; } | { success: true; details: string; documentArtifactId: string; assetId: string; markdown: string; mediaType: "image/svg+xml" | "image/png"; encoding: "utf8" | "base64"; format: "svg" | "png"; renderTheme: "light" | "dark"; background: string; error?: undefined; }>

Type Parameters

Type ParameterDefault type
S extends ChartImageToolStateChartImageToolState

Parameters

ParameterType
storeStoreLike<S>

Returns

Tool<{ documentArtifactId: string; sourceToolCallId?: string; sqlQuery?: string; vegaLiteSpec?: string; format: "svg" | "png"; assetId?: string; alt: string; title?: string; width: number; height: number; pngScale: number; renderTheme: "light" | "dark"; background?: string; }, { success: false; details: string; documentArtifactId: string; error: string; assetId?: undefined; markdown?: undefined; mediaType?: undefined; encoding?: undefined; format?: undefined; renderTheme?: undefined; background?: undefined; } | { success: true; details: string; documentArtifactId: string; assetId: string; markdown: string; mediaType: "image/svg+xml" | "image/png"; encoding: "utf8" | "base64"; format: "svg" | "png"; renderTheme: "light" | "dark"; background: string; error?: undefined; }>