@wildix/wim-knowledge-base-client 0.0.24 → 0.0.26

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.
@@ -385,6 +385,7 @@ const se_SearchKnowledgeBaseCommand = async (input, context) => {
385
385
  let body;
386
386
  body = JSON.stringify((0, smithy_client_1.take)(input, {
387
387
  'searchConfig': _ => se_SearchConfig(_, context),
388
+ 'withMetadata': [],
388
389
  }));
389
390
  b.m("POST")
390
391
  .h(headers)
@@ -802,6 +803,7 @@ const de_SearchKnowledgeBaseCommand = async (output, context) => {
802
803
  });
803
804
  const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
804
805
  const doc = (0, smithy_client_1.take)(data, {
806
+ 'metadata': _ => de_Document(_, context),
805
807
  'results': _ => de_SearchKnowledgeBaseResults(_, context),
806
808
  });
807
809
  Object.assign(contents, doc);
@@ -1032,9 +1034,11 @@ const se_ProxyConfig = (input, context) => {
1032
1034
  };
1033
1035
  const se_SearchConfig = (input, context) => {
1034
1036
  return (0, smithy_client_1.take)(input, {
1037
+ 'extendMetadata': [],
1035
1038
  'searchStrategy': [],
1036
1039
  'threshold': smithy_client_1.serializeFloat,
1037
1040
  'topK': [],
1041
+ 'useQueryOptimization': [],
1038
1042
  });
1039
1043
  };
