@aws-sdk/client-bedrock-runtime 3.554.0 → 3.561.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/README.md +1 -1
- package/dist-cjs/index.js +20 -2
- package/dist-es/models/models_0.js +4 -0
- package/dist-es/protocols/Aws_restJson1.js +12 -0
- package/dist-types/BedrockRuntime.d.ts +1 -1
- package/dist-types/BedrockRuntimeClient.d.ts +1 -1
- package/dist-types/commands/InvokeModelCommand.d.ts +8 -4
- package/dist-types/commands/InvokeModelWithResponseStreamCommand.d.ts +14 -5
- package/dist-types/index.d.ts +1 -1
- package/dist-types/models/models_0.d.ts +102 -12
- package/dist-types/ts3.4/models/models_0.d.ts +11 -0
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
AWS SDK for JavaScript BedrockRuntime Client for Node.js, Browser and React Native.
|
|
8
8
|
|
|
9
|
-
<p>Describes the API operations for running inference using Bedrock models.</p>
|
|
9
|
+
<p>Describes the API operations for running inference using Amazon Bedrock models.</p>
|
|
10
10
|
|
|
11
11
|
## Installing
|
|
12
12
|
|
package/dist-cjs/index.js
CHANGED
|
@@ -42,6 +42,7 @@ __export(src_exports, {
|
|
|
42
42
|
ResponseStreamFilterSensitiveLog: () => ResponseStreamFilterSensitiveLog,
|
|
43
43
|
ServiceQuotaExceededException: () => ServiceQuotaExceededException,
|
|
44
44
|
ThrottlingException: () => ThrottlingException,
|
|
45
|
+
Trace: () => Trace,
|
|
45
46
|
ValidationException: () => ValidationException,
|
|
46
47
|
__Client: () => import_smithy_client.Client
|
|
47
48
|
});
|
|
@@ -253,6 +254,10 @@ var _InternalServerException = class _InternalServerException extends BedrockRun
|
|
|
253
254
|
};
|
|
254
255
|
__name(_InternalServerException, "InternalServerException");
|
|
255
256
|
var InternalServerException = _InternalServerException;
|
|
257
|
+
var Trace = {
|
|
258
|
+
DISABLED: "DISABLED",
|
|
259
|
+
ENABLED: "ENABLED"
|
|
260
|
+
};
|
|
256
261
|
var _ModelErrorException = class _ModelErrorException extends BedrockRuntimeServiceException {
|
|
257
262
|
/**
|
|
258
263
|
* @internal
|
|
@@ -456,7 +461,10 @@ var se_InvokeModelCommand = /* @__PURE__ */ __name(async (input, context) => {
|
|
|
456
461
|
const b = (0, import_core.requestBuilder)(input, context);
|
|
457
462
|
const headers = (0, import_smithy_client.map)({}, isSerializableHeaderValue, {
|
|
458
463
|
[_ct]: input[_cT] || "application/octet-stream",
|
|
459
|
-
[_a]: input[_a]
|
|
464
|
+
[_a]: input[_a],
|
|
465
|
+
[_xabt]: input[_t],
|
|
466
|
+
[_xabg]: input[_gI],
|
|
467
|
+
[_xabg_]: input[_gV]
|
|
460
468
|
});
|
|
461
469
|
b.bp("/model/{modelId}/invoke");
|
|
462
470
|
b.p("modelId", () => input.modelId, "{modelId}", false);
|
|
@@ -471,7 +479,10 @@ var se_InvokeModelWithResponseStreamCommand = /* @__PURE__ */ __name(async (inpu
|
|
|
471
479
|
const b = (0, import_core.requestBuilder)(input, context);
|
|
472
480
|
const headers = (0, import_smithy_client.map)({}, isSerializableHeaderValue, {
|
|
473
481
|
[_ct]: input[_cT] || "application/octet-stream",
|
|
474
|
-
[_xaba]: input[_a]
|
|
482
|
+
[_xaba]: input[_a],
|
|
483
|
+
[_xabt]: input[_t],
|
|
484
|
+
[_xabg]: input[_gI],
|
|
485
|
+
[_xabg_]: input[_gV]
|
|
475
486
|
});
|
|
476
487
|
b.bp("/model/{modelId}/invoke-with-response-stream");
|
|
477
488
|
b.p("modelId", () => input.modelId, "{modelId}", false);
|
|
@@ -781,8 +792,14 @@ var isSerializableHeaderValue = /* @__PURE__ */ __name((value) => value !== void
|
|
|
781
792
|
var _a = "accept";
|
|
782
793
|
var _cT = "contentType";
|
|
783
794
|
var _ct = "content-type";
|
|
795
|
+
var _gI = "guardrailIdentifier";
|
|
796
|
+
var _gV = "guardrailVersion";
|
|
797
|
+
var _t = "trace";
|
|
784
798
|
var _xaba = "x-amzn-bedrock-accept";
|
|
785
799
|
var _xabct = "x-amzn-bedrock-content-type";
|
|
800
|
+
var _xabg = "x-amzn-bedrock-guardrailidentifier";
|
|
801
|
+
var _xabg_ = "x-amzn-bedrock-guardrailversion";
|
|
802
|
+
var _xabt = "x-amzn-bedrock-trace";
|
|
786
803
|
|
|
787
804
|
// src/commands/InvokeModelCommand.ts
|
|
788
805
|
var _InvokeModelCommand = class _InvokeModelCommand extends import_smithy_client.Command.classBuilder().ep({
|
|
@@ -843,6 +860,7 @@ var BedrockRuntime = _BedrockRuntime;
|
|
|
843
860
|
InvokeModelWithResponseStreamCommand,
|
|
844
861
|
AccessDeniedException,
|
|
845
862
|
InternalServerException,
|
|
863
|
+
Trace,
|
|
846
864
|
ModelErrorException,
|
|
847
865
|
ModelNotReadyException,
|
|
848
866
|
ModelTimeoutException,
|
|
@@ -24,6 +24,10 @@ export class InternalServerException extends __BaseException {
|
|
|
24
24
|
Object.setPrototypeOf(this, InternalServerException.prototype);
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
|
+
export const Trace = {
|
|
28
|
+
DISABLED: "DISABLED",
|
|
29
|
+
ENABLED: "ENABLED",
|
|
30
|
+
};
|
|
27
31
|
export class ModelErrorException extends __BaseException {
|
|
28
32
|
constructor(opts) {
|
|
29
33
|
super({
|
|
@@ -8,6 +8,9 @@ export const se_InvokeModelCommand = async (input, context) => {
|
|
|
8
8
|
const headers = map({}, isSerializableHeaderValue, {
|
|
9
9
|
[_ct]: input[_cT] || "application/octet-stream",
|
|
10
10
|
[_a]: input[_a],
|
|
11
|
+
[_xabt]: input[_t],
|
|
12
|
+
[_xabg]: input[_gI],
|
|
13
|
+
[_xabg_]: input[_gV],
|
|
11
14
|
});
|
|
12
15
|
b.bp("/model/{modelId}/invoke");
|
|
13
16
|
b.p("modelId", () => input.modelId, "{modelId}", false);
|
|
@@ -23,6 +26,9 @@ export const se_InvokeModelWithResponseStreamCommand = async (input, context) =>
|
|
|
23
26
|
const headers = map({}, isSerializableHeaderValue, {
|
|
24
27
|
[_ct]: input[_cT] || "application/octet-stream",
|
|
25
28
|
[_xaba]: input[_a],
|
|
29
|
+
[_xabt]: input[_t],
|
|
30
|
+
[_xabg]: input[_gI],
|
|
31
|
+
[_xabg_]: input[_gV],
|
|
26
32
|
});
|
|
27
33
|
b.bp("/model/{modelId}/invoke-with-response-stream");
|
|
28
34
|
b.p("modelId", () => input.modelId, "{modelId}", false);
|
|
@@ -334,5 +340,11 @@ const isSerializableHeaderValue = (value) => value !== undefined &&
|
|
|
334
340
|
const _a = "accept";
|
|
335
341
|
const _cT = "contentType";
|
|
336
342
|
const _ct = "content-type";
|
|
343
|
+
const _gI = "guardrailIdentifier";
|
|
344
|
+
const _gV = "guardrailVersion";
|
|
345
|
+
const _t = "trace";
|
|
337
346
|
const _xaba = "x-amzn-bedrock-accept";
|
|
338
347
|
const _xabct = "x-amzn-bedrock-content-type";
|
|
348
|
+
const _xabg = "x-amzn-bedrock-guardrailidentifier";
|
|
349
|
+
const _xabg_ = "x-amzn-bedrock-guardrailversion";
|
|
350
|
+
const _xabt = "x-amzn-bedrock-trace";
|
|
@@ -17,7 +17,7 @@ export interface BedrockRuntime {
|
|
|
17
17
|
invokeModelWithResponseStream(args: InvokeModelWithResponseStreamCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: InvokeModelWithResponseStreamCommandOutput) => void): void;
|
|
18
18
|
}
|
|
19
19
|
/**
|
|
20
|
-
* <p>Describes the API operations for running inference using Bedrock models.</p>
|
|
20
|
+
* <p>Describes the API operations for running inference using Amazon Bedrock models.</p>
|
|
21
21
|
* @public
|
|
22
22
|
*/
|
|
23
23
|
export declare class BedrockRuntime extends BedrockRuntimeClient implements BedrockRuntime {
|
|
@@ -158,7 +158,7 @@ export type BedrockRuntimeClientResolvedConfigType = __SmithyResolvedConfigurati
|
|
|
158
158
|
export interface BedrockRuntimeClientResolvedConfig extends BedrockRuntimeClientResolvedConfigType {
|
|
159
159
|
}
|
|
160
160
|
/**
|
|
161
|
-
* <p>Describes the API operations for running inference using Bedrock models.</p>
|
|
161
|
+
* <p>Describes the API operations for running inference using Amazon Bedrock models.</p>
|
|
162
162
|
* @public
|
|
163
163
|
*/
|
|
164
164
|
export declare class BedrockRuntimeClient extends __Client<__HttpHandlerOptions, ServiceInputTypes, ServiceOutputTypes, BedrockRuntimeClientResolvedConfig> {
|
|
@@ -39,10 +39,11 @@ declare const InvokeModelCommand_base: {
|
|
|
39
39
|
getEndpointParameterInstructions(): import("@smithy/middleware-endpoint").EndpointParameterInstructions;
|
|
40
40
|
};
|
|
41
41
|
/**
|
|
42
|
-
* <p>Invokes the specified Bedrock model to run inference using the
|
|
43
|
-
* You use
|
|
44
|
-
* <p>For
|
|
45
|
-
*
|
|
42
|
+
* <p>Invokes the specified Amazon Bedrock model to run inference using the prompt and inference parameters provided in the request body.
|
|
43
|
+
* You use model inference to generate text, images, and embeddings.</p>
|
|
44
|
+
* <p>For example code, see <i>Invoke model code examples</i> in the <i>Amazon Bedrock User Guide</i>.
|
|
45
|
+
* </p>
|
|
46
|
+
* <p>This operation requires permission for the <code>bedrock:InvokeModel</code> action.</p>
|
|
46
47
|
* @example
|
|
47
48
|
* Use a bare-bones client and the command you need to make an API call.
|
|
48
49
|
* ```javascript
|
|
@@ -54,6 +55,9 @@ declare const InvokeModelCommand_base: {
|
|
|
54
55
|
* contentType: "STRING_VALUE",
|
|
55
56
|
* accept: "STRING_VALUE",
|
|
56
57
|
* modelId: "STRING_VALUE", // required
|
|
58
|
+
* trace: "ENABLED" || "DISABLED",
|
|
59
|
+
* guardrailIdentifier: "STRING_VALUE",
|
|
60
|
+
* guardrailVersion: "STRING_VALUE",
|
|
57
61
|
* };
|
|
58
62
|
* const command = new InvokeModelCommand(input);
|
|
59
63
|
* const response = await client.send(command);
|
|
@@ -32,10 +32,16 @@ declare const InvokeModelWithResponseStreamCommand_base: {
|
|
|
32
32
|
getEndpointParameterInstructions(): import("@smithy/middleware-endpoint").EndpointParameterInstructions;
|
|
33
33
|
};
|
|
34
34
|
/**
|
|
35
|
-
* <p>Invoke the specified Bedrock model to run inference using the
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
* <
|
|
35
|
+
* <p>Invoke the specified Amazon Bedrock model to run inference using the prompt and inference parameters provided in the request body. The response is returned in a stream.</p>
|
|
36
|
+
* <p>To see if a model supports streaming, call <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_GetFoundationModel.html">GetFoundationModel</a>
|
|
37
|
+
* and check the <code>responseStreamingSupported</code> field in the response.</p>
|
|
38
|
+
* <note>
|
|
39
|
+
* <p>The CLI doesn't support <code>InvokeModelWithResponseStream</code>.</p>
|
|
40
|
+
* </note>
|
|
41
|
+
* <p>For example code, see <i>Invoke model with streaming code
|
|
42
|
+
* example</i> in the <i>Amazon Bedrock User Guide</i>.
|
|
43
|
+
* </p>
|
|
44
|
+
* <p>This operation requires permissions to perform the <code>bedrock:InvokeModelWithResponseStream</code> action. </p>
|
|
39
45
|
* @example
|
|
40
46
|
* Use a bare-bones client and the command you need to make an API call.
|
|
41
47
|
* ```javascript
|
|
@@ -47,6 +53,9 @@ declare const InvokeModelWithResponseStreamCommand_base: {
|
|
|
47
53
|
* contentType: "STRING_VALUE",
|
|
48
54
|
* accept: "STRING_VALUE",
|
|
49
55
|
* modelId: "STRING_VALUE", // required
|
|
56
|
+
* trace: "ENABLED" || "DISABLED",
|
|
57
|
+
* guardrailIdentifier: "STRING_VALUE",
|
|
58
|
+
* guardrailVersion: "STRING_VALUE",
|
|
50
59
|
* };
|
|
51
60
|
* const command = new InvokeModelWithResponseStreamCommand(input);
|
|
52
61
|
* const response = await client.send(command);
|
|
@@ -97,7 +106,7 @@ declare const InvokeModelWithResponseStreamCommand_base: {
|
|
|
97
106
|
* <p>The model specified in the request is not ready to serve inference requests.</p>
|
|
98
107
|
*
|
|
99
108
|
* @throws {@link ModelStreamErrorException} (client fault)
|
|
100
|
-
* <p>An error occurred while streaming the response.</p>
|
|
109
|
+
* <p>An error occurred while streaming the response. Retry your request.</p>
|
|
101
110
|
*
|
|
102
111
|
* @throws {@link ModelTimeoutException} (client fault)
|
|
103
112
|
* <p>The request took too long to process. Processing time exceeded the model timeout length.</p>
|
package/dist-types/index.d.ts
CHANGED
|
@@ -24,12 +24,24 @@ export declare class InternalServerException extends __BaseException {
|
|
|
24
24
|
*/
|
|
25
25
|
constructor(opts: __ExceptionOptionType<InternalServerException, __BaseException>);
|
|
26
26
|
}
|
|
27
|
+
/**
|
|
28
|
+
* @public
|
|
29
|
+
* @enum
|
|
30
|
+
*/
|
|
31
|
+
export declare const Trace: {
|
|
32
|
+
readonly DISABLED: "DISABLED";
|
|
33
|
+
readonly ENABLED: "ENABLED";
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* @public
|
|
37
|
+
*/
|
|
38
|
+
export type Trace = (typeof Trace)[keyof typeof Trace];
|
|
27
39
|
/**
|
|
28
40
|
* @public
|
|
29
41
|
*/
|
|
30
42
|
export interface InvokeModelRequest {
|
|
31
43
|
/**
|
|
32
|
-
* <p>
|
|
44
|
+
* <p>The prompt and inference parameters in the format specified in the <code>contentType</code> in the header. To see the format and content of the request and response bodies for different models, refer to <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Inference parameters</a>. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/api-methods-run.html">Run inference</a> in the Bedrock User Guide.</p>
|
|
33
45
|
* @public
|
|
34
46
|
*/
|
|
35
47
|
body: Uint8Array | undefined;
|
|
@@ -40,23 +52,62 @@ export interface InvokeModelRequest {
|
|
|
40
52
|
*/
|
|
41
53
|
contentType?: string;
|
|
42
54
|
/**
|
|
43
|
-
* <p>The desired MIME type of the inference body in the response. The default value is
|
|
44
|
-
* <code>application/json</code>.</p>
|
|
55
|
+
* <p>The desired MIME type of the inference body in the response. The default value is <code>application/json</code>.</p>
|
|
45
56
|
* @public
|
|
46
57
|
*/
|
|
47
58
|
accept?: string;
|
|
48
59
|
/**
|
|
49
|
-
* <p>
|
|
60
|
+
* <p>The unique identifier of the model to invoke to run inference.</p>
|
|
61
|
+
* <p>The <code>modelId</code> to provide depends on the type of model that you use:</p>
|
|
62
|
+
* <ul>
|
|
63
|
+
* <li>
|
|
64
|
+
* <p>If you use a base model, specify the model ID or its ARN. For a list of model IDs for base models, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-ids.html#model-ids-arns">Amazon Bedrock base model IDs (on-demand throughput)</a> in the Amazon Bedrock User Guide.</p>
|
|
65
|
+
* </li>
|
|
66
|
+
* <li>
|
|
67
|
+
* <p>If you use a provisioned model, specify the ARN of the Provisioned Throughput. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/prov-thru-use.html">Run inference using a Provisioned Throughput</a> in the Amazon Bedrock User Guide.</p>
|
|
68
|
+
* </li>
|
|
69
|
+
* <li>
|
|
70
|
+
* <p>If you use a custom model, first purchase Provisioned Throughput for it. Then specify the ARN of the resulting provisioned model. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-use.html">Use a custom model in Amazon Bedrock</a> in the Amazon Bedrock User Guide.</p>
|
|
71
|
+
* </li>
|
|
72
|
+
* </ul>
|
|
50
73
|
* @public
|
|
51
74
|
*/
|
|
52
75
|
modelId: string | undefined;
|
|
76
|
+
/**
|
|
77
|
+
* <p>Specifies whether to enable or disable the Bedrock trace. If enabled, you can see the full Bedrock trace.</p>
|
|
78
|
+
* @public
|
|
79
|
+
*/
|
|
80
|
+
trace?: Trace;
|
|
81
|
+
/**
|
|
82
|
+
* <p>The unique identifier of the guardrail that you want to use. If you don't provide a value, no guardrail is applied
|
|
83
|
+
* to the invocation.</p>
|
|
84
|
+
* <p>An error will be thrown in the following situations.</p>
|
|
85
|
+
* <ul>
|
|
86
|
+
* <li>
|
|
87
|
+
* <p>You don't provide a guardrail identifier but you specify the <code>amazon-bedrock-guardrailConfig</code> field in the request body.</p>
|
|
88
|
+
* </li>
|
|
89
|
+
* <li>
|
|
90
|
+
* <p>You enable the guardrail but the <code>contentType</code> isn't <code>application/json</code>.</p>
|
|
91
|
+
* </li>
|
|
92
|
+
* <li>
|
|
93
|
+
* <p>You provide a guardrail identifier, but <code>guardrailVersion</code> isn't specified.</p>
|
|
94
|
+
* </li>
|
|
95
|
+
* </ul>
|
|
96
|
+
* @public
|
|
97
|
+
*/
|
|
98
|
+
guardrailIdentifier?: string;
|
|
99
|
+
/**
|
|
100
|
+
* <p>The version number for the guardrail. The value can also be <code>DRAFT</code>.</p>
|
|
101
|
+
* @public
|
|
102
|
+
*/
|
|
103
|
+
guardrailVersion?: string;
|
|
53
104
|
}
|
|
54
105
|
/**
|
|
55
106
|
* @public
|
|
56
107
|
*/
|
|
57
108
|
export interface InvokeModelResponse {
|
|
58
109
|
/**
|
|
59
|
-
* <p>Inference response from the model in the format specified in the
|
|
110
|
+
* <p>Inference response from the model in the format specified in the <code>contentType</code> header. To see the format and content of the request and response bodies for different models, refer to <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Inference parameters</a>.</p>
|
|
60
111
|
* @public
|
|
61
112
|
*/
|
|
62
113
|
body: Uint8Array | undefined;
|
|
@@ -165,8 +216,7 @@ export declare class ValidationException extends __BaseException {
|
|
|
165
216
|
*/
|
|
166
217
|
export interface InvokeModelWithResponseStreamRequest {
|
|
167
218
|
/**
|
|
168
|
-
* <p>
|
|
169
|
-
* content-type. To see the format and content of this field for different models, refer to <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Inference parameters</a>.</p>
|
|
219
|
+
* <p>The prompt and inference parameters in the format specified in the <code>contentType</code> in the header. To see the format and content of the request and response bodies for different models, refer to <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Inference parameters</a>. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/api-methods-run.html">Run inference</a> in the Bedrock User Guide.</p>
|
|
170
220
|
* @public
|
|
171
221
|
*/
|
|
172
222
|
body: Uint8Array | undefined;
|
|
@@ -183,10 +233,50 @@ export interface InvokeModelWithResponseStreamRequest {
|
|
|
183
233
|
*/
|
|
184
234
|
accept?: string;
|
|
185
235
|
/**
|
|
186
|
-
* <p>
|
|
236
|
+
* <p>The unique identifier of the model to invoke to run inference.</p>
|
|
237
|
+
* <p>The <code>modelId</code> to provide depends on the type of model that you use:</p>
|
|
238
|
+
* <ul>
|
|
239
|
+
* <li>
|
|
240
|
+
* <p>If you use a base model, specify the model ID or its ARN. For a list of model IDs for base models, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-ids.html#model-ids-arns">Amazon Bedrock base model IDs (on-demand throughput)</a> in the Amazon Bedrock User Guide.</p>
|
|
241
|
+
* </li>
|
|
242
|
+
* <li>
|
|
243
|
+
* <p>If you use a provisioned model, specify the ARN of the Provisioned Throughput. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/prov-thru-use.html">Run inference using a Provisioned Throughput</a> in the Amazon Bedrock User Guide.</p>
|
|
244
|
+
* </li>
|
|
245
|
+
* <li>
|
|
246
|
+
* <p>If you use a custom model, first purchase Provisioned Throughput for it. Then specify the ARN of the resulting provisioned model. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-use.html">Use a custom model in Amazon Bedrock</a> in the Amazon Bedrock User Guide.</p>
|
|
247
|
+
* </li>
|
|
248
|
+
* </ul>
|
|
187
249
|
* @public
|
|
188
250
|
*/
|
|
189
251
|
modelId: string | undefined;
|
|
252
|
+
/**
|
|
253
|
+
* <p>Specifies whether to enable or disable the Bedrock trace. If enabled, you can see the full Bedrock trace.</p>
|
|
254
|
+
* @public
|
|
255
|
+
*/
|
|
256
|
+
trace?: Trace;
|
|
257
|
+
/**
|
|
258
|
+
* <p>The unique identifier of the guardrail that you want to use. If you don't provide a value, no guardrail is applied
|
|
259
|
+
* to the invocation.</p>
|
|
260
|
+
* <p>An error is thrown in the following situations.</p>
|
|
261
|
+
* <ul>
|
|
262
|
+
* <li>
|
|
263
|
+
* <p>You don't provide a guardrail identifier but you specify the <code>amazon-bedrock-guardrailConfig</code> field in the request body.</p>
|
|
264
|
+
* </li>
|
|
265
|
+
* <li>
|
|
266
|
+
* <p>You enable the guardrail but the <code>contentType</code> isn't <code>application/json</code>.</p>
|
|
267
|
+
* </li>
|
|
268
|
+
* <li>
|
|
269
|
+
* <p>You provide a guardrail identifier, but <code>guardrailVersion</code> isn't specified.</p>
|
|
270
|
+
* </li>
|
|
271
|
+
* </ul>
|
|
272
|
+
* @public
|
|
273
|
+
*/
|
|
274
|
+
guardrailIdentifier?: string;
|
|
275
|
+
/**
|
|
276
|
+
* <p>The version number for the guardrail. The value can also be <code>DRAFT</code>.</p>
|
|
277
|
+
* @public
|
|
278
|
+
*/
|
|
279
|
+
guardrailVersion?: string;
|
|
190
280
|
}
|
|
191
281
|
/**
|
|
192
282
|
* <p>Payload content included in the response.</p>
|
|
@@ -200,7 +290,7 @@ export interface PayloadPart {
|
|
|
200
290
|
bytes?: Uint8Array;
|
|
201
291
|
}
|
|
202
292
|
/**
|
|
203
|
-
* <p>An error occurred while streaming the response.</p>
|
|
293
|
+
* <p>An error occurred while streaming the response. Retry your request.</p>
|
|
204
294
|
* @public
|
|
205
295
|
*/
|
|
206
296
|
export declare class ModelStreamErrorException extends __BaseException {
|
|
@@ -257,7 +347,7 @@ export declare namespace ResponseStream {
|
|
|
257
347
|
$unknown?: never;
|
|
258
348
|
}
|
|
259
349
|
/**
|
|
260
|
-
* <p>An error occurred while streaming the response.</p>
|
|
350
|
+
* <p>An error occurred while streaming the response. Retry your request.</p>
|
|
261
351
|
* @public
|
|
262
352
|
*/
|
|
263
353
|
interface ModelStreamErrorExceptionMember {
|
|
@@ -283,7 +373,7 @@ export declare namespace ResponseStream {
|
|
|
283
373
|
$unknown?: never;
|
|
284
374
|
}
|
|
285
375
|
/**
|
|
286
|
-
* <p>The number of requests exceeds the limit. Resubmit your request later.</p>
|
|
376
|
+
* <p>The number or frequency of requests exceeds the limit. Resubmit your request later.</p>
|
|
287
377
|
* @public
|
|
288
378
|
*/
|
|
289
379
|
interface ThrottlingExceptionMember {
|
|
@@ -336,7 +426,7 @@ export declare namespace ResponseStream {
|
|
|
336
426
|
*/
|
|
337
427
|
export interface InvokeModelWithResponseStreamResponse {
|
|
338
428
|
/**
|
|
339
|
-
* <p>Inference response from the model in the format specified by
|
|
429
|
+
* <p>Inference response from the model in the format specified by the <code>contentType</code> header. To see the format and content of this field for different models, refer to <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Inference parameters</a>.</p>
|
|
340
430
|
* @public
|
|
341
431
|
*/
|
|
342
432
|
body: AsyncIterable<ResponseStream> | undefined;
|
|
@@ -14,11 +14,19 @@ export declare class InternalServerException extends __BaseException {
|
|
|
14
14
|
opts: __ExceptionOptionType<InternalServerException, __BaseException>
|
|
15
15
|
);
|
|
16
16
|
}
|
|
17
|
+
export declare const Trace: {
|
|
18
|
+
readonly DISABLED: "DISABLED";
|
|
19
|
+
readonly ENABLED: "ENABLED";
|
|
20
|
+
};
|
|
21
|
+
export type Trace = (typeof Trace)[keyof typeof Trace];
|
|
17
22
|
export interface InvokeModelRequest {
|
|
18
23
|
body: Uint8Array | undefined;
|
|
19
24
|
contentType?: string;
|
|
20
25
|
accept?: string;
|
|
21
26
|
modelId: string | undefined;
|
|
27
|
+
trace?: Trace;
|
|
28
|
+
guardrailIdentifier?: string;
|
|
29
|
+
guardrailVersion?: string;
|
|
22
30
|
}
|
|
23
31
|
export interface InvokeModelResponse {
|
|
24
32
|
body: Uint8Array | undefined;
|
|
@@ -80,6 +88,9 @@ export interface InvokeModelWithResponseStreamRequest {
|
|
|
80
88
|
contentType?: string;
|
|
81
89
|
accept?: string;
|
|
82
90
|
modelId: string | undefined;
|
|
91
|
+
trace?: Trace;
|
|
92
|
+
guardrailIdentifier?: string;
|
|
93
|
+
guardrailVersion?: string;
|
|
83
94
|
}
|
|
84
95
|
export interface PayloadPart {
|
|
85
96
|
bytes?: Uint8Array;
|
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.561.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.
|
|
24
|
-
"@aws-sdk/core": "3.
|
|
25
|
-
"@aws-sdk/credential-provider-node": "3.
|
|
23
|
+
"@aws-sdk/client-sts": "3.556.0",
|
|
24
|
+
"@aws-sdk/core": "3.556.0",
|
|
25
|
+
"@aws-sdk/credential-provider-node": "3.556.0",
|
|
26
26
|
"@aws-sdk/middleware-host-header": "3.535.0",
|
|
27
27
|
"@aws-sdk/middleware-logger": "3.535.0",
|
|
28
28
|
"@aws-sdk/middleware-recursion-detection": "3.535.0",
|