@sisense/sdk-ai-core 0.6.0 → 0.6.1
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/constants.d.ts +1 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/engines/build-query/types.d.ts +1 -1
- package/dist/engines/build-query/types.d.ts.map +1 -1
- package/dist/engines/chart-builder/update-chart/update-chart-data-options.d.ts.map +1 -1
- package/dist/engines/data-source-fields/data-source-fields-engine.d.ts +12 -4
- package/dist/engines/data-source-fields/data-source-fields-engine.d.ts.map +1 -1
- package/dist/engines/data-source-fields/types.d.ts +3 -1
- package/dist/engines/data-source-fields/types.d.ts.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1285 -1222
- package/dist/index.js.map +1 -1
- package/dist/services/formulas/formulas-service.d.ts +14 -0
- package/dist/services/formulas/formulas-service.d.ts.map +1 -0
- package/dist/utils/http-client.d.ts +5 -2
- package/dist/utils/http-client.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/constants.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export declare const TOOL_NAME_GET_DATA_SOURCE_FIELDS = "getDataSourceFields";
|
|
|
8
8
|
export declare const TOOL_NAME_BUILD_QUERY = "buildQuery";
|
|
9
9
|
export declare const TOOL_CONTEXT_MAX_ASSETS = 10;
|
|
10
10
|
export declare const MAX_DATA_SOURCE_FIELDS_SUMMARY = 200;
|
|
11
|
+
export declare const MAX_DATA_SOURCE_FORMULAS_SUMMARY = 50;
|
|
11
12
|
export declare const DEFAULT_LLM = "LLM_PLACEHOLDER";
|
|
12
13
|
export declare const HEADER_USER_ACTION_ID = "x-user-action-id";
|
|
13
14
|
export declare const HEADER_TRACEPARENT = "traceparent";
|
package/dist/constants.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"A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,oBAAoB,CAAC;AAG7C,eAAO,MAAM,qBAAqB,qBAAqB,CAAC;AACxD,eAAO,MAAM,kBAAkB,gBAAgB,CAAC;AAChD,eAAO,MAAM,qBAAqB,qBAAqB,CAAC;AACxD,eAAO,MAAM,mBAAmB,mBAAmB,CAAC;AACpD,eAAO,MAAM,eAAe,eAAe,CAAC;AAE5C,eAAO,MAAM,eAAe,UAM3B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/engines/build-query/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAE7D;;GAEG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;EAS3B,CAAC;AAEH;;GAEG;AACH,MAAM,WAAW,iBAAiB;IACjC,gCAAgC;IAChC,UAAU,EAAE,MAAM,CAAC;IACnB,2EAA2E;IAC3E,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,wEAAwE;IACxE,eAAe,CAAC,EAAE,MAAM,MAAM,CAAC;CAC/B;AAED,MAAM,WAAW,WAAW;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,WAAW,CAAC;IACvB,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/engines/build-query/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAE7D;;GAEG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;EAS3B,CAAC;AAEH;;GAEG;AACH,MAAM,WAAW,iBAAiB;IACjC,gCAAgC;IAChC,UAAU,EAAE,MAAM,CAAC;IACnB,2EAA2E;IAC3E,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,wEAAwE;IACxE,eAAe,CAAC,EAAE,MAAM,MAAM,CAAC;CAC/B;AAED,MAAM,WAAW,WAAW;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,WAAW,CAAC;IACvB,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;CAChC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-chart-data-options.d.ts","sourceRoot":"","sources":["../../../../src/engines/chart-builder/update-chart/update-chart-data-options.ts"],"names":[],"mappings":"AACA,OAAO,EACN,iBAAiB,EACjB,wBAAwB,EACxB,iBAAiB,EACjB,MAAM,UAAU,CAAC;AAQlB,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,KAAK,kCAAkC,GAAG;IACzC,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,EAAE,wBAAwB,CAAC;CAC3C,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,+BAA+B,GAC3C,kBAAkB,wBAAwB,EAC1C,gBAAgB,CAAC,CAAC,UAAU,EAC5B,yBAAyB,MAAM,KAC7B,MA8DF,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,4BAA4B,GAAU,iDAIhD,kCAAkC,KAAG,OAAO,CAAC,wBAAwB,
|
|
1
|
+
{"version":3,"file":"update-chart-data-options.d.ts","sourceRoot":"","sources":["../../../../src/engines/chart-builder/update-chart/update-chart-data-options.ts"],"names":[],"mappings":"AACA,OAAO,EACN,iBAAiB,EACjB,wBAAwB,EACxB,iBAAiB,EACjB,MAAM,UAAU,CAAC;AAQlB,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,KAAK,kCAAkC,GAAG;IACzC,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,EAAE,wBAAwB,CAAC;CAC3C,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,+BAA+B,GAC3C,kBAAkB,wBAAwB,EAC1C,gBAAgB,CAAC,CAAC,UAAU,EAC5B,yBAAyB,MAAM,KAC7B,MA8DF,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,4BAA4B,GAAU,iDAIhD,kCAAkC,KAAG,OAAO,CAAC,wBAAwB,CAoCvE,CAAC;AA8CF,eAAO,MAAM,sBAAsB,GAClC,yBAAyB,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,EAC1D,cAAc,MAAM,EACpB,SAAS,iBAAiB;;EAgB1B,CAAC;AAgHF,eAAO,MAAM,yBAAyB,4BA/FX,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,WACjD,iBAAiB;;EAgG3B,CAAC;AAEF,eAAO,MAAM,kBAAkB,4BAnGJ,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,WACjD,iBAAiB;;EAoG3B,CAAC;AAEF,eAAO,MAAM,sBAAsB,4BAvGR,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,WACjD,iBAAiB;;EAwG3B,CAAC;AAEF,eAAO,MAAM,2BAA2B,4BA3Gb,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,WACjD,iBAAiB;;EA4G3B,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { JSONArray, DataSourceField } from '@sisense/sdk-data';
|
|
2
3
|
import { DataSourceFieldWithDescription } from '../../services/data-sources/data-sources-service';
|
|
3
|
-
import { DataSourceField } from '@sisense/sdk-data';
|
|
4
4
|
import { getDataSourceFieldsSchema, GetDataSourceFieldsContext, DataSourceFieldsResult } from './types';
|
|
5
5
|
/**
|
|
6
6
|
* Fetches fields for a data source (decoupled from UI/store).
|
|
@@ -10,11 +10,19 @@ import { getDataSourceFieldsSchema, GetDataSourceFieldsContext, DataSourceFields
|
|
|
10
10
|
*/
|
|
11
11
|
export declare function getDataSourceFieldsEngine(params: z.infer<typeof getDataSourceFieldsSchema>, context: GetDataSourceFieldsContext): Promise<DataSourceFieldsResult>;
|
|
12
12
|
/**
|
|
13
|
-
* Builds the
|
|
13
|
+
* Builds the shared formulas block for the LLM summary from NLQ-shaped formula JSON.
|
|
14
|
+
* Each formula must have an `args` array: name = args[0]; description = args[args.length - 1] only when args.length >= 2, else ''.
|
|
15
|
+
* @param formulas - Shared formulas in JSON format (array of { function, args })
|
|
16
|
+
* @returns YAML block with heading and list of { name, description }, or empty string if none
|
|
17
|
+
*/
|
|
18
|
+
export declare function buildCompactSharedFormulas(formulas: JSONArray): string;
|
|
19
|
+
/**
|
|
20
|
+
* Builds the compact schema string returned to the LLM (intro + tables/columns + optional shared formulas).
|
|
14
21
|
* Reduces token use by returning a single string instead of a JSON object.
|
|
15
22
|
* @param dataSourceTitle - The title of the data source
|
|
16
23
|
* @param fields - The full list of fields from the data source
|
|
17
|
-
* @
|
|
24
|
+
* @param formulas - Optional shared formulas in NLQ JSON format (for the chat agent)
|
|
25
|
+
* @returns A compact schema string with table and column names, and shared formulas when provided
|
|
18
26
|
*/
|
|
19
|
-
export declare function getDataSourceFieldsSummary(dataSourceTitle: string, fields: DataSourceFieldWithDescription[] | DataSourceField[]): string;
|
|
27
|
+
export declare function getDataSourceFieldsSummary(dataSourceTitle: string, fields: DataSourceFieldWithDescription[] | DataSourceField[], formulas?: JSONArray): string;
|
|
20
28
|
//# sourceMappingURL=data-source-fields-engine.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-source-fields-engine.d.ts","sourceRoot":"","sources":["../../../src/engines/data-source-fields/data-source-fields-engine.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAEN,8BAA8B,EAC9B,MAAM,8CAA8C,CAAC;
|
|
1
|
+
{"version":3,"file":"data-source-fields-engine.d.ts","sourceRoot":"","sources":["../../../src/engines/data-source-fields/data-source-fields-engine.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,SAAS,EAAa,MAAM,mBAAmB,CAAC;AAE9D,OAAO,EAEN,8BAA8B,EAC9B,MAAM,8CAA8C,CAAC;AAEtD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAOpD,OAAO,EACN,yBAAyB,EACzB,0BAA0B,EAC1B,sBAAsB,EACtB,MAAM,SAAS,CAAC;AAEjB;;;;;GAKG;AACH,wBAAsB,yBAAyB,CAC9C,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,EACjD,OAAO,EAAE,0BAA0B,GACjC,OAAO,CAAC,sBAAsB,CAAC,CAiDjC;AAsBD;;;;;GAKG;AACH,wBAAgB,0BAA0B,CAAC,QAAQ,EAAE,SAAS,GAAG,MAAM,CAuCtE;AAED;;;;;;;GAOG;AACH,wBAAgB,0BAA0B,CACzC,eAAe,EAAE,MAAM,EACvB,MAAM,EAAE,8BAA8B,EAAE,GAAG,eAAe,EAAE,EAC5D,QAAQ,CAAC,EAAE,SAAS,GAClB,MAAM,CA2BR"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { DataSourceField } from '@sisense/sdk-data';
|
|
2
|
+
import { DataSourceField, JSONArray } from '@sisense/sdk-data';
|
|
3
3
|
import { HttpClient } from '@sisense/sdk-rest-client';
|
|
4
4
|
import { DataSourceFieldWithDescription } from '../../services/data-sources/data-sources-service';
|
|
5
5
|
/**
|
|
@@ -28,5 +28,7 @@ export interface GetDataSourceFieldsContext {
|
|
|
28
28
|
export interface DataSourceFieldsResult {
|
|
29
29
|
dataSourceTitle: string;
|
|
30
30
|
fields: DataSourceFieldWithDescription[] | DataSourceField[];
|
|
31
|
+
/** Shared formulas as JSON */
|
|
32
|
+
formulas?: JSONArray;
|
|
31
33
|
}
|
|
32
34
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/engines/data-source-fields/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/engines/data-source-fields/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,KAAK,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,8BAA8B,EAAE,MAAM,8CAA8C,CAAC;AAE9F;;GAEG;AACH,eAAO,MAAM,yBAAyB;;;;;;EAEpC,CAAC;AAEH;;GAEG;AACH,MAAM,WAAW,0BAA0B;IAC1C;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,UAAU,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACtC,eAAe,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,8BAA8B,EAAE,GAAG,eAAe,EAAE,CAAC;IAC7D,8BAA8B;IAC9B,QAAQ,CAAC,EAAE,SAAS,CAAC;CACrB"}
|
package/dist/index.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export * from './utils/user-action-tracking';
|
|
|
9
9
|
export * from './singleton-clients';
|
|
10
10
|
export * from './utils/chat-completion-utils';
|
|
11
11
|
export * from './services/data-sources/data-sources-service';
|
|
12
|
+
export * from './services/formulas/formulas-service';
|
|
12
13
|
export * from './services/nlq/nlq-service';
|
|
13
14
|
export * from './services/dashboards/fusion-dashboards-service';
|
|
14
15
|
export * from './services/dashboards/dashboards-service';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,WAAW,CAAC;AAG1B,cAAc,aAAa,CAAC;AAG5B,OAAO,EACN,WAAW,EACX,iBAAiB,EACjB,uBAAuB,EACvB,sBAAsB,GACtB,MAAM,mBAAmB,CAAC;AAG3B,cAAc,kBAAkB,CAAC;AAGjC,cAAc,eAAe,CAAC;AAE9B,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,8BAA8B,CAAC;AAG7C,cAAc,qBAAqB,CAAC;AAGpC,cAAc,+BAA+B,CAAC;AAG9C,cAAc,8CAA8C,CAAC;AAC7D,cAAc,4BAA4B,CAAC;AAC3C,cAAc,iDAAiD,CAAC;AAChE,cAAc,0CAA0C,CAAC;AACzD,cAAc,4CAA4C,CAAC;AAC3D,cAAc,oCAAoC,CAAC;AACnD,cAAc,oCAAoC,CAAC;AACnD,cAAc,qCAAqC,CAAC;AACpD,cAAc,wCAAwC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,WAAW,CAAC;AAG1B,cAAc,aAAa,CAAC;AAG5B,OAAO,EACN,WAAW,EACX,iBAAiB,EACjB,uBAAuB,EACvB,sBAAsB,GACtB,MAAM,mBAAmB,CAAC;AAG3B,cAAc,kBAAkB,CAAC;AAGjC,cAAc,eAAe,CAAC;AAE9B,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,8BAA8B,CAAC;AAG7C,cAAc,qBAAqB,CAAC;AAGpC,cAAc,+BAA+B,CAAC;AAG9C,cAAc,8CAA8C,CAA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