@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.
- package/dist-cjs/protocols/Aws_restJson1.js +3 -3
- package/dist-es/protocols/Aws_restJson1.js +3 -3
- package/dist-types/commands/GenerateSearchAnswerCommand.d.ts +20 -2
- package/dist-types/commands/SearchKnowledgeBaseCommand.d.ts +5 -1
- package/dist-types/models/models_0.d.ts +20 -3
- package/package.json +1 -1
|
@@ -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':
|
|
768
|
-
'sources': _ =>
|
|
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':
|
|
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':
|
|
722
|
-
'sources': _ =>
|
|
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':
|
|
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:
|
|
64
|
-
* //
|
|
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:
|
|
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:
|
|
1022
|
-
sources:
|
|
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
|
|
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.
|
|
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",
|