@wildix/wim-knowledge-base-client 0.0.55 → 0.0.59
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-cjs/protocols/Aws_restJson1.js +23 -3
- package/dist-es/protocols/Aws_restJson1.js +24 -4
- package/dist-types/commands/GenerateSearchAnswerCommand.d.ts +2 -2
- package/dist-types/commands/ListSearchQueriesHistoryCommand.d.ts +16 -9
- package/dist-types/commands/SearchKnowledgeBaseCommand.d.ts +1 -1
- package/dist-types/models/models_0.d.ts +81 -10
- package/package.json +1 -1
|
@@ -1287,11 +1287,11 @@ const de_DescribeDataSourceResult = (output, context) => {
|
|
|
1287
1287
|
};
|
|
1288
1288
|
const de_SearchHistoryItem = (output, context) => {
|
|
1289
1289
|
return (0, smithy_client_1.take)(output, {
|
|
1290
|
-
'chunks': (_) => de_SearchKnowledgeBaseResultsList(_, context),
|
|
1291
|
-
'chunksCount': smithy_client_1.expectInt32,
|
|
1292
1290
|
'companyId': smithy_client_1.expectString,
|
|
1293
|
-
'createdAt':
|
|
1291
|
+
'createdAt': smithy_client_1.expectString,
|
|
1294
1292
|
'request': (_) => de_SearchHistoryRequest(_, context),
|
|
1293
|
+
'results': (_) => de_SearchHistoryResultsList(_, context),
|
|
1294
|
+
'resultsCount': smithy_client_1.expectInt32,
|
|
1295
1295
|
'sessionId': smithy_client_1.expectString,
|
|
1296
1296
|
'stages': smithy_client_1._json,
|
|
1297
1297
|
'totalDuration': smithy_client_1.expectInt32,
|
|
@@ -1314,6 +1314,26 @@ const de_SearchHistoryRequest = (output, context) => {
|
|
|
1314
1314
|
'user': smithy_client_1.expectString,
|
|
1315
1315
|
});
|
|
1316
1316
|
};
|
|
1317
|
+
const de_SearchHistoryResultItem = (output, context) => {
|
|
1318
|
+
return (0, smithy_client_1.take)(output, {
|
|
1319
|
+
'chunkId': smithy_client_1.expectString,
|
|
1320
|
+
'dataSourceId': smithy_client_1.expectString,
|
|
1321
|
+
'dataSourceType': smithy_client_1.expectString,
|
|
1322
|
+
'documentHierarchy': smithy_client_1._json,
|
|
1323
|
+
'documentId': smithy_client_1.expectString,
|
|
1324
|
+
'documentTitle': smithy_client_1.expectString,
|
|
1325
|
+
'documentUrl': smithy_client_1.expectString,
|
|
1326
|
+
'fullTextScore': smithy_client_1.limitedParseDouble,
|
|
1327
|
+
'score': smithy_client_1.limitedParseDouble,
|
|
1328
|
+
'semanticScore': smithy_client_1.limitedParseDouble,
|
|
1329
|
+
});
|
|
1330
|
+
};
|
|
1331
|
+
const de_SearchHistoryResultsList = (output, context) => {
|
|
1332
|
+
const retVal = (output || []).filter((e) => e != null).map((entry) => {
|
|
1333
|
+
return de_SearchHistoryResultItem(entry, context);
|
|
1334
|
+
});
|
|
1335
|
+
return retVal;
|
|
1336
|
+
};
|
|
1317
1337
|
const de_SearchKnowledgeBaseResultItem = (output, context) => {
|
|
1318
1338
|
return (0, smithy_client_1.take)(output, {
|
|
1319
1339
|
'chunkId': smithy_client_1.expectString,
|
|
@@ -2,7 +2,7 @@ import { KnowledgeBaseServiceException as __BaseException } from "../models/Know
|
|
|
2
2
|
import { DataSourceConfig, DataSourceNotFoundException, DocumentNotFoundException, ForbiddenException, KnowledgeBaseNotFoundException, UnauthorizedException, ValidationException, } from "../models/models_0";
|
|
3
3
|
import { awsExpectUnion as __expectUnion, loadRestJsonErrorCode, parseJsonBody as parseBody, parseJsonErrorBody as parseErrorBody, } from "@aws-sdk/core";
|
|
4
4
|
import { requestBuilder as rb } from "@smithy/core";
|
|
5
|
-
import { decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectNonNull as __expectNonNull,
|
|
5
|
+
import { decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, limitedParseDouble as __limitedParseDouble, serializeFloat as __serializeFloat, _json, collectBody, map, take, withBaseException, } from "@smithy/smithy-client";
|
|
6
6
|
export const se_CleanDataSourceCommand = async (input, context) => {
|
|
7
7
|
const b = rb(input, context);
|
|
8
8
|
const headers = {};
|
|
@@ -1219,11 +1219,11 @@ const de_DescribeDataSourceResult = (output, context) => {
|
|
|
1219
1219
|
};
|
|
1220
1220
|
const de_SearchHistoryItem = (output, context) => {
|
|
1221
1221
|
return take(output, {
|
|
1222
|
-
'chunks': (_) => de_SearchKnowledgeBaseResultsList(_, context),
|
|
1223
|
-
'chunksCount': __expectInt32,
|
|
1224
1222
|
'companyId': __expectString,
|
|
1225
|
-
'createdAt':
|
|
1223
|
+
'createdAt': __expectString,
|
|
1226
1224
|
'request': (_) => de_SearchHistoryRequest(_, context),
|
|
1225
|
+
'results': (_) => de_SearchHistoryResultsList(_, context),
|
|
1226
|
+
'resultsCount': __expectInt32,
|
|
1227
1227
|
'sessionId': __expectString,
|
|
1228
1228
|
'stages': _json,
|
|
1229
1229
|
'totalDuration': __expectInt32,
|
|
@@ -1246,6 +1246,26 @@ const de_SearchHistoryRequest = (output, context) => {
|
|
|
1246
1246
|
'user': __expectString,
|
|
1247
1247
|
});
|
|
1248
1248
|
};
|
|
1249
|
+
const de_SearchHistoryResultItem = (output, context) => {
|
|
1250
|
+
return take(output, {
|
|
1251
|
+
'chunkId': __expectString,
|
|
1252
|
+
'dataSourceId': __expectString,
|
|
1253
|
+
'dataSourceType': __expectString,
|
|
1254
|
+
'documentHierarchy': _json,
|
|
1255
|
+
'documentId': __expectString,
|
|
1256
|
+
'documentTitle': __expectString,
|
|
1257
|
+
'documentUrl': __expectString,
|
|
1258
|
+
'fullTextScore': __limitedParseDouble,
|
|
1259
|
+
'score': __limitedParseDouble,
|
|
1260
|
+
'semanticScore': __limitedParseDouble,
|
|
1261
|
+
});
|
|
1262
|
+
};
|
|
1263
|
+
const de_SearchHistoryResultsList = (output, context) => {
|
|
1264
|
+
const retVal = (output || []).filter((e) => e != null).map((entry) => {
|
|
1265
|
+
return de_SearchHistoryResultItem(entry, context);
|
|
1266
|
+
});
|
|
1267
|
+
return retVal;
|
|
1268
|
+
};
|
|
1249
1269
|
const de_SearchKnowledgeBaseResultItem = (output, context) => {
|
|
1250
1270
|
return take(output, {
|
|
1251
1271
|
'chunkId': __expectString,
|
|
@@ -45,13 +45,13 @@ declare const GenerateSearchAnswerCommand_base: {
|
|
|
45
45
|
* documentUrl: "STRING_VALUE", // required
|
|
46
46
|
* dataSourceId: "STRING_VALUE", // required
|
|
47
47
|
* dataSourceType: "files" || "confluence" || "gdrive", // required
|
|
48
|
-
* content: "STRING_VALUE", // required
|
|
49
48
|
* score: Number("double"), // required
|
|
50
49
|
* fullTextScore: Number("double"),
|
|
51
50
|
* semanticScore: Number("double"),
|
|
52
51
|
* documentHierarchy: [ // StringList
|
|
53
52
|
* "STRING_VALUE",
|
|
54
53
|
* ],
|
|
54
|
+
* content: "STRING_VALUE", // required
|
|
55
55
|
* },
|
|
56
56
|
* ],
|
|
57
57
|
* model: "STRING_VALUE",
|
|
@@ -77,13 +77,13 @@ declare const GenerateSearchAnswerCommand_base: {
|
|
|
77
77
|
* // documentUrl: "STRING_VALUE", // required
|
|
78
78
|
* // dataSourceId: "STRING_VALUE", // required
|
|
79
79
|
* // dataSourceType: "files" || "confluence" || "gdrive", // required
|
|
80
|
-
* // content: "STRING_VALUE", // required
|
|
81
80
|
* // score: Number("double"), // required
|
|
82
81
|
* // fullTextScore: Number("double"),
|
|
83
82
|
* // semanticScore: Number("double"),
|
|
84
83
|
* // documentHierarchy: [ // StringList
|
|
85
84
|
* // "STRING_VALUE",
|
|
86
85
|
* // ],
|
|
86
|
+
* // content: "STRING_VALUE", // required
|
|
87
87
|
* // },
|
|
88
88
|
* // ],
|
|
89
89
|
* // };
|
|
@@ -65,40 +65,47 @@ declare const ListSearchQueriesHistoryCommand_base: {
|
|
|
65
65
|
* // searchThreshold: Number("double"), // required
|
|
66
66
|
* // },
|
|
67
67
|
* // stages: { // SearchHistoryStages
|
|
68
|
-
* // overall: { //
|
|
68
|
+
* // overall: { // SearchHistoryOverallStage
|
|
69
69
|
* // startTime: Number("long"), // required
|
|
70
70
|
* // endTime: Number("long"), // required
|
|
71
71
|
* // duration: Number("int"), // required
|
|
72
72
|
* // },
|
|
73
|
+
* // transformQuery: { // SearchHistoryTransformQueryStage
|
|
74
|
+
* // startTime: Number("long"), // required
|
|
75
|
+
* // endTime: Number("long"), // required
|
|
76
|
+
* // duration: Number("int"), // required
|
|
77
|
+
* // model: "STRING_VALUE", // required
|
|
78
|
+
* // inputTokens: Number("int"), // required
|
|
79
|
+
* // outputTokens: Number("int"), // required
|
|
80
|
+
* // transformedQuery: "STRING_VALUE", // required
|
|
81
|
+
* // },
|
|
73
82
|
* // generateQueryEmbedding: { // SearchHistoryEmbeddingStage
|
|
74
83
|
* // startTime: Number("long"), // required
|
|
75
84
|
* // endTime: Number("long"), // required
|
|
76
85
|
* // duration: Number("int"), // required
|
|
77
|
-
* // provider: "STRING_VALUE", // required
|
|
78
86
|
* // model: "STRING_VALUE", // required
|
|
79
87
|
* // inputTokens: Number("int"), // required
|
|
80
88
|
* // outputTokens: Number("int"), // required
|
|
81
89
|
* // },
|
|
82
|
-
* // search: {
|
|
90
|
+
* // search: { // SearchHistorySearchStage
|
|
83
91
|
* // startTime: Number("long"), // required
|
|
84
92
|
* // endTime: Number("long"), // required
|
|
85
93
|
* // duration: Number("int"), // required
|
|
86
94
|
* // },
|
|
87
|
-
* // enrichData: {
|
|
95
|
+
* // enrichData: { // SearchEnrichDataStage
|
|
88
96
|
* // startTime: Number("long"), // required
|
|
89
97
|
* // endTime: Number("long"), // required
|
|
90
98
|
* // duration: Number("int"), // required
|
|
91
99
|
* // },
|
|
92
100
|
* // },
|
|
93
|
-
* //
|
|
94
|
-
* // { //
|
|
101
|
+
* // results: [ // SearchHistoryResultsList // required
|
|
102
|
+
* // { // SearchHistoryResultItem
|
|
95
103
|
* // chunkId: "STRING_VALUE", // required
|
|
96
104
|
* // documentId: "STRING_VALUE", // required
|
|
97
105
|
* // documentTitle: "STRING_VALUE", // required
|
|
98
106
|
* // documentUrl: "STRING_VALUE", // required
|
|
99
107
|
* // dataSourceId: "STRING_VALUE", // required
|
|
100
108
|
* // dataSourceType: "files" || "confluence" || "gdrive", // required
|
|
101
|
-
* // content: "STRING_VALUE", // required
|
|
102
109
|
* // score: Number("double"), // required
|
|
103
110
|
* // fullTextScore: Number("double"),
|
|
104
111
|
* // semanticScore: Number("double"),
|
|
@@ -107,9 +114,9 @@ declare const ListSearchQueriesHistoryCommand_base: {
|
|
|
107
114
|
* // ],
|
|
108
115
|
* // },
|
|
109
116
|
* // ],
|
|
110
|
-
* // createdAt:
|
|
117
|
+
* // createdAt: "STRING_VALUE", // required
|
|
111
118
|
* // totalDuration: Number("int"), // required
|
|
112
|
-
* //
|
|
119
|
+
* // resultsCount: Number("int"), // required
|
|
113
120
|
* // },
|
|
114
121
|
* // ],
|
|
115
122
|
* // };
|
|
@@ -56,13 +56,13 @@ declare const SearchKnowledgeBaseCommand_base: {
|
|
|
56
56
|
* // documentUrl: "STRING_VALUE", // required
|
|
57
57
|
* // dataSourceId: "STRING_VALUE", // required
|
|
58
58
|
* // dataSourceType: "files" || "confluence" || "gdrive", // required
|
|
59
|
-
* // content: "STRING_VALUE", // required
|
|
60
59
|
* // score: Number("double"), // required
|
|
61
60
|
* // fullTextScore: Number("double"),
|
|
62
61
|
* // semanticScore: Number("double"),
|
|
63
62
|
* // documentHierarchy: [ // StringList
|
|
64
63
|
* // "STRING_VALUE",
|
|
65
64
|
* // ],
|
|
65
|
+
* // content: "STRING_VALUE", // required
|
|
66
66
|
* // },
|
|
67
67
|
* // ],
|
|
68
68
|
* // metadata: { // SearchResultMetadata
|
|
@@ -963,7 +963,6 @@ export interface SearchKnowledgeBaseResultItem {
|
|
|
963
963
|
*/
|
|
964
964
|
dataSourceId: string;
|
|
965
965
|
dataSourceType: DataSourceType;
|
|
966
|
-
content: string;
|
|
967
966
|
/**
|
|
968
967
|
* The total score of the result, calculated from the semantic search score and the full-text search score.
|
|
969
968
|
* @public
|
|
@@ -984,6 +983,7 @@ export interface SearchKnowledgeBaseResultItem {
|
|
|
984
983
|
* @public
|
|
985
984
|
*/
|
|
986
985
|
documentHierarchy?: (string)[] | undefined;
|
|
986
|
+
content: string;
|
|
987
987
|
}
|
|
988
988
|
/**
|
|
989
989
|
* @public
|
|
@@ -1519,7 +1519,50 @@ export interface SearchHistoryRequest {
|
|
|
1519
1519
|
/**
|
|
1520
1520
|
* @public
|
|
1521
1521
|
*/
|
|
1522
|
-
export interface
|
|
1522
|
+
export interface SearchHistoryResultItem {
|
|
1523
|
+
/**
|
|
1524
|
+
* The ID of the chunk. Example: 123e4567-e89b-12d3-a456-426614174000
|
|
1525
|
+
* @public
|
|
1526
|
+
*/
|
|
1527
|
+
chunkId: string;
|
|
1528
|
+
/**
|
|
1529
|
+
* Unique identifier of the document
|
|
1530
|
+
* @public
|
|
1531
|
+
*/
|
|
1532
|
+
documentId: string;
|
|
1533
|
+
documentTitle: string;
|
|
1534
|
+
documentUrl: string;
|
|
1535
|
+
/**
|
|
1536
|
+
* Unique identifier of the data source
|
|
1537
|
+
* @public
|
|
1538
|
+
*/
|
|
1539
|
+
dataSourceId: string;
|
|
1540
|
+
dataSourceType: DataSourceType;
|
|
1541
|
+
/**
|
|
1542
|
+
* The total score of the result, calculated from the semantic search score and the full-text search score.
|
|
1543
|
+
* @public
|
|
1544
|
+
*/
|
|
1545
|
+
score: number;
|
|
1546
|
+
/**
|
|
1547
|
+
* The score of the result, calculated from the full-text bm25 search score.
|
|
1548
|
+
* @public
|
|
1549
|
+
*/
|
|
1550
|
+
fullTextScore?: number | undefined;
|
|
1551
|
+
/**
|
|
1552
|
+
* The score of the result, calculated from the semantic vector search score.
|
|
1553
|
+
* @public
|
|
1554
|
+
*/
|
|
1555
|
+
semanticScore?: number | undefined;
|
|
1556
|
+
/**
|
|
1557
|
+
* The hierarchy of the document. The hierarchy is a list of document IDs that are the parents of the current document. The hierarchy is used to build the document hierarchy in the search results.
|
|
1558
|
+
* @public
|
|
1559
|
+
*/
|
|
1560
|
+
documentHierarchy?: (string)[] | undefined;
|
|
1561
|
+
}
|
|
1562
|
+
/**
|
|
1563
|
+
* @public
|
|
1564
|
+
*/
|
|
1565
|
+
export interface SearchEnrichDataStage {
|
|
1523
1566
|
startTime: number;
|
|
1524
1567
|
endTime: number;
|
|
1525
1568
|
duration: number;
|
|
@@ -1531,19 +1574,47 @@ export interface SearchHistoryEmbeddingStage {
|
|
|
1531
1574
|
startTime: number;
|
|
1532
1575
|
endTime: number;
|
|
1533
1576
|
duration: number;
|
|
1534
|
-
provider: string;
|
|
1535
1577
|
model: string;
|
|
1536
1578
|
inputTokens: number;
|
|
1537
1579
|
outputTokens: number;
|
|
1538
1580
|
}
|
|
1581
|
+
/**
|
|
1582
|
+
* @public
|
|
1583
|
+
*/
|
|
1584
|
+
export interface SearchHistoryOverallStage {
|
|
1585
|
+
startTime: number;
|
|
1586
|
+
endTime: number;
|
|
1587
|
+
duration: number;
|
|
1588
|
+
}
|
|
1589
|
+
/**
|
|
1590
|
+
* @public
|
|
1591
|
+
*/
|
|
1592
|
+
export interface SearchHistorySearchStage {
|
|
1593
|
+
startTime: number;
|
|
1594
|
+
endTime: number;
|
|
1595
|
+
duration: number;
|
|
1596
|
+
}
|
|
1597
|
+
/**
|
|
1598
|
+
* @public
|
|
1599
|
+
*/
|
|
1600
|
+
export interface SearchHistoryTransformQueryStage {
|
|
1601
|
+
startTime: number;
|
|
1602
|
+
endTime: number;
|
|
1603
|
+
duration: number;
|
|
1604
|
+
model: string;
|
|
1605
|
+
inputTokens: number;
|
|
1606
|
+
outputTokens: number;
|
|
1607
|
+
transformedQuery: string;
|
|
1608
|
+
}
|
|
1539
1609
|
/**
|
|
1540
1610
|
* @public
|
|
1541
1611
|
*/
|
|
1542
1612
|
export interface SearchHistoryStages {
|
|
1543
|
-
overall:
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1613
|
+
overall: SearchHistoryOverallStage;
|
|
1614
|
+
transformQuery?: SearchHistoryTransformQueryStage | undefined;
|
|
1615
|
+
generateQueryEmbedding: SearchHistoryEmbeddingStage;
|
|
1616
|
+
search: SearchHistorySearchStage;
|
|
1617
|
+
enrichData?: SearchEnrichDataStage | undefined;
|
|
1547
1618
|
}
|
|
1548
1619
|
/**
|
|
1549
1620
|
* @public
|
|
@@ -1553,10 +1624,10 @@ export interface SearchHistoryItem {
|
|
|
1553
1624
|
companyId: string;
|
|
1554
1625
|
request: SearchHistoryRequest;
|
|
1555
1626
|
stages: SearchHistoryStages;
|
|
1556
|
-
|
|
1557
|
-
createdAt:
|
|
1627
|
+
results: (SearchHistoryResultItem)[];
|
|
1628
|
+
createdAt: string;
|
|
1558
1629
|
totalDuration: number;
|
|
1559
|
-
|
|
1630
|
+
resultsCount: number;
|
|
1560
1631
|
}
|
|
1561
1632
|
/**
|
|
1562
1633
|
* @public
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wildix/wim-knowledge-base-client",
|
|
3
3
|
"description": "@wildix/wim-knowledge-base-client client",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.59",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
|
|
7
7
|
"build:cjs": "tsc -p tsconfig.cjs.json",
|