@aws-sdk/client-bedrock-agent-runtime 3.490.0 → 3.496.0

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/index.js CHANGED
@@ -1,12 +1,1444 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BedrockAgentRuntimeServiceException = void 0;
4
- const tslib_1 = require("tslib");
5
- tslib_1.__exportStar(require("./BedrockAgentRuntimeClient"), exports);
6
- tslib_1.__exportStar(require("./BedrockAgentRuntime"), exports);
7
- tslib_1.__exportStar(require("./commands"), exports);
8
- tslib_1.__exportStar(require("./pagination"), exports);
9
- tslib_1.__exportStar(require("./models"), exports);
10
- require("@aws-sdk/util-endpoints");
11
- var BedrockAgentRuntimeServiceException_1 = require("./models/BedrockAgentRuntimeServiceException");
12
- Object.defineProperty(exports, "BedrockAgentRuntimeServiceException", { enumerable: true, get: function () { return BedrockAgentRuntimeServiceException_1.BedrockAgentRuntimeServiceException; } });
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+
21
+ // src/index.ts
22
+ var src_exports = {};
23
+ __export(src_exports, {
24
+ AccessDeniedException: () => AccessDeniedException,
25
+ ActionGroupInvocationInputFilterSensitiveLog: () => ActionGroupInvocationInputFilterSensitiveLog,
26
+ ActionGroupInvocationOutputFilterSensitiveLog: () => ActionGroupInvocationOutputFilterSensitiveLog,
27
+ BadGatewayException: () => BadGatewayException,
28
+ BedrockAgentRuntime: () => BedrockAgentRuntime,
29
+ BedrockAgentRuntimeClient: () => BedrockAgentRuntimeClient,
30
+ BedrockAgentRuntimeServiceException: () => BedrockAgentRuntimeServiceException,
31
+ ConflictException: () => ConflictException,
32
+ CreationMode: () => CreationMode,
33
+ DependencyFailedException: () => DependencyFailedException,
34
+ FailureTraceFilterSensitiveLog: () => FailureTraceFilterSensitiveLog,
35
+ FinalResponseFilterSensitiveLog: () => FinalResponseFilterSensitiveLog,
36
+ InternalServerException: () => InternalServerException,
37
+ InvocationInputFilterSensitiveLog: () => InvocationInputFilterSensitiveLog,
38
+ InvocationType: () => InvocationType,
39
+ InvokeAgentCommand: () => InvokeAgentCommand,
40
+ InvokeAgentRequestFilterSensitiveLog: () => InvokeAgentRequestFilterSensitiveLog,
41
+ InvokeAgentResponseFilterSensitiveLog: () => InvokeAgentResponseFilterSensitiveLog,
42
+ KnowledgeBaseLookupInputFilterSensitiveLog: () => KnowledgeBaseLookupInputFilterSensitiveLog,
43
+ KnowledgeBaseQueryFilterSensitiveLog: () => KnowledgeBaseQueryFilterSensitiveLog,
44
+ ModelInvocationInputFilterSensitiveLog: () => ModelInvocationInputFilterSensitiveLog,
45
+ ObservationFilterSensitiveLog: () => ObservationFilterSensitiveLog,
46
+ OrchestrationTrace: () => OrchestrationTrace,
47
+ OrchestrationTraceFilterSensitiveLog: () => OrchestrationTraceFilterSensitiveLog,
48
+ PayloadPartFilterSensitiveLog: () => PayloadPartFilterSensitiveLog,
49
+ PostProcessingModelInvocationOutputFilterSensitiveLog: () => PostProcessingModelInvocationOutputFilterSensitiveLog,
50
+ PostProcessingParsedResponseFilterSensitiveLog: () => PostProcessingParsedResponseFilterSensitiveLog,
51
+ PostProcessingTrace: () => PostProcessingTrace,
52
+ PostProcessingTraceFilterSensitiveLog: () => PostProcessingTraceFilterSensitiveLog,
53
+ PreProcessingModelInvocationOutputFilterSensitiveLog: () => PreProcessingModelInvocationOutputFilterSensitiveLog,
54
+ PreProcessingParsedResponseFilterSensitiveLog: () => PreProcessingParsedResponseFilterSensitiveLog,
55
+ PreProcessingTrace: () => PreProcessingTrace,
56
+ PreProcessingTraceFilterSensitiveLog: () => PreProcessingTraceFilterSensitiveLog,
57
+ PromptType: () => PromptType,
58
+ RationaleFilterSensitiveLog: () => RationaleFilterSensitiveLog,
59
+ RepromptResponseFilterSensitiveLog: () => RepromptResponseFilterSensitiveLog,
60
+ ResourceNotFoundException: () => ResourceNotFoundException,
61
+ ResponseStream: () => ResponseStream,
62
+ ResponseStreamFilterSensitiveLog: () => ResponseStreamFilterSensitiveLog,
63
+ RetrievalResultLocationType: () => RetrievalResultLocationType,
64
+ RetrieveAndGenerateCommand: () => RetrieveAndGenerateCommand,
65
+ RetrieveAndGenerateInputFilterSensitiveLog: () => RetrieveAndGenerateInputFilterSensitiveLog,
66
+ RetrieveAndGenerateOutputFilterSensitiveLog: () => RetrieveAndGenerateOutputFilterSensitiveLog,
67
+ RetrieveAndGenerateRequestFilterSensitiveLog: () => RetrieveAndGenerateRequestFilterSensitiveLog,
68
+ RetrieveAndGenerateResponseFilterSensitiveLog: () => RetrieveAndGenerateResponseFilterSensitiveLog,
69
+ RetrieveAndGenerateType: () => RetrieveAndGenerateType,
70
+ RetrieveCommand: () => RetrieveCommand,
71
+ RetrieveRequestFilterSensitiveLog: () => RetrieveRequestFilterSensitiveLog,
72
+ RetrieveResponseFilterSensitiveLog: () => RetrieveResponseFilterSensitiveLog,
73
+ ServiceQuotaExceededException: () => ServiceQuotaExceededException,
74
+ Source: () => Source,
75
+ ThrottlingException: () => ThrottlingException,
76
+ Trace: () => Trace,
77
+ TraceFilterSensitiveLog: () => TraceFilterSensitiveLog,
78
+ TracePartFilterSensitiveLog: () => TracePartFilterSensitiveLog,
79
+ Type: () => Type,
80
+ ValidationException: () => ValidationException,
81
+ __Client: () => import_smithy_client.Client,
82
+ paginateRetrieve: () => paginateRetrieve
83
+ });
84
+ module.exports = __toCommonJS(src_exports);
85
+
86
+ // src/BedrockAgentRuntimeClient.ts
87
+ var import_middleware_host_header = require("@aws-sdk/middleware-host-header");
88
+ var import_middleware_logger = require("@aws-sdk/middleware-logger");
89
+ var import_middleware_recursion_detection = require("@aws-sdk/middleware-recursion-detection");
90
+ var import_middleware_signing = require("@aws-sdk/middleware-signing");
91
+ var import_middleware_user_agent = require("@aws-sdk/middleware-user-agent");
92
+ var import_config_resolver = require("@smithy/config-resolver");
93
+ var import_eventstream_serde_config_resolver = require("@smithy/eventstream-serde-config-resolver");
94
+ var import_middleware_content_length = require("@smithy/middleware-content-length");
95
+ var import_middleware_endpoint = require("@smithy/middleware-endpoint");
96
+ var import_middleware_retry = require("@smithy/middleware-retry");
97
+
98
+
99
+ // src/endpoint/EndpointParameters.ts
100
+ var resolveClientEndpointParameters = /* @__PURE__ */ __name((options) => {
101
+ return {
102
+ ...options,
103
+ useDualstackEndpoint: options.useDualstackEndpoint ?? false,
104
+ useFipsEndpoint: options.useFipsEndpoint ?? false,
105
+ defaultSigningName: "bedrock"
106
+ };
107
+ }, "resolveClientEndpointParameters");
108
+ var commonParams = {
109
+ UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
110
+ Endpoint: { type: "builtInParams", name: "endpoint" },
111
+ Region: { type: "builtInParams", name: "region" },
112
+ UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }
113
+ };
114
+
115
+ // src/BedrockAgentRuntimeClient.ts
116
+ var import_runtimeConfig = require("././runtimeConfig");
117
+
118
+ // src/runtimeExtensions.ts
119
+ var import_region_config_resolver = require("@aws-sdk/region-config-resolver");
120
+ var import_protocol_http = require("@smithy/protocol-http");
121
+ var import_smithy_client = require("@smithy/smithy-client");
122
+ var asPartial = /* @__PURE__ */ __name((t) => t, "asPartial");
123
+ var resolveRuntimeExtensions = /* @__PURE__ */ __name((runtimeConfig, extensions) => {
124
+ const extensionConfiguration = {
125
+ ...asPartial((0, import_region_config_resolver.getAwsRegionExtensionConfiguration)(runtimeConfig)),
126
+ ...asPartial((0, import_smithy_client.getDefaultExtensionConfiguration)(runtimeConfig)),
127
+ ...asPartial((0, import_protocol_http.getHttpHandlerExtensionConfiguration)(runtimeConfig))
128
+ };
129
+ extensions.forEach((extension) => extension.configure(extensionConfiguration));
130
+ return {
131
+ ...runtimeConfig,
132
+ ...(0, import_region_config_resolver.resolveAwsRegionExtensionConfiguration)(extensionConfiguration),
133
+ ...(0, import_smithy_client.resolveDefaultRuntimeConfig)(extensionConfiguration),
134
+ ...(0, import_protocol_http.resolveHttpHandlerRuntimeConfig)(extensionConfiguration)
135
+ };
136
+ }, "resolveRuntimeExtensions");
137
+
138
+ // src/BedrockAgentRuntimeClient.ts
139
+ var _BedrockAgentRuntimeClient = class _BedrockAgentRuntimeClient extends import_smithy_client.Client {
140
+ constructor(...[configuration]) {
141
+ const _config_0 = (0, import_runtimeConfig.getRuntimeConfig)(configuration || {});
142
+ const _config_1 = resolveClientEndpointParameters(_config_0);
143
+ const _config_2 = (0, import_config_resolver.resolveRegionConfig)(_config_1);
144
+ const _config_3 = (0, import_middleware_endpoint.resolveEndpointConfig)(_config_2);
145
+ const _config_4 = (0, import_middleware_retry.resolveRetryConfig)(_config_3);
146
+ const _config_5 = (0, import_middleware_host_header.resolveHostHeaderConfig)(_config_4);
147
+ const _config_6 = (0, import_middleware_signing.resolveAwsAuthConfig)(_config_5);
148
+ const _config_7 = (0, import_middleware_user_agent.resolveUserAgentConfig)(_config_6);
149
+ const _config_8 = (0, import_eventstream_serde_config_resolver.resolveEventStreamSerdeConfig)(_config_7);
150
+ const _config_9 = resolveRuntimeExtensions(_config_8, (configuration == null ? void 0 : configuration.extensions) || []);
151
+ super(_config_9);
152
+ this.config = _config_9;
153
+ this.middlewareStack.use((0, import_middleware_retry.getRetryPlugin)(this.config));
154
+ this.middlewareStack.use((0, import_middleware_content_length.getContentLengthPlugin)(this.config));
155
+ this.middlewareStack.use((0, import_middleware_host_header.getHostHeaderPlugin)(this.config));
156
+ this.middlewareStack.use((0, import_middleware_logger.getLoggerPlugin)(this.config));
157
+ this.middlewareStack.use((0, import_middleware_recursion_detection.getRecursionDetectionPlugin)(this.config));
158
+ this.middlewareStack.use((0, import_middleware_signing.getAwsAuthPlugin)(this.config));
159
+ this.middlewareStack.use((0, import_middleware_user_agent.getUserAgentPlugin)(this.config));
160
+ }
161
+ /**
162
+ * Destroy underlying resources, like sockets. It's usually not necessary to do this.
163
+ * However in Node.js, it's best to explicitly shut down the client's agent when it is no longer needed.
164
+ * Otherwise, sockets might stay open for quite a long time before the server terminates them.
165
+ */
166
+ destroy() {
167
+ super.destroy();
168
+ }
169
+ };
170
+ __name(_BedrockAgentRuntimeClient, "BedrockAgentRuntimeClient");
171
+ var BedrockAgentRuntimeClient = _BedrockAgentRuntimeClient;
172
+
173
+ // src/BedrockAgentRuntime.ts
174
+
175
+
176
+ // src/commands/InvokeAgentCommand.ts
177
+
178
+ var import_middleware_serde = require("@smithy/middleware-serde");
179
+
180
+ var import_types = require("@smithy/types");
181
+
182
+ // src/models/models_0.ts
183
+
184
+
185
+ // src/models/BedrockAgentRuntimeServiceException.ts
186
+
187
+ var _BedrockAgentRuntimeServiceException = class _BedrockAgentRuntimeServiceException extends import_smithy_client.ServiceException {
188
+ /**
189
+ * @internal
190
+ */
191
+ constructor(options) {
192
+ super(options);
193
+ Object.setPrototypeOf(this, _BedrockAgentRuntimeServiceException.prototype);
194
+ }
195
+ };
196
+ __name(_BedrockAgentRuntimeServiceException, "BedrockAgentRuntimeServiceException");
197
+ var BedrockAgentRuntimeServiceException = _BedrockAgentRuntimeServiceException;
198
+
199
+ // src/models/models_0.ts
200
+ var _AccessDeniedException = class _AccessDeniedException extends BedrockAgentRuntimeServiceException {
201
+ /**
202
+ * @internal
203
+ */
204
+ constructor(opts) {
205
+ super({
206
+ name: "AccessDeniedException",
207
+ $fault: "client",
208
+ ...opts
209
+ });
210
+ this.name = "AccessDeniedException";
211
+ this.$fault = "client";
212
+ Object.setPrototypeOf(this, _AccessDeniedException.prototype);
213
+ }
214
+ };
215
+ __name(_AccessDeniedException, "AccessDeniedException");
216
+ var AccessDeniedException = _AccessDeniedException;
217
+ var _BadGatewayException = class _BadGatewayException extends BedrockAgentRuntimeServiceException {
218
+ /**
219
+ * @internal
220
+ */
221
+ constructor(opts) {
222
+ super({
223
+ name: "BadGatewayException",
224
+ $fault: "server",
225
+ ...opts
226
+ });
227
+ this.name = "BadGatewayException";
228
+ this.$fault = "server";
229
+ Object.setPrototypeOf(this, _BadGatewayException.prototype);
230
+ this.resourceName = opts.resourceName;
231
+ }
232
+ };
233
+ __name(_BadGatewayException, "BadGatewayException");
234
+ var BadGatewayException = _BadGatewayException;
235
+ var _ConflictException = class _ConflictException extends BedrockAgentRuntimeServiceException {
236
+ /**
237
+ * @internal
238
+ */
239
+ constructor(opts) {
240
+ super({
241
+ name: "ConflictException",
242
+ $fault: "client",
243
+ ...opts
244
+ });
245
+ this.name = "ConflictException";
246
+ this.$fault = "client";
247
+ Object.setPrototypeOf(this, _ConflictException.prototype);
248
+ }
249
+ };
250
+ __name(_ConflictException, "ConflictException");
251
+ var ConflictException = _ConflictException;
252
+ var _DependencyFailedException = class _DependencyFailedException extends BedrockAgentRuntimeServiceException {
253
+ /**
254
+ * @internal
255
+ */
256
+ constructor(opts) {
257
+ super({
258
+ name: "DependencyFailedException",
259
+ $fault: "client",
260
+ ...opts
261
+ });
262
+ this.name = "DependencyFailedException";
263
+ this.$fault = "client";
264
+ Object.setPrototypeOf(this, _DependencyFailedException.prototype);
265
+ this.resourceName = opts.resourceName;
266
+ }
267
+ };
268
+ __name(_DependencyFailedException, "DependencyFailedException");
269
+ var DependencyFailedException = _DependencyFailedException;
270
+ var _InternalServerException = class _InternalServerException extends BedrockAgentRuntimeServiceException {
271
+ /**
272
+ * @internal
273
+ */
274
+ constructor(opts) {
275
+ super({
276
+ name: "InternalServerException",
277
+ $fault: "server",
278
+ ...opts
279
+ });
280
+ this.name = "InternalServerException";
281
+ this.$fault = "server";
282
+ Object.setPrototypeOf(this, _InternalServerException.prototype);
283
+ }
284
+ };
285
+ __name(_InternalServerException, "InternalServerException");
286
+ var InternalServerException = _InternalServerException;
287
+ var RetrievalResultLocationType = {
288
+ S3: "S3"
289
+ };
290
+ var _ResourceNotFoundException = class _ResourceNotFoundException extends BedrockAgentRuntimeServiceException {
291
+ /**
292
+ * @internal
293
+ */
294
+ constructor(opts) {
295
+ super({
296
+ name: "ResourceNotFoundException",
297
+ $fault: "client",
298
+ ...opts
299
+ });
300
+ this.name = "ResourceNotFoundException";
301
+ this.$fault = "client";
302
+ Object.setPrototypeOf(this, _ResourceNotFoundException.prototype);
303
+ }
304
+ };
305
+ __name(_ResourceNotFoundException, "ResourceNotFoundException");
306
+ var ResourceNotFoundException = _ResourceNotFoundException;
307
+ var _ServiceQuotaExceededException = class _ServiceQuotaExceededException extends BedrockAgentRuntimeServiceException {
308
+ /**
309
+ * @internal
310
+ */
311
+ constructor(opts) {
312
+ super({
313
+ name: "ServiceQuotaExceededException",
314
+ $fault: "client",
315
+ ...opts
316
+ });
317
+ this.name = "ServiceQuotaExceededException";
318
+ this.$fault = "client";
319
+ Object.setPrototypeOf(this, _ServiceQuotaExceededException.prototype);
320
+ }
321
+ };
322
+ __name(_ServiceQuotaExceededException, "ServiceQuotaExceededException");
323
+ var ServiceQuotaExceededException = _ServiceQuotaExceededException;
324
+ var _ThrottlingException = class _ThrottlingException extends BedrockAgentRuntimeServiceException {
325
+ /**
326
+ * @internal
327
+ */
328
+ constructor(opts) {
329
+ super({
330
+ name: "ThrottlingException",
331
+ $fault: "client",
332
+ ...opts
333
+ });
334
+ this.name = "ThrottlingException";
335
+ this.$fault = "client";
336
+ Object.setPrototypeOf(this, _ThrottlingException.prototype);
337
+ }
338
+ };
339
+ __name(_ThrottlingException, "ThrottlingException");
340
+ var ThrottlingException = _ThrottlingException;
341
+ var InvocationType = {
342
+ ACTION_GROUP: "ACTION_GROUP",
343
+ FINISH: "FINISH",
344
+ KNOWLEDGE_BASE: "KNOWLEDGE_BASE"
345
+ };
346
+ var CreationMode = {
347
+ DEFAULT: "DEFAULT",
348
+ OVERRIDDEN: "OVERRIDDEN"
349
+ };
350
+ var PromptType = {
351
+ KNOWLEDGE_BASE_RESPONSE_GENERATION: "KNOWLEDGE_BASE_RESPONSE_GENERATION",
352
+ ORCHESTRATION: "ORCHESTRATION",
353
+ POST_PROCESSING: "POST_PROCESSING",
354
+ PRE_PROCESSING: "PRE_PROCESSING"
355
+ };
356
+ var Source = {
357
+ ACTION_GROUP: "ACTION_GROUP",
358
+ KNOWLEDGE_BASE: "KNOWLEDGE_BASE",
359
+ PARSER: "PARSER"
360
+ };
361
+ var Type = {
362
+ ACTION_GROUP: "ACTION_GROUP",
363
+ ASK_USER: "ASK_USER",
364
+ FINISH: "FINISH",
365
+ KNOWLEDGE_BASE: "KNOWLEDGE_BASE",
366
+ REPROMPT: "REPROMPT"
367
+ };
368
+ var OrchestrationTrace;
369
+ ((OrchestrationTrace3) => {
370
+ OrchestrationTrace3.visit = /* @__PURE__ */ __name((value, visitor) => {
371
+ if (value.rationale !== void 0)
372
+ return visitor.rationale(value.rationale);
373
+ if (value.invocationInput !== void 0)
374
+ return visitor.invocationInput(value.invocationInput);
375
+ if (value.observation !== void 0)
376
+ return visitor.observation(value.observation);
377
+ if (value.modelInvocationInput !== void 0)
378
+ return visitor.modelInvocationInput(value.modelInvocationInput);
379
+ return visitor._(value.$unknown[0], value.$unknown[1]);
380
+ }, "visit");
381
+ })(OrchestrationTrace || (OrchestrationTrace = {}));
382
+ var PostProcessingTrace;
383
+ ((PostProcessingTrace3) => {
384
+ PostProcessingTrace3.visit = /* @__PURE__ */ __name((value, visitor) => {
385
+ if (value.modelInvocationInput !== void 0)
386
+ return visitor.modelInvocationInput(value.modelInvocationInput);
387
+ if (value.modelInvocationOutput !== void 0)
388
+ return visitor.modelInvocationOutput(value.modelInvocationOutput);
389
+ return visitor._(value.$unknown[0], value.$unknown[1]);
390
+ }, "visit");
391
+ })(PostProcessingTrace || (PostProcessingTrace = {}));
392
+ var PreProcessingTrace;
393
+ ((PreProcessingTrace3) => {
394
+ PreProcessingTrace3.visit = /* @__PURE__ */ __name((value, visitor) => {
395
+ if (value.modelInvocationInput !== void 0)
396
+ return visitor.modelInvocationInput(value.modelInvocationInput);
397
+ if (value.modelInvocationOutput !== void 0)
398
+ return visitor.modelInvocationOutput(value.modelInvocationOutput);
399
+ return visitor._(value.$unknown[0], value.$unknown[1]);
400
+ }, "visit");
401
+ })(PreProcessingTrace || (PreProcessingTrace = {}));
402
+ var Trace;
403
+ ((Trace3) => {
404
+ Trace3.visit = /* @__PURE__ */ __name((value, visitor) => {
405
+ if (value.preProcessingTrace !== void 0)
406
+ return visitor.preProcessingTrace(value.preProcessingTrace);
407
+ if (value.orchestrationTrace !== void 0)
408
+ return visitor.orchestrationTrace(value.orchestrationTrace);
409
+ if (value.postProcessingTrace !== void 0)
410
+ return visitor.postProcessingTrace(value.postProcessingTrace);
411
+ if (value.failureTrace !== void 0)
412
+ return visitor.failureTrace(value.failureTrace);
413
+ return visitor._(value.$unknown[0], value.$unknown[1]);
414
+ }, "visit");
415
+ })(Trace || (Trace = {}));
416
+ var _ValidationException = class _ValidationException extends BedrockAgentRuntimeServiceException {
417
+ /**
418
+ * @internal
419
+ */
420
+ constructor(opts) {
421
+ super({
422
+ name: "ValidationException",
423
+ $fault: "client",
424
+ ...opts
425
+ });
426
+ this.name = "ValidationException";
427
+ this.$fault = "client";
428
+ Object.setPrototypeOf(this, _ValidationException.prototype);
429
+ }
430
+ };
431
+ __name(_ValidationException, "ValidationException");
432
+ var ValidationException = _ValidationException;
433
+ var ResponseStream;
434
+ ((ResponseStream3) => {
435
+ ResponseStream3.visit = /* @__PURE__ */ __name((value, visitor) => {
436
+ if (value.chunk !== void 0)
437
+ return visitor.chunk(value.chunk);
438
+ if (value.trace !== void 0)
439
+ return visitor.trace(value.trace);
440
+ if (value.internalServerException !== void 0)
441
+ return visitor.internalServerException(value.internalServerException);
442
+ if (value.validationException !== void 0)
443
+ return visitor.validationException(value.validationException);
444
+ if (value.resourceNotFoundException !== void 0)
445
+ return visitor.resourceNotFoundException(value.resourceNotFoundException);
446
+ if (value.serviceQuotaExceededException !== void 0)
447
+ return visitor.serviceQuotaExceededException(value.serviceQuotaExceededException);
448
+ if (value.throttlingException !== void 0)
449
+ return visitor.throttlingException(value.throttlingException);
450
+ if (value.accessDeniedException !== void 0)
451
+ return visitor.accessDeniedException(value.accessDeniedException);
452
+ if (value.conflictException !== void 0)
453
+ return visitor.conflictException(value.conflictException);
454
+ if (value.dependencyFailedException !== void 0)
455
+ return visitor.dependencyFailedException(value.dependencyFailedException);
456
+ if (value.badGatewayException !== void 0)
457
+ return visitor.badGatewayException(value.badGatewayException);
458
+ return visitor._(value.$unknown[0], value.$unknown[1]);
459
+ }, "visit");
460
+ })(ResponseStream || (ResponseStream = {}));
461
+ var RetrieveAndGenerateType = {
462
+ KNOWLEDGE_BASE: "KNOWLEDGE_BASE"
463
+ };
464
+ var ActionGroupInvocationInputFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
465
+ ...obj,
466
+ ...obj.actionGroupName && { actionGroupName: import_smithy_client.SENSITIVE_STRING },
467
+ ...obj.verb && { verb: import_smithy_client.SENSITIVE_STRING },
468
+ ...obj.apiPath && { apiPath: import_smithy_client.SENSITIVE_STRING }
469
+ }), "ActionGroupInvocationInputFilterSensitiveLog");
470
+ var ActionGroupInvocationOutputFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
471
+ ...obj,
472
+ ...obj.text && { text: import_smithy_client.SENSITIVE_STRING }
473
+ }), "ActionGroupInvocationOutputFilterSensitiveLog");
474
+ var InvokeAgentRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
475
+ ...obj,
476
+ ...obj.inputText && { inputText: import_smithy_client.SENSITIVE_STRING }
477
+ }), "InvokeAgentRequestFilterSensitiveLog");
478
+ var PayloadPartFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
479
+ ...obj,
480
+ ...obj.bytes && { bytes: import_smithy_client.SENSITIVE_STRING }
481
+ }), "PayloadPartFilterSensitiveLog");
482
+ var FailureTraceFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
483
+ ...obj,
484
+ ...obj.failureReason && { failureReason: import_smithy_client.SENSITIVE_STRING }
485
+ }), "FailureTraceFilterSensitiveLog");
486
+ var KnowledgeBaseLookupInputFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
487
+ ...obj,
488
+ ...obj.text && { text: import_smithy_client.SENSITIVE_STRING },
489
+ ...obj.knowledgeBaseId && { knowledgeBaseId: import_smithy_client.SENSITIVE_STRING }
490
+ }), "KnowledgeBaseLookupInputFilterSensitiveLog");
491
+ var InvocationInputFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
492
+ ...obj,
493
+ ...obj.actionGroupInvocationInput && {
494
+ actionGroupInvocationInput: ActionGroupInvocationInputFilterSensitiveLog(obj.actionGroupInvocationInput)
495
+ },
496
+ ...obj.knowledgeBaseLookupInput && {
497
+ knowledgeBaseLookupInput: KnowledgeBaseLookupInputFilterSensitiveLog(obj.knowledgeBaseLookupInput)
498
+ }
499
+ }), "InvocationInputFilterSensitiveLog");
500
+ var ModelInvocationInputFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
501
+ ...obj,
502
+ ...obj.text && { text: import_smithy_client.SENSITIVE_STRING }
503
+ }), "ModelInvocationInputFilterSensitiveLog");
504
+ var FinalResponseFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
505
+ ...obj,
506
+ ...obj.text && { text: import_smithy_client.SENSITIVE_STRING }
507
+ }), "FinalResponseFilterSensitiveLog");
508
+ var RepromptResponseFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
509
+ ...obj,
510
+ ...obj.source && { source: import_smithy_client.SENSITIVE_STRING }
511
+ }), "RepromptResponseFilterSensitiveLog");
512
+ var ObservationFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
513
+ ...obj,
514
+ ...obj.actionGroupInvocationOutput && {
515
+ actionGroupInvocationOutput: ActionGroupInvocationOutputFilterSensitiveLog(obj.actionGroupInvocationOutput)
516
+ },
517
+ ...obj.finalResponse && { finalResponse: FinalResponseFilterSensitiveLog(obj.finalResponse) },
518
+ ...obj.repromptResponse && { repromptResponse: import_smithy_client.SENSITIVE_STRING }
519
+ }), "ObservationFilterSensitiveLog");
520
+ var RationaleFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
521
+ ...obj,
522
+ ...obj.text && { text: import_smithy_client.SENSITIVE_STRING }
523
+ }), "RationaleFilterSensitiveLog");
524
+ var OrchestrationTraceFilterSensitiveLog = /* @__PURE__ */ __name((obj) => {
525
+ if (obj.rationale !== void 0)
526
+ return { rationale: import_smithy_client.SENSITIVE_STRING };
527
+ if (obj.invocationInput !== void 0)
528
+ return { invocationInput: import_smithy_client.SENSITIVE_STRING };
529
+ if (obj.observation !== void 0)
530
+ return { observation: import_smithy_client.SENSITIVE_STRING };
531
+ if (obj.modelInvocationInput !== void 0)
532
+ return { modelInvocationInput: import_smithy_client.SENSITIVE_STRING };
533
+ if (obj.$unknown !== void 0)
534
+ return { [obj.$unknown[0]]: "UNKNOWN" };
535
+ }, "OrchestrationTraceFilterSensitiveLog");
536
+ var PostProcessingParsedResponseFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
537
+ ...obj,
538
+ ...obj.text && { text: import_smithy_client.SENSITIVE_STRING }
539
+ }), "PostProcessingParsedResponseFilterSensitiveLog");
540
+ var PostProcessingModelInvocationOutputFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
541
+ ...obj,
542
+ ...obj.parsedResponse && { parsedResponse: import_smithy_client.SENSITIVE_STRING }
543
+ }), "PostProcessingModelInvocationOutputFilterSensitiveLog");
544
+ var PostProcessingTraceFilterSensitiveLog = /* @__PURE__ */ __name((obj) => {
545
+ if (obj.modelInvocationInput !== void 0)
546
+ return { modelInvocationInput: import_smithy_client.SENSITIVE_STRING };
547
+ if (obj.modelInvocationOutput !== void 0)
548
+ return { modelInvocationOutput: import_smithy_client.SENSITIVE_STRING };
549
+ if (obj.$unknown !== void 0)
550
+ return { [obj.$unknown[0]]: "UNKNOWN" };
551
+ }, "PostProcessingTraceFilterSensitiveLog");
552
+ var PreProcessingParsedResponseFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
553
+ ...obj,
554
+ ...obj.rationale && { rationale: import_smithy_client.SENSITIVE_STRING }
555
+ }), "PreProcessingParsedResponseFilterSensitiveLog");
556
+ var PreProcessingModelInvocationOutputFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
557
+ ...obj,
558
+ ...obj.parsedResponse && { parsedResponse: import_smithy_client.SENSITIVE_STRING }
559
+ }), "PreProcessingModelInvocationOutputFilterSensitiveLog");
560
+ var PreProcessingTraceFilterSensitiveLog = /* @__PURE__ */ __name((obj) => {
561
+ if (obj.modelInvocationInput !== void 0)
562
+ return { modelInvocationInput: import_smithy_client.SENSITIVE_STRING };
563
+ if (obj.modelInvocationOutput !== void 0)
564
+ return { modelInvocationOutput: import_smithy_client.SENSITIVE_STRING };
565
+ if (obj.$unknown !== void 0)
566
+ return { [obj.$unknown[0]]: "UNKNOWN" };
567
+ }, "PreProcessingTraceFilterSensitiveLog");
568
+ var TraceFilterSensitiveLog = /* @__PURE__ */ __name((obj) => {
569
+ if (obj.preProcessingTrace !== void 0)
570
+ return { preProcessingTrace: import_smithy_client.SENSITIVE_STRING };
571
+ if (obj.orchestrationTrace !== void 0)
572
+ return { orchestrationTrace: import_smithy_client.SENSITIVE_STRING };
573
+ if (obj.postProcessingTrace !== void 0)
574
+ return { postProcessingTrace: import_smithy_client.SENSITIVE_STRING };
575
+ if (obj.failureTrace !== void 0)
576
+ return { failureTrace: import_smithy_client.SENSITIVE_STRING };
577
+ if (obj.$unknown !== void 0)
578
+ return { [obj.$unknown[0]]: "UNKNOWN" };
579
+ }, "TraceFilterSensitiveLog");
580
+ var TracePartFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
581
+ ...obj,
582
+ ...obj.trace && { trace: import_smithy_client.SENSITIVE_STRING }
583
+ }), "TracePartFilterSensitiveLog");
584
+ var ResponseStreamFilterSensitiveLog = /* @__PURE__ */ __name((obj) => {
585
+ if (obj.chunk !== void 0)
586
+ return { chunk: import_smithy_client.SENSITIVE_STRING };
587
+ if (obj.trace !== void 0)
588
+ return { trace: import_smithy_client.SENSITIVE_STRING };
589
+ if (obj.internalServerException !== void 0)
590
+ return { internalServerException: obj.internalServerException };
591
+ if (obj.validationException !== void 0)
592
+ return { validationException: obj.validationException };
593
+ if (obj.resourceNotFoundException !== void 0)
594
+ return { resourceNotFoundException: obj.resourceNotFoundException };
595
+ if (obj.serviceQuotaExceededException !== void 0)
596
+ return { serviceQuotaExceededException: obj.serviceQuotaExceededException };
597
+ if (obj.throttlingException !== void 0)
598
+ return { throttlingException: obj.throttlingException };
599
+ if (obj.accessDeniedException !== void 0)
600
+ return { accessDeniedException: obj.accessDeniedException };
601
+ if (obj.conflictException !== void 0)
602
+ return { conflictException: obj.conflictException };
603
+ if (obj.dependencyFailedException !== void 0)
604
+ return { dependencyFailedException: obj.dependencyFailedException };
605
+ if (obj.badGatewayException !== void 0)
606
+ return { badGatewayException: obj.badGatewayException };
607
+ if (obj.$unknown !== void 0)
608
+ return { [obj.$unknown[0]]: "UNKNOWN" };
609
+ }, "ResponseStreamFilterSensitiveLog");
610
+ var InvokeAgentResponseFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
611
+ ...obj,
612
+ ...obj.completion && { completion: "STREAMING_CONTENT" }
613
+ }), "InvokeAgentResponseFilterSensitiveLog");
614
+ var RetrieveAndGenerateInputFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
615
+ ...obj
616
+ }), "RetrieveAndGenerateInputFilterSensitiveLog");
617
+ var RetrieveAndGenerateRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
618
+ ...obj,
619
+ ...obj.input && { input: import_smithy_client.SENSITIVE_STRING }
620
+ }), "RetrieveAndGenerateRequestFilterSensitiveLog");
621
+ var RetrieveAndGenerateOutputFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
622
+ ...obj
623
+ }), "RetrieveAndGenerateOutputFilterSensitiveLog");
624
+ var RetrieveAndGenerateResponseFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
625
+ ...obj,
626
+ ...obj.output && { output: import_smithy_client.SENSITIVE_STRING }
627
+ }), "RetrieveAndGenerateResponseFilterSensitiveLog");
628
+ var KnowledgeBaseQueryFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
629
+ ...obj
630
+ }), "KnowledgeBaseQueryFilterSensitiveLog");
631
+ var RetrieveRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
632
+ ...obj,
633
+ ...obj.retrievalQuery && { retrievalQuery: import_smithy_client.SENSITIVE_STRING }
634
+ }), "RetrieveRequestFilterSensitiveLog");
635
+ var RetrieveResponseFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
636
+ ...obj,
637
+ ...obj.retrievalResults && { retrievalResults: import_smithy_client.SENSITIVE_STRING }
638
+ }), "RetrieveResponseFilterSensitiveLog");
639
+
640
+ // src/protocols/Aws_restJson1.ts
641
+ var import_core = require("@aws-sdk/core");
642
+ var import_core2 = require("@smithy/core");
643
+
644
+ var se_InvokeAgentCommand = /* @__PURE__ */ __name(async (input, context) => {
645
+ const b = (0, import_core2.requestBuilder)(input, context);
646
+ const headers = {
647
+ "content-type": "application/json"
648
+ };
649
+ b.bp("/agents/{agentId}/agentAliases/{agentAliasId}/sessions/{sessionId}/text");
650
+ b.p("agentId", () => input.agentId, "{agentId}", false);
651
+ b.p("agentAliasId", () => input.agentAliasId, "{agentAliasId}", false);
652
+ b.p("sessionId", () => input.sessionId, "{sessionId}", false);
653
+ let body;
654
+ body = JSON.stringify(
655
+ (0, import_smithy_client.take)(input, {
656
+ enableTrace: [],
657
+ endSession: [],
658
+ inputText: [],
659
+ sessionState: (_) => (0, import_smithy_client._json)(_)
660
+ })
661
+ );
662
+ b.m("POST").h(headers).b(body);
663
+ return b.build();
664
+ }, "se_InvokeAgentCommand");
665
+ var se_RetrieveCommand = /* @__PURE__ */ __name(async (input, context) => {
666
+ const b = (0, import_core2.requestBuilder)(input, context);
667
+ const headers = {
668
+ "content-type": "application/json"
669
+ };
670
+ b.bp("/knowledgebases/{knowledgeBaseId}/retrieve");
671
+ b.p("knowledgeBaseId", () => input.knowledgeBaseId, "{knowledgeBaseId}", false);
672
+ let body;
673
+ body = JSON.stringify(
674
+ (0, import_smithy_client.take)(input, {
675
+ nextToken: [],
676
+ retrievalConfiguration: (_) => (0, import_smithy_client._json)(_),
677
+ retrievalQuery: (_) => (0, import_smithy_client._json)(_)
678
+ })
679
+ );
680
+ b.m("POST").h(headers).b(body);
681
+ return b.build();
682
+ }, "se_RetrieveCommand");
683
+ var se_RetrieveAndGenerateCommand = /* @__PURE__ */ __name(async (input, context) => {
684
+ const b = (0, import_core2.requestBuilder)(input, context);
685
+ const headers = {
686
+ "content-type": "application/json"
687
+ };
688
+ b.bp("/retrieveAndGenerate");
689
+ let body;
690
+ body = JSON.stringify(
691
+ (0, import_smithy_client.take)(input, {
692
+ input: (_) => (0, import_smithy_client._json)(_),
693
+ retrieveAndGenerateConfiguration: (_) => (0, import_smithy_client._json)(_),
694
+ sessionConfiguration: (_) => (0, import_smithy_client._json)(_),
695
+ sessionId: []
696
+ })
697
+ );
698
+ b.m("POST").h(headers).b(body);
699
+ return b.build();
700
+ }, "se_RetrieveAndGenerateCommand");
701
+ var de_InvokeAgentCommand = /* @__PURE__ */ __name(async (output, context) => {
702
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
703
+ return de_InvokeAgentCommandError(output, context);
704
+ }
705
+ const contents = (0, import_smithy_client.map)({
706
+ $metadata: deserializeMetadata(output),
707
+ [_cT]: [, output.headers[_xabact]],
708
+ [_sI]: [, output.headers[_xabasi]]
709
+ });
710
+ const data = output.body;
711
+ contents.completion = de_ResponseStream(data, context);
712
+ return contents;
713
+ }, "de_InvokeAgentCommand");
714
+ var de_InvokeAgentCommandError = /* @__PURE__ */ __name(async (output, context) => {
715
+ const parsedOutput = {
716
+ ...output,
717
+ body: await parseErrorBody(output.body, context)
718
+ };
719
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
720
+ switch (errorCode) {
721
+ case "AccessDeniedException":
722
+ case "com.amazonaws.bedrockagentruntime#AccessDeniedException":
723
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
724
+ case "BadGatewayException":
725
+ case "com.amazonaws.bedrockagentruntime#BadGatewayException":
726
+ throw await de_BadGatewayExceptionRes(parsedOutput, context);
727
+ case "ConflictException":
728
+ case "com.amazonaws.bedrockagentruntime#ConflictException":
729
+ throw await de_ConflictExceptionRes(parsedOutput, context);
730
+ case "DependencyFailedException":
731
+ case "com.amazonaws.bedrockagentruntime#DependencyFailedException":
732
+ throw await de_DependencyFailedExceptionRes(parsedOutput, context);
733
+ case "InternalServerException":
734
+ case "com.amazonaws.bedrockagentruntime#InternalServerException":
735
+ throw await de_InternalServerExceptionRes(parsedOutput, context);
736
+ case "ResourceNotFoundException":
737
+ case "com.amazonaws.bedrockagentruntime#ResourceNotFoundException":
738
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
739
+ case "ServiceQuotaExceededException":
740
+ case "com.amazonaws.bedrockagentruntime#ServiceQuotaExceededException":
741
+ throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
742
+ case "ThrottlingException":
743
+ case "com.amazonaws.bedrockagentruntime#ThrottlingException":
744
+ throw await de_ThrottlingExceptionRes(parsedOutput, context);
745
+ case "ValidationException":
746
+ case "com.amazonaws.bedrockagentruntime#ValidationException":
747
+ throw await de_ValidationExceptionRes(parsedOutput, context);
748
+ default:
749
+ const parsedBody = parsedOutput.body;
750
+ return throwDefaultError({
751
+ output,
752
+ parsedBody,
753
+ errorCode
754
+ });
755
+ }
756
+ }, "de_InvokeAgentCommandError");
757
+ var de_RetrieveCommand = /* @__PURE__ */ __name(async (output, context) => {
758
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
759
+ return de_RetrieveCommandError(output, context);
760
+ }
761
+ const contents = (0, import_smithy_client.map)({
762
+ $metadata: deserializeMetadata(output)
763
+ });
764
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
765
+ const doc = (0, import_smithy_client.take)(data, {
766
+ nextToken: import_smithy_client.expectString,
767
+ retrievalResults: (_) => de_KnowledgeBaseRetrievalResults(_, context)
768
+ });
769
+ Object.assign(contents, doc);
770
+ return contents;
771
+ }, "de_RetrieveCommand");
772
+ var de_RetrieveCommandError = /* @__PURE__ */ __name(async (output, context) => {
773
+ const parsedOutput = {
774
+ ...output,
775
+ body: await parseErrorBody(output.body, context)
776
+ };
777
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
778
+ switch (errorCode) {
779
+ case "AccessDeniedException":
780
+ case "com.amazonaws.bedrockagentruntime#AccessDeniedException":
781
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
782
+ case "BadGatewayException":
783
+ case "com.amazonaws.bedrockagentruntime#BadGatewayException":
784
+ throw await de_BadGatewayExceptionRes(parsedOutput, context);
785
+ case "ConflictException":
786
+ case "com.amazonaws.bedrockagentruntime#ConflictException":
787
+ throw await de_ConflictExceptionRes(parsedOutput, context);
788
+ case "DependencyFailedException":
789
+ case "com.amazonaws.bedrockagentruntime#DependencyFailedException":
790
+ throw await de_DependencyFailedExceptionRes(parsedOutput, context);
791
+ case "InternalServerException":
792
+ case "com.amazonaws.bedrockagentruntime#InternalServerException":
793
+ throw await de_InternalServerExceptionRes(parsedOutput, context);
794
+ case "ResourceNotFoundException":
795
+ case "com.amazonaws.bedrockagentruntime#ResourceNotFoundException":
796
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
797
+ case "ServiceQuotaExceededException":
798
+ case "com.amazonaws.bedrockagentruntime#ServiceQuotaExceededException":
799
+ throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
800
+ case "ThrottlingException":
801
+ case "com.amazonaws.bedrockagentruntime#ThrottlingException":
802
+ throw await de_ThrottlingExceptionRes(parsedOutput, context);
803
+ case "ValidationException":
804
+ case "com.amazonaws.bedrockagentruntime#ValidationException":
805
+ throw await de_ValidationExceptionRes(parsedOutput, context);
806
+ default:
807
+ const parsedBody = parsedOutput.body;
808
+ return throwDefaultError({
809
+ output,
810
+ parsedBody,
811
+ errorCode
812
+ });
813
+ }
814
+ }, "de_RetrieveCommandError");
815
+ var de_RetrieveAndGenerateCommand = /* @__PURE__ */ __name(async (output, context) => {
816
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
817
+ return de_RetrieveAndGenerateCommandError(output, context);
818
+ }
819
+ const contents = (0, import_smithy_client.map)({
820
+ $metadata: deserializeMetadata(output)
821
+ });
822
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
823
+ const doc = (0, import_smithy_client.take)(data, {
824
+ citations: import_smithy_client._json,
825
+ output: import_smithy_client._json,
826
+ sessionId: import_smithy_client.expectString
827
+ });
828
+ Object.assign(contents, doc);
829
+ return contents;
830
+ }, "de_RetrieveAndGenerateCommand");
831
+ var de_RetrieveAndGenerateCommandError = /* @__PURE__ */ __name(async (output, context) => {
832
+ const parsedOutput = {
833
+ ...output,
834
+ body: await parseErrorBody(output.body, context)
835
+ };
836
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
837
+ switch (errorCode) {
838
+ case "AccessDeniedException":
839
+ case "com.amazonaws.bedrockagentruntime#AccessDeniedException":
840
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
841
+ case "BadGatewayException":
842
+ case "com.amazonaws.bedrockagentruntime#BadGatewayException":
843
+ throw await de_BadGatewayExceptionRes(parsedOutput, context);
844
+ case "ConflictException":
845
+ case "com.amazonaws.bedrockagentruntime#ConflictException":
846
+ throw await de_ConflictExceptionRes(parsedOutput, context);
847
+ case "DependencyFailedException":
848
+ case "com.amazonaws.bedrockagentruntime#DependencyFailedException":
849
+ throw await de_DependencyFailedExceptionRes(parsedOutput, context);
850
+ case "InternalServerException":
851
+ case "com.amazonaws.bedrockagentruntime#InternalServerException":
852
+ throw await de_InternalServerExceptionRes(parsedOutput, context);
853
+ case "ResourceNotFoundException":
854
+ case "com.amazonaws.bedrockagentruntime#ResourceNotFoundException":
855
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
856
+ case "ServiceQuotaExceededException":
857
+ case "com.amazonaws.bedrockagentruntime#ServiceQuotaExceededException":
858
+ throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
859
+ case "ThrottlingException":
860
+ case "com.amazonaws.bedrockagentruntime#ThrottlingException":
861
+ throw await de_ThrottlingExceptionRes(parsedOutput, context);
862
+ case "ValidationException":
863
+ case "com.amazonaws.bedrockagentruntime#ValidationException":
864
+ throw await de_ValidationExceptionRes(parsedOutput, context);
865
+ default:
866
+ const parsedBody = parsedOutput.body;
867
+ return throwDefaultError({
868
+ output,
869
+ parsedBody,
870
+ errorCode
871
+ });
872
+ }
873
+ }, "de_RetrieveAndGenerateCommandError");
874
+ var throwDefaultError = (0, import_smithy_client.withBaseException)(BedrockAgentRuntimeServiceException);
875
+ var de_AccessDeniedExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
876
+ const contents = (0, import_smithy_client.map)({});
877
+ const data = parsedOutput.body;
878
+ const doc = (0, import_smithy_client.take)(data, {
879
+ message: import_smithy_client.expectString
880
+ });
881
+ Object.assign(contents, doc);
882
+ const exception = new AccessDeniedException({
883
+ $metadata: deserializeMetadata(parsedOutput),
884
+ ...contents
885
+ });
886
+ return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
887
+ }, "de_AccessDeniedExceptionRes");
888
+ var de_BadGatewayExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
889
+ const contents = (0, import_smithy_client.map)({});
890
+ const data = parsedOutput.body;
891
+ const doc = (0, import_smithy_client.take)(data, {
892
+ message: import_smithy_client.expectString,
893
+ resourceName: import_smithy_client.expectString
894
+ });
895
+ Object.assign(contents, doc);
896
+ const exception = new BadGatewayException({
897
+ $metadata: deserializeMetadata(parsedOutput),
898
+ ...contents
899
+ });
900
+ return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
901
+ }, "de_BadGatewayExceptionRes");
902
+ var de_ConflictExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
903
+ const contents = (0, import_smithy_client.map)({});
904
+ const data = parsedOutput.body;
905
+ const doc = (0, import_smithy_client.take)(data, {
906
+ message: import_smithy_client.expectString
907
+ });
908
+ Object.assign(contents, doc);
909
+ const exception = new ConflictException({
910
+ $metadata: deserializeMetadata(parsedOutput),
911
+ ...contents
912
+ });
913
+ return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
914
+ }, "de_ConflictExceptionRes");
915
+ var de_DependencyFailedExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
916
+ const contents = (0, import_smithy_client.map)({});
917
+ const data = parsedOutput.body;
918
+ const doc = (0, import_smithy_client.take)(data, {
919
+ message: import_smithy_client.expectString,
920
+ resourceName: import_smithy_client.expectString
921
+ });
922
+ Object.assign(contents, doc);
923
+ const exception = new DependencyFailedException({
924
+ $metadata: deserializeMetadata(parsedOutput),
925
+ ...contents
926
+ });
927
+ return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
928
+ }, "de_DependencyFailedExceptionRes");
929
+ var de_InternalServerExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
930
+ const contents = (0, import_smithy_client.map)({});
931
+ const data = parsedOutput.body;
932
+ const doc = (0, import_smithy_client.take)(data, {
933
+ message: import_smithy_client.expectString
934
+ });
935
+ Object.assign(contents, doc);
936
+ const exception = new InternalServerException({
937
+ $metadata: deserializeMetadata(parsedOutput),
938
+ ...contents
939
+ });
940
+ return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
941
+ }, "de_InternalServerExceptionRes");
942
+ var de_ResourceNotFoundExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
943
+ const contents = (0, import_smithy_client.map)({});
944
+ const data = parsedOutput.body;
945
+ const doc = (0, import_smithy_client.take)(data, {
946
+ message: import_smithy_client.expectString
947
+ });
948
+ Object.assign(contents, doc);
949
+ const exception = new ResourceNotFoundException({
950
+ $metadata: deserializeMetadata(parsedOutput),
951
+ ...contents
952
+ });
953
+ return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
954
+ }, "de_ResourceNotFoundExceptionRes");
955
+ var de_ServiceQuotaExceededExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
956
+ const contents = (0, import_smithy_client.map)({});
957
+ const data = parsedOutput.body;
958
+ const doc = (0, import_smithy_client.take)(data, {
959
+ message: import_smithy_client.expectString
960
+ });
961
+ Object.assign(contents, doc);
962
+ const exception = new ServiceQuotaExceededException({
963
+ $metadata: deserializeMetadata(parsedOutput),
964
+ ...contents
965
+ });
966
+ return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
967
+ }, "de_ServiceQuotaExceededExceptionRes");
968
+ var de_ThrottlingExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
969
+ const contents = (0, import_smithy_client.map)({});
970
+ const data = parsedOutput.body;
971
+ const doc = (0, import_smithy_client.take)(data, {
972
+ message: import_smithy_client.expectString
973
+ });
974
+ Object.assign(contents, doc);
975
+ const exception = new ThrottlingException({
976
+ $metadata: deserializeMetadata(parsedOutput),
977
+ ...contents
978
+ });
979
+ return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
980
+ }, "de_ThrottlingExceptionRes");
981
+ var de_ValidationExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
982
+ const contents = (0, import_smithy_client.map)({});
983
+ const data = parsedOutput.body;
984
+ const doc = (0, import_smithy_client.take)(data, {
985
+ message: import_smithy_client.expectString
986
+ });
987
+ Object.assign(contents, doc);
988
+ const exception = new ValidationException({
989
+ $metadata: deserializeMetadata(parsedOutput),
990
+ ...contents
991
+ });
992
+ return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
993
+ }, "de_ValidationExceptionRes");
994
+ var de_ResponseStream = /* @__PURE__ */ __name((output, context) => {
995
+ return context.eventStreamMarshaller.deserialize(output, async (event) => {
996
+ if (event["chunk"] != null) {
997
+ return {
998
+ chunk: await de_PayloadPart_event(event["chunk"], context)
999
+ };
1000
+ }
1001
+ if (event["trace"] != null) {
1002
+ return {
1003
+ trace: await de_TracePart_event(event["trace"], context)
1004
+ };
1005
+ }
1006
+ if (event["internalServerException"] != null) {
1007
+ return {
1008
+ internalServerException: await de_InternalServerException_event(event["internalServerException"], context)
1009
+ };
1010
+ }
1011
+ if (event["validationException"] != null) {
1012
+ return {
1013
+ validationException: await de_ValidationException_event(event["validationException"], context)
1014
+ };
1015
+ }
1016
+ if (event["resourceNotFoundException"] != null) {
1017
+ return {
1018
+ resourceNotFoundException: await de_ResourceNotFoundException_event(
1019
+ event["resourceNotFoundException"],
1020
+ context
1021
+ )
1022
+ };
1023
+ }
1024
+ if (event["serviceQuotaExceededException"] != null) {
1025
+ return {
1026
+ serviceQuotaExceededException: await de_ServiceQuotaExceededException_event(
1027
+ event["serviceQuotaExceededException"],
1028
+ context
1029
+ )
1030
+ };
1031
+ }
1032
+ if (event["throttlingException"] != null) {
1033
+ return {
1034
+ throttlingException: await de_ThrottlingException_event(event["throttlingException"], context)
1035
+ };
1036
+ }
1037
+ if (event["accessDeniedException"] != null) {
1038
+ return {
1039
+ accessDeniedException: await de_AccessDeniedException_event(event["accessDeniedException"], context)
1040
+ };
1041
+ }
1042
+ if (event["conflictException"] != null) {
1043
+ return {
1044
+ conflictException: await de_ConflictException_event(event["conflictException"], context)
1045
+ };
1046
+ }
1047
+ if (event["dependencyFailedException"] != null) {
1048
+ return {
1049
+ dependencyFailedException: await de_DependencyFailedException_event(
1050
+ event["dependencyFailedException"],
1051
+ context
1052
+ )
1053
+ };
1054
+ }
1055
+ if (event["badGatewayException"] != null) {
1056
+ return {
1057
+ badGatewayException: await de_BadGatewayException_event(event["badGatewayException"], context)
1058
+ };
1059
+ }
1060
+ return { $unknown: output };
1061
+ });
1062
+ }, "de_ResponseStream");
1063
+ var de_AccessDeniedException_event = /* @__PURE__ */ __name(async (output, context) => {
1064
+ const parsedOutput = {
1065
+ ...output,
1066
+ body: await parseBody(output.body, context)
1067
+ };
1068
+ return de_AccessDeniedExceptionRes(parsedOutput, context);
1069
+ }, "de_AccessDeniedException_event");
1070
+ var de_BadGatewayException_event = /* @__PURE__ */ __name(async (output, context) => {
1071
+ const parsedOutput = {
1072
+ ...output,
1073
+ body: await parseBody(output.body, context)
1074
+ };
1075
+ return de_BadGatewayExceptionRes(parsedOutput, context);
1076
+ }, "de_BadGatewayException_event");
1077
+ var de_ConflictException_event = /* @__PURE__ */ __name(async (output, context) => {
1078
+ const parsedOutput = {
1079
+ ...output,
1080
+ body: await parseBody(output.body, context)
1081
+ };
1082
+ return de_ConflictExceptionRes(parsedOutput, context);
1083
+ }, "de_ConflictException_event");
1084
+ var de_DependencyFailedException_event = /* @__PURE__ */ __name(async (output, context) => {
1085
+ const parsedOutput = {
1086
+ ...output,
1087
+ body: await parseBody(output.body, context)
1088
+ };
1089
+ return de_DependencyFailedExceptionRes(parsedOutput, context);
1090
+ }, "de_DependencyFailedException_event");
1091
+ var de_InternalServerException_event = /* @__PURE__ */ __name(async (output, context) => {
1092
+ const parsedOutput = {
1093
+ ...output,
1094
+ body: await parseBody(output.body, context)
1095
+ };
1096
+ return de_InternalServerExceptionRes(parsedOutput, context);
1097
+ }, "de_InternalServerException_event");
1098
+ var de_PayloadPart_event = /* @__PURE__ */ __name(async (output, context) => {
1099
+ const contents = {};
1100
+ const data = await parseBody(output.body, context);
1101
+ Object.assign(contents, de_PayloadPart(data, context));
1102
+ return contents;
1103
+ }, "de_PayloadPart_event");
1104
+ var de_ResourceNotFoundException_event = /* @__PURE__ */ __name(async (output, context) => {
1105
+ const parsedOutput = {
1106
+ ...output,
1107
+ body: await parseBody(output.body, context)
1108
+ };
1109
+ return de_ResourceNotFoundExceptionRes(parsedOutput, context);
1110
+ }, "de_ResourceNotFoundException_event");
1111
+ var de_ServiceQuotaExceededException_event = /* @__PURE__ */ __name(async (output, context) => {
1112
+ const parsedOutput = {
1113
+ ...output,
1114
+ body: await parseBody(output.body, context)
1115
+ };
1116
+ return de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
1117
+ }, "de_ServiceQuotaExceededException_event");
1118
+ var de_ThrottlingException_event = /* @__PURE__ */ __name(async (output, context) => {
1119
+ const parsedOutput = {
1120
+ ...output,
1121
+ body: await parseBody(output.body, context)
1122
+ };
1123
+ return de_ThrottlingExceptionRes(parsedOutput, context);
1124
+ }, "de_ThrottlingException_event");
1125
+ var de_TracePart_event = /* @__PURE__ */ __name(async (output, context) => {
1126
+ const contents = {};
1127
+ const data = await parseBody(output.body, context);
1128
+ Object.assign(contents, de_TracePart(data, context));
1129
+ return contents;
1130
+ }, "de_TracePart_event");
1131
+ var de_ValidationException_event = /* @__PURE__ */ __name(async (output, context) => {
1132
+ const parsedOutput = {
1133
+ ...output,
1134
+ body: await parseBody(output.body, context)
1135
+ };
1136
+ return de_ValidationExceptionRes(parsedOutput, context);
1137
+ }, "de_ValidationException_event");
1138
+ var de_InferenceConfiguration = /* @__PURE__ */ __name((output, context) => {
1139
+ return (0, import_smithy_client.take)(output, {
1140
+ maximumLength: import_smithy_client.expectInt32,
1141
+ stopSequences: import_smithy_client._json,
1142
+ temperature: import_smithy_client.limitedParseFloat32,
1143
+ topK: import_smithy_client.expectInt32,
1144
+ topP: import_smithy_client.limitedParseFloat32
1145
+ });
1146
+ }, "de_InferenceConfiguration");
1147
+ var de_KnowledgeBaseRetrievalResult = /* @__PURE__ */ __name((output, context) => {
1148
+ return (0, import_smithy_client.take)(output, {
1149
+ content: import_smithy_client._json,
1150
+ location: import_smithy_client._json,
1151
+ score: import_smithy_client.limitedParseDouble
1152
+ });
1153
+ }, "de_KnowledgeBaseRetrievalResult");
1154
+ var de_KnowledgeBaseRetrievalResults = /* @__PURE__ */ __name((output, context) => {
1155
+ const retVal = (output || []).filter((e) => e != null).map((entry) => {
1156
+ return de_KnowledgeBaseRetrievalResult(entry, context);
1157
+ });
1158
+ return retVal;
1159
+ }, "de_KnowledgeBaseRetrievalResults");
1160
+ var de_ModelInvocationInput = /* @__PURE__ */ __name((output, context) => {
1161
+ return (0, import_smithy_client.take)(output, {
1162
+ inferenceConfiguration: (_) => de_InferenceConfiguration(_, context),
1163
+ overrideLambda: import_smithy_client.expectString,
1164
+ parserMode: import_smithy_client.expectString,
1165
+ promptCreationMode: import_smithy_client.expectString,
1166
+ text: import_smithy_client.expectString,
1167
+ traceId: import_smithy_client.expectString,
1168
+ type: import_smithy_client.expectString
1169
+ });
1170
+ }, "de_ModelInvocationInput");
1171
+ var de_OrchestrationTrace = /* @__PURE__ */ __name((output, context) => {
1172
+ if (output.invocationInput != null) {
1173
+ return {
1174
+ invocationInput: (0, import_smithy_client._json)(output.invocationInput)
1175
+ };
1176
+ }
1177
+ if (output.modelInvocationInput != null) {
1178
+ return {
1179
+ modelInvocationInput: de_ModelInvocationInput(output.modelInvocationInput, context)
1180
+ };
1181
+ }
1182
+ if (output.observation != null) {
1183
+ return {
1184
+ observation: (0, import_smithy_client._json)(output.observation)
1185
+ };
1186
+ }
1187
+ if (output.rationale != null) {
1188
+ return {
1189
+ rationale: (0, import_smithy_client._json)(output.rationale)
1190
+ };
1191
+ }
1192
+ return { $unknown: Object.entries(output)[0] };
1193
+ }, "de_OrchestrationTrace");
1194
+ var de_PayloadPart = /* @__PURE__ */ __name((output, context) => {
1195
+ return (0, import_smithy_client.take)(output, {
1196
+ attribution: import_smithy_client._json,
1197
+ bytes: context.base64Decoder
1198
+ });
1199
+ }, "de_PayloadPart");
1200
+ var de_PostProcessingTrace = /* @__PURE__ */ __name((output, context) => {
1201
+ if (output.modelInvocationInput != null) {
1202
+ return {
1203
+ modelInvocationInput: de_ModelInvocationInput(output.modelInvocationInput, context)
1204
+ };
1205
+ }
1206
+ if (output.modelInvocationOutput != null) {
1207
+ return {
1208
+ modelInvocationOutput: (0, import_smithy_client._json)(output.modelInvocationOutput)
1209
+ };
1210
+ }
1211
+ return { $unknown: Object.entries(output)[0] };
1212
+ }, "de_PostProcessingTrace");
1213
+ var de_PreProcessingTrace = /* @__PURE__ */ __name((output, context) => {
1214
+ if (output.modelInvocationInput != null) {
1215
+ return {
1216
+ modelInvocationInput: de_ModelInvocationInput(output.modelInvocationInput, context)
1217
+ };
1218
+ }
1219
+ if (output.modelInvocationOutput != null) {
1220
+ return {
1221
+ modelInvocationOutput: (0, import_smithy_client._json)(output.modelInvocationOutput)
1222
+ };
1223
+ }
1224
+ return { $unknown: Object.entries(output)[0] };
1225
+ }, "de_PreProcessingTrace");
1226
+ var de_Trace = /* @__PURE__ */ __name((output, context) => {
1227
+ if (output.failureTrace != null) {
1228
+ return {
1229
+ failureTrace: (0, import_smithy_client._json)(output.failureTrace)
1230
+ };
1231
+ }
1232
+ if (output.orchestrationTrace != null) {
1233
+ return {
1234
+ orchestrationTrace: de_OrchestrationTrace((0, import_core.awsExpectUnion)(output.orchestrationTrace), context)
1235
+ };
1236
+ }
1237
+ if (output.postProcessingTrace != null) {
1238
+ return {
1239
+ postProcessingTrace: de_PostProcessingTrace((0, import_core.awsExpectUnion)(output.postProcessingTrace), context)
1240
+ };
1241
+ }
1242
+ if (output.preProcessingTrace != null) {
1243
+ return {
1244
+ preProcessingTrace: de_PreProcessingTrace((0, import_core.awsExpectUnion)(output.preProcessingTrace), context)
1245
+ };
1246
+ }
1247
+ return { $unknown: Object.entries(output)[0] };
1248
+ }, "de_Trace");
1249
+ var de_TracePart = /* @__PURE__ */ __name((output, context) => {
1250
+ return (0, import_smithy_client.take)(output, {
1251
+ agentAliasId: import_smithy_client.expectString,
1252
+ agentId: import_smithy_client.expectString,
1253
+ sessionId: import_smithy_client.expectString,
1254
+ trace: (_) => de_Trace((0, import_core.awsExpectUnion)(_), context)
1255
+ });
1256
+ }, "de_TracePart");
1257
+ var deserializeMetadata = /* @__PURE__ */ __name((output) => ({
1258
+ httpStatusCode: output.statusCode,
1259
+ requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
1260
+ extendedRequestId: output.headers["x-amz-id-2"],
1261
+ cfId: output.headers["x-amz-cf-id"]
1262
+ }), "deserializeMetadata");
1263
+ var collectBodyString = /* @__PURE__ */ __name((streamBody, context) => (0, import_smithy_client.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body)), "collectBodyString");
1264
+ var _cT = "contentType";
1265
+ var _sI = "sessionId";
1266
+ var _xabact = "x-amzn-bedrock-agent-content-type";
1267
+ var _xabasi = "x-amz-bedrock-agent-session-id";
1268
+ var parseBody = /* @__PURE__ */ __name((streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
1269
+ if (encoded.length) {
1270
+ return JSON.parse(encoded);
1271
+ }
1272
+ return {};
1273
+ }), "parseBody");
1274
+ var parseErrorBody = /* @__PURE__ */ __name(async (errorBody, context) => {
1275
+ const value = await parseBody(errorBody, context);
1276
+ value.message = value.message ?? value.Message;
1277
+ return value;
1278
+ }, "parseErrorBody");
1279
+ var loadRestJsonErrorCode = /* @__PURE__ */ __name((output, data) => {
1280
+ const findKey = /* @__PURE__ */ __name((object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()), "findKey");
1281
+ const sanitizeErrorCode = /* @__PURE__ */ __name((rawValue) => {
1282
+ let cleanValue = rawValue;
1283
+ if (typeof cleanValue === "number") {
1284
+ cleanValue = cleanValue.toString();
1285
+ }
1286
+ if (cleanValue.indexOf(",") >= 0) {
1287
+ cleanValue = cleanValue.split(",")[0];
1288
+ }
1289
+ if (cleanValue.indexOf(":") >= 0) {
1290
+ cleanValue = cleanValue.split(":")[0];
1291
+ }
1292
+ if (cleanValue.indexOf("#") >= 0) {
1293
+ cleanValue = cleanValue.split("#")[1];
1294
+ }
1295
+ return cleanValue;
1296
+ }, "sanitizeErrorCode");
1297
+ const headerKey = findKey(output.headers, "x-amzn-errortype");
1298
+ if (headerKey !== void 0) {
1299
+ return sanitizeErrorCode(output.headers[headerKey]);
1300
+ }
1301
+ if (data.code !== void 0) {
1302
+ return sanitizeErrorCode(data.code);
1303
+ }
1304
+ if (data["__type"] !== void 0) {
1305
+ return sanitizeErrorCode(data["__type"]);
1306
+ }
1307
+ }, "loadRestJsonErrorCode");
1308
+
1309
+ // src/commands/InvokeAgentCommand.ts
1310
+ var _InvokeAgentCommand = class _InvokeAgentCommand extends import_smithy_client.Command.classBuilder().ep({
1311
+ ...commonParams
1312
+ }).m(function(Command, cs, config, o) {
1313
+ return [
1314
+ (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
1315
+ (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
1316
+ ];
1317
+ }).s("AmazonBedrockAgentRunTimeService", "InvokeAgent", {
1318
+ /**
1319
+ * @internal
1320
+ */
1321
+ eventStream: {
1322
+ output: true
1323
+ }
1324
+ }).n("BedrockAgentRuntimeClient", "InvokeAgentCommand").f(InvokeAgentRequestFilterSensitiveLog, InvokeAgentResponseFilterSensitiveLog).ser(se_InvokeAgentCommand).de(de_InvokeAgentCommand).build() {
1325
+ };
1326
+ __name(_InvokeAgentCommand, "InvokeAgentCommand");
1327
+ var InvokeAgentCommand = _InvokeAgentCommand;
1328
+
1329
+ // src/commands/RetrieveAndGenerateCommand.ts
1330
+
1331
+
1332
+
1333
+
1334
+ var _RetrieveAndGenerateCommand = class _RetrieveAndGenerateCommand extends import_smithy_client.Command.classBuilder().ep({
1335
+ ...commonParams
1336
+ }).m(function(Command, cs, config, o) {
1337
+ return [
1338
+ (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
1339
+ (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
1340
+ ];
1341
+ }).s("AmazonBedrockAgentRunTimeService", "RetrieveAndGenerate", {}).n("BedrockAgentRuntimeClient", "RetrieveAndGenerateCommand").f(RetrieveAndGenerateRequestFilterSensitiveLog, RetrieveAndGenerateResponseFilterSensitiveLog).ser(se_RetrieveAndGenerateCommand).de(de_RetrieveAndGenerateCommand).build() {
1342
+ };
1343
+ __name(_RetrieveAndGenerateCommand, "RetrieveAndGenerateCommand");
1344
+ var RetrieveAndGenerateCommand = _RetrieveAndGenerateCommand;
1345
+
1346
+ // src/commands/RetrieveCommand.ts
1347
+
1348
+
1349
+
1350
+
1351
+ var _RetrieveCommand = class _RetrieveCommand extends import_smithy_client.Command.classBuilder().ep({
1352
+ ...commonParams
1353
+ }).m(function(Command, cs, config, o) {
1354
+ return [
1355
+ (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
1356
+ (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
1357
+ ];
1358
+ }).s("AmazonBedrockAgentRunTimeService", "Retrieve", {}).n("BedrockAgentRuntimeClient", "RetrieveCommand").f(RetrieveRequestFilterSensitiveLog, RetrieveResponseFilterSensitiveLog).ser(se_RetrieveCommand).de(de_RetrieveCommand).build() {
1359
+ };
1360
+ __name(_RetrieveCommand, "RetrieveCommand");
1361
+ var RetrieveCommand = _RetrieveCommand;
1362
+
1363
+ // src/BedrockAgentRuntime.ts
1364
+ var commands = {
1365
+ InvokeAgentCommand,
1366
+ RetrieveCommand,
1367
+ RetrieveAndGenerateCommand
1368
+ };
1369
+ var _BedrockAgentRuntime = class _BedrockAgentRuntime extends BedrockAgentRuntimeClient {
1370
+ };
1371
+ __name(_BedrockAgentRuntime, "BedrockAgentRuntime");
1372
+ var BedrockAgentRuntime = _BedrockAgentRuntime;
1373
+ (0, import_smithy_client.createAggregatedClient)(commands, BedrockAgentRuntime);
1374
+
1375
+ // src/pagination/RetrievePaginator.ts
1376
+ var import_core3 = require("@smithy/core");
1377
+ var paginateRetrieve = (0, import_core3.createPaginator)(BedrockAgentRuntimeClient, RetrieveCommand, "nextToken", "nextToken", "");
1378
+
1379
+ // src/index.ts
1380
+ var import_util_endpoints = require("@aws-sdk/util-endpoints");
1381
+ // Annotate the CommonJS export names for ESM import in node:
1382
+
1383
+ 0 && (module.exports = {
1384
+ AccessDeniedException,
1385
+ ActionGroupInvocationInputFilterSensitiveLog,
1386
+ ActionGroupInvocationOutputFilterSensitiveLog,
1387
+ BadGatewayException,
1388
+ BedrockAgentRuntime,
1389
+ BedrockAgentRuntimeClient,
1390
+ BedrockAgentRuntimeServiceException,
1391
+ ConflictException,
1392
+ CreationMode,
1393
+ DependencyFailedException,
1394
+ FailureTraceFilterSensitiveLog,
1395
+ FinalResponseFilterSensitiveLog,
1396
+ InternalServerException,
1397
+ InvocationInputFilterSensitiveLog,
1398
+ InvocationType,
1399
+ InvokeAgentCommand,
1400
+ InvokeAgentRequestFilterSensitiveLog,
1401
+ InvokeAgentResponseFilterSensitiveLog,
1402
+ KnowledgeBaseLookupInputFilterSensitiveLog,
1403
+ KnowledgeBaseQueryFilterSensitiveLog,
1404
+ ModelInvocationInputFilterSensitiveLog,
1405
+ ObservationFilterSensitiveLog,
1406
+ OrchestrationTrace,
1407
+ OrchestrationTraceFilterSensitiveLog,
1408
+ PayloadPartFilterSensitiveLog,
1409
+ PostProcessingModelInvocationOutputFilterSensitiveLog,
1410
+ PostProcessingParsedResponseFilterSensitiveLog,
1411
+ PostProcessingTrace,
1412
+ PostProcessingTraceFilterSensitiveLog,
1413
+ PreProcessingModelInvocationOutputFilterSensitiveLog,
1414
+ PreProcessingParsedResponseFilterSensitiveLog,
1415
+ PreProcessingTrace,
1416
+ PreProcessingTraceFilterSensitiveLog,
1417
+ PromptType,
1418
+ RationaleFilterSensitiveLog,
1419
+ RepromptResponseFilterSensitiveLog,
1420
+ ResourceNotFoundException,
1421
+ ResponseStream,
1422
+ ResponseStreamFilterSensitiveLog,
1423
+ RetrievalResultLocationType,
1424
+ RetrieveAndGenerateCommand,
1425
+ RetrieveAndGenerateInputFilterSensitiveLog,
1426
+ RetrieveAndGenerateOutputFilterSensitiveLog,
1427
+ RetrieveAndGenerateRequestFilterSensitiveLog,
1428
+ RetrieveAndGenerateResponseFilterSensitiveLog,
1429
+ RetrieveAndGenerateType,
1430
+ RetrieveCommand,
1431
+ RetrieveRequestFilterSensitiveLog,
1432
+ RetrieveResponseFilterSensitiveLog,
1433
+ ServiceQuotaExceededException,
1434
+ Source,
1435
+ ThrottlingException,
1436
+ Trace,
1437
+ TraceFilterSensitiveLog,
1438
+ TracePartFilterSensitiveLog,
1439
+ Type,
1440
+ ValidationException,
1441
+ __Client,
1442
+ paginateRetrieve
1443
+ });
1444
+