@sqlrooms/ai 0.24.8 → 0.24.9
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 +56 -40
- package/dist/AiSlice.d.ts.map +1 -1
- package/dist/AiSlice.js +29 -0
- package/dist/AiSlice.js.map +1 -1
- package/dist/analysis.d.ts +5 -1
- package/dist/analysis.d.ts.map +1 -1
- package/dist/analysis.js +6 -3
- package/dist/analysis.js.map +1 -1
- package/dist/components/AnalysisAnswer.d.ts +1 -0
- package/dist/components/AnalysisAnswer.d.ts.map +1 -1
- package/dist/components/AnalysisAnswer.js +88 -3
- package/dist/components/AnalysisAnswer.js.map +1 -1
- package/dist/schemas.d.ts +66 -133
- package/dist/schemas.d.ts.map +1 -1
- package/dist/schemas.js +3 -29
- package/dist/schemas.js.map +1 -1
- package/package.json +13 -12
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AnalysisAnswer.d.ts","sourceRoot":"","sources":["../../src/components/AnalysisAnswer.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"AnalysisAnswer.d.ts","sourceRoot":"","sources":["../../src/components/AnalysisAnswer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuC,MAAM,OAAO,CAAC;AAM5D,KAAK,mBAAmB,GAAG;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,OAAO,CAAC;CACnB,CAAC;AAoGF;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,iDAwEzB,CAAC"}
|
|
@@ -1,14 +1,99 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import React from 'react';
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React, { useState, useCallback, useMemo } from 'react';
|
|
3
3
|
import Markdown from 'react-markdown';
|
|
4
|
+
import rehypeRaw from 'rehype-raw';
|
|
5
|
+
import { truncate } from '@sqlrooms/utils';
|
|
4
6
|
import { MessageContainer } from './MessageContainer';
|
|
7
|
+
// Constants moved outside component to prevent recreation
|
|
8
|
+
const THINK_WORD_LIMIT = 10;
|
|
9
|
+
const COMPLETE_THINK_REGEX = /<think>([\s\S]*?)<\/think>/g;
|
|
10
|
+
const INCOMPLETE_THINK_REGEX = /<think>([\s\S]*)$/;
|
|
11
|
+
/**
|
|
12
|
+
* Processes content and extracts think content in one pass
|
|
13
|
+
*/
|
|
14
|
+
const processContent = (originalContent) => {
|
|
15
|
+
const thinkContents = [];
|
|
16
|
+
let processedContent = originalContent;
|
|
17
|
+
let index = 0;
|
|
18
|
+
// Replace complete think tags
|
|
19
|
+
processedContent = processedContent.replace(COMPLETE_THINK_REGEX, (match, content) => {
|
|
20
|
+
if (content) {
|
|
21
|
+
thinkContents.push({
|
|
22
|
+
content: content.trim(),
|
|
23
|
+
isComplete: true,
|
|
24
|
+
index: index++,
|
|
25
|
+
});
|
|
26
|
+
return `\n\n<think-block data-index="${index - 1}"></think-block>\n\n`;
|
|
27
|
+
}
|
|
28
|
+
return match;
|
|
29
|
+
});
|
|
30
|
+
// Replace incomplete think tags (no closing tag)
|
|
31
|
+
processedContent = processedContent.replace(INCOMPLETE_THINK_REGEX, (match, content) => {
|
|
32
|
+
if (content) {
|
|
33
|
+
thinkContents.push({
|
|
34
|
+
content: content.trim(),
|
|
35
|
+
isComplete: false,
|
|
36
|
+
index: index++,
|
|
37
|
+
});
|
|
38
|
+
return `\n\n<think-block data-index="${index - 1}"></think-block>\n\n`;
|
|
39
|
+
}
|
|
40
|
+
return match;
|
|
41
|
+
});
|
|
42
|
+
return { processedContent, thinkContents };
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* ThinkBlock component for rendering individual think blocks
|
|
46
|
+
*/
|
|
47
|
+
const ThinkBlock = React.memo(({ thinkContent, isExpanded, onToggleExpansion }) => {
|
|
48
|
+
const { content, isComplete, index } = thinkContent;
|
|
49
|
+
const displayText = isComplete && !isExpanded ? truncate(content, THINK_WORD_LIMIT) : content;
|
|
50
|
+
const needsTruncation = isComplete && content.split(' ').length > THINK_WORD_LIMIT;
|
|
51
|
+
return (_jsx("div", { className: "inline-block", children: _jsxs("span", { className: "rounded-lg bg-gray-50 px-3 py-2 text-sm font-normal text-gray-100 dark:bg-gray-800/50 dark:text-gray-400", children: [_jsx("span", { className: "inline-flex items-start gap-2", children: _jsxs("span", { className: "text-gray-400", children: [_jsx("span", { className: "inline-block opacity-60 grayscale", children: "\uD83D\uDCAD" }), ' ', displayText] }) }), needsTruncation && (_jsx("button", { onClick: () => onToggleExpansion(content), className: "ml-2 text-xs text-gray-500 underline hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-300", children: isExpanded ? 'Show less' : 'Show more' }))] }) }, `think-${index}`));
|
|
52
|
+
});
|
|
53
|
+
ThinkBlock.displayName = 'ThinkBlock';
|
|
5
54
|
/**
|
|
6
55
|
* Renders an analysis answer with markdown content of the final streaming response.
|
|
56
|
+
* Supports streaming think content that may arrive in chunks (e.g., "<think>Hello" before "</think>").
|
|
7
57
|
*
|
|
8
58
|
* @param {AnalysisAnswerProps} props - The component props. See {@link AnalysisAnswerProps} for more details.
|
|
9
59
|
* @returns {JSX.Element} The rendered answer tool call
|
|
10
60
|
*/
|
|
11
61
|
export const AnalysisAnswer = React.memo(function AnalysisAnswer(props) {
|
|
12
|
-
|
|
62
|
+
const [expandedThink, setExpandedThink] = useState(new Set());
|
|
63
|
+
const toggleThinkExpansion = useCallback((content) => {
|
|
64
|
+
setExpandedThink((prev) => {
|
|
65
|
+
const newExpanded = new Set(prev);
|
|
66
|
+
if (newExpanded.has(content)) {
|
|
67
|
+
newExpanded.delete(content);
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
newExpanded.add(content);
|
|
71
|
+
}
|
|
72
|
+
return newExpanded;
|
|
73
|
+
});
|
|
74
|
+
}, []);
|
|
75
|
+
// Memoize content processing to avoid recalculation on every render
|
|
76
|
+
const { processedContent, thinkContents } = useMemo(() => processContent(props.content), [props.content]);
|
|
77
|
+
// Memoize the think-block component to prevent unnecessary re-renders
|
|
78
|
+
const thinkBlockComponent = useCallback((thinkBlock) => {
|
|
79
|
+
try {
|
|
80
|
+
const index = parseInt(thinkBlock.props?.['data-index'] || '0', 10);
|
|
81
|
+
const thinkContent = thinkContents[index];
|
|
82
|
+
if (!thinkContent) {
|
|
83
|
+
console.warn(`Think content not found for index: ${index}`);
|
|
84
|
+
return null;
|
|
85
|
+
}
|
|
86
|
+
const isExpanded = expandedThink.has(thinkContent.content);
|
|
87
|
+
return (_jsx(ThinkBlock, { thinkContent: thinkContent, isExpanded: isExpanded, onToggleExpansion: toggleThinkExpansion }));
|
|
88
|
+
}
|
|
89
|
+
catch (error) {
|
|
90
|
+
console.error('Error rendering think block:', error);
|
|
91
|
+
return null;
|
|
92
|
+
}
|
|
93
|
+
}, [thinkContents, expandedThink, toggleThinkExpansion]);
|
|
94
|
+
return (_jsx("div", { className: "flex flex-col gap-5", children: _jsx(MessageContainer, { isSuccess: true, type: props.isAnswer ? 'answer' : 'thinking', content: props, children: _jsx(Markdown, { className: "prose dark:prose-invert max-w-none text-sm", rehypePlugins: [rehypeRaw], components: {
|
|
95
|
+
// @ts-expect-error - Custom HTML element not in react-markdown types
|
|
96
|
+
'think-block': thinkBlockComponent,
|
|
97
|
+
}, children: processedContent }) }) }));
|
|
13
98
|
});
|
|
14
99
|
//# sourceMappingURL=AnalysisAnswer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AnalysisAnswer.js","sourceRoot":"","sources":["../../src/components/AnalysisAnswer.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"AnalysisAnswer.js","sourceRoot":"","sources":["../../src/components/AnalysisAnswer.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,EAAC,QAAQ,EAAE,WAAW,EAAE,OAA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AAY,EAC1B,UAAU,EAAE,UAAU,EACtB,iBAAiB,EAAE,oBAAoB,GACvC,CACH,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,KAAK,CAAC,8BAA8B,EAAE,KAAK,CAAC,CAAC;YACrD,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC,EACD,CAAC,aAAa,EAAE,aAAa,EAAE,oBAAoB,CAAC,CACrD,CAAC;IAEF,OAAO,CACL,cAAK,SAAS,EAAC,qBAAqB,YAClC,KAAC,gBAAgB,IACf,SAAS,EAAE,IAAI,EACf,IAAI,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,UAAU,EAC5C,OAAO,EAAE,KAAK,YAEd,KAAC,QAAQ,IACP,SAAS,EAAC,4CAA4C,EACtD,aAAa,EAAE,CAAC,SAAS,CAAC,EAC1B,UAAU,EAAE;oBACV,qEAAqE;oBACrE,aAAa,EAAE,mBAAmB;iBACnC,YAEA,gBAAgB,GACR,GACM,GACf,CACP,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["import React, {useState, useCallback, useMemo} from 'react';\nimport Markdown from 'react-markdown';\nimport rehypeRaw from 'rehype-raw';\nimport {truncate} from '@sqlrooms/utils';\nimport {MessageContainer} from './MessageContainer';\n\ntype AnalysisAnswerProps = {\n content: string;\n isAnswer: boolean;\n};\n\ntype ThinkContent = {\n content: string;\n isComplete: boolean;\n index: number;\n};\n\n// Constants moved outside component to prevent recreation\nconst THINK_WORD_LIMIT = 10;\nconst COMPLETE_THINK_REGEX = /<think>([\\s\\S]*?)<\\/think>/g;\nconst INCOMPLETE_THINK_REGEX = /<think>([\\s\\S]*)$/;\n\n/**\n * Processes content and extracts think content in one pass\n */\nconst processContent = (\n originalContent: string,\n): {\n processedContent: string;\n thinkContents: ThinkContent[];\n} => {\n const thinkContents: ThinkContent[] = [];\n let processedContent = originalContent;\n let index = 0;\n\n // Replace complete think tags\n processedContent = processedContent.replace(\n COMPLETE_THINK_REGEX,\n (match, content) => {\n if (content) {\n thinkContents.push({\n content: content.trim(),\n isComplete: true,\n index: index++,\n });\n return `\\n\\n<think-block data-index=\"${index - 1}\"></think-block>\\n\\n`;\n }\n return match;\n },\n );\n\n // Replace incomplete think tags (no closing tag)\n processedContent = processedContent.replace(\n INCOMPLETE_THINK_REGEX,\n (match, content) => {\n if (content) {\n thinkContents.push({\n content: content.trim(),\n isComplete: false,\n index: index++,\n });\n return `\\n\\n<think-block data-index=\"${index - 1}\"></think-block>\\n\\n`;\n }\n return match;\n },\n );\n\n return {processedContent, thinkContents};\n};\n\n/**\n * ThinkBlock component for rendering individual think blocks\n */\nconst ThinkBlock = React.memo<{\n thinkContent: ThinkContent;\n isExpanded: boolean;\n onToggleExpansion: (content: string) => void;\n}>(({thinkContent, isExpanded, onToggleExpansion}) => {\n const {content, isComplete, index} = thinkContent;\n\n const displayText =\n isComplete && !isExpanded ? truncate(content, THINK_WORD_LIMIT) : content;\n const needsTruncation =\n isComplete && content.split(' ').length > THINK_WORD_LIMIT;\n\n return (\n <div key={`think-${index}`} className=\"inline-block\">\n <span className=\"rounded-lg bg-gray-50 px-3 py-2 text-sm font-normal text-gray-100 dark:bg-gray-800/50 dark:text-gray-400\">\n <span className=\"inline-flex items-start gap-2\">\n <span className=\"text-gray-400\">\n <span className=\"inline-block opacity-60 grayscale\">💭</span>{' '}\n {displayText}\n </span>\n </span>\n {needsTruncation && (\n <button\n onClick={() => onToggleExpansion(content)}\n className=\"ml-2 text-xs text-gray-500 underline hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-300\"\n >\n {isExpanded ? 'Show less' : 'Show more'}\n </button>\n )}\n </span>\n </div>\n );\n});\n\nThinkBlock.displayName = 'ThinkBlock';\n\n/**\n * Renders an analysis answer with markdown content of the final streaming response.\n * Supports streaming think content that may arrive in chunks (e.g., \"<think>Hello\" before \"</think>\").\n *\n * @param {AnalysisAnswerProps} props - The component props. See {@link AnalysisAnswerProps} for more details.\n * @returns {JSX.Element} The rendered answer tool call\n */\nexport const AnalysisAnswer = React.memo(function AnalysisAnswer(\n props: AnalysisAnswerProps,\n) {\n const [expandedThink, setExpandedThink] = useState<Set<string>>(new Set());\n\n const toggleThinkExpansion = useCallback((content: string) => {\n setExpandedThink((prev) => {\n const newExpanded = new Set(prev);\n if (newExpanded.has(content)) {\n newExpanded.delete(content);\n } else {\n newExpanded.add(content);\n }\n return newExpanded;\n });\n }, []);\n\n // Memoize content processing to avoid recalculation on every render\n const {processedContent, thinkContents} = useMemo(\n () => processContent(props.content),\n [props.content],\n );\n\n // Memoize the think-block component to prevent unnecessary re-renders\n const thinkBlockComponent = useCallback(\n (thinkBlock: any) => {\n try {\n const index = parseInt(thinkBlock.props?.['data-index'] || '0', 10);\n const thinkContent = thinkContents[index];\n\n if (!thinkContent) {\n console.warn(`Think content not found for index: ${index}`);\n return null;\n }\n\n const isExpanded = expandedThink.has(thinkContent.content);\n\n return (\n <ThinkBlock\n thinkContent={thinkContent}\n isExpanded={isExpanded}\n onToggleExpansion={toggleThinkExpansion}\n />\n );\n } catch (error) {\n console.error('Error rendering think block:', error);\n return null;\n }\n },\n [thinkContents, expandedThink, toggleThinkExpansion],\n );\n\n return (\n <div className=\"flex flex-col gap-5\">\n <MessageContainer\n isSuccess={true}\n type={props.isAnswer ? 'answer' : 'thinking'}\n content={props}\n >\n <Markdown\n className=\"prose dark:prose-invert max-w-none text-sm\"\n rehypePlugins={[rehypeRaw]}\n components={{\n // @ts-expect-error - Custom HTML element not in react-markdown types\n 'think-block': thinkBlockComponent,\n }}\n >\n {processedContent}\n </Markdown>\n </MessageContainer>\n </div>\n );\n});\n"]}
|
package/dist/schemas.d.ts
CHANGED
|
@@ -21,79 +21,6 @@ export declare const ErrorMessageSchema: z.ZodObject<{
|
|
|
21
21
|
error: string;
|
|
22
22
|
}>;
|
|
23
23
|
export type ErrorMessageSchema = z.infer<typeof ErrorMessageSchema>;
|
|
24
|
-
export declare const StreamMessagePartSchema: z.ZodUnion<[z.ZodObject<{
|
|
25
|
-
type: z.ZodLiteral<"text">;
|
|
26
|
-
text: z.ZodString;
|
|
27
|
-
additionalData: z.ZodOptional<z.ZodAny>;
|
|
28
|
-
isCompleted: z.ZodOptional<z.ZodBoolean>;
|
|
29
|
-
}, "strip", z.ZodTypeAny, {
|
|
30
|
-
type: "text";
|
|
31
|
-
text: string;
|
|
32
|
-
additionalData?: any;
|
|
33
|
-
isCompleted?: boolean | undefined;
|
|
34
|
-
}, {
|
|
35
|
-
type: "text";
|
|
36
|
-
text: string;
|
|
37
|
-
additionalData?: any;
|
|
38
|
-
isCompleted?: boolean | undefined;
|
|
39
|
-
}>, z.ZodObject<{
|
|
40
|
-
type: z.ZodLiteral<"tool-invocation">;
|
|
41
|
-
toolInvocation: z.ZodObject<{
|
|
42
|
-
toolCallId: z.ZodString;
|
|
43
|
-
toolName: z.ZodString;
|
|
44
|
-
args: z.ZodAny;
|
|
45
|
-
state: z.ZodString;
|
|
46
|
-
result: z.ZodOptional<z.ZodAny>;
|
|
47
|
-
}, "strip", z.ZodTypeAny, {
|
|
48
|
-
toolCallId: string;
|
|
49
|
-
toolName: string;
|
|
50
|
-
state: string;
|
|
51
|
-
result?: any;
|
|
52
|
-
args?: any;
|
|
53
|
-
}, {
|
|
54
|
-
toolCallId: string;
|
|
55
|
-
toolName: string;
|
|
56
|
-
state: string;
|
|
57
|
-
result?: any;
|
|
58
|
-
args?: any;
|
|
59
|
-
}>;
|
|
60
|
-
additionalData: z.ZodOptional<z.ZodAny>;
|
|
61
|
-
isCompleted: z.ZodOptional<z.ZodBoolean>;
|
|
62
|
-
}, "strip", z.ZodTypeAny, {
|
|
63
|
-
type: "tool-invocation";
|
|
64
|
-
toolInvocation: {
|
|
65
|
-
toolCallId: string;
|
|
66
|
-
toolName: string;
|
|
67
|
-
state: string;
|
|
68
|
-
result?: any;
|
|
69
|
-
args?: any;
|
|
70
|
-
};
|
|
71
|
-
additionalData?: any;
|
|
72
|
-
isCompleted?: boolean | undefined;
|
|
73
|
-
}, {
|
|
74
|
-
type: "tool-invocation";
|
|
75
|
-
toolInvocation: {
|
|
76
|
-
toolCallId: string;
|
|
77
|
-
toolName: string;
|
|
78
|
-
state: string;
|
|
79
|
-
result?: any;
|
|
80
|
-
args?: any;
|
|
81
|
-
};
|
|
82
|
-
additionalData?: any;
|
|
83
|
-
isCompleted?: boolean | undefined;
|
|
84
|
-
}>, z.ZodObject<{
|
|
85
|
-
type: z.ZodString;
|
|
86
|
-
additionalData: z.ZodOptional<z.ZodAny>;
|
|
87
|
-
isCompleted: z.ZodOptional<z.ZodBoolean>;
|
|
88
|
-
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
89
|
-
type: z.ZodString;
|
|
90
|
-
additionalData: z.ZodOptional<z.ZodAny>;
|
|
91
|
-
isCompleted: z.ZodOptional<z.ZodBoolean>;
|
|
92
|
-
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
93
|
-
type: z.ZodString;
|
|
94
|
-
additionalData: z.ZodOptional<z.ZodAny>;
|
|
95
|
-
isCompleted: z.ZodOptional<z.ZodBoolean>;
|
|
96
|
-
}, z.ZodTypeAny, "passthrough">>]>;
|
|
97
24
|
export declare const AnalysisResultSchema: z.ZodObject<{
|
|
98
25
|
id: z.ZodString;
|
|
99
26
|
prompt: z.ZodString;
|
|
@@ -106,13 +33,13 @@ export declare const AnalysisResultSchema: z.ZodObject<{
|
|
|
106
33
|
}, "strip", z.ZodTypeAny, {
|
|
107
34
|
type: "text";
|
|
108
35
|
text: string;
|
|
109
|
-
additionalData?: any;
|
|
110
36
|
isCompleted?: boolean | undefined;
|
|
37
|
+
additionalData?: any;
|
|
111
38
|
}, {
|
|
112
39
|
type: "text";
|
|
113
40
|
text: string;
|
|
114
|
-
additionalData?: any;
|
|
115
41
|
isCompleted?: boolean | undefined;
|
|
42
|
+
additionalData?: any;
|
|
116
43
|
}>, z.ZodObject<{
|
|
117
44
|
type: z.ZodLiteral<"tool-invocation">;
|
|
118
45
|
toolInvocation: z.ZodObject<{
|
|
@@ -122,42 +49,42 @@ export declare const AnalysisResultSchema: z.ZodObject<{
|
|
|
122
49
|
state: z.ZodString;
|
|
123
50
|
result: z.ZodOptional<z.ZodAny>;
|
|
124
51
|
}, "strip", z.ZodTypeAny, {
|
|
125
|
-
toolCallId: string;
|
|
126
52
|
toolName: string;
|
|
53
|
+
toolCallId: string;
|
|
127
54
|
state: string;
|
|
128
|
-
result?: any;
|
|
129
55
|
args?: any;
|
|
56
|
+
result?: any;
|
|
130
57
|
}, {
|
|
131
|
-
toolCallId: string;
|
|
132
58
|
toolName: string;
|
|
59
|
+
toolCallId: string;
|
|
133
60
|
state: string;
|
|
134
|
-
result?: any;
|
|
135
61
|
args?: any;
|
|
62
|
+
result?: any;
|
|
136
63
|
}>;
|
|
137
64
|
additionalData: z.ZodOptional<z.ZodAny>;
|
|
138
65
|
isCompleted: z.ZodOptional<z.ZodBoolean>;
|
|
139
66
|
}, "strip", z.ZodTypeAny, {
|
|
140
67
|
type: "tool-invocation";
|
|
141
68
|
toolInvocation: {
|
|
142
|
-
toolCallId: string;
|
|
143
69
|
toolName: string;
|
|
70
|
+
toolCallId: string;
|
|
144
71
|
state: string;
|
|
145
|
-
result?: any;
|
|
146
72
|
args?: any;
|
|
73
|
+
result?: any;
|
|
147
74
|
};
|
|
148
|
-
additionalData?: any;
|
|
149
75
|
isCompleted?: boolean | undefined;
|
|
76
|
+
additionalData?: any;
|
|
150
77
|
}, {
|
|
151
78
|
type: "tool-invocation";
|
|
152
79
|
toolInvocation: {
|
|
153
|
-
toolCallId: string;
|
|
154
80
|
toolName: string;
|
|
81
|
+
toolCallId: string;
|
|
155
82
|
state: string;
|
|
156
|
-
result?: any;
|
|
157
83
|
args?: any;
|
|
84
|
+
result?: any;
|
|
158
85
|
};
|
|
159
|
-
additionalData?: any;
|
|
160
86
|
isCompleted?: boolean | undefined;
|
|
87
|
+
additionalData?: any;
|
|
161
88
|
}>, z.ZodObject<{
|
|
162
89
|
type: z.ZodString;
|
|
163
90
|
additionalData: z.ZodOptional<z.ZodAny>;
|
|
@@ -175,19 +102,19 @@ export declare const AnalysisResultSchema: z.ZodObject<{
|
|
|
175
102
|
parts?: ({
|
|
176
103
|
type: "text";
|
|
177
104
|
text: string;
|
|
178
|
-
additionalData?: any;
|
|
179
105
|
isCompleted?: boolean | undefined;
|
|
106
|
+
additionalData?: any;
|
|
180
107
|
} | {
|
|
181
108
|
type: "tool-invocation";
|
|
182
109
|
toolInvocation: {
|
|
183
|
-
toolCallId: string;
|
|
184
110
|
toolName: string;
|
|
111
|
+
toolCallId: string;
|
|
185
112
|
state: string;
|
|
186
|
-
result?: any;
|
|
187
113
|
args?: any;
|
|
114
|
+
result?: any;
|
|
188
115
|
};
|
|
189
|
-
additionalData?: any;
|
|
190
116
|
isCompleted?: boolean | undefined;
|
|
117
|
+
additionalData?: any;
|
|
191
118
|
} | z.objectOutputType<{
|
|
192
119
|
type: z.ZodString;
|
|
193
120
|
additionalData: z.ZodOptional<z.ZodAny>;
|
|
@@ -197,19 +124,19 @@ export declare const AnalysisResultSchema: z.ZodObject<{
|
|
|
197
124
|
parts?: ({
|
|
198
125
|
type: "text";
|
|
199
126
|
text: string;
|
|
200
|
-
additionalData?: any;
|
|
201
127
|
isCompleted?: boolean | undefined;
|
|
128
|
+
additionalData?: any;
|
|
202
129
|
} | {
|
|
203
130
|
type: "tool-invocation";
|
|
204
131
|
toolInvocation: {
|
|
205
|
-
toolCallId: string;
|
|
206
132
|
toolName: string;
|
|
133
|
+
toolCallId: string;
|
|
207
134
|
state: string;
|
|
208
|
-
result?: any;
|
|
209
135
|
args?: any;
|
|
136
|
+
result?: any;
|
|
210
137
|
};
|
|
211
|
-
additionalData?: any;
|
|
212
138
|
isCompleted?: boolean | undefined;
|
|
139
|
+
additionalData?: any;
|
|
213
140
|
} | z.objectInputType<{
|
|
214
141
|
type: z.ZodString;
|
|
215
142
|
additionalData: z.ZodOptional<z.ZodAny>;
|
|
@@ -219,19 +146,19 @@ export declare const AnalysisResultSchema: z.ZodObject<{
|
|
|
219
146
|
parts?: ({
|
|
220
147
|
type: "text";
|
|
221
148
|
text: string;
|
|
222
|
-
additionalData?: any;
|
|
223
149
|
isCompleted?: boolean | undefined;
|
|
150
|
+
additionalData?: any;
|
|
224
151
|
} | {
|
|
225
152
|
type: "tool-invocation";
|
|
226
153
|
toolInvocation: {
|
|
227
|
-
toolCallId: string;
|
|
228
154
|
toolName: string;
|
|
155
|
+
toolCallId: string;
|
|
229
156
|
state: string;
|
|
230
|
-
result?: any;
|
|
231
157
|
args?: any;
|
|
158
|
+
result?: any;
|
|
232
159
|
};
|
|
233
|
-
additionalData?: any;
|
|
234
160
|
isCompleted?: boolean | undefined;
|
|
161
|
+
additionalData?: any;
|
|
235
162
|
} | z.objectOutputType<{
|
|
236
163
|
type: z.ZodString;
|
|
237
164
|
additionalData: z.ZodOptional<z.ZodAny>;
|
|
@@ -254,19 +181,19 @@ export declare const AnalysisResultSchema: z.ZodObject<{
|
|
|
254
181
|
parts?: ({
|
|
255
182
|
type: "text";
|
|
256
183
|
text: string;
|
|
257
|
-
additionalData?: any;
|
|
258
184
|
isCompleted?: boolean | undefined;
|
|
185
|
+
additionalData?: any;
|
|
259
186
|
} | {
|
|
260
187
|
type: "tool-invocation";
|
|
261
188
|
toolInvocation: {
|
|
262
|
-
toolCallId: string;
|
|
263
189
|
toolName: string;
|
|
190
|
+
toolCallId: string;
|
|
264
191
|
state: string;
|
|
265
|
-
result?: any;
|
|
266
192
|
args?: any;
|
|
193
|
+
result?: any;
|
|
267
194
|
};
|
|
268
|
-
additionalData?: any;
|
|
269
195
|
isCompleted?: boolean | undefined;
|
|
196
|
+
additionalData?: any;
|
|
270
197
|
} | z.objectOutputType<{
|
|
271
198
|
type: z.ZodString;
|
|
272
199
|
additionalData: z.ZodOptional<z.ZodAny>;
|
|
@@ -291,6 +218,8 @@ export declare const AnalysisSessionSchema: z.ZodObject<{
|
|
|
291
218
|
name: z.ZodString;
|
|
292
219
|
modelProvider: z.ZodString;
|
|
293
220
|
model: z.ZodString;
|
|
221
|
+
customModelName: z.ZodOptional<z.ZodString>;
|
|
222
|
+
ollamaBaseUrl: z.ZodOptional<z.ZodString>;
|
|
294
223
|
analysisResults: z.ZodArray<z.ZodObject<{
|
|
295
224
|
id: z.ZodString;
|
|
296
225
|
prompt: z.ZodString;
|
|
@@ -303,13 +232,13 @@ export declare const AnalysisSessionSchema: z.ZodObject<{
|
|
|
303
232
|
}, "strip", z.ZodTypeAny, {
|
|
304
233
|
type: "text";
|
|
305
234
|
text: string;
|
|
306
|
-
additionalData?: any;
|
|
307
235
|
isCompleted?: boolean | undefined;
|
|
236
|
+
additionalData?: any;
|
|
308
237
|
}, {
|
|
309
238
|
type: "text";
|
|
310
239
|
text: string;
|
|
311
|
-
additionalData?: any;
|
|
312
240
|
isCompleted?: boolean | undefined;
|
|
241
|
+
additionalData?: any;
|
|
313
242
|
}>, z.ZodObject<{
|
|
314
243
|
type: z.ZodLiteral<"tool-invocation">;
|
|
315
244
|
toolInvocation: z.ZodObject<{
|
|
@@ -319,42 +248,42 @@ export declare const AnalysisSessionSchema: z.ZodObject<{
|
|
|
319
248
|
state: z.ZodString;
|
|
320
249
|
result: z.ZodOptional<z.ZodAny>;
|
|
321
250
|
}, "strip", z.ZodTypeAny, {
|
|
322
|
-
toolCallId: string;
|
|
323
251
|
toolName: string;
|
|
252
|
+
toolCallId: string;
|
|
324
253
|
state: string;
|
|
325
|
-
result?: any;
|
|
326
254
|
args?: any;
|
|
255
|
+
result?: any;
|
|
327
256
|
}, {
|
|
328
|
-
toolCallId: string;
|
|
329
257
|
toolName: string;
|
|
258
|
+
toolCallId: string;
|
|
330
259
|
state: string;
|
|
331
|
-
result?: any;
|
|
332
260
|
args?: any;
|
|
261
|
+
result?: any;
|
|
333
262
|
}>;
|
|
334
263
|
additionalData: z.ZodOptional<z.ZodAny>;
|
|
335
264
|
isCompleted: z.ZodOptional<z.ZodBoolean>;
|
|
336
265
|
}, "strip", z.ZodTypeAny, {
|
|
337
266
|
type: "tool-invocation";
|
|
338
267
|
toolInvocation: {
|
|
339
|
-
toolCallId: string;
|
|
340
268
|
toolName: string;
|
|
269
|
+
toolCallId: string;
|
|
341
270
|
state: string;
|
|
342
|
-
result?: any;
|
|
343
271
|
args?: any;
|
|
272
|
+
result?: any;
|
|
344
273
|
};
|
|
345
|
-
additionalData?: any;
|
|
346
274
|
isCompleted?: boolean | undefined;
|
|
275
|
+
additionalData?: any;
|
|
347
276
|
}, {
|
|
348
277
|
type: "tool-invocation";
|
|
349
278
|
toolInvocation: {
|
|
350
|
-
toolCallId: string;
|
|
351
279
|
toolName: string;
|
|
280
|
+
toolCallId: string;
|
|
352
281
|
state: string;
|
|
353
|
-
result?: any;
|
|
354
282
|
args?: any;
|
|
283
|
+
result?: any;
|
|
355
284
|
};
|
|
356
|
-
additionalData?: any;
|
|
357
285
|
isCompleted?: boolean | undefined;
|
|
286
|
+
additionalData?: any;
|
|
358
287
|
}>, z.ZodObject<{
|
|
359
288
|
type: z.ZodString;
|
|
360
289
|
additionalData: z.ZodOptional<z.ZodAny>;
|
|
@@ -372,19 +301,19 @@ export declare const AnalysisSessionSchema: z.ZodObject<{
|
|
|
372
301
|
parts?: ({
|
|
373
302
|
type: "text";
|
|
374
303
|
text: string;
|
|
375
|
-
additionalData?: any;
|
|
376
304
|
isCompleted?: boolean | undefined;
|
|
305
|
+
additionalData?: any;
|
|
377
306
|
} | {
|
|
378
307
|
type: "tool-invocation";
|
|
379
308
|
toolInvocation: {
|
|
380
|
-
toolCallId: string;
|
|
381
309
|
toolName: string;
|
|
310
|
+
toolCallId: string;
|
|
382
311
|
state: string;
|
|
383
|
-
result?: any;
|
|
384
312
|
args?: any;
|
|
313
|
+
result?: any;
|
|
385
314
|
};
|
|
386
|
-
additionalData?: any;
|
|
387
315
|
isCompleted?: boolean | undefined;
|
|
316
|
+
additionalData?: any;
|
|
388
317
|
} | z.objectOutputType<{
|
|
389
318
|
type: z.ZodString;
|
|
390
319
|
additionalData: z.ZodOptional<z.ZodAny>;
|
|
@@ -394,19 +323,19 @@ export declare const AnalysisSessionSchema: z.ZodObject<{
|
|
|
394
323
|
parts?: ({
|
|
395
324
|
type: "text";
|
|
396
325
|
text: string;
|
|
397
|
-
additionalData?: any;
|
|
398
326
|
isCompleted?: boolean | undefined;
|
|
327
|
+
additionalData?: any;
|
|
399
328
|
} | {
|
|
400
329
|
type: "tool-invocation";
|
|
401
330
|
toolInvocation: {
|
|
402
|
-
toolCallId: string;
|
|
403
331
|
toolName: string;
|
|
332
|
+
toolCallId: string;
|
|
404
333
|
state: string;
|
|
405
|
-
result?: any;
|
|
406
334
|
args?: any;
|
|
335
|
+
result?: any;
|
|
407
336
|
};
|
|
408
|
-
additionalData?: any;
|
|
409
337
|
isCompleted?: boolean | undefined;
|
|
338
|
+
additionalData?: any;
|
|
410
339
|
} | z.objectInputType<{
|
|
411
340
|
type: z.ZodString;
|
|
412
341
|
additionalData: z.ZodOptional<z.ZodAny>;
|
|
@@ -416,19 +345,19 @@ export declare const AnalysisSessionSchema: z.ZodObject<{
|
|
|
416
345
|
parts?: ({
|
|
417
346
|
type: "text";
|
|
418
347
|
text: string;
|
|
419
|
-
additionalData?: any;
|
|
420
348
|
isCompleted?: boolean | undefined;
|
|
349
|
+
additionalData?: any;
|
|
421
350
|
} | {
|
|
422
351
|
type: "tool-invocation";
|
|
423
352
|
toolInvocation: {
|
|
424
|
-
toolCallId: string;
|
|
425
353
|
toolName: string;
|
|
354
|
+
toolCallId: string;
|
|
426
355
|
state: string;
|
|
427
|
-
result?: any;
|
|
428
356
|
args?: any;
|
|
357
|
+
result?: any;
|
|
429
358
|
};
|
|
430
|
-
additionalData?: any;
|
|
431
359
|
isCompleted?: boolean | undefined;
|
|
360
|
+
additionalData?: any;
|
|
432
361
|
} | z.objectOutputType<{
|
|
433
362
|
type: z.ZodString;
|
|
434
363
|
additionalData: z.ZodOptional<z.ZodAny>;
|
|
@@ -451,19 +380,19 @@ export declare const AnalysisSessionSchema: z.ZodObject<{
|
|
|
451
380
|
parts?: ({
|
|
452
381
|
type: "text";
|
|
453
382
|
text: string;
|
|
454
|
-
additionalData?: any;
|
|
455
383
|
isCompleted?: boolean | undefined;
|
|
384
|
+
additionalData?: any;
|
|
456
385
|
} | {
|
|
457
386
|
type: "tool-invocation";
|
|
458
387
|
toolInvocation: {
|
|
459
|
-
toolCallId: string;
|
|
460
388
|
toolName: string;
|
|
389
|
+
toolCallId: string;
|
|
461
390
|
state: string;
|
|
462
|
-
result?: any;
|
|
463
391
|
args?: any;
|
|
392
|
+
result?: any;
|
|
464
393
|
};
|
|
465
|
-
additionalData?: any;
|
|
466
394
|
isCompleted?: boolean | undefined;
|
|
395
|
+
additionalData?: any;
|
|
467
396
|
} | z.objectOutputType<{
|
|
468
397
|
type: z.ZodString;
|
|
469
398
|
additionalData: z.ZodOptional<z.ZodAny>;
|
|
@@ -496,19 +425,19 @@ export declare const AnalysisSessionSchema: z.ZodObject<{
|
|
|
496
425
|
parts?: ({
|
|
497
426
|
type: "text";
|
|
498
427
|
text: string;
|
|
499
|
-
additionalData?: any;
|
|
500
428
|
isCompleted?: boolean | undefined;
|
|
429
|
+
additionalData?: any;
|
|
501
430
|
} | {
|
|
502
431
|
type: "tool-invocation";
|
|
503
432
|
toolInvocation: {
|
|
504
|
-
toolCallId: string;
|
|
505
433
|
toolName: string;
|
|
434
|
+
toolCallId: string;
|
|
506
435
|
state: string;
|
|
507
|
-
result?: any;
|
|
508
436
|
args?: any;
|
|
437
|
+
result?: any;
|
|
509
438
|
};
|
|
510
|
-
additionalData?: any;
|
|
511
439
|
isCompleted?: boolean | undefined;
|
|
440
|
+
additionalData?: any;
|
|
512
441
|
} | z.objectOutputType<{
|
|
513
442
|
type: z.ZodString;
|
|
514
443
|
additionalData: z.ZodOptional<z.ZodAny>;
|
|
@@ -519,6 +448,8 @@ export declare const AnalysisSessionSchema: z.ZodObject<{
|
|
|
519
448
|
error: string;
|
|
520
449
|
} | undefined;
|
|
521
450
|
}[];
|
|
451
|
+
customModelName?: string | undefined;
|
|
452
|
+
ollamaBaseUrl?: string | undefined;
|
|
522
453
|
createdAt?: Date | undefined;
|
|
523
454
|
}, {
|
|
524
455
|
id: string;
|
|
@@ -534,6 +465,8 @@ export declare const AnalysisSessionSchema: z.ZodObject<{
|
|
|
534
465
|
error: string;
|
|
535
466
|
} | undefined;
|
|
536
467
|
}[];
|
|
468
|
+
customModelName?: string | undefined;
|
|
469
|
+
ollamaBaseUrl?: string | undefined;
|
|
537
470
|
createdAt?: Date | undefined;
|
|
538
471
|
}>;
|
|
539
472
|
export type AnalysisSessionSchema = z.infer<typeof AnalysisSessionSchema>;
|
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;
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../src/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAGtB,eAAO,MAAM,mBAAmB;;;;;;;;;;;;EAI9B,CAAC;AACH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEtE,eAAO,MAAM,kBAAkB;;;;;;EAE7B,CAAC;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AA6DpE,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oBAoB4nC,CAAC;sBAAqB,CAAC;;;;;oBAAyG,CAAC;sBAAqB,CAAC;;;;;;;;;;oBAAkR,CAAC;sBAAqB,CAAC;;;;;;;;;;oBAAgO,CAAC;sBAAqB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oBAA9Q,CAAC;sBAAqB,CAAC;;;;;;;;;;;;;;;;;;;;;oBAAgO,CAAC;sBAAqB,CAAC;;;;;;;;;;;;;;;;;;;;;oBAA9Q,CAAC;sBAAqB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oBAAvB,CAAC;sBAAqB,CAAC;;;;;;;;;;;;;;;;;;;;;EAd3lD,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAExE,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAW2nC,CAAC;0BAAqB,CAAC;;;;;wBAAyG,CAAC;0BAAqB,CAAC;;;;;;;;;;wBAAkR,CAAC;0BAAqB,CAAC;;;;;;;;;;wBAAgO,CAAC;0BAAqB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAA9Q,CAAC;0BAAqB,CAAC;;;;;;;;;;;;;;;;;;;;;wBAAgO,CAAC;0BAAqB,CAAC;;;;;;;;;;;;;;;;;;;;;wBAA9Q,CAAC;0BAAqB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAAvB,CAAC;0BAAqB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAAvB,CAAC;0BAAqB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAF3lD,CAAC;AACH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
|
package/dist/schemas.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { StreamMessagePartSchema } from '@openassistant/core';
|
|
2
3
|
export const QueryToolParameters = z.object({
|
|
3
4
|
type: z.literal('query'),
|
|
4
5
|
sqlQuery: z.string(),
|
|
@@ -7,35 +8,6 @@ export const QueryToolParameters = z.object({
|
|
|
7
8
|
export const ErrorMessageSchema = z.object({
|
|
8
9
|
error: z.string(),
|
|
9
10
|
});
|
|
10
|
-
// TODO: StreamMessagePart schema should be provided by @openassistant/core
|
|
11
|
-
export const StreamMessagePartSchema = z.union([
|
|
12
|
-
z.object({
|
|
13
|
-
type: z.literal('text'),
|
|
14
|
-
text: z.string(),
|
|
15
|
-
additionalData: z.any().optional(),
|
|
16
|
-
isCompleted: z.boolean().optional(),
|
|
17
|
-
}),
|
|
18
|
-
z.object({
|
|
19
|
-
type: z.literal('tool-invocation'),
|
|
20
|
-
toolInvocation: z.object({
|
|
21
|
-
toolCallId: z.string(),
|
|
22
|
-
toolName: z.string(),
|
|
23
|
-
args: z.any(),
|
|
24
|
-
state: z.string(),
|
|
25
|
-
result: z.any().optional(),
|
|
26
|
-
}),
|
|
27
|
-
additionalData: z.any().optional(),
|
|
28
|
-
isCompleted: z.boolean().optional(),
|
|
29
|
-
}),
|
|
30
|
-
// Add a catch-all for other part types that might exist
|
|
31
|
-
z
|
|
32
|
-
.object({
|
|
33
|
-
type: z.string(),
|
|
34
|
-
additionalData: z.any().optional(),
|
|
35
|
-
isCompleted: z.boolean().optional(),
|
|
36
|
-
})
|
|
37
|
-
.passthrough(),
|
|
38
|
-
]);
|
|
39
11
|
// migrate from old streamMessage to new streamMessage
|
|
40
12
|
const migrateStreamMessage = z.preprocess((data) => {
|
|
41
13
|
if (data &&
|
|
@@ -98,6 +70,8 @@ export const AnalysisSessionSchema = z.object({
|
|
|
98
70
|
name: z.string(),
|
|
99
71
|
modelProvider: z.string(),
|
|
100
72
|
model: z.string(),
|
|
73
|
+
customModelName: z.string().optional(),
|
|
74
|
+
ollamaBaseUrl: z.string().optional(),
|
|
101
75
|
analysisResults: z.array(AnalysisResultSchema),
|
|
102
76
|
createdAt: z.coerce.date().optional(),
|
|
103
77
|
});
|