@aws-sdk/client-bedrock-runtime 3.504.0 → 3.509.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 +7 -50
- package/dist-es/protocols/Aws_restJson1.js +6 -49
- package/package.json +3 -3
package/dist-cjs/index.js
CHANGED
|
@@ -425,7 +425,7 @@ var se_InvokeModelWithResponseStreamCommand = /* @__PURE__ */ __name(async (inpu
|
|
|
425
425
|
}, "se_InvokeModelWithResponseStreamCommand");
|
|
426
426
|
var de_InvokeModelCommand = /* @__PURE__ */ __name(async (output, context) => {
|
|
427
427
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
428
|
-
return
|
|
428
|
+
return de_CommandError(output, context);
|
|
429
429
|
}
|
|
430
430
|
const contents = (0, import_smithy_client.map)({
|
|
431
431
|
$metadata: deserializeMetadata(output),
|
|
@@ -435,52 +435,9 @@ var de_InvokeModelCommand = /* @__PURE__ */ __name(async (output, context) => {
|
|
|
435
435
|
contents.body = data;
|
|
436
436
|
return contents;
|
|
437
437
|
}, "de_InvokeModelCommand");
|
|
438
|
-
var de_InvokeModelCommandError = /* @__PURE__ */ __name(async (output, context) => {
|
|
439
|
-
const parsedOutput = {
|
|
440
|
-
...output,
|
|
441
|
-
body: await parseErrorBody(output.body, context)
|
|
442
|
-
};
|
|
443
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
444
|
-
switch (errorCode) {
|
|
445
|
-
case "AccessDeniedException":
|
|
446
|
-
case "com.amazonaws.bedrockruntime#AccessDeniedException":
|
|
447
|
-
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
448
|
-
case "InternalServerException":
|
|
449
|
-
case "com.amazonaws.bedrockruntime#InternalServerException":
|
|
450
|
-
throw await de_InternalServerExceptionRes(parsedOutput, context);
|
|
451
|
-
case "ModelErrorException":
|
|
452
|
-
case "com.amazonaws.bedrockruntime#ModelErrorException":
|
|
453
|
-
throw await de_ModelErrorExceptionRes(parsedOutput, context);
|
|
454
|
-
case "ModelNotReadyException":
|
|
455
|
-
case "com.amazonaws.bedrockruntime#ModelNotReadyException":
|
|
456
|
-
throw await de_ModelNotReadyExceptionRes(parsedOutput, context);
|
|
457
|
-
case "ModelTimeoutException":
|
|
458
|
-
case "com.amazonaws.bedrockruntime#ModelTimeoutException":
|
|
459
|
-
throw await de_ModelTimeoutExceptionRes(parsedOutput, context);
|
|
460
|
-
case "ResourceNotFoundException":
|
|
461
|
-
case "com.amazonaws.bedrockruntime#ResourceNotFoundException":
|
|
462
|
-
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
463
|
-
case "ServiceQuotaExceededException":
|
|
464
|
-
case "com.amazonaws.bedrockruntime#ServiceQuotaExceededException":
|
|
465
|
-
throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
|
|
466
|
-
case "ThrottlingException":
|
|
467
|
-
case "com.amazonaws.bedrockruntime#ThrottlingException":
|
|
468
|
-
throw await de_ThrottlingExceptionRes(parsedOutput, context);
|
|
469
|
-
case "ValidationException":
|
|
470
|
-
case "com.amazonaws.bedrockruntime#ValidationException":
|
|
471
|
-
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
472
|
-
default:
|
|
473
|
-
const parsedBody = parsedOutput.body;
|
|
474
|
-
return throwDefaultError({
|
|
475
|
-
output,
|
|
476
|
-
parsedBody,
|
|
477
|
-
errorCode
|
|
478
|
-
});
|
|
479
|
-
}
|
|
480
|
-
}, "de_InvokeModelCommandError");
|
|
481
438
|
var de_InvokeModelWithResponseStreamCommand = /* @__PURE__ */ __name(async (output, context) => {
|
|
482
439
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
483
|
-
return
|
|
440
|
+
return de_CommandError(output, context);
|
|
484
441
|
}
|
|
485
442
|
const contents = (0, import_smithy_client.map)({
|
|
486
443
|
$metadata: deserializeMetadata(output),
|
|
@@ -490,7 +447,7 @@ var de_InvokeModelWithResponseStreamCommand = /* @__PURE__ */ __name(async (outp
|
|
|
490
447
|
contents.body = de_ResponseStream(data, context);
|
|
491
448
|
return contents;
|
|
492
449
|
}, "de_InvokeModelWithResponseStreamCommand");
|
|
493
|
-
var
|
|
450
|
+
var de_CommandError = /* @__PURE__ */ __name(async (output, context) => {
|
|
494
451
|
const parsedOutput = {
|
|
495
452
|
...output,
|
|
496
453
|
body: await parseErrorBody(output.body, context)
|
|
@@ -509,9 +466,6 @@ var de_InvokeModelWithResponseStreamCommandError = /* @__PURE__ */ __name(async
|
|
|
509
466
|
case "ModelNotReadyException":
|
|
510
467
|
case "com.amazonaws.bedrockruntime#ModelNotReadyException":
|
|
511
468
|
throw await de_ModelNotReadyExceptionRes(parsedOutput, context);
|
|
512
|
-
case "ModelStreamErrorException":
|
|
513
|
-
case "com.amazonaws.bedrockruntime#ModelStreamErrorException":
|
|
514
|
-
throw await de_ModelStreamErrorExceptionRes(parsedOutput, context);
|
|
515
469
|
case "ModelTimeoutException":
|
|
516
470
|
case "com.amazonaws.bedrockruntime#ModelTimeoutException":
|
|
517
471
|
throw await de_ModelTimeoutExceptionRes(parsedOutput, context);
|
|
@@ -527,6 +481,9 @@ var de_InvokeModelWithResponseStreamCommandError = /* @__PURE__ */ __name(async
|
|
|
527
481
|
case "ValidationException":
|
|
528
482
|
case "com.amazonaws.bedrockruntime#ValidationException":
|
|
529
483
|
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
484
|
+
case "ModelStreamErrorException":
|
|
485
|
+
case "com.amazonaws.bedrockruntime#ModelStreamErrorException":
|
|
486
|
+
throw await de_ModelStreamErrorExceptionRes(parsedOutput, context);
|
|
530
487
|
default:
|
|
531
488
|
const parsedBody = parsedOutput.body;
|
|
532
489
|
return throwDefaultError({
|
|
@@ -535,7 +492,7 @@ var de_InvokeModelWithResponseStreamCommandError = /* @__PURE__ */ __name(async
|
|
|
535
492
|
errorCode
|
|
536
493
|
});
|
|
537
494
|
}
|
|
538
|
-
}, "
|
|
495
|
+
}, "de_CommandError");
|
|
539
496
|
var throwDefaultError = (0, import_smithy_client.withBaseException)(BedrockRuntimeServiceException);
|
|
540
497
|
var de_AccessDeniedExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
|
|
541
498
|
const contents = (0, import_smithy_client.map)({});
|
|
@@ -34,7 +34,7 @@ export const se_InvokeModelWithResponseStreamCommand = async (input, context) =>
|
|
|
34
34
|
};
|
|
35
35
|
export const de_InvokeModelCommand = async (output, context) => {
|
|
36
36
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
37
|
-
return
|
|
37
|
+
return de_CommandError(output, context);
|
|
38
38
|
}
|
|
39
39
|
const contents = map({
|
|
40
40
|
$metadata: deserializeMetadata(output),
|
|
@@ -44,52 +44,9 @@ export const de_InvokeModelCommand = async (output, context) => {
|
|
|
44
44
|
contents.body = data;
|
|
45
45
|
return contents;
|
|
46
46
|
};
|
|
47
|
-
const de_InvokeModelCommandError = async (output, context) => {
|
|
48
|
-
const parsedOutput = {
|
|
49
|
-
...output,
|
|
50
|
-
body: await parseErrorBody(output.body, context),
|
|
51
|
-
};
|
|
52
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
53
|
-
switch (errorCode) {
|
|
54
|
-
case "AccessDeniedException":
|
|
55
|
-
case "com.amazonaws.bedrockruntime#AccessDeniedException":
|
|
56
|
-
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
57
|
-
case "InternalServerException":
|
|
58
|
-
case "com.amazonaws.bedrockruntime#InternalServerException":
|
|
59
|
-
throw await de_InternalServerExceptionRes(parsedOutput, context);
|
|
60
|
-
case "ModelErrorException":
|
|
61
|
-
case "com.amazonaws.bedrockruntime#ModelErrorException":
|
|
62
|
-
throw await de_ModelErrorExceptionRes(parsedOutput, context);
|
|
63
|
-
case "ModelNotReadyException":
|
|
64
|
-
case "com.amazonaws.bedrockruntime#ModelNotReadyException":
|
|
65
|
-
throw await de_ModelNotReadyExceptionRes(parsedOutput, context);
|
|
66
|
-
case "ModelTimeoutException":
|
|
67
|
-
case "com.amazonaws.bedrockruntime#ModelTimeoutException":
|
|
68
|
-
throw await de_ModelTimeoutExceptionRes(parsedOutput, context);
|
|
69
|
-
case "ResourceNotFoundException":
|
|
70
|
-
case "com.amazonaws.bedrockruntime#ResourceNotFoundException":
|
|
71
|
-
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
72
|
-
case "ServiceQuotaExceededException":
|
|
73
|
-
case "com.amazonaws.bedrockruntime#ServiceQuotaExceededException":
|
|
74
|
-
throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
|
|
75
|
-
case "ThrottlingException":
|
|
76
|
-
case "com.amazonaws.bedrockruntime#ThrottlingException":
|
|
77
|
-
throw await de_ThrottlingExceptionRes(parsedOutput, context);
|
|
78
|
-
case "ValidationException":
|
|
79
|
-
case "com.amazonaws.bedrockruntime#ValidationException":
|
|
80
|
-
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
81
|
-
default:
|
|
82
|
-
const parsedBody = parsedOutput.body;
|
|
83
|
-
return throwDefaultError({
|
|
84
|
-
output,
|
|
85
|
-
parsedBody,
|
|
86
|
-
errorCode,
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
};
|
|
90
47
|
export const de_InvokeModelWithResponseStreamCommand = async (output, context) => {
|
|
91
48
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
92
|
-
return
|
|
49
|
+
return de_CommandError(output, context);
|
|
93
50
|
}
|
|
94
51
|
const contents = map({
|
|
95
52
|
$metadata: deserializeMetadata(output),
|
|
@@ -99,7 +56,7 @@ export const de_InvokeModelWithResponseStreamCommand = async (output, context) =
|
|
|
99
56
|
contents.body = de_ResponseStream(data, context);
|
|
100
57
|
return contents;
|
|
101
58
|
};
|
|
102
|
-
const
|
|
59
|
+
const de_CommandError = async (output, context) => {
|
|
103
60
|
const parsedOutput = {
|
|
104
61
|
...output,
|
|
105
62
|
body: await parseErrorBody(output.body, context),
|
|
@@ -118,9 +75,6 @@ const de_InvokeModelWithResponseStreamCommandError = async (output, context) =>
|
|
|
118
75
|
case "ModelNotReadyException":
|
|
119
76
|
case "com.amazonaws.bedrockruntime#ModelNotReadyException":
|
|
120
77
|
throw await de_ModelNotReadyExceptionRes(parsedOutput, context);
|
|
121
|
-
case "ModelStreamErrorException":
|
|
122
|
-
case "com.amazonaws.bedrockruntime#ModelStreamErrorException":
|
|
123
|
-
throw await de_ModelStreamErrorExceptionRes(parsedOutput, context);
|
|
124
78
|
case "ModelTimeoutException":
|
|
125
79
|
case "com.amazonaws.bedrockruntime#ModelTimeoutException":
|
|
126
80
|
throw await de_ModelTimeoutExceptionRes(parsedOutput, context);
|
|
@@ -136,6 +90,9 @@ const de_InvokeModelWithResponseStreamCommandError = async (output, context) =>
|
|
|
136
90
|
case "ValidationException":
|
|
137
91
|
case "com.amazonaws.bedrockruntime#ValidationException":
|
|
138
92
|
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
93
|
+
case "ModelStreamErrorException":
|
|
94
|
+
case "com.amazonaws.bedrockruntime#ModelStreamErrorException":
|
|
95
|
+
throw await de_ModelStreamErrorExceptionRes(parsedOutput, context);
|
|
139
96
|
default:
|
|
140
97
|
const parsedBody = parsedOutput.body;
|
|
141
98
|
return throwDefaultError({
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-sdk/client-bedrock-runtime",
|
|
3
3
|
"description": "AWS SDK for JavaScript Bedrock Runtime Client for Node.js, Browser and React Native",
|
|
4
|
-
"version": "3.
|
|
4
|
+
"version": "3.509.0",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
|
|
7
7
|
"build:cjs": "node ../../scripts/compilation/inline client-bedrock-runtime",
|
|
@@ -20,9 +20,9 @@
|
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@aws-crypto/sha256-browser": "3.0.0",
|
|
22
22
|
"@aws-crypto/sha256-js": "3.0.0",
|
|
23
|
-
"@aws-sdk/client-sts": "3.
|
|
23
|
+
"@aws-sdk/client-sts": "3.507.0",
|
|
24
24
|
"@aws-sdk/core": "3.496.0",
|
|
25
|
-
"@aws-sdk/credential-provider-node": "3.
|
|
25
|
+
"@aws-sdk/credential-provider-node": "3.509.0",
|
|
26
26
|
"@aws-sdk/middleware-host-header": "3.502.0",
|
|
27
27
|
"@aws-sdk/middleware-logger": "3.502.0",
|
|
28
28
|
"@aws-sdk/middleware-recursion-detection": "3.502.0",
|