@finos/legend-lego 2.0.187 → 2.0.189
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/lib/index.css +2 -2
- package/lib/index.css.map +1 -1
- package/lib/legend-ai/LegendAITypes.d.ts +196 -0
- package/lib/legend-ai/LegendAITypes.d.ts.map +1 -0
- package/lib/legend-ai/LegendAITypes.js +281 -0
- package/lib/legend-ai/LegendAITypes.js.map +1 -0
- package/lib/legend-ai/LegendAI_LegendApplicationPlugin_Extension.d.ts +127 -0
- package/lib/legend-ai/LegendAI_LegendApplicationPlugin_Extension.d.ts.map +1 -0
- package/lib/legend-ai/LegendAI_LegendApplicationPlugin_Extension.js +63 -0
- package/lib/legend-ai/LegendAI_LegendApplicationPlugin_Extension.js.map +1 -0
- package/lib/legend-ai/__test-utils__/LegendAITestUtils.d.ts +29 -0
- package/lib/legend-ai/__test-utils__/LegendAITestUtils.d.ts.map +1 -0
- package/lib/legend-ai/__test-utils__/LegendAITestUtils.js +98 -0
- package/lib/legend-ai/__test-utils__/LegendAITestUtils.js.map +1 -0
- package/lib/legend-ai/components/LegendAIChat.d.ts +23 -0
- package/lib/legend-ai/components/LegendAIChat.d.ts.map +1 -0
- package/lib/legend-ai/components/LegendAIChat.js +179 -0
- package/lib/legend-ai/components/LegendAIChat.js.map +1 -0
- package/lib/legend-ai/components/LegendAIErrorBoundary.d.ts +31 -0
- package/lib/legend-ai/components/LegendAIErrorBoundary.d.ts.map +1 -0
- package/lib/legend-ai/components/LegendAIErrorBoundary.js +35 -0
- package/lib/legend-ai/components/LegendAIErrorBoundary.js.map +1 -0
- package/lib/legend-ai/components/LegendAIResultGrid.d.ts +20 -0
- package/lib/legend-ai/components/LegendAIResultGrid.d.ts.map +1 -0
- package/lib/legend-ai/components/LegendAIResultGrid.js +90 -0
- package/lib/legend-ai/components/LegendAIResultGrid.js.map +1 -0
- package/lib/legend-ai/index.d.ts +22 -0
- package/lib/legend-ai/index.d.ts.map +1 -0
- package/lib/legend-ai/index.js +22 -0
- package/lib/legend-ai/index.js.map +1 -0
- package/lib/legend-ai/stores/LegendAIChatState.d.ts +46 -0
- package/lib/legend-ai/stores/LegendAIChatState.d.ts.map +1 -0
- package/lib/legend-ai/stores/LegendAIChatState.js +559 -0
- package/lib/legend-ai/stores/LegendAIChatState.js.map +1 -0
- package/package.json +7 -3
- package/src/legend-ai/LegendAITypes.ts +386 -0
- package/src/legend-ai/LegendAI_LegendApplicationPlugin_Extension.ts +208 -0
- package/src/legend-ai/__test-utils__/LegendAITestUtils.ts +139 -0
- package/src/legend-ai/components/LegendAIChat.tsx +502 -0
- package/src/legend-ai/components/LegendAIErrorBoundary.tsx +42 -0
- package/src/legend-ai/components/LegendAIResultGrid.tsx +132 -0
- package/src/legend-ai/index.ts +46 -0
- package/src/legend-ai/stores/LegendAIChatState.ts +1004 -0
- package/tsconfig.json +8 -0
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright (c) 2026-present, Goldman Sachs
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
import { useMemo, useCallback, useState, useRef, useEffect } from 'react';
|
|
18
|
+
import { SendIcon, LoadingIcon, SparkleStarsIcon, CodeIcon, TableIcon, CopyIcon, RefreshIcon, MarkdownTextViewer, } from '@finos/legend-art';
|
|
19
|
+
import { noop } from '@finos/legend-shared';
|
|
20
|
+
import { PRIMITIVE_TYPE } from '@finos/legend-graph';
|
|
21
|
+
import { LegendAIThinkingStepStatus, LegendAIMessageRole, LegendAIQuestionIntent, } from '../LegendAITypes.js';
|
|
22
|
+
import { useLegendAIChatState } from '../stores/LegendAIChatState.js';
|
|
23
|
+
import { LegendAIResultGrid } from './LegendAIResultGrid.js';
|
|
24
|
+
export const LEGEND_AI_ANCHOR_ID = 'legend-ai-anchor';
|
|
25
|
+
const COPY_FEEDBACK_DURATION_MS = 2000;
|
|
26
|
+
const MAX_SUGGESTED_QUERIES = 8;
|
|
27
|
+
const STRING_TYPES = new Set([PRIMITIVE_TYPE.STRING]);
|
|
28
|
+
const NUMERIC_TYPES = new Set([
|
|
29
|
+
PRIMITIVE_TYPE.NUMBER,
|
|
30
|
+
PRIMITIVE_TYPE.INTEGER,
|
|
31
|
+
PRIMITIVE_TYPE.FLOAT,
|
|
32
|
+
PRIMITIVE_TYPE.DECIMAL,
|
|
33
|
+
]);
|
|
34
|
+
const DATE_TYPES = new Set([
|
|
35
|
+
PRIMITIVE_TYPE.DATE,
|
|
36
|
+
PRIMITIVE_TYPE.STRICTDATE,
|
|
37
|
+
PRIMITIVE_TYPE.DATETIME,
|
|
38
|
+
]);
|
|
39
|
+
export function isStringColumn(c) {
|
|
40
|
+
return STRING_TYPES.has(c.type ?? '') && !c.name.toLowerCase().includes('id');
|
|
41
|
+
}
|
|
42
|
+
export function isNumericColumn(c) {
|
|
43
|
+
return NUMERIC_TYPES.has(c.type ?? '');
|
|
44
|
+
}
|
|
45
|
+
export function isDateColumn(c) {
|
|
46
|
+
return (DATE_TYPES.has(c.type ?? '') ||
|
|
47
|
+
c.name.toLowerCase().includes('date') ||
|
|
48
|
+
c.name.toLowerCase().includes('time'));
|
|
49
|
+
}
|
|
50
|
+
function buildDataInsightSuggestions(primary, stringCol, numericCol, dateCol) {
|
|
51
|
+
const result = [];
|
|
52
|
+
if (stringCol && numericCol) {
|
|
53
|
+
result.push(`What are the top ${stringCol.name} values by total ${numericCol.name} in ${primary.title}?`);
|
|
54
|
+
}
|
|
55
|
+
else if (stringCol) {
|
|
56
|
+
result.push(`What are the distinct ${stringCol.name} values in ${primary.title}?`);
|
|
57
|
+
}
|
|
58
|
+
if (dateCol && stringCol) {
|
|
59
|
+
result.push(`Show ${primary.title} records from the last month grouped by ${stringCol.name}`);
|
|
60
|
+
}
|
|
61
|
+
if (numericCol && !stringCol) {
|
|
62
|
+
result.push(`What is the total ${numericCol.name} in ${primary.title}?`);
|
|
63
|
+
}
|
|
64
|
+
return result;
|
|
65
|
+
}
|
|
66
|
+
function buildMultiServiceSuggestion(services) {
|
|
67
|
+
if (services.length < 2) {
|
|
68
|
+
return [];
|
|
69
|
+
}
|
|
70
|
+
const svcA = services[0];
|
|
71
|
+
const svcB = services[1];
|
|
72
|
+
if (!svcA || !svcB) {
|
|
73
|
+
return [];
|
|
74
|
+
}
|
|
75
|
+
const result = [`Show the latest 10 records from ${svcB.title}`];
|
|
76
|
+
const colNamesA = new Set(svcA.columns.map((c) => c.name.toLowerCase()));
|
|
77
|
+
const sharedCol = svcB.columns.find((c) => colNamesA.has(c.name.toLowerCase()));
|
|
78
|
+
if (sharedCol) {
|
|
79
|
+
result.push(`Compare ${svcA.title} and ${svcB.title} by ${sharedCol.name}, show 10 rows`);
|
|
80
|
+
}
|
|
81
|
+
return result;
|
|
82
|
+
}
|
|
83
|
+
export function buildSuggestedQueries(services, metadata) {
|
|
84
|
+
const suggestions = [
|
|
85
|
+
`What data does ${metadata.name} offer and how can I use it?`,
|
|
86
|
+
];
|
|
87
|
+
if (services.length === 0) {
|
|
88
|
+
return [
|
|
89
|
+
...suggestions,
|
|
90
|
+
'What access points are available?',
|
|
91
|
+
'Describe the data model and key entities',
|
|
92
|
+
];
|
|
93
|
+
}
|
|
94
|
+
const primary = services[0];
|
|
95
|
+
if (!primary) {
|
|
96
|
+
return [
|
|
97
|
+
...suggestions,
|
|
98
|
+
'What access points are available and what columns do they have?',
|
|
99
|
+
];
|
|
100
|
+
}
|
|
101
|
+
const stringCol = primary.columns.find(isStringColumn);
|
|
102
|
+
const numericCol = primary.columns.find(isNumericColumn);
|
|
103
|
+
const dateCol = primary.columns.find(isDateColumn);
|
|
104
|
+
const multiSvcSuggestions = buildMultiServiceSuggestion(services);
|
|
105
|
+
const primaryRecordsSuggestion = dateCol
|
|
106
|
+
? `Show the 10 most recent records from ${primary.title} by ${dateCol.name}`
|
|
107
|
+
: `Show 10 records from ${primary.title}`;
|
|
108
|
+
return [
|
|
109
|
+
...suggestions,
|
|
110
|
+
primaryRecordsSuggestion,
|
|
111
|
+
...buildDataInsightSuggestions(primary, stringCol, numericCol, dateCol),
|
|
112
|
+
...multiSvcSuggestions,
|
|
113
|
+
].slice(0, MAX_SUGGESTED_QUERIES);
|
|
114
|
+
}
|
|
115
|
+
function renderStepStatusIcon(status) {
|
|
116
|
+
if (status === LegendAIThinkingStepStatus.ACTIVE) {
|
|
117
|
+
return _jsx(LoadingIcon, { isLoading: true });
|
|
118
|
+
}
|
|
119
|
+
return status === LegendAIThinkingStepStatus.DONE ? '\u2713' : '\u2717';
|
|
120
|
+
}
|
|
121
|
+
const AssistantMessageView = (props) => {
|
|
122
|
+
const { msg, isThinkingVisible, onToggleThinking, onSuggestedQueryClick } = props;
|
|
123
|
+
const [sqlCopied, setSqlCopied] = useState(false);
|
|
124
|
+
const copyTimerRef = useRef(undefined);
|
|
125
|
+
useEffect(() => () => {
|
|
126
|
+
if (copyTimerRef.current !== undefined) {
|
|
127
|
+
clearTimeout(copyTimerRef.current);
|
|
128
|
+
}
|
|
129
|
+
}, []);
|
|
130
|
+
const handleCopySql = useCallback(() => {
|
|
131
|
+
if (msg.sql) {
|
|
132
|
+
navigator.clipboard.writeText(msg.sql).catch(noop());
|
|
133
|
+
setSqlCopied(true);
|
|
134
|
+
if (copyTimerRef.current !== undefined) {
|
|
135
|
+
clearTimeout(copyTimerRef.current);
|
|
136
|
+
}
|
|
137
|
+
copyTimerRef.current = setTimeout(() => {
|
|
138
|
+
setSqlCopied(false);
|
|
139
|
+
copyTimerRef.current = undefined;
|
|
140
|
+
}, COPY_FEEDBACK_DURATION_MS);
|
|
141
|
+
}
|
|
142
|
+
}, [msg.sql]);
|
|
143
|
+
return (_jsxs("div", { className: "legend-ai__msg legend-ai__msg--assistant", children: [_jsx("div", { className: "legend-ai__msg-avatar", children: _jsx(SparkleStarsIcon, {}) }), _jsxs("div", { className: "legend-ai__msg-content", children: [msg.thinkingSteps.length > 0 && (_jsxs("div", { className: "legend-ai__thinking", children: [!msg.isProcessing && (_jsxs("button", { type: "button", className: "legend-ai__thinking-toggle", onClick: onToggleThinking, children: [_jsx("span", { className: "legend-ai__thinking-toggle-icon", children: isThinkingVisible ? '\u25BC' : '\u25B6' }), "Thought for ", msg.thinkingDuration ?? '...', "s"] })), isThinkingVisible && (_jsx("div", { className: "legend-ai__thinking-steps", children: msg.thinkingSteps.map((step) => (_jsxs("div", { className: `legend-ai__thinking-step legend-ai__thinking-step--${step.status}`, children: [_jsx("span", { className: "legend-ai__thinking-step-icon", children: renderStepStatusIcon(step.status) }), _jsx("span", { children: step.label })] }, step.label))) }))] })), msg.sql && (_jsxs("div", { className: "legend-ai__sql-block", children: [_jsxs("div", { className: "legend-ai__sql-block-header", children: [_jsx("span", { className: "legend-ai__sql-block-header-icon", children: _jsx(CodeIcon, {}) }), _jsx("span", { children: "Generated SQL" }), msg.sqlGenTime && (_jsxs("span", { className: "legend-ai__sql-block-time", children: [msg.sqlGenTime, "s"] })), _jsx("button", { type: "button", className: "legend-ai__sql-copy-btn", title: "Copy SQL", "aria-label": "Copy SQL", onClick: handleCopySql, children: sqlCopied ? (_jsx("span", { className: "legend-ai__sql-copy-btn--copied", children: "\\u2713" })) : (_jsx(CopyIcon, {})) })] }), _jsx("div", { className: "legend-ai__sql-scroll", children: _jsx("pre", { className: "legend-ai__sql-display", children: msg.sql }) })] })), msg.isExecuting && (_jsxs("div", { className: "legend-ai__executing", children: [_jsx(LoadingIcon, { isLoading: true }), _jsx("span", { children: "Executing query..." })] })), msg.textAnswer && (_jsx("div", { className: "legend-ai__text-answer", children: _jsx(MarkdownTextViewer, { value: { value: msg.textAnswer }, className: "legend-ai__text-answer-md" }) })), msg.error && _jsx("div", { className: "legend-ai__exec-error", children: msg.error }), !msg.isProcessing &&
|
|
144
|
+
msg.suggestedQueries.length > 0 &&
|
|
145
|
+
onSuggestedQueryClick && (_jsxs("div", { className: "legend-ai__follow-up-suggestions", children: [_jsx("span", { className: "legend-ai__follow-up-label", children: "Try a data query:" }), msg.suggestedQueries.map((q) => (_jsx("button", { type: "button", className: "legend-ai__follow-up-btn", onClick: () => onSuggestedQueryClick(q), children: q }, q)))] })), msg.gridData && (_jsxs("div", { className: "legend-ai__results-block", children: [_jsxs("div", { className: "legend-ai__results-header", children: [_jsx("span", { className: "legend-ai__results-header-icon", children: _jsx(TableIcon, {}) }), _jsx("span", { children: "Results" }), _jsxs("span", { className: "legend-ai__results-meta", children: [msg.gridData.rowData.length, " row", msg.gridData.rowData.length === 1 ? '' : 's', msg.execTime ? ` \u00B7 ${msg.execTime}s` : ''] })] }), _jsx(LegendAIResultGrid, { data: msg.gridData })] }))] })] }));
|
|
146
|
+
};
|
|
147
|
+
export const LegendAIChat = (props) => {
|
|
148
|
+
const { services, coordinates, config, metadata, title, plugin, dataProductCoordinates, pureExecutionContext, } = props;
|
|
149
|
+
const state = useLegendAIChatState(services, coordinates, config, metadata, plugin, dataProductCoordinates, pureExecutionContext);
|
|
150
|
+
const suggestedQueries = useMemo(() => buildSuggestedQueries(services, metadata), [services, metadata]);
|
|
151
|
+
const hasMessages = state.messages.length > 0;
|
|
152
|
+
const textareaRef = useRef(null);
|
|
153
|
+
useEffect(() => {
|
|
154
|
+
const el = textareaRef.current;
|
|
155
|
+
if (el) {
|
|
156
|
+
el.style.height = 'auto';
|
|
157
|
+
el.style.height = `${el.scrollHeight}px`;
|
|
158
|
+
}
|
|
159
|
+
}, [state.questionText]);
|
|
160
|
+
return (_jsxs("div", { className: "legend-ai", id: LEGEND_AI_ANCHOR_ID, children: [_jsxs("div", { className: "legend-ai__header", children: [_jsx("div", { className: "legend-ai__header-icon", children: _jsx(SparkleStarsIcon, {}) }), _jsx("div", { className: "legend-ai__title", children: title ?? 'Legend AI' }), hasMessages && (_jsxs("button", { type: "button", className: "legend-ai__clear-btn", title: "Clear chat", "aria-label": "Clear chat", onClick: () => state.clearChat(), children: [_jsx(RefreshIcon, {}), _jsx("span", { children: "Clear" })] }))] }), _jsxs("div", { className: "legend-ai__conversation", ref: state.conversationRef, children: [!hasMessages && (_jsxs("div", { className: "legend-ai__empty-state", children: [_jsx("div", { className: "legend-ai__empty-icon", children: _jsx(SparkleStarsIcon, {}) }), _jsx("div", { className: "legend-ai__empty-text", children: "Ask a question about your data" }), _jsx("div", { className: "legend-ai__suggestions", children: _jsx("div", { className: "legend-ai__suggestions-grid", children: suggestedQueries.map((q) => (_jsxs("button", { type: "button", className: "legend-ai__suggestion-card", onClick: () => {
|
|
161
|
+
state.setQuestionText(q);
|
|
162
|
+
}, children: [_jsx("span", { className: "legend-ai__suggestion-card-icon", children: _jsx(SparkleStarsIcon, {}) }), _jsx("span", { className: "legend-ai__suggestion-card-text", children: q })] }, q))) }) })] })), state.messages.map((msg, msgIndex) => {
|
|
163
|
+
if (msg.role === LegendAIMessageRole.USER) {
|
|
164
|
+
return (_jsx("div", { className: "legend-ai__msg legend-ai__msg--user", children: _jsx("div", { className: "legend-ai__msg-bubble", children: msg.text }) }, msg.id));
|
|
165
|
+
}
|
|
166
|
+
const isThinkingVisible = msg.isProcessing || state.expandedThinking.has(msgIndex);
|
|
167
|
+
return (_jsx(AssistantMessageView, { msg: msg, isThinkingVisible: isThinkingVisible, onToggleThinking: () => state.toggleThinking(msgIndex), onSuggestedQueryClick: (q) => state.askQuestionWithIntent(q, services.length > 0
|
|
168
|
+
? LegendAIQuestionIntent.DATA_QUERY
|
|
169
|
+
: LegendAIQuestionIntent.ORCHESTRATOR) }, msg.id));
|
|
170
|
+
})] }), _jsx("div", { className: "legend-ai__input-area", children: _jsxs("div", { className: "legend-ai__question-wrapper", children: [_jsx("textarea", { ref: textareaRef, className: "legend-ai__question", placeholder: "Ask anything about the data...", rows: 1, spellCheck: false, value: state.questionText, onChange: (e) => state.setQuestionText(e.target.value), onKeyDown: (e) => {
|
|
171
|
+
if (e.key === 'Enter' && !e.shiftKey) {
|
|
172
|
+
e.preventDefault();
|
|
173
|
+
if (!state.isSending && state.questionText.trim()) {
|
|
174
|
+
state.askQuestion();
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
} }), _jsx("button", { type: "button", title: "Send", "aria-label": "Send", className: "legend-ai__send-btn", disabled: state.isSending || !state.questionText.trim(), onClick: () => state.askQuestion(), children: state.isSending ? _jsx(LoadingIcon, { isLoading: true }) : _jsx(SendIcon, {}) })] }) })] }));
|
|
178
|
+
};
|
|
179
|
+
//# sourceMappingURL=LegendAIChat.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LegendAIChat.js","sourceRoot":"","sources":["../../../src/legend-ai/components/LegendAIChat.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC1E,OAAO,EACL,QAAQ,EACR,WAAW,EACX,gBAAgB,EAChB,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,WAAW,EACX,kBAAkB,GACnB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAML,0BAA0B,EAC1B,mBAAmB,EACnB,sBAAsB,GACvB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,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copyright (c) 2026-present, Goldman Sachs
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { Component, type ErrorInfo, type ReactNode } from 'react';
|
|
17
|
+
export declare class LegendAIErrorBoundary extends Component<{
|
|
18
|
+
children: ReactNode;
|
|
19
|
+
}, {
|
|
20
|
+
hasError: boolean;
|
|
21
|
+
}> {
|
|
22
|
+
constructor(props: {
|
|
23
|
+
children: ReactNode;
|
|
24
|
+
});
|
|
25
|
+
static getDerivedStateFromError(): {
|
|
26
|
+
hasError: boolean;
|
|
27
|
+
};
|
|
28
|
+
componentDidCatch(_error: Error, _info: ErrorInfo): void;
|
|
29
|
+
render(): ReactNode;
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=LegendAIErrorBoundary.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LegendAIErrorBoundary.d.ts","sourceRoot":"","sources":["../../../src/legend-ai/components/LegendAIErrorBoundary.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,SAAS,EAAE,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAElE,qBAAa,qBAAsB,SAAQ,SAAS,CAClD;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,EACvB;IAAE,QAAQ,EAAE,OAAO,CAAA;CAAE,CACtB;gBACa,KAAK,EAAE;QAAE,QAAQ,EAAE,SAAS,CAAA;KAAE;IAK1C,MAAM,CAAC,wBAAwB,IAAI;QAAE,QAAQ,EAAE,OAAO,CAAA;KAAE;IAI/C,iBAAiB,CAAC,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,GAAG,IAAI;IAIxD,MAAM,IAAI,SAAS;CAM7B"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026-present, Goldman Sachs
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { Component } from 'react';
|
|
17
|
+
export class LegendAIErrorBoundary extends Component {
|
|
18
|
+
constructor(props) {
|
|
19
|
+
super(props);
|
|
20
|
+
this.state = { hasError: false };
|
|
21
|
+
}
|
|
22
|
+
static getDerivedStateFromError() {
|
|
23
|
+
return { hasError: true };
|
|
24
|
+
}
|
|
25
|
+
componentDidCatch(_error, _info) {
|
|
26
|
+
/* noop */
|
|
27
|
+
}
|
|
28
|
+
render() {
|
|
29
|
+
if (this.state.hasError) {
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
32
|
+
return this.props.children;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=LegendAIErrorBoundary.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LegendAIErrorBoundary.js","sourceRoot":"","sources":["../../../src/legend-ai/components/LegendAIErrorBoundary.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,SAAS,EAAkC,MAAM,OAAO,CAAC;AAElE,MAAM,OAAO,qBAAsB,SAAQ,SAG1C;IACC,YAAY,KAA8B;QACxC,KAAK,CAAC,KAAK,CAAC,CAAC;QACb,IAAI,CAAC,KAAK,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;IACnC,CAAC;IAED,MAAM,CAAC,wBAAwB;QAC7B,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC5B,CAAC;IAEQ,iBAAiB,CAAC,MAAa,EAAE,KAAgB;QACxD,UAAU;IACZ,CAAC;IAEQ,MAAM;QACb,IAAI,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC;YACxB,OAAO,IAAI,CAAC;QACd,CAAC;QACD,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC;IAC7B,CAAC;CACF"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026-present, Goldman Sachs
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { type LegendAIGridData } from '../LegendAITypes.js';
|
|
17
|
+
export declare const LegendAIResultGrid: (props: {
|
|
18
|
+
data: LegendAIGridData;
|
|
19
|
+
}) => React.ReactNode;
|
|
20
|
+
//# sourceMappingURL=LegendAIResultGrid.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LegendAIResultGrid.d.ts","sourceRoot":"","sources":["../../../src/legend-ai/components/LegendAIResultGrid.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAOH,OAAO,EACL,KAAK,gBAAgB,EAEtB,MAAM,qBAAqB,CAAC;AAI7B,eAAO,MAAM,kBAAkB,GAAI,OAAO;IACxC,IAAI,EAAE,gBAAgB,CAAC;CACxB,KAAG,KAAK,CAAC,SAqGT,CAAC"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright (c) 2026-present, Goldman Sachs
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
import { useMemo, useRef, useEffect, useCallback } from 'react';
|
|
18
|
+
import { DataGrid, } from '../../data-grid/index.js';
|
|
19
|
+
import { buildColumnDefsFromNames, } from '../LegendAITypes.js';
|
|
20
|
+
const FIT_GRID_WIDTH_COLUMN_THRESHOLD = 6;
|
|
21
|
+
export const LegendAIResultGrid = (props) => {
|
|
22
|
+
const { data } = props;
|
|
23
|
+
const gridRef = useRef(null);
|
|
24
|
+
const defaultColDef = useMemo(() => ({
|
|
25
|
+
resizable: true,
|
|
26
|
+
sortable: true,
|
|
27
|
+
filter: true,
|
|
28
|
+
minWidth: 120,
|
|
29
|
+
wrapHeaderText: true,
|
|
30
|
+
autoHeaderHeight: true,
|
|
31
|
+
}), []);
|
|
32
|
+
const handleWheel = useCallback((e) => {
|
|
33
|
+
const container = gridRef.current;
|
|
34
|
+
if (!container) {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
const viewport = container.querySelector('.ag-body-horizontal-scroll-viewport');
|
|
38
|
+
if (!viewport) {
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
if (e.shiftKey && e.deltaY !== 0) {
|
|
42
|
+
viewport.scrollLeft += e.deltaY;
|
|
43
|
+
e.preventDefault();
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
const body = container.querySelector('.ag-body-viewport');
|
|
47
|
+
if (body && e.deltaY !== 0) {
|
|
48
|
+
const atTop = body.scrollTop <= 0 && e.deltaY < 0;
|
|
49
|
+
const atBottom = body.scrollTop + body.clientHeight >= body.scrollHeight - 1 &&
|
|
50
|
+
e.deltaY > 0;
|
|
51
|
+
if (atTop || atBottom) {
|
|
52
|
+
viewport.scrollLeft += e.deltaY;
|
|
53
|
+
e.preventDefault();
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}, []);
|
|
57
|
+
useEffect(() => {
|
|
58
|
+
const el = gridRef.current;
|
|
59
|
+
if (!el) {
|
|
60
|
+
return undefined;
|
|
61
|
+
}
|
|
62
|
+
el.addEventListener('wheel', handleWheel, { passive: false });
|
|
63
|
+
return () => {
|
|
64
|
+
el.removeEventListener('wheel', handleWheel);
|
|
65
|
+
};
|
|
66
|
+
}, [handleWheel]);
|
|
67
|
+
const effectiveColumnDefs = useMemo(() => {
|
|
68
|
+
if (data.columnDefs.length > 0) {
|
|
69
|
+
return data.columnDefs;
|
|
70
|
+
}
|
|
71
|
+
const firstRow = data.rowData[0];
|
|
72
|
+
if (firstRow) {
|
|
73
|
+
return buildColumnDefsFromNames(Object.keys(firstRow));
|
|
74
|
+
}
|
|
75
|
+
return [];
|
|
76
|
+
}, [data.columnDefs, data.rowData]);
|
|
77
|
+
if (effectiveColumnDefs.length === 0) {
|
|
78
|
+
return _jsx("div", { className: "legend-ai__grid--empty", children: "No results to display" });
|
|
79
|
+
}
|
|
80
|
+
const fewColumns = effectiveColumnDefs.length <= FIT_GRID_WIDTH_COLUMN_THRESHOLD;
|
|
81
|
+
return (_jsx("div", { ref: gridRef, className: "legend-ai__grid ag-theme-balham", children: _jsx(DataGrid, { columnDefs: effectiveColumnDefs, rowData: data.rowData, defaultColDef: defaultColDef, suppressFieldDotNotation: true, autoSizeStrategy: fewColumns
|
|
82
|
+
? { type: 'fitGridWidth', defaultMinWidth: 120 }
|
|
83
|
+
: { type: 'fitCellContents' }, alwaysShowHorizontalScroll: !fewColumns, enableRangeSelection: true, copyHeadersToClipboard: true, enableCharts: true, statusBar: {
|
|
84
|
+
statusPanels: [
|
|
85
|
+
{ statusPanel: 'agTotalRowCountComponent', align: 'left' },
|
|
86
|
+
{ statusPanel: 'agAggregationComponent', align: 'right' },
|
|
87
|
+
],
|
|
88
|
+
} }) }));
|
|
89
|
+
};
|
|
90
|
+
//# sourceMappingURL=LegendAIResultGrid.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LegendAIResultGrid.js","sourceRoot":"","sources":["../../../src/legend-ai/components/LegendAIResultGrid.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAChE,OAAO,EACL,QAAQ,GAET,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAEL,wBAAwB,GACzB,MAAM,qBAAqB,CAAC;AAE7B,MAAM,+BAA+B,GAAG,CAAC,CAAC;AAE1C,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,KAElC,EAAmB,EAAE;IACpB,MAAM,EAAE,IAAI,E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,EAAE,SAAS,EAAC,iCAAiC,YAC5D,KAAC,QAAQ,IACP,UAAU,EAAE,mBAAmB,EAC/B,OAAO,EAAE,IAAI,CAAC,OAAO,EACrB,aAAa,EAAE,aAAa,EAC5B,wBAAwB,EAAE,IAAI,EAC9B,gBAAgB,EACd,UAAU;gBACR,CAAC,CAAC,EAAE,IAAI,EAAE,cAAc,EAAE,eAAe,EAAE,GAAG,EAAE;gBAChD,CAAC,CAAC,EAAE,IAAI,EAAE,iBAAiB,EAAE,EAEjC,0BAA0B,EAAE,CAAC,UAAU,EACvC,oBAAoB,EAAE,IAAI,EAC1B,sBAAsB,EAAE,IAAI,EAC5B,YAAY,EAAE,IAAI,EAClB,SAAS,EAAE;gBACT,YAAY,EAAE;oBACZ,EAAE,WAAW,EAAE,0BAA0B,EAAE,KAAK,EAAE,MAAM,EAAE;oBAC1D,EAAE,WAAW,EAAE,wBAAwB,EAAE,KAAK,EAAE,OAAO,EAAE;iBAC1D;aACF,GACD,GACE,CACP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2020-present, Goldman Sachs
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
export * from './LegendAITypes.js';
|
|
17
|
+
export * from './LegendAI_LegendApplicationPlugin_Extension.js';
|
|
18
|
+
export { LegendAIChat, LEGEND_AI_ANCHOR_ID, isStringColumn, isNumericColumn, isDateColumn, buildSuggestedQueries, } from './components/LegendAIChat.js';
|
|
19
|
+
export { LegendAIErrorBoundary } from './components/LegendAIErrorBoundary.js';
|
|
20
|
+
export { useLegendAIChatState, updateLastAssistant, addThinkingStep, completeThinkingSteps, finishWithThinkingError, buildConversationHistory, buildGenerationFailureMessage, buildExecutionErrorMessage, generateAndJudgeSql, executeSqlAndReport, executePureQueryAndReport, processQuestionViaOrchestrator, processQuestion, processQuestionWithIntent, handleMetadataQuestion, type MessageSetter, } from './stores/LegendAIChatState.js';
|
|
21
|
+
export { LegendAIResultGrid } from './components/LegendAIResultGrid.js';
|
|
22
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/legend-ai/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,cAAc,oBAAoB,CAAC;AACnC,cAAc,iDAAiD,CAAC;AAChE,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,cAAc,EACd,eAAe,EACf,YAAY,EACZ,qBAAqB,GACtB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,qBAAqB,EAAE,MAAM,uCAAuC,CAAC;AAC9E,OAAO,EACL,oBAAoB,EACpB,mBAAmB,EACnB,eAAe,EACf,qBAAqB,EACrB,uBAAuB,EACvB,wBAAwB,EACxB,6BAA6B,EAC7B,0BAA0B,EAC1B,mBAAmB,EACnB,mBAAmB,EACnB,yBAAyB,EACzB,8BAA8B,EAC9B,eAAe,EACf,yBAAyB,EACzB,sBAAsB,EACtB,KAAK,aAAa,GACnB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2020-present, Goldman Sachs
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
export * from './LegendAITypes.js';
|
|
17
|
+
export * from './LegendAI_LegendApplicationPlugin_Extension.js';
|
|
18
|
+
export { LegendAIChat, LEGEND_AI_ANCHOR_ID, isStringColumn, isNumericColumn, isDateColumn, buildSuggestedQueries, } from './components/LegendAIChat.js';
|
|
19
|
+
export { LegendAIErrorBoundary } from './components/LegendAIErrorBoundary.js';
|
|
20
|
+
export { useLegendAIChatState, updateLastAssistant, addThinkingStep, completeThinkingSteps, finishWithThinkingError, buildConversationHistory, buildGenerationFailureMessage, buildExecutionErrorMessage, generateAndJudgeSql, executeSqlAndReport, executePureQueryAndReport, processQuestionViaOrchestrator, processQuestion, processQuestionWithIntent, handleMetadataQuestion, } from './stores/LegendAIChatState.js';
|
|
21
|
+
export { LegendAIResultGrid } from './components/LegendAIResultGrid.js';
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/legend-ai/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,cAAc,oBAAoB,CAAC;AACnC,cAAc,iDAAiD,CAAC;AAChE,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,cAAc,EACd,eAAe,EACf,YAAY,EACZ,qBAAqB,GACtB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,qBAAqB,EAAE,MAAM,uCAAuC,CAAC;AAC9E,OAAO,EACL,oBAAoB,EACpB,mBAAmB,EACnB,eAAe,EACf,qBAAqB,EACrB,uBAAuB,EACvB,wBAAwB,EACxB,6BAA6B,EAC7B,0BAA0B,EAC1B,mBAAmB,EACnB,mBAAmB,EACnB,yBAAyB,EACzB,8BAA8B,EAC9B,eAAe,EACf,yBAAyB,EACzB,sBAAsB,GAEvB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026-present, Goldman Sachs
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { type TDSServiceSchema, type LegendAIConfig, type LegendAIChatState, type LegendAIAssistantMessage, type LegendAIMessage, type LegendAIConversationTurn, type LegendAIProductMetadata, LegendAIQuestionIntent } from '../LegendAITypes.js';
|
|
17
|
+
import { type LegendAI_LegendApplicationPlugin_Extension, type LegendAIOrchestratorDataProductCoordinates, type LegendAISqlExecutionResultData } from '../LegendAI_LegendApplicationPlugin_Extension.js';
|
|
18
|
+
import type { QueryExplicitExecutionContextInfo } from '@finos/legend-graph';
|
|
19
|
+
export type MessageSetter = React.Dispatch<React.SetStateAction<LegendAIMessage[]>>;
|
|
20
|
+
interface LegendAIOperationContext {
|
|
21
|
+
config: LegendAIConfig;
|
|
22
|
+
plugin: LegendAI_LegendApplicationPlugin_Extension;
|
|
23
|
+
history: LegendAIConversationTurn[];
|
|
24
|
+
setMessages: MessageSetter;
|
|
25
|
+
}
|
|
26
|
+
interface LegendAIOrchestratorOptionsParam {
|
|
27
|
+
dataProductCoordinates: LegendAIOrchestratorDataProductCoordinates;
|
|
28
|
+
pureExecutionContext?: QueryExplicitExecutionContextInfo;
|
|
29
|
+
}
|
|
30
|
+
export declare function updateLastAssistant(setMessages: MessageSetter, updater: (msg: LegendAIAssistantMessage) => Partial<LegendAIAssistantMessage>): void;
|
|
31
|
+
export declare function addThinkingStep(setMessages: MessageSetter, label: string): void;
|
|
32
|
+
export declare function completeThinkingSteps(setMessages: MessageSetter): void;
|
|
33
|
+
export declare function finishWithThinkingError(setMessages: MessageSetter, errorMsg: string, startTime: number): void;
|
|
34
|
+
export declare function buildConversationHistory(messages: LegendAIMessage[]): LegendAIConversationTurn[];
|
|
35
|
+
export declare function buildGenerationFailureMessage(failure: string, suggestion: string | undefined, services: TDSServiceSchema[]): string;
|
|
36
|
+
export declare function buildExecutionErrorMessage(errStr: string, services: TDSServiceSchema[]): string;
|
|
37
|
+
export declare function handleMetadataQuestion(question: string, metadata: LegendAIProductMetadata, context: LegendAIOperationContext, startTime: number, hasQueryableServices?: boolean): Promise<void>;
|
|
38
|
+
export declare function generateAndJudgeSql(question: string, services: TDSServiceSchema[], coordinates: string, context: LegendAIOperationContext, startTime: number): Promise<string | null>;
|
|
39
|
+
export declare function executeSqlAndReport(sql: string, services: TDSServiceSchema[], config: LegendAIConfig, plugin: LegendAI_LegendApplicationPlugin_Extension, setMessages: MessageSetter, startTime: number, dataProductCoordinates?: LegendAIOrchestratorDataProductCoordinates): Promise<LegendAISqlExecutionResultData | undefined>;
|
|
40
|
+
export declare function executePureQueryAndReport(pureQuery: string, pureExecutionContext: QueryExplicitExecutionContextInfo, dataProductCoordinates: LegendAIOrchestratorDataProductCoordinates, config: LegendAIConfig, plugin: LegendAI_LegendApplicationPlugin_Extension, setMessages: MessageSetter, startTime: number): Promise<LegendAISqlExecutionResultData>;
|
|
41
|
+
export declare function processQuestionViaOrchestrator(question: string, dataProductCoordinates: LegendAIOrchestratorDataProductCoordinates, _metadata: LegendAIProductMetadata, context: LegendAIOperationContext, pureExecutionContext?: QueryExplicitExecutionContextInfo): Promise<void>;
|
|
42
|
+
export declare function processQuestion(question: string, services: TDSServiceSchema[], coordinates: string, metadata: LegendAIProductMetadata, context: LegendAIOperationContext, dataProductCoordinates?: LegendAIOrchestratorDataProductCoordinates, pureExecutionContext?: QueryExplicitExecutionContextInfo): Promise<void>;
|
|
43
|
+
export declare function processQuestionWithIntent(question: string, intent: LegendAIQuestionIntent, services: TDSServiceSchema[], coordinates: string, metadata: LegendAIProductMetadata, context: LegendAIOperationContext, orchestratorOptions?: LegendAIOrchestratorOptionsParam): Promise<void>;
|
|
44
|
+
export declare const useLegendAIChatState: (services: TDSServiceSchema[], coordinates: string, config: LegendAIConfig, metadata: LegendAIProductMetadata, plugin: LegendAI_LegendApplicationPlugin_Extension, dataProductCoordinates?: LegendAIOrchestratorDataProductCoordinates, pureExecutionContext?: QueryExplicitExecutionContextInfo) => LegendAIChatState;
|
|
45
|
+
export {};
|
|
46
|
+
//# sourceMappingURL=LegendAIChatState.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LegendAIChatState.d.ts","sourceRoot":"","sources":["../../../src/legend-ai/stores/LegendAIChatState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACtB,KAAK,wBAAwB,EAE7B,KAAK,eAAe,EACpB,KAAK,wBAAwB,EAC7B,KAAK,uBAAuB,EAC5B,sBAAsB,EAKvB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,KAAK,0CAA0C,EAC/C,KAAK,0CAA0C,EAC/C,KAAK,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