@sqlrooms/vega 0.16.4 → 0.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +26 -28
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -123,34 +123,32 @@ A tool for creating Vega-Lite charts in AI-assisted workflows, designed to work
|
|
|
123
123
|
```tsx
|
|
124
124
|
import {createVegaChartTool} from '@sqlrooms/vega';
|
|
125
125
|
import {createAiSlice} from '@sqlrooms/ai';
|
|
126
|
-
import {
|
|
127
|
-
|
|
128
|
-
// Create a
|
|
129
|
-
export const {
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
}),
|
|
153
|
-
);
|
|
126
|
+
import {createRoomStore} from '@sqlrooms/room-shell';
|
|
127
|
+
|
|
128
|
+
// Create a room store with the VegaChartTool configured
|
|
129
|
+
export const {roomStore, useRoomStore} = createRoomStore((set, get, store) => ({
|
|
130
|
+
// Other slices and state...
|
|
131
|
+
|
|
132
|
+
// AI slice with custom tools
|
|
133
|
+
...createAiSlice({
|
|
134
|
+
getApiKey: (modelProvider: string) => {
|
|
135
|
+
return get()?.apiKeys[modelProvider] || '';
|
|
136
|
+
},
|
|
137
|
+
// Configure custom tools at store creation time
|
|
138
|
+
customTools: {
|
|
139
|
+
// Add the VegaChart tool
|
|
140
|
+
chart: createVegaChartTool({
|
|
141
|
+
// Optional custom description
|
|
142
|
+
description:
|
|
143
|
+
'Create data visualizations using Vega-Lite and SQL queries',
|
|
144
|
+
}),
|
|
145
|
+
|
|
146
|
+
// Other custom tools...
|
|
147
|
+
},
|
|
148
|
+
})(set, get, store),
|
|
149
|
+
|
|
150
|
+
// Other state and methods...
|
|
151
|
+
}));
|
|
154
152
|
```
|
|
155
153
|
|
|
156
154
|
#### Tool Parameters
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sqlrooms/vega",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.0",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -18,10 +18,10 @@
|
|
|
18
18
|
"access": "public"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@sqlrooms/ai": "0.
|
|
22
|
-
"@sqlrooms/duckdb": "0.
|
|
23
|
-
"@sqlrooms/ui": "0.
|
|
24
|
-
"@sqlrooms/utils": "0.
|
|
21
|
+
"@sqlrooms/ai": "0.17.0",
|
|
22
|
+
"@sqlrooms/duckdb": "0.17.0",
|
|
23
|
+
"@sqlrooms/ui": "0.17.0",
|
|
24
|
+
"@sqlrooms/utils": "0.17.0",
|
|
25
25
|
"react-vega": "^7.6.0",
|
|
26
26
|
"vega": "^5.33.0",
|
|
27
27
|
"vega-lite": "^5.23.0",
|
|
@@ -38,5 +38,5 @@
|
|
|
38
38
|
"typecheck": "tsc --noEmit",
|
|
39
39
|
"typedoc": "typedoc"
|
|
40
40
|
},
|
|
41
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "1f2a306da771481e2c89d8bfbd0507772167b1b5"
|
|
42
42
|
}
|