1040
1044
  const de_Document = (output, context) => {
@@ -1111,12 +1115,12 @@ const de_ProxyConfig = (output, context) => {
1111
1115
  const de_SearchKnowledgeBaseResult = (output, context) => {
1112
1116
  return (0, smithy_client_1.take)(output, {
1113
1117
  'content': smithy_client_1.expectString,
1118
+ 'dataSourceId': smithy_client_1.expectString,
1114
1119
  'dataSourceType': smithy_client_1.expectString,
1115
1120
  'documentId': smithy_client_1.expectString,
1116
1121
  'documentTitle': smithy_client_1.expectString,
1117
1122
  'documentUrl': smithy_client_1.expectString,
1118
1123
  'score': smithy_client_1.limitedParseDouble,
1119
- 'source': smithy_client_1.expectString,
1120
1124
  });
1121
1125
  };
1122
1126
  const de_SearchKnowledgeBaseResults = (output, context) => {
@@ -361,6 +361,7 @@ export const se_SearchKnowledgeBaseCommand = async (input, context) => {
361
361
  let body;
362
362
  body = JSON.stringify(take(input, {
363
363
  'searchConfig': _ => se_SearchConfig(_, context),
364
+ 'withMetadata': [],
364
365
  }));
365
366
  b.m("POST")
366
367
  .h(headers)
@@ -752,6 +753,7 @@ export const de_SearchKnowledgeBaseCommand = async (output, context) => {
752
753
  });
753
754
  const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
754
755
  const doc = take(data, {
756
+ 'metadata': _ => de_Document(_, context),
755
757
  'results': _ => de_SearchKnowledgeBaseResults(_, context),
756
758
  });
757
759
  Object.assign(contents, doc);
@@ -976,9 +978,11 @@ const se_ProxyConfig = (input, context) => {
976
978
  };
977
979
  const se_SearchConfig = (input, context) => {
978
980
  return take(input, {
981
+ 'extendMetadata': [],
979
982
  'searchStrategy': [],
980
983
  'threshold': __serializeFloat,
981
984
  'topK': [],
985
+ 'useQueryOptimization': [],
982
986
  });
983
987
  };
984
988
  const de_Document = (output, context) => {
@@ -1055,12 +1059,12 @@ const de_ProxyConfig = (output, context) => {
1055
1059
  const de_SearchKnowledgeBaseResult = (output, context) => {
1056
1060
  return take(output, {
1057
1061
  'content': __expectString,
1062
+ 'dataSourceId': __expectString,
1058
1063
  'dataSourceType': __expectString,
1059
1064
  'documentId': __expectString,
1060
1065
  'documentTitle': __expectString,
1061
1066
  'documentUrl': __expectString,
1062
1067
  'score': __limitedParseDouble,
1063
- 'source': __expectString,
1064
1068
  });
1065
1069
  };
1066
1070
  const de_SearchKnowledgeBaseResults = (output, context) => {
@@ -37,13 +37,8 @@ declare const CreateKnowledgeBaseCommand_base: {
37
37
  * const input = { // CreateKnowledgeBaseInput
38
38
  * name: "STRING_VALUE", // required
39
39
  * description: "STRING_VALUE",
40
- * dataSources: [ // KnowledgeBaseDataSourcesList // required
41
- * { // DataSourceListItem
42
- * id: "STRING_VALUE", // required
43
- * name: "STRING_VALUE", // required
44
- * type: "files" || "confluence" || "gdrive" || "proxy", // required
45
- * enabled: true || false, // required
46
- * },
40
+ * dataSources: [ // DataSourceIdsList // required
41
+ * "STRING_VALUE",
47
42
  * ],
48
43
  * companyId: "STRING_VALUE",
49
44
  * };
@@ -53,13 +48,8 @@ declare const CreateKnowledgeBaseCommand_base: {
53
48
  * // knowledgeBase: { // KnowledgeBaseItem
54
49
  * // name: "STRING_VALUE", // required
55
50
  * // description: "STRING_VALUE",
56
- * // dataSources: [ // KnowledgeBaseDataSourcesList // required
57
- * // { // DataSourceListItem
58
- * // id: "STRING_VALUE", // required
59
- * // name: "STRING_VALUE", // required
60
- * // type: "files" || "confluence" || "gdrive" || "proxy", // required
61
- * // enabled: true || false, // required
62
- * // },
51
+ * // dataSources: [ // DataSourceIdsList // required
52
+ * // "STRING_VALUE",
63
53
  * // ],
64
54
  * // id: "STRING_VALUE", // required
65
55
  * // companyId: "STRING_VALUE", // required
@@ -44,13 +44,8 @@ declare const GetKnowledgeBaseCommand_base: {
44
44
  * // knowledgeBase: { // KnowledgeBaseItem
45
45
  * // name: "STRING_VALUE", // required
46
46
  * // description: "STRING_VALUE",
47
- * // dataSources: [ // KnowledgeBaseDataSourcesList // required
48
- * // { // DataSourceListItem
49
- * // id: "STRING_VALUE", // required
50
- * // name: "STRING_VALUE", // required
51
- * // type: "files" || "confluence" || "gdrive" || "proxy", // required
52
- * // enabled: true || false, // required
53
- * // },
47
+ * // dataSources: [ // DataSourceIdsList // required
48
+ * // "STRING_VALUE",
54
49
  * // ],
55
50
  * // id: "STRING_VALUE", // required
56
51
  * // companyId: "STRING_VALUE", // required
@@ -44,13 +44,8 @@ declare const ListKnowledgeBasesCommand_base: {
44
44
  * // { // KnowledgeBaseItem
45
45
  * // name: "STRING_VALUE", // required
46
46
  * // description: "STRING_VALUE",
47
- * // dataSources: [ // KnowledgeBaseDataSourcesList // required
48
- * // { // DataSourceListItem
49
- * // id: "STRING_VALUE", // required
50
- * // name: "STRING_VALUE", // required
51
- * // type: "files" || "confluence" || "gdrive" || "proxy", // required
52
- * // enabled: true || false, // required
53
- * // },
47
+ * // dataSources: [ // DataSourceIdsList // required
48
+ * // "STRING_VALUE",
54
49
  * // ],
55
50
  * // id: "STRING_VALUE", // required
56
51
  * // companyId: "STRING_VALUE", // required
@@ -42,6 +42,8 @@ declare const QueryKnowledgeBaseCommand_base: {
42
42
  * topK: Number("int"),
43
43
  * threshold: Number("double"),
44
44
  * searchStrategy: "bm25" || "vector" || "hybrid",
45
+ * useQueryOptimization: true || false,
46
+ * extendMetadata: true || false,
45
47
  * },
46
48
  * llmConfig: { // LlmConfig
47
49
  * provider: "STRING_VALUE",
@@ -42,7 +42,10 @@ declare const SearchKnowledgeBaseCommand_base: {
42
42
  * topK: Number("int"),
43
43
  * threshold: Number("double"),
44
44
  * searchStrategy: "bm25" || "vector" || "hybrid",
45
+ * useQueryOptimization: true || false,
46
+ * extendMetadata: true || false,
45
47
  * },
48
+ * withMetadata: true || false,
46
49
  * };
47
50
  * const command = new SearchKnowledgeBaseCommand(input);
48
51
  * const response = await client.send(command);
@@ -51,13 +54,14 @@ declare const SearchKnowledgeBaseCommand_base: {
51
54
  * // { // SearchKnowledgeBaseResult
52
55
  * // documentId: "STRING_VALUE", // required
53
56
  * // documentTitle: "STRING_VALUE", // required
54
- * // score: Number("double"), // required
55
- * // source: "STRING_VALUE", // required
56
- * // content: "STRING_VALUE", // required
57
57
  * // documentUrl: "STRING_VALUE", // required
58
+ * // dataSourceId: "STRING_VALUE", // required
58
59
  * // dataSourceType: "files" || "confluence" || "gdrive" || "proxy", // required
60
+ * // content: "STRING_VALUE", // required
61
+ * // score: Number("double"), // required
59
62
  * // },
60
63
  * // ],
64
+ * // metadata: "DOCUMENT_VALUE",
61
65
  * // };
62
66
  *
63
67
  * ```
@@ -37,13 +37,8 @@ declare const UpdateKnowledgeBaseCommand_base: {
37
37
  * const input = { // UpdateKnowledgeBaseInput
38
38
  * name: "STRING_VALUE", // required
39
39
  * description: "STRING_VALUE",
40
- * dataSources: [ // KnowledgeBaseDataSourcesList // required
41
- * { // DataSourceListItem
42
- * id: "STRING_VALUE", // required
43
- * name: "STRING_VALUE", // required
44
- * type: "files" || "confluence" || "gdrive" || "proxy", // required
45
- * enabled: true || false, // required
46
- * },
40
+ * dataSources: [ // DataSourceIdsList // required
41
+ * "STRING_VALUE",
47
42
  * ],
48
43
  * companyId: "STRING_VALUE",
49
44
  * knowledgeBaseId: "STRING_VALUE", // required
@@ -54,13 +49,8 @@ declare const UpdateKnowledgeBaseCommand_base: {
54
49
  * // knowledgeBase: { // KnowledgeBaseItem
55
50
  * // name: "STRING_VALUE", // required
56
51
  * // description: "STRING_VALUE",
57
- * // dataSources: [ // KnowledgeBaseDataSourcesList // required
58
- * // { // DataSourceListItem
59
- * // id: "STRING_VALUE", // required
60
- * // name: "STRING_VALUE", // required
61
- * // type: "files" || "confluence" || "gdrive" || "proxy", // required
62
- * // enabled: true || false, // required
63
- * // },
52
+ * // dataSources: [ // DataSourceIdsList // required
53
+ * // "STRING_VALUE",
64
54
  * // ],
65
55
  * // id: "STRING_VALUE", // required
66
56
  * // companyId: "STRING_VALUE", // required
@@ -579,31 +579,6 @@ export interface DocumentItem {
579
579
  export interface CreateDocumentOutput {
580
580
  document: DocumentItem;
581
581
  }
582
- /**
583
- * @public
584
- */
585
- export interface DataSourceListItem {
586
- /**
587
- * The ID of the data source. Example: 123e4567-e89b-12d3-a456-426614174000
588
- * @public
589
- */
590
- id: string;
591
- /**
592
- * The name of the data source. Example: Product Confluence
593
- * @public
594
- */
595
- name: string;
596
- /**
597
- * The type of the data source. Example: confluence
598
- * @public
599
- */
600
- type: DataSourceType;
601
- /**
602
- * Whether the data source is enabled. Example: true
603
- * @public
604
- */
605
- enabled: boolean;
606
- }
607
582
  /**
608
583
  * @public
609
584
  */
@@ -618,7 +593,7 @@ export interface CreateKnowledgeBaseInput {
618
593
  * @public
619
594
  */
620
595
  description?: string | undefined;
621
- dataSources: (DataSourceListItem)[];
596
+ dataSources: (string)[];
622
597
  /**
623
598
  * The unique identifier of the tenant when a service token is used.
624
599
  * @public
@@ -639,7 +614,7 @@ export interface KnowledgeBaseItem {
639
614
  * @public
640
615
  */
641
616
  description?: string | undefined;
642
- dataSources: (DataSourceListItem)[];
617
+ dataSources: (string)[];
643
618
  /**
644
619
  * The ID of the knowledge base. Example: 123e4567-e89b-12d3-a456-426614174000
645
620
  * @public
@@ -1289,6 +1264,16 @@ export interface SearchConfig {
1289
1264
  * @public
1290
1265
  */
1291
1266
  searchStrategy?: SearchStrategy | undefined;
1267
+ /**
1268
+ * Whether to use the query transform to improve the search results. Example: true. The query transform will use the query to improve the search results.
1269
+ * @public
1270
+ */
1271
+ useQueryOptimization?: boolean | undefined;
1272
+ /**
1273
+ * Whether to extend the metadata of the search results. Example: true. The metadata will be extended with the additional information.
1274
+ * @public
1275
+ */
1276
+ extendMetadata?: boolean | undefined;
1292
1277
  }
1293
1278
  /**
1294
1279
  * @public
@@ -1352,6 +1337,11 @@ export interface SearchKnowledgeBaseInput {
1352
1337
  * @public
1353
1338
  */
1354
1339
  searchConfig?: SearchConfig | undefined;
1340
+ /**
1341
+ * Whether to include the metadata of the search results.
1342
+ * @public
1343
+ */
1344
+ withMetadata?: boolean | undefined;
1355
1345
  }
1356
1346
  /**
1357
1347
  * @public
@@ -1363,21 +1353,22 @@ export interface SearchKnowledgeBaseResult {
1363
1353
  */
1364
1354
  documentId: string;
1365
1355
  documentTitle: string;
1366
- score: number;
1356
+ documentUrl: string;
1367
1357
  /**
1368
1358
  * The ID of the data source. Example: 123e4567-e89b-12d3-a456-426614174000
1369
1359
  * @public
1370
1360
  */
1371
- source: string;
1372
- content: string;
1373
- documentUrl: string;
1361
+ dataSourceId: string;
1374
1362
  dataSourceType: DataSourceType;
1363
+ content: string;
1364
+ score: number;
1375
1365
  }
1376
1366
  /**
1377
1367
  * @public
1378
1368
  */
1379
1369
  export interface SearchKnowledgeBaseOutput {
1380
1370
  results: (SearchKnowledgeBaseResult)[];
1371
+ metadata?: __DocumentType | undefined;
1381
1372
  }
1382
1373
  /**
1383
1374
  * @public
@@ -1537,7 +1528,7 @@ export interface UpdateKnowledgeBaseInput {
1537
1528
  * @public
1538
1529
  */
1539
1530
  description?: string | undefined;
1540
- dataSources: (DataSourceListItem)[];
1531
+ dataSources: (string)[];
1541
1532
  /**
1542
1533
  * The unique identifier of the tenant when a service token is used.
1543
1534
  * @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.24",
4
+ "version": "0.0.26",
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",