-
Notifications
You must be signed in to change notification settings - Fork 586
/
QueryAssistantCommand.ts
253 lines (250 loc) · 9.99 KB
/
QueryAssistantCommand.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
// smithy-typescript generated code
import { getEndpointPlugin } from "@smithy/middleware-endpoint";
import { getSerdePlugin } from "@smithy/middleware-serde";
import { Command as $Command } from "@smithy/smithy-client";
import { MetadataBearer as __MetadataBearer } from "@smithy/types";
import { commonParams } from "../endpoint/EndpointParameters";
import {
QueryAssistantRequest,
QueryAssistantRequestFilterSensitiveLog,
QueryAssistantResponse,
QueryAssistantResponseFilterSensitiveLog,
} from "../models/models_0";
import { de_QueryAssistantCommand, se_QueryAssistantCommand } from "../protocols/Aws_restJson1";
import { QConnectClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../QConnectClient";
/**
* @public
*/
export { __MetadataBearer, $Command };
/**
* @public
*
* The input for {@link QueryAssistantCommand}.
*/
export interface QueryAssistantCommandInput extends QueryAssistantRequest {}
/**
* @public
*
* The output of {@link QueryAssistantCommand}.
*/
export interface QueryAssistantCommandOutput extends QueryAssistantResponse, __MetadataBearer {}
/**
* @public
* @deprecated QueryAssistant API will be discontinued starting June 1, 2024. To receive generative responses after March 1, 2024 you will need to create a new Assistant in the Connect console and integrate the Amazon Q in Connect JavaScript library (amazon-q-connectjs) into your applications.
*
* <p>Performs a manual search against the specified assistant. To retrieve recommendations for
* an assistant, use <a href="https://docs.aws.amazon.com/amazon-q-connect/latest/APIReference/API_GetRecommendations.html">GetRecommendations</a>.
* </p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
* import { QConnectClient, QueryAssistantCommand } from "@aws-sdk/client-qconnect"; // ES Modules import
* // const { QConnectClient, QueryAssistantCommand } = require("@aws-sdk/client-qconnect"); // CommonJS import
* const client = new QConnectClient(config);
* const input = { // QueryAssistantRequest
* assistantId: "STRING_VALUE", // required
* queryText: "STRING_VALUE", // required
* nextToken: "STRING_VALUE",
* maxResults: Number("int"),
* sessionId: "STRING_VALUE",
* queryCondition: [ // QueryConditionExpression
* { // QueryCondition Union: only one key present
* single: { // QueryConditionItem
* field: "STRING_VALUE", // required
* comparator: "STRING_VALUE", // required
* value: "STRING_VALUE", // required
* },
* },
* ],
* };
* const command = new QueryAssistantCommand(input);
* const response = await client.send(command);
* // { // QueryAssistantResponse
* // results: [ // QueryResultsList // required
* // { // ResultData
* // resultId: "STRING_VALUE", // required
* // document: { // Document
* // contentReference: { // ContentReference
* // knowledgeBaseArn: "STRING_VALUE",
* // knowledgeBaseId: "STRING_VALUE",
* // contentArn: "STRING_VALUE",
* // contentId: "STRING_VALUE",
* // },
* // title: { // DocumentText
* // text: "STRING_VALUE",
* // highlights: [ // Highlights
* // { // Highlight
* // beginOffsetInclusive: Number("int"),
* // endOffsetExclusive: Number("int"),
* // },
* // ],
* // },
* // excerpt: {
* // text: "STRING_VALUE",
* // highlights: [
* // {
* // beginOffsetInclusive: Number("int"),
* // endOffsetExclusive: Number("int"),
* // },
* // ],
* // },
* // },
* // relevanceScore: Number("double"),
* // data: { // DataSummary
* // reference: { // DataReference Union: only one key present
* // contentReference: {
* // knowledgeBaseArn: "STRING_VALUE",
* // knowledgeBaseId: "STRING_VALUE",
* // contentArn: "STRING_VALUE",
* // contentId: "STRING_VALUE",
* // },
* // generativeReference: { // GenerativeReference
* // modelId: "STRING_VALUE",
* // generationId: "STRING_VALUE",
* // },
* // },
* // details: { // DataDetails Union: only one key present
* // contentData: { // ContentDataDetails
* // textData: { // TextData
* // title: {
* // text: "STRING_VALUE",
* // highlights: [
* // {
* // beginOffsetInclusive: Number("int"),
* // endOffsetExclusive: Number("int"),
* // },
* // ],
* // },
* // excerpt: {
* // text: "STRING_VALUE",
* // highlights: [
* // {
* // beginOffsetInclusive: Number("int"),
* // endOffsetExclusive: Number("int"),
* // },
* // ],
* // },
* // },
* // rankingData: { // RankingData
* // relevanceScore: Number("double"),
* // relevanceLevel: "STRING_VALUE",
* // },
* // },
* // generativeData: { // GenerativeDataDetails
* // completion: "STRING_VALUE", // required
* // references: [ // DataSummaryList // required
* // {
* // reference: {// Union: only one key present
* // contentReference: "<ContentReference>",
* // generativeReference: {
* // modelId: "STRING_VALUE",
* // generationId: "STRING_VALUE",
* // },
* // },
* // details: {// Union: only one key present
* // contentData: {
* // textData: {
* // title: "<DocumentText>",
* // excerpt: "<DocumentText>",
* // },
* // rankingData: {
* // relevanceScore: Number("double"),
* // relevanceLevel: "STRING_VALUE",
* // },
* // },
* // generativeData: {
* // completion: "STRING_VALUE", // required
* // references: [ // required
* // "<DataSummary>",
* // ],
* // rankingData: {
* // relevanceScore: Number("double"),
* // relevanceLevel: "STRING_VALUE",
* // },
* // },
* // sourceContentData: { // SourceContentDataDetails
* // id: "STRING_VALUE", // required
* // type: "STRING_VALUE", // required
* // textData: {
* // title: "<DocumentText>",
* // excerpt: "<DocumentText>",
* // },
* // rankingData: {
* // relevanceScore: Number("double"),
* // relevanceLevel: "STRING_VALUE",
* // },
* // },
* // },
* // },
* // ],
* // rankingData: {
* // relevanceScore: Number("double"),
* // relevanceLevel: "STRING_VALUE",
* // },
* // },
* // sourceContentData: {
* // id: "STRING_VALUE", // required
* // type: "STRING_VALUE", // required
* // textData: {
* // title: "<DocumentText>",
* // excerpt: "<DocumentText>",
* // },
* // rankingData: "<RankingData>", // required
* // },
* // },
* // },
* // type: "STRING_VALUE",
* // },
* // ],
* // nextToken: "STRING_VALUE",
* // };
*
* ```
*
* @param QueryAssistantCommandInput - {@link QueryAssistantCommandInput}
* @returns {@link QueryAssistantCommandOutput}
* @see {@link QueryAssistantCommandInput} for command's `input` shape.
* @see {@link QueryAssistantCommandOutput} for command's `response` shape.
* @see {@link QConnectClientResolvedConfig | config} for QConnectClient's `config` shape.
*
* @throws {@link AccessDeniedException} (client fault)
* <p>You do not have sufficient access to perform this action.</p>
*
* @throws {@link RequestTimeoutException} (client fault)
* <p>The request reached the service more than 15 minutes after the date stamp on the request
* or more than 15 minutes after the request expiration date (such as for pre-signed URLs), or
* the date stamp on the request is more than 15 minutes in the future.</p>
*
* @throws {@link ResourceNotFoundException} (client fault)
* <p>The specified resource does not exist.</p>
*
* @throws {@link ValidationException} (client fault)
* <p>The input fails to satisfy the constraints specified by a service.</p>
*
* @throws {@link QConnectServiceException}
* <p>Base exception class for all service exceptions from QConnect service.</p>
*
*/
export class QueryAssistantCommand extends $Command
.classBuilder<
QueryAssistantCommandInput,
QueryAssistantCommandOutput,
QConnectClientResolvedConfig,
ServiceInputTypes,
ServiceOutputTypes
>()
.ep({
...commonParams,
})
.m(function (this: any, Command: any, cs: any, config: QConnectClientResolvedConfig, o: any) {
return [
getSerdePlugin(config, this.serialize, this.deserialize),
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
];
})
.s("WisdomService", "QueryAssistant", {})
.n("QConnectClient", "QueryAssistantCommand")
.f(QueryAssistantRequestFilterSensitiveLog, QueryAssistantResponseFilterSensitiveLog)
.ser(se_QueryAssistantCommand)
.de(de_QueryAssistantCommand)
.build() {}