@sqlrooms/ai 0.5.1 → 0.6.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/dist/AiSlice.d.ts +90 -75
- package/dist/AiSlice.d.ts.map +1 -1
- package/dist/AiSlice.js +105 -61
- package/dist/AiSlice.js.map +1 -1
- package/dist/AnalysisResult.d.ts +16 -2
- package/dist/AnalysisResult.d.ts.map +1 -1
- package/dist/AnalysisResult.js +43 -7
- package/dist/AnalysisResult.js.map +1 -1
- package/dist/QueryResult.d.ts +9 -0
- package/dist/QueryResult.d.ts.map +1 -0
- package/dist/QueryResult.js +46 -0
- package/dist/QueryResult.js.map +1 -0
- package/dist/ToolCall.d.ts +64 -5
- package/dist/ToolCall.d.ts.map +1 -1
- package/dist/ToolCall.js +53 -10
- package/dist/ToolCall.js.map +1 -1
- package/dist/ToolResult.d.ts +3 -0
- package/dist/ToolResult.d.ts.map +1 -1
- package/dist/ToolResult.js +19 -2
- package/dist/ToolResult.js.map +1 -1
- package/dist/analysis.d.ts +48 -174
- package/dist/analysis.d.ts.map +1 -1
- package/dist/analysis.js +219 -61
- package/dist/analysis.js.map +1 -1
- package/dist/schemas.d.ts +84 -110
- package/dist/schemas.d.ts.map +1 -1
- package/dist/schemas.js +13 -11
- package/dist/schemas.js.map +1 -1
- package/package.json +9 -7
package/dist/schemas.d.ts
CHANGED
|
@@ -13,35 +13,22 @@ export declare const QueryToolParameters: z.ZodObject<{
|
|
|
13
13
|
reasoning: string;
|
|
14
14
|
}>;
|
|
15
15
|
export type QueryToolParameters = z.infer<typeof QueryToolParameters>;
|
|
16
|
-
export declare const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}, "strip", z.ZodTypeAny, {
|
|
23
|
-
sqlQuery: string;
|
|
24
|
-
vegaLiteSpec: string;
|
|
25
|
-
}, {
|
|
26
|
-
sqlQuery: string;
|
|
27
|
-
vegaLiteSpec: string;
|
|
28
|
-
}>, z.ZodNull]>;
|
|
16
|
+
export declare const AnalysisSchema: z.ZodString;
|
|
17
|
+
export type AnalysisSchema = z.infer<typeof AnalysisSchema>;
|
|
18
|
+
export declare const ChartToolParameters: z.ZodObject<{
|
|
19
|
+
sqlQuery: z.ZodString;
|
|
20
|
+
vegaLiteSpec: z.ZodString;
|
|
21
|
+
reasoning: z.ZodString;
|
|
29
22
|
}, "strip", z.ZodTypeAny, {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
sqlQuery: string;
|
|
34
|
-
vegaLiteSpec: string;
|
|
35
|
-
} | null;
|
|
23
|
+
sqlQuery: string;
|
|
24
|
+
reasoning: string;
|
|
25
|
+
vegaLiteSpec: string;
|
|
36
26
|
}, {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
sqlQuery: string;
|
|
41
|
-
vegaLiteSpec: string;
|
|
42
|
-
} | null;
|
|
27
|
+
sqlQuery: string;
|
|
28
|
+
reasoning: string;
|
|
29
|
+
vegaLiteSpec: string;
|
|
43
30
|
}>;
|
|
44
|
-
export type
|
|
31
|
+
export type ChartToolParameters = z.infer<typeof ChartToolParameters>;
|
|
45
32
|
export declare const ToolCallSchema: z.ZodObject<{
|
|
46
33
|
toolName: z.ZodString;
|
|
47
34
|
toolCallId: z.ZodString;
|
|
@@ -58,32 +45,17 @@ export declare const ToolCallSchema: z.ZodObject<{
|
|
|
58
45
|
sqlQuery: string;
|
|
59
46
|
reasoning: string;
|
|
60
47
|
}>, z.ZodObject<{
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
sqlQuery: z.ZodString;
|
|
65
|
-
vegaLiteSpec: z.ZodString;
|
|
66
|
-
}, "strip", z.ZodTypeAny, {
|
|
67
|
-
sqlQuery: string;
|
|
68
|
-
vegaLiteSpec: string;
|
|
69
|
-
}, {
|
|
70
|
-
sqlQuery: string;
|
|
71
|
-
vegaLiteSpec: string;
|
|
72
|
-
}>, z.ZodNull]>;
|
|
48
|
+
sqlQuery: z.ZodString;
|
|
49
|
+
vegaLiteSpec: z.ZodString;
|
|
50
|
+
reasoning: z.ZodString;
|
|
73
51
|
}, "strip", z.ZodTypeAny, {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
sqlQuery: string;
|
|
78
|
-
vegaLiteSpec: string;
|
|
79
|
-
} | null;
|
|
52
|
+
sqlQuery: string;
|
|
53
|
+
reasoning: string;
|
|
54
|
+
vegaLiteSpec: string;
|
|
80
55
|
}, {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
sqlQuery: string;
|
|
85
|
-
vegaLiteSpec: string;
|
|
86
|
-
} | null;
|
|
56
|
+
sqlQuery: string;
|
|
57
|
+
reasoning: string;
|
|
58
|
+
vegaLiteSpec: string;
|
|
87
59
|
}>]>;
|
|
88
60
|
}, "strip", z.ZodTypeAny, {
|
|
89
61
|
toolName: string;
|
|
@@ -93,12 +65,9 @@ export declare const ToolCallSchema: z.ZodObject<{
|
|
|
93
65
|
sqlQuery: string;
|
|
94
66
|
reasoning: string;
|
|
95
67
|
} | {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
sqlQuery: string;
|
|
100
|
-
vegaLiteSpec: string;
|
|
101
|
-
} | null;
|
|
68
|
+
sqlQuery: string;
|
|
69
|
+
reasoning: string;
|
|
70
|
+
vegaLiteSpec: string;
|
|
102
71
|
};
|
|
103
72
|
}, {
|
|
104
73
|
toolName: string;
|
|
@@ -108,15 +77,23 @@ export declare const ToolCallSchema: z.ZodObject<{
|
|
|
108
77
|
sqlQuery: string;
|
|
109
78
|
reasoning: string;
|
|
110
79
|
} | {
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
sqlQuery: string;
|
|
115
|
-
vegaLiteSpec: string;
|
|
116
|
-
} | null;
|
|
80
|
+
sqlQuery: string;
|
|
81
|
+
reasoning: string;
|
|
82
|
+
vegaLiteSpec: string;
|
|
117
83
|
};
|
|
118
84
|
}>;
|
|
119
85
|
export type ToolCallSchema = z.infer<typeof ToolCallSchema>;
|
|
86
|
+
export declare const ToolCallMessageSchema: z.ZodObject<{
|
|
87
|
+
toolCallId: z.ZodString;
|
|
88
|
+
element: z.ZodAny;
|
|
89
|
+
}, "strip", z.ZodTypeAny, {
|
|
90
|
+
toolCallId: string;
|
|
91
|
+
element?: any;
|
|
92
|
+
}, {
|
|
93
|
+
toolCallId: string;
|
|
94
|
+
element?: any;
|
|
95
|
+
}>;
|
|
96
|
+
export type ToolCallMessageSchema = z.infer<typeof ToolCallMessageSchema>;
|
|
120
97
|
export declare const ToolResultSchema: z.ZodObject<{
|
|
121
98
|
toolName: z.ZodString;
|
|
122
99
|
toolCallId: z.ZodString;
|
|
@@ -229,32 +206,17 @@ export declare const AnalysisResultSchema: z.ZodObject<{
|
|
|
229
206
|
sqlQuery: string;
|
|
230
207
|
reasoning: string;
|
|
231
208
|
}>, z.ZodObject<{
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
sqlQuery: z.ZodString;
|
|
236
|
-
vegaLiteSpec: z.ZodString;
|
|
237
|
-
}, "strip", z.ZodTypeAny, {
|
|
238
|
-
sqlQuery: string;
|
|
239
|
-
vegaLiteSpec: string;
|
|
240
|
-
}, {
|
|
241
|
-
sqlQuery: string;
|
|
242
|
-
vegaLiteSpec: string;
|
|
243
|
-
}>, z.ZodNull]>;
|
|
209
|
+
sqlQuery: z.ZodString;
|
|
210
|
+
vegaLiteSpec: z.ZodString;
|
|
211
|
+
reasoning: z.ZodString;
|
|
244
212
|
}, "strip", z.ZodTypeAny, {
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
sqlQuery: string;
|
|
249
|
-
vegaLiteSpec: string;
|
|
250
|
-
} | null;
|
|
213
|
+
sqlQuery: string;
|
|
214
|
+
reasoning: string;
|
|
215
|
+
vegaLiteSpec: string;
|
|
251
216
|
}, {
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
sqlQuery: string;
|
|
256
|
-
vegaLiteSpec: string;
|
|
257
|
-
} | null;
|
|
217
|
+
sqlQuery: string;
|
|
218
|
+
reasoning: string;
|
|
219
|
+
vegaLiteSpec: string;
|
|
258
220
|
}>]>;
|
|
259
221
|
}, "strip", z.ZodTypeAny, {
|
|
260
222
|
toolName: string;
|
|
@@ -264,12 +226,9 @@ export declare const AnalysisResultSchema: z.ZodObject<{
|
|
|
264
226
|
sqlQuery: string;
|
|
265
227
|
reasoning: string;
|
|
266
228
|
} | {
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
sqlQuery: string;
|
|
271
|
-
vegaLiteSpec: string;
|
|
272
|
-
} | null;
|
|
229
|
+
sqlQuery: string;
|
|
230
|
+
reasoning: string;
|
|
231
|
+
vegaLiteSpec: string;
|
|
273
232
|
};
|
|
274
233
|
}, {
|
|
275
234
|
toolName: string;
|
|
@@ -279,14 +238,23 @@ export declare const AnalysisResultSchema: z.ZodObject<{
|
|
|
279
238
|
sqlQuery: string;
|
|
280
239
|
reasoning: string;
|
|
281
240
|
} | {
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
sqlQuery: string;
|
|
286
|
-
vegaLiteSpec: string;
|
|
287
|
-
} | null;
|
|
241
|
+
sqlQuery: string;
|
|
242
|
+
reasoning: string;
|
|
243
|
+
vegaLiteSpec: string;
|
|
288
244
|
};
|
|
289
245
|
}>, "many">;
|
|
246
|
+
toolCallMessages: z.ZodArray<z.ZodObject<{
|
|
247
|
+
toolCallId: z.ZodString;
|
|
248
|
+
element: z.ZodAny;
|
|
249
|
+
}, "strip", z.ZodTypeAny, {
|
|
250
|
+
toolCallId: string;
|
|
251
|
+
element?: any;
|
|
252
|
+
}, {
|
|
253
|
+
toolCallId: string;
|
|
254
|
+
element?: any;
|
|
255
|
+
}>, "many">;
|
|
256
|
+
analysis: z.ZodString;
|
|
257
|
+
isCompleted: z.ZodBoolean;
|
|
290
258
|
}, "strip", z.ZodTypeAny, {
|
|
291
259
|
id: string;
|
|
292
260
|
prompt: string;
|
|
@@ -310,14 +278,17 @@ export declare const AnalysisResultSchema: z.ZodObject<{
|
|
|
310
278
|
sqlQuery: string;
|
|
311
279
|
reasoning: string;
|
|
312
280
|
} | {
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
sqlQuery: string;
|
|
317
|
-
vegaLiteSpec: string;
|
|
318
|
-
} | null;
|
|
281
|
+
sqlQuery: string;
|
|
282
|
+
reasoning: string;
|
|
283
|
+
vegaLiteSpec: string;
|
|
319
284
|
};
|
|
320
285
|
}[];
|
|
286
|
+
toolCallMessages: {
|
|
287
|
+
toolCallId: string;
|
|
288
|
+
element?: any;
|
|
289
|
+
}[];
|
|
290
|
+
analysis: string;
|
|
291
|
+
isCompleted: boolean;
|
|
321
292
|
}, {
|
|
322
293
|
id: string;
|
|
323
294
|
prompt: string;
|
|
@@ -341,14 +312,17 @@ export declare const AnalysisResultSchema: z.ZodObject<{
|
|
|
341
312
|
sqlQuery: string;
|
|
342
313
|
reasoning: string;
|
|
343
314
|
} | {
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
sqlQuery: string;
|
|
348
|
-
vegaLiteSpec: string;
|
|
349
|
-
} | null;
|
|
315
|
+
sqlQuery: string;
|
|
316
|
+
reasoning: string;
|
|
317
|
+
vegaLiteSpec: string;
|
|
350
318
|
};
|
|
351
319
|
}[];
|
|
320
|
+
toolCallMessages: {
|
|
321
|
+
toolCallId: string;
|
|
322
|
+
element?: any;
|
|
323
|
+
}[];
|
|
324
|
+
analysis: string;
|
|
325
|
+
isCompleted: boolean;
|
|
352
326
|
}>;
|
|
353
327
|
export type AnalysisResultSchema = z.infer<typeof AnalysisResultSchema>;
|
|
354
328
|
//# sourceMappingURL=schemas.d.ts.map
|
package/dist/schemas.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../src/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,eAAO,MAAM,mBAAmB;;;;;;;;;;;;EAI9B,CAAC;AACH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEtE,eAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../src/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,eAAO,MAAM,mBAAmB;;;;;;;;;;;;EAI9B,CAAC;AACH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEtE,eAAO,MAAM,cAAc,aAAa,CAAC;AACzC,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAE5D,eAAO,MAAM,mBAAmB;;;;;;;;;;;;EAI9B,CAAC;AACH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEtE,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAIzB,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAE5D,eAAO,MAAM,qBAAqB;;;;;;;;;EAGhC,CAAC;AACH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAE1E,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAc3B,CAAC;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAEhE,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAQ/B,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
|
package/dist/schemas.js
CHANGED
|
@@ -4,21 +4,20 @@ export const QueryToolParameters = z.object({
|
|
|
4
4
|
sqlQuery: z.string(),
|
|
5
5
|
reasoning: z.string(),
|
|
6
6
|
});
|
|
7
|
-
export const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
sqlQuery: z.string(),
|
|
13
|
-
vegaLiteSpec: z.string(),
|
|
14
|
-
}),
|
|
15
|
-
z.null(),
|
|
16
|
-
]),
|
|
7
|
+
export const AnalysisSchema = z.string();
|
|
8
|
+
export const ChartToolParameters = z.object({
|
|
9
|
+
sqlQuery: z.string(),
|
|
10
|
+
vegaLiteSpec: z.string(),
|
|
11
|
+
reasoning: z.string(),
|
|
17
12
|
});
|
|
18
13
|
export const ToolCallSchema = z.object({
|
|
19
14
|
toolName: z.string(),
|
|
20
15
|
toolCallId: z.string(),
|
|
21
|
-
args: z.union([QueryToolParameters,
|
|
16
|
+
args: z.union([QueryToolParameters, ChartToolParameters]),
|
|
17
|
+
});
|
|
18
|
+
export const ToolCallMessageSchema = z.object({
|
|
19
|
+
toolCallId: z.string(),
|
|
20
|
+
element: z.any(),
|
|
22
21
|
});
|
|
23
22
|
export const ToolResultSchema = z.object({
|
|
24
23
|
toolName: z.string(),
|
|
@@ -40,5 +39,8 @@ export const AnalysisResultSchema = z.object({
|
|
|
40
39
|
prompt: z.string(),
|
|
41
40
|
toolResults: z.array(ToolResultSchema),
|
|
42
41
|
toolCalls: z.array(ToolCallSchema),
|
|
42
|
+
toolCallMessages: z.array(ToolCallMessageSchema),
|
|
43
|
+
analysis: z.string(),
|
|
44
|
+
isCompleted: z.boolean(),
|
|
43
45
|
});
|
|
44
46
|
//# sourceMappingURL=schemas.js.map
|
package/dist/schemas.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.js","sourceRoot":"","sources":["../src/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1C,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC;IACxB,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;IACpB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;CACtB,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"schemas.js","sourceRoot":"","sources":["../src/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1C,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC;IACxB,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;IACpB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;CACtB,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC;AAGzC,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1C,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;IACpB,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE;IACxB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;CACtB,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC;IACrC,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;IACpB,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;IACtB,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,mBAAmB,EAAE,mBAAmB,CAAC,CAAC;CAC1D,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5C,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;IACtB,OAAO,EAAE,CAAC,CAAC,GAAG,EAAE;CACjB,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IACvC,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;IACpB,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;IACtB,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC;IACvB,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC;QACd,CAAC,CAAC,MAAM,CAAC;YACP,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC;YACzB,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;SAClB,CAAC;QACF,CAAC,CAAC,MAAM,CAAC;YACP,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC;YACxB,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC;SACxB,CAAC;KACH,CAAC;CACH,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE;IACtB,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;IAClB,WAAW,EAAE,CAAC,CAAC,KAAK,CAAC,gBAAgB,CAAC;IACtC,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,cAAc,CAAC;IAClC,gBAAgB,EAAE,CAAC,CAAC,KAAK,CAAC,qBAAqB,CAAC;IAChD,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;IACpB,WAAW,EAAE,CAAC,CAAC,OAAO,EAAE;CACzB,CAAC,CAAC","sourcesContent":["import {z} from 'zod';\n\nexport const QueryToolParameters = z.object({\n type: z.literal('query'),\n sqlQuery: z.string(),\n reasoning: z.string(),\n});\nexport type QueryToolParameters = z.infer<typeof QueryToolParameters>;\n\nexport const AnalysisSchema = z.string();\nexport type AnalysisSchema = z.infer<typeof AnalysisSchema>;\n\nexport const ChartToolParameters = z.object({\n sqlQuery: z.string(),\n vegaLiteSpec: z.string(),\n reasoning: z.string(),\n});\nexport type ChartToolParameters = z.infer<typeof ChartToolParameters>;\n\nexport const ToolCallSchema = z.object({\n toolName: z.string(),\n toolCallId: z.string(),\n args: z.union([QueryToolParameters, ChartToolParameters]),\n});\nexport type ToolCallSchema = z.infer<typeof ToolCallSchema>;\n\nexport const ToolCallMessageSchema = z.object({\n toolCallId: z.string(),\n element: z.any(),\n});\nexport type ToolCallMessageSchema = z.infer<typeof ToolCallMessageSchema>;\n\nexport const ToolResultSchema = z.object({\n toolName: z.string(),\n toolCallId: z.string(),\n args: z.record(z.any()),\n result: z.union([\n z.object({\n success: z.literal(false),\n error: z.string(),\n }),\n z.object({\n success: z.literal(true),\n data: z.record(z.any()),\n }),\n ]),\n});\nexport type ToolResultSchema = z.infer<typeof ToolResultSchema>;\n\nexport const AnalysisResultSchema = z.object({\n id: z.string().cuid2(),\n prompt: z.string(),\n toolResults: z.array(ToolResultSchema),\n toolCalls: z.array(ToolCallSchema),\n toolCallMessages: z.array(ToolCallMessageSchema),\n analysis: z.string(),\n isCompleted: z.boolean(),\n});\nexport type AnalysisResultSchema = z.infer<typeof AnalysisResultSchema>;\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sqlrooms/ai",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -20,12 +20,14 @@
|
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@ai-sdk/provider": "^1.0.7",
|
|
23
|
+
"@openassistant/core": "^0.1.9",
|
|
23
24
|
"@paralleldrive/cuid2": "^2.2.2",
|
|
24
|
-
"@sqlrooms/
|
|
25
|
-
"@sqlrooms/
|
|
26
|
-
"@sqlrooms/project-
|
|
27
|
-
"@sqlrooms/
|
|
28
|
-
"@sqlrooms/
|
|
25
|
+
"@sqlrooms/data-table": "0.6.0",
|
|
26
|
+
"@sqlrooms/duckdb": "0.6.0",
|
|
27
|
+
"@sqlrooms/project-builder": "0.6.0",
|
|
28
|
+
"@sqlrooms/project-config": "0.6.0",
|
|
29
|
+
"@sqlrooms/ui": "0.6.0",
|
|
30
|
+
"@sqlrooms/vega": "0.6.0",
|
|
29
31
|
"ai": "^4.1.28",
|
|
30
32
|
"immer": "^10.1.1",
|
|
31
33
|
"lucide-react": "^0.475.0",
|
|
@@ -43,5 +45,5 @@
|
|
|
43
45
|
"lint": "eslint .",
|
|
44
46
|
"typedoc": "typedoc"
|
|
45
47
|
},
|
|
46
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "f46dfe6b5d135e1a039b49b3ba71cda7150eab0f"
|
|
47
49
|
}
|