@wildix/wim-knowledge-base-client 0.0.50 → 0.0.51

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.
@@ -764,8 +764,8 @@ const de_GenerateSearchAnswerCommand = async (output, context) => {
764
764
  const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
765
765
  const doc = (0, smithy_client_1.take)(data, {
766
766
  'answer': smithy_client_1.expectString,
767
- 'metadata': _ => de_Document(_, context),
768
- 'sources': _ => de_Document(_, context),
767
+ 'metadata': smithy_client_1._json,
768
+ 'sources': _ => de_SearchKnowledgeBaseResults(_, context),
769
769
  });
770
770
  Object.assign(contents, doc);
771
771
  return contents;
@@ -1012,7 +1012,7 @@ const de_SearchKnowledgeBaseCommand = async (output, context) => {
1012
1012
  });
1013
1013
  const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
1014
1014
  const doc = (0, smithy_client_1.take)(data, {
1015
- 'metadata': _ => de_Document(_, context),
1015
+ 'metadata': smithy_client_1._json,
1016
1016
  'results': _ => de_SearchKnowledgeBaseResults(_, context),
1017
1017
  });
1018
1018
  Object.assign(contents, doc);
@@ -718,8 +718,8 @@ export const de_GenerateSearchAnswerCommand = async (output, context) => {
718
718
  const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
719
719
  const doc = take(data, {
720
720
  'answer': __expectString,
721
- 'metadata': _ => de_Document(_, context),
722
- 'sources': _ => de_Document(_, context),
721
+ 'metadata': _json,
722
+ 'sources': _ => de_SearchKnowledgeBaseResults(_, context),
723
723
  });
724
724
  Object.assign(contents, doc);
725
725
  return contents;
@@ -950,7 +950,7 @@ export const de_SearchKnowledgeBaseCommand = async (output, context) => {
950
950
  });
951
951
  const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
952
952
  const doc = take(data, {
953
- 'metadata': _ => de_Document(_, context),
953
+ 'metadata': _json,
954
954
  'results': _ => de_SearchKnowledgeBaseResults(_, context),
955
955
  });
956
956
  Object.assign(contents, doc);
@@ -60,8 +60,26 @@ declare const GenerateSearchAnswerCommand_base: {
60
60
  * const response = await client.send(command);
61
61
  * // { // GenerateSearchAnswerOutput
62
62
  * // answer: "STRING_VALUE", // required
63
- * // metadata: "DOCUMENT_VALUE", // required
64
- * // sources: "DOCUMENT_VALUE", // required
63
+ * // metadata: { // AnswerMetadata
64
+ * // model: "STRING_VALUE", // required
65
+ * // inputTokens: Number("int"), // required
66
+ * // outputTokens: Number("int"), // required
67
+ * // duration: Number("int"), // required
68
+ * // },
69
+ * // sources: [ // SearchKnowledgeBaseResults // required
70
+ * // { // SearchKnowledgeBaseResult
71
+ * // documentId: "STRING_VALUE", // required
72
+ * // documentTitle: "STRING_VALUE", // required
73
+ * // documentUrl: "STRING_VALUE", // required
74
+ * // dataSourceId: "STRING_VALUE", // required
75
+ * // dataSourceType: "files" || "confluence" || "gdrive", // required
76
+ * // content: "STRING_VALUE", // required
77
+ * // score: Number("double"), // required
78
+ * // documentHierarchy: [ // StringList
79
+ * // "STRING_VALUE",
80
+ * // ],
81
+ * // },
82
+ * // ],
65
83
  * // };
66
84
  *
67
85
  * ```
@@ -62,7 +62,11 @@ declare const SearchKnowledgeBaseCommand_base: {
62
62
  * // ],
63
63
  * // },
64
64
  * // ],
65
- * // metadata: "DOCUMENT_VALUE",
65
+ * // metadata: { // SearchResultMetadata
66
+ * // duration: Number("int"), // required
67
+ * // inputTokens: Number("int"), // required
68
+ * // outputTokens: Number("int"), // required
69
+ * // },
66
70
  * // };
67
71
  *
68
72
  * ```
@@ -34,6 +34,15 @@ export declare class UnauthorizedException extends __BaseException {
34
34
  */
35
35
  constructor(opts: __ExceptionOptionType<UnauthorizedException, __BaseException>);
36
36
  }
37
+ /**
38
+ * @public
39
+ */
40
+ export interface AnswerMetadata {
41
+ model: string;
42
+ inputTokens: number;
43
+ outputTokens: number;
44
+ duration: number;
45
+ }
37
46
  /**
38
47
  * @public
39
48
  */
@@ -1018,8 +1027,8 @@ export interface GenerateSearchAnswerInput {
1018
1027
  */
1019
1028
  export interface GenerateSearchAnswerOutput {
1020
1029
  answer: string;
1021
- metadata: __DocumentType;
1022
- sources: __DocumentType;
1030
+ metadata: AnswerMetadata;
1031
+ sources: (SearchKnowledgeBaseResult)[];
1023
1032
  }
1024
1033
  /**
1025
1034
  * @public
@@ -1566,12 +1575,20 @@ export interface SearchKnowledgeBaseInput {
1566
1575
  */
1567
1576
  externalSessionId?: string | undefined;
1568
1577
  }
1578
+ /**
1579
+ * @public
1580
+ */
1581
+ export interface SearchResultMetadata {
1582
+ duration: number;
1583
+ inputTokens: number;
1584
+ outputTokens: number;
1585
+ }
1569
1586
  /**
1570
1587
  * @public
1571
1588
  */
1572
1589
  export interface SearchKnowledgeBaseOutput {
1573
1590
  results: (SearchKnowledgeBaseResult)[];
1574
- metadata?: __DocumentType | undefined;
1591
+ metadata: SearchResultMetadata;
1575
1592
  }
1576
1593
  /**
1577
1594
  * @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.50",
4
+ "version": "0.0.51",
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",