@aws-sdk/client-sagemaker-runtime 3.398.0 → 3.405.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 +8 -0
- package/dist-cjs/SageMakerRuntime.js +2 -0
- package/dist-cjs/SageMakerRuntimeClient.js +5 -3
- package/dist-cjs/commands/InvokeEndpointWithResponseStreamCommand.js +47 -0
- package/dist-cjs/commands/index.js +1 -0
- package/dist-cjs/endpoint/ruleset.js +1 -1
- package/dist-cjs/models/models_0.js +70 -1
- package/dist-cjs/protocols/Aws_restJson1.js +144 -1
- package/dist-cjs/runtimeConfig.browser.js +2 -0
- package/dist-cjs/runtimeConfig.js +2 -0
- package/dist-es/SageMakerRuntime.js +2 -0
- package/dist-es/SageMakerRuntimeClient.js +5 -3
- package/dist-es/commands/InvokeEndpointWithResponseStreamCommand.js +43 -0
- package/dist-es/commands/index.js +1 -0
- package/dist-es/endpoint/ruleset.js +1 -1
- package/dist-es/models/models_0.js +63 -0
- package/dist-es/protocols/Aws_restJson1.js +142 -1
- package/dist-es/runtimeConfig.browser.js +2 -0
- package/dist-es/runtimeConfig.js +2 -0
- package/dist-types/SageMakerRuntime.d.ts +7 -0
- package/dist-types/SageMakerRuntimeClient.d.ts +11 -5
- package/dist-types/commands/InvokeEndpointAsyncCommand.d.ts +8 -8
- package/dist-types/commands/InvokeEndpointCommand.d.ts +7 -8
- package/dist-types/commands/InvokeEndpointWithResponseStreamCommand.d.ts +151 -0
- package/dist-types/commands/index.d.ts +1 -0
- package/dist-types/models/models_0.d.ts +326 -61
- package/dist-types/protocols/Aws_restJson1.d.ts +10 -1
- package/dist-types/runtimeConfig.browser.d.ts +1 -0
- package/dist-types/runtimeConfig.d.ts +1 -0
- package/dist-types/runtimeConfig.native.d.ts +1 -0
- package/dist-types/ts3.4/SageMakerRuntime.d.ts +17 -0
- package/dist-types/ts3.4/SageMakerRuntimeClient.d.ts +16 -2
- package/dist-types/ts3.4/commands/InvokeEndpointWithResponseStreamCommand.d.ts +49 -0
- package/dist-types/ts3.4/commands/index.d.ts +1 -0
- package/dist-types/ts3.4/models/models_0.d.ts +82 -0
- package/dist-types/ts3.4/protocols/Aws_restJson1.d.ts +16 -1
- package/dist-types/ts3.4/runtimeConfig.browser.d.ts +1 -0
- package/dist-types/ts3.4/runtimeConfig.d.ts +1 -0
- package/dist-types/ts3.4/runtimeConfig.native.d.ts +1 -0
- package/package.json +10 -7
|
@@ -34,15 +34,15 @@ export interface InvokeEndpointInput {
|
|
|
34
34
|
/**
|
|
35
35
|
* @public
|
|
36
36
|
* <p>The name of the endpoint that you specified when you created the endpoint using the
|
|
37
|
-
*
|
|
37
|
+
* <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/API_CreateEndpoint.html">CreateEndpoint</a> API.</p>
|
|
38
38
|
*/
|
|
39
39
|
EndpointName: string | undefined;
|
|
40
40
|
/**
|
|
41
41
|
* @public
|
|
42
42
|
* <p>Provides input data, in the format specified in the <code>ContentType</code>
|
|
43
|
-
*
|
|
43
|
+
* request header. Amazon SageMaker passes all of the data in the body to the model. </p>
|
|
44
44
|
* <p>For information about the format of the request body, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/cdf-inference.html">Common Data
|
|
45
|
-
*
|
|
45
|
+
* Formats-Inference</a>.</p>
|
|
46
46
|
*/
|
|
47
47
|
Body: Uint8Array | undefined;
|
|
48
48
|
/**
|
|
@@ -52,25 +52,25 @@ export interface InvokeEndpointInput {
|
|
|
52
52
|
ContentType?: string;
|
|
53
53
|
/**
|
|
54
54
|
* @public
|
|
55
|
-
* <p>The desired MIME type of the inference
|
|
55
|
+
* <p>The desired MIME type of the inference response from the model container.</p>
|
|
56
56
|
*/
|
|
57
57
|
Accept?: string;
|
|
58
58
|
/**
|
|
59
59
|
* @public
|
|
60
60
|
* <p>Provides additional information about a request for an inference submitted to a model
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
61
|
+
* hosted at an Amazon SageMaker endpoint. The information is an opaque value that is forwarded
|
|
62
|
+
* verbatim. You could use this value, for example, to provide an ID that you can use to
|
|
63
|
+
* track a request or to provide other metadata that a service endpoint was programmed to
|
|
64
|
+
* process. The value must consist of no more than 1024 visible US-ASCII characters as
|
|
65
|
+
* specified in <a href="https://datatracker.ietf.org/doc/html/rfc7230#section-3.2.6">Section 3.3.6. Field Value Components</a> of the Hypertext Transfer Protocol
|
|
66
|
+
* (HTTP/1.1). </p>
|
|
67
67
|
* <p>The code in your model is responsible for setting or updating any custom attributes in
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
*
|
|
68
|
+
* the response. If your code does not set this value in the response, an empty value is
|
|
69
|
+
* returned. For example, if a custom attribute represents the trace ID, your model can
|
|
70
|
+
* prepend the custom attribute with <code>Trace ID:</code> in your post-processing
|
|
71
|
+
* function. </p>
|
|
72
72
|
* <p>This feature is currently supported in the Amazon Web Services SDKs but not in the Amazon SageMaker
|
|
73
|
-
*
|
|
73
|
+
* Python SDK. </p>
|
|
74
74
|
*/
|
|
75
75
|
CustomAttributes?: string;
|
|
76
76
|
/**
|
|
@@ -81,18 +81,18 @@ export interface InvokeEndpointInput {
|
|
|
81
81
|
/**
|
|
82
82
|
* @public
|
|
83
83
|
* <p>Specify the production variant to send the inference request to when invoking an
|
|
84
|
-
*
|
|
85
|
-
*
|
|
86
|
-
*
|
|
84
|
+
* endpoint that is running two or more variants. Note that this parameter overrides the
|
|
85
|
+
* default behavior for the endpoint, which is to distribute the invocation traffic based
|
|
86
|
+
* on the variant weights.</p>
|
|
87
87
|
* <p>For information about how to use variant targeting to perform a/b testing, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/model-ab-testing.html">Test models in
|
|
88
|
-
*
|
|
88
|
+
* production</a>
|
|
89
89
|
* </p>
|
|
90
90
|
*/
|
|
91
91
|
TargetVariant?: string;
|
|
92
92
|
/**
|
|
93
93
|
* @public
|
|
94
94
|
* <p>If the endpoint hosts multiple containers and is configured to use direct invocation,
|
|
95
|
-
*
|
|
95
|
+
* this parameter specifies the host name of the container to invoke.</p>
|
|
96
96
|
*/
|
|
97
97
|
TargetContainerHostname?: string;
|
|
98
98
|
/**
|
|
@@ -118,15 +118,15 @@ export interface InvokeEndpointOutput {
|
|
|
118
118
|
* @public
|
|
119
119
|
* <p>Includes the inference provided by the model. </p>
|
|
120
120
|
* <p>For information about the format of the response body, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/cdf-inference.html">Common Data
|
|
121
|
-
*
|
|
122
|
-
* <p>If the explainer is activated, the
|
|
123
|
-
*
|
|
124
|
-
*
|
|
121
|
+
* Formats-Inference</a>.</p>
|
|
122
|
+
* <p>If the explainer is activated, the body includes the explanations provided by the
|
|
123
|
+
* model. For more information, see the <b>Response section</b>
|
|
124
|
+
* under <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/clarify-online-explainability-invoke-endpoint.html#clarify-online-explainability-response">Invoke the Endpoint</a> in the Developer Guide.</p>
|
|
125
125
|
*/
|
|
126
126
|
Body: Uint8Array | undefined;
|
|
127
127
|
/**
|
|
128
128
|
* @public
|
|
129
|
-
* <p>The MIME type of the inference returned
|
|
129
|
+
* <p>The MIME type of the inference returned from the model container.</p>
|
|
130
130
|
*/
|
|
131
131
|
ContentType?: string;
|
|
132
132
|
/**
|
|
@@ -137,21 +137,21 @@ export interface InvokeEndpointOutput {
|
|
|
137
137
|
/**
|
|
138
138
|
* @public
|
|
139
139
|
* <p>Provides additional information in the response about the inference returned by a
|
|
140
|
-
*
|
|
141
|
-
*
|
|
142
|
-
*
|
|
143
|
-
*
|
|
144
|
-
*
|
|
145
|
-
*
|
|
146
|
-
*
|
|
147
|
-
*
|
|
140
|
+
* model hosted at an Amazon SageMaker endpoint. The information is an opaque value that is
|
|
141
|
+
* forwarded verbatim. You could use this value, for example, to return an ID received in
|
|
142
|
+
* the <code>CustomAttributes</code> header of a request or other metadata that a service
|
|
143
|
+
* endpoint was programmed to produce. The value must consist of no more than 1024 visible
|
|
144
|
+
* US-ASCII characters as specified in <a href="https://tools.ietf.org/html/rfc7230#section-3.2.6">Section 3.3.6. Field Value
|
|
145
|
+
* Components</a> of the Hypertext Transfer Protocol (HTTP/1.1). If the customer
|
|
146
|
+
* wants the custom attribute returned, the model must set the custom attribute to be
|
|
147
|
+
* included on the way back. </p>
|
|
148
148
|
* <p>The code in your model is responsible for setting or updating any custom attributes in
|
|
149
|
-
*
|
|
150
|
-
*
|
|
151
|
-
*
|
|
152
|
-
*
|
|
149
|
+
* the response. If your code does not set this value in the response, an empty value is
|
|
150
|
+
* returned. For example, if a custom attribute represents the trace ID, your model can
|
|
151
|
+
* prepend the custom attribute with <code>Trace ID:</code> in your post-processing
|
|
152
|
+
* function.</p>
|
|
153
153
|
* <p>This feature is currently supported in the Amazon Web Services SDKs but not in the Amazon SageMaker
|
|
154
|
-
*
|
|
154
|
+
* Python SDK.</p>
|
|
155
155
|
*/
|
|
156
156
|
CustomAttributes?: string;
|
|
157
157
|
}
|
|
@@ -232,9 +232,7 @@ export interface InvokeEndpointAsyncInput {
|
|
|
232
232
|
/**
|
|
233
233
|
* @public
|
|
234
234
|
* <p>The name of the endpoint that you specified when you created the endpoint using the
|
|
235
|
-
*
|
|
236
|
-
* <code>CreateEndpoint</code>
|
|
237
|
-
* </a> API.</p>
|
|
235
|
+
* <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/API_CreateEndpoint.html">CreateEndpoint</a> API.</p>
|
|
238
236
|
*/
|
|
239
237
|
EndpointName: string | undefined;
|
|
240
238
|
/**
|
|
@@ -244,31 +242,31 @@ export interface InvokeEndpointAsyncInput {
|
|
|
244
242
|
ContentType?: string;
|
|
245
243
|
/**
|
|
246
244
|
* @public
|
|
247
|
-
* <p>The desired MIME type of the inference
|
|
245
|
+
* <p>The desired MIME type of the inference response from the model container.</p>
|
|
248
246
|
*/
|
|
249
247
|
Accept?: string;
|
|
250
248
|
/**
|
|
251
249
|
* @public
|
|
252
250
|
* <p>Provides additional information about a request for an inference submitted to a model
|
|
253
|
-
*
|
|
254
|
-
*
|
|
255
|
-
*
|
|
256
|
-
*
|
|
257
|
-
*
|
|
258
|
-
*
|
|
251
|
+
* hosted at an Amazon SageMaker endpoint. The information is an opaque value that is forwarded
|
|
252
|
+
* verbatim. You could use this value, for example, to provide an ID that you can use to
|
|
253
|
+
* track a request or to provide other metadata that a service endpoint was programmed to
|
|
254
|
+
* process. The value must consist of no more than 1024 visible US-ASCII characters as
|
|
255
|
+
* specified in <a href="https://datatracker.ietf.org/doc/html/rfc7230#section-3.2.6">Section 3.3.6. Field Value Components</a> of the Hypertext Transfer Protocol
|
|
256
|
+
* (HTTP/1.1). </p>
|
|
259
257
|
* <p>The code in your model is responsible for setting or updating any custom attributes in
|
|
260
|
-
*
|
|
261
|
-
*
|
|
262
|
-
*
|
|
263
|
-
*
|
|
258
|
+
* the response. If your code does not set this value in the response, an empty value is
|
|
259
|
+
* returned. For example, if a custom attribute represents the trace ID, your model can
|
|
260
|
+
* prepend the custom attribute with <code>Trace ID:</code> in your post-processing
|
|
261
|
+
* function. </p>
|
|
264
262
|
* <p>This feature is currently supported in the Amazon Web Services SDKs but not in the Amazon SageMaker
|
|
265
|
-
*
|
|
263
|
+
* Python SDK. </p>
|
|
266
264
|
*/
|
|
267
265
|
CustomAttributes?: string;
|
|
268
266
|
/**
|
|
269
267
|
* @public
|
|
270
|
-
* <p>The identifier for the inference request. Amazon SageMaker will generate an
|
|
271
|
-
* none is specified. </p>
|
|
268
|
+
* <p>The identifier for the inference request. Amazon SageMaker will generate an
|
|
269
|
+
* identifier for you if none is specified. </p>
|
|
272
270
|
*/
|
|
273
271
|
InferenceId?: string;
|
|
274
272
|
/**
|
|
@@ -278,13 +276,14 @@ export interface InvokeEndpointAsyncInput {
|
|
|
278
276
|
InputLocation: string | undefined;
|
|
279
277
|
/**
|
|
280
278
|
* @public
|
|
281
|
-
* <p>Maximum age in seconds a request can be in the queue before it is marked as
|
|
282
|
-
*
|
|
279
|
+
* <p>Maximum age in seconds a request can be in the queue before it is marked as expired.
|
|
280
|
+
* The default is 6 hours, or 21,600 seconds.</p>
|
|
283
281
|
*/
|
|
284
282
|
RequestTTLSeconds?: number;
|
|
285
283
|
/**
|
|
286
284
|
* @public
|
|
287
|
-
* <p>Maximum amount of time in seconds a request can be processed before it is marked as
|
|
285
|
+
* <p>Maximum amount of time in seconds a request can be processed before it is marked as
|
|
286
|
+
* expired. The default is 15 minutes, or 900 seconds.</p>
|
|
288
287
|
*/
|
|
289
288
|
InvocationTimeoutSeconds?: number;
|
|
290
289
|
}
|
|
@@ -295,8 +294,8 @@ export interface InvokeEndpointAsyncOutput {
|
|
|
295
294
|
/**
|
|
296
295
|
* @public
|
|
297
296
|
* <p>Identifier for an inference request. This will be the same as the
|
|
298
|
-
* <code>InferenceId</code> specified in the input. Amazon SageMaker will generate
|
|
299
|
-
* for you if you do not specify one.</p>
|
|
297
|
+
* <code>InferenceId</code> specified in the input. Amazon SageMaker will generate
|
|
298
|
+
* an identifier for you if you do not specify one.</p>
|
|
300
299
|
*/
|
|
301
300
|
InferenceId?: string;
|
|
302
301
|
/**
|
|
@@ -306,10 +305,260 @@ export interface InvokeEndpointAsyncOutput {
|
|
|
306
305
|
OutputLocation?: string;
|
|
307
306
|
/**
|
|
308
307
|
* @public
|
|
309
|
-
* <p>The Amazon S3 URI where the inference failure response payload is
|
|
308
|
+
* <p>The Amazon S3 URI where the inference failure response payload is
|
|
309
|
+
* stored.</p>
|
|
310
310
|
*/
|
|
311
311
|
FailureLocation?: string;
|
|
312
312
|
}
|
|
313
|
+
/**
|
|
314
|
+
* @public
|
|
315
|
+
* <p>The stream processing failed because of an unknown error, exception or failure. Try your request again.</p>
|
|
316
|
+
*/
|
|
317
|
+
export declare class InternalStreamFailure extends __BaseException {
|
|
318
|
+
readonly name: "InternalStreamFailure";
|
|
319
|
+
readonly $fault: "server";
|
|
320
|
+
Message?: string;
|
|
321
|
+
/**
|
|
322
|
+
* @internal
|
|
323
|
+
*/
|
|
324
|
+
constructor(opts: __ExceptionOptionType<InternalStreamFailure, __BaseException>);
|
|
325
|
+
}
|
|
326
|
+
/**
|
|
327
|
+
* @public
|
|
328
|
+
*/
|
|
329
|
+
export interface InvokeEndpointWithResponseStreamInput {
|
|
330
|
+
/**
|
|
331
|
+
* @public
|
|
332
|
+
* <p>The name of the endpoint that you specified when you created the endpoint using the
|
|
333
|
+
* <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/API_CreateEndpoint.html">CreateEndpoint</a> API.</p>
|
|
334
|
+
*/
|
|
335
|
+
EndpointName: string | undefined;
|
|
336
|
+
/**
|
|
337
|
+
* @public
|
|
338
|
+
* <p>Provides input data, in the format specified in the <code>ContentType</code>
|
|
339
|
+
* request header. Amazon SageMaker passes all of the data in the body to the model. </p>
|
|
340
|
+
* <p>For information about the format of the request body, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/cdf-inference.html">Common Data
|
|
341
|
+
* Formats-Inference</a>.</p>
|
|
342
|
+
*/
|
|
343
|
+
Body: Uint8Array | undefined;
|
|
344
|
+
/**
|
|
345
|
+
* @public
|
|
346
|
+
* <p>The MIME type of the input data in the request body.</p>
|
|
347
|
+
*/
|
|
348
|
+
ContentType?: string;
|
|
349
|
+
/**
|
|
350
|
+
* @public
|
|
351
|
+
* <p>The desired MIME type of the inference response from the model container.</p>
|
|
352
|
+
*/
|
|
353
|
+
Accept?: string;
|
|
354
|
+
/**
|
|
355
|
+
* @public
|
|
356
|
+
* <p>Provides additional information about a request for an inference submitted to a model
|
|
357
|
+
* hosted at an Amazon SageMaker endpoint. The information is an opaque value that is forwarded
|
|
358
|
+
* verbatim. You could use this value, for example, to provide an ID that you can use to
|
|
359
|
+
* track a request or to provide other metadata that a service endpoint was programmed to
|
|
360
|
+
* process. The value must consist of no more than 1024 visible US-ASCII characters as
|
|
361
|
+
* specified in <a href="https://datatracker.ietf.org/doc/html/rfc7230#section-3.2.6">Section 3.3.6. Field Value Components</a> of the Hypertext Transfer Protocol
|
|
362
|
+
* (HTTP/1.1). </p>
|
|
363
|
+
* <p>The code in your model is responsible for setting or updating any custom attributes in
|
|
364
|
+
* the response. If your code does not set this value in the response, an empty value is
|
|
365
|
+
* returned. For example, if a custom attribute represents the trace ID, your model can
|
|
366
|
+
* prepend the custom attribute with <code>Trace ID:</code> in your post-processing
|
|
367
|
+
* function. </p>
|
|
368
|
+
* <p>This feature is currently supported in the Amazon Web Services SDKs but not in the Amazon SageMaker
|
|
369
|
+
* Python SDK. </p>
|
|
370
|
+
*/
|
|
371
|
+
CustomAttributes?: string;
|
|
372
|
+
/**
|
|
373
|
+
* @public
|
|
374
|
+
* <p>Specify the production variant to send the inference request to when invoking an
|
|
375
|
+
* endpoint that is running two or more variants. Note that this parameter overrides the
|
|
376
|
+
* default behavior for the endpoint, which is to distribute the invocation traffic based
|
|
377
|
+
* on the variant weights.</p>
|
|
378
|
+
* <p>For information about how to use variant targeting to perform a/b testing, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/model-ab-testing.html">Test models in
|
|
379
|
+
* production</a>
|
|
380
|
+
* </p>
|
|
381
|
+
*/
|
|
382
|
+
TargetVariant?: string;
|
|
383
|
+
/**
|
|
384
|
+
* @public
|
|
385
|
+
* <p>If the endpoint hosts multiple containers and is configured to use direct invocation,
|
|
386
|
+
* this parameter specifies the host name of the container to invoke.</p>
|
|
387
|
+
*/
|
|
388
|
+
TargetContainerHostname?: string;
|
|
389
|
+
/**
|
|
390
|
+
* @public
|
|
391
|
+
* <p>An identifier that you assign to your request.</p>
|
|
392
|
+
*/
|
|
393
|
+
InferenceId?: string;
|
|
394
|
+
}
|
|
395
|
+
/**
|
|
396
|
+
* @public
|
|
397
|
+
* <p> An error occurred while streaming the response body. This error can have the
|
|
398
|
+
* following error codes:</p>
|
|
399
|
+
* <dl>
|
|
400
|
+
* <dt>ModelInvocationTimeExceeded</dt>
|
|
401
|
+
* <dd>
|
|
402
|
+
* <p>The model failed to finish sending the response within the timeout period allowed by Amazon SageMaker.</p>
|
|
403
|
+
* </dd>
|
|
404
|
+
* <dt>StreamBroken</dt>
|
|
405
|
+
* <dd>
|
|
406
|
+
* <p>The Transmission Control Protocol (TCP) connection between the client and
|
|
407
|
+
* the model was reset or closed.</p>
|
|
408
|
+
* </dd>
|
|
409
|
+
* </dl>
|
|
410
|
+
*/
|
|
411
|
+
export declare class ModelStreamError extends __BaseException {
|
|
412
|
+
readonly name: "ModelStreamError";
|
|
413
|
+
readonly $fault: "client";
|
|
414
|
+
Message?: string;
|
|
415
|
+
/**
|
|
416
|
+
* @public
|
|
417
|
+
* <p>This error can have the following error codes:</p>
|
|
418
|
+
* <dl>
|
|
419
|
+
* <dt>ModelInvocationTimeExceeded</dt>
|
|
420
|
+
* <dd>
|
|
421
|
+
* <p>The model failed to finish sending the response within the timeout period
|
|
422
|
+
* allowed by Amazon SageMaker.</p>
|
|
423
|
+
* </dd>
|
|
424
|
+
* <dt>StreamBroken</dt>
|
|
425
|
+
* <dd>
|
|
426
|
+
* <p>The Transmission Control Protocol (TCP) connection between the client and
|
|
427
|
+
* the model was reset or closed.</p>
|
|
428
|
+
* </dd>
|
|
429
|
+
* </dl>
|
|
430
|
+
*/
|
|
431
|
+
ErrorCode?: string;
|
|
432
|
+
/**
|
|
433
|
+
* @internal
|
|
434
|
+
*/
|
|
435
|
+
constructor(opts: __ExceptionOptionType<ModelStreamError, __BaseException>);
|
|
436
|
+
}
|
|
437
|
+
/**
|
|
438
|
+
* @public
|
|
439
|
+
* <p>A wrapper for pieces of the payload that's returned in response to a streaming
|
|
440
|
+
* inference request. A streaming inference response consists of one or more payload parts.
|
|
441
|
+
* </p>
|
|
442
|
+
*/
|
|
443
|
+
export interface PayloadPart {
|
|
444
|
+
/**
|
|
445
|
+
* @public
|
|
446
|
+
* <p>A blob that contains part of the response for your streaming inference request.</p>
|
|
447
|
+
*/
|
|
448
|
+
Bytes?: Uint8Array;
|
|
449
|
+
}
|
|
450
|
+
/**
|
|
451
|
+
* @public
|
|
452
|
+
* <p>A stream of payload parts. Each part contains a portion of the response for a
|
|
453
|
+
* streaming inference request.</p>
|
|
454
|
+
*/
|
|
455
|
+
export type ResponseStream = ResponseStream.InternalStreamFailureMember | ResponseStream.ModelStreamErrorMember | ResponseStream.PayloadPartMember | ResponseStream.$UnknownMember;
|
|
456
|
+
/**
|
|
457
|
+
* @public
|
|
458
|
+
*/
|
|
459
|
+
export declare namespace ResponseStream {
|
|
460
|
+
/**
|
|
461
|
+
* @public
|
|
462
|
+
* <p>A wrapper for pieces of the payload that's returned in response to a streaming
|
|
463
|
+
* inference request. A streaming inference response consists of one or more payload parts.
|
|
464
|
+
* </p>
|
|
465
|
+
*/
|
|
466
|
+
interface PayloadPartMember {
|
|
467
|
+
PayloadPart: PayloadPart;
|
|
468
|
+
ModelStreamError?: never;
|
|
469
|
+
InternalStreamFailure?: never;
|
|
470
|
+
$unknown?: never;
|
|
471
|
+
}
|
|
472
|
+
/**
|
|
473
|
+
* @public
|
|
474
|
+
* <p> An error occurred while streaming the response body. This error can have the
|
|
475
|
+
* following error codes:</p>
|
|
476
|
+
* <dl>
|
|
477
|
+
* <dt>ModelInvocationTimeExceeded</dt>
|
|
478
|
+
* <dd>
|
|
479
|
+
* <p>The model failed to finish sending the response within the timeout period allowed by Amazon SageMaker.</p>
|
|
480
|
+
* </dd>
|
|
481
|
+
* <dt>StreamBroken</dt>
|
|
482
|
+
* <dd>
|
|
483
|
+
* <p>The Transmission Control Protocol (TCP) connection between the client and
|
|
484
|
+
* the model was reset or closed.</p>
|
|
485
|
+
* </dd>
|
|
486
|
+
* </dl>
|
|
487
|
+
*/
|
|
488
|
+
interface ModelStreamErrorMember {
|
|
489
|
+
PayloadPart?: never;
|
|
490
|
+
ModelStreamError: ModelStreamError;
|
|
491
|
+
InternalStreamFailure?: never;
|
|
492
|
+
$unknown?: never;
|
|
493
|
+
}
|
|
494
|
+
/**
|
|
495
|
+
* @public
|
|
496
|
+
* <p>The stream processing failed because of an unknown error, exception or failure. Try your request again.</p>
|
|
497
|
+
*/
|
|
498
|
+
interface InternalStreamFailureMember {
|
|
499
|
+
PayloadPart?: never;
|
|
500
|
+
ModelStreamError?: never;
|
|
501
|
+
InternalStreamFailure: InternalStreamFailure;
|
|
502
|
+
$unknown?: never;
|
|
503
|
+
}
|
|
504
|
+
/**
|
|
505
|
+
* @public
|
|
506
|
+
*/
|
|
507
|
+
interface $UnknownMember {
|
|
508
|
+
PayloadPart?: never;
|
|
509
|
+
ModelStreamError?: never;
|
|
510
|
+
InternalStreamFailure?: never;
|
|
511
|
+
$unknown: [string, any];
|
|
512
|
+
}
|
|
513
|
+
interface Visitor<T> {
|
|
514
|
+
PayloadPart: (value: PayloadPart) => T;
|
|
515
|
+
ModelStreamError: (value: ModelStreamError) => T;
|
|
516
|
+
InternalStreamFailure: (value: InternalStreamFailure) => T;
|
|
517
|
+
_: (name: string, value: any) => T;
|
|
518
|
+
}
|
|
519
|
+
const visit: <T>(value: ResponseStream, visitor: Visitor<T>) => T;
|
|
520
|
+
}
|
|
521
|
+
/**
|
|
522
|
+
* @public
|
|
523
|
+
*/
|
|
524
|
+
export interface InvokeEndpointWithResponseStreamOutput {
|
|
525
|
+
/**
|
|
526
|
+
* @public
|
|
527
|
+
* <p>A stream of payload parts. Each part contains a portion of the response for a
|
|
528
|
+
* streaming inference request.</p>
|
|
529
|
+
*/
|
|
530
|
+
Body: AsyncIterable<ResponseStream> | undefined;
|
|
531
|
+
/**
|
|
532
|
+
* @public
|
|
533
|
+
* <p>The MIME type of the inference returned from the model container.</p>
|
|
534
|
+
*/
|
|
535
|
+
ContentType?: string;
|
|
536
|
+
/**
|
|
537
|
+
* @public
|
|
538
|
+
* <p>Identifies the production variant that was invoked.</p>
|
|
539
|
+
*/
|
|
540
|
+
InvokedProductionVariant?: string;
|
|
541
|
+
/**
|
|
542
|
+
* @public
|
|
543
|
+
* <p>Provides additional information in the response about the inference returned by a
|
|
544
|
+
* model hosted at an Amazon SageMaker endpoint. The information is an opaque value that is
|
|
545
|
+
* forwarded verbatim. You could use this value, for example, to return an ID received in
|
|
546
|
+
* the <code>CustomAttributes</code> header of a request or other metadata that a service
|
|
547
|
+
* endpoint was programmed to produce. The value must consist of no more than 1024 visible
|
|
548
|
+
* US-ASCII characters as specified in <a href="https://tools.ietf.org/html/rfc7230#section-3.2.6">Section 3.3.6. Field Value
|
|
549
|
+
* Components</a> of the Hypertext Transfer Protocol (HTTP/1.1). If the customer
|
|
550
|
+
* wants the custom attribute returned, the model must set the custom attribute to be
|
|
551
|
+
* included on the way back. </p>
|
|
552
|
+
* <p>The code in your model is responsible for setting or updating any custom attributes in
|
|
553
|
+
* the response. If your code does not set this value in the response, an empty value is
|
|
554
|
+
* returned. For example, if a custom attribute represents the trace ID, your model can
|
|
555
|
+
* prepend the custom attribute with <code>Trace ID:</code> in your post-processing
|
|
556
|
+
* function.</p>
|
|
557
|
+
* <p>This feature is currently supported in the Amazon Web Services SDKs but not in the Amazon SageMaker
|
|
558
|
+
* Python SDK.</p>
|
|
559
|
+
*/
|
|
560
|
+
CustomAttributes?: string;
|
|
561
|
+
}
|
|
313
562
|
/**
|
|
314
563
|
* @internal
|
|
315
564
|
*/
|
|
@@ -322,3 +571,19 @@ export declare const InvokeEndpointOutputFilterSensitiveLog: (obj: InvokeEndpoin
|
|
|
322
571
|
* @internal
|
|
323
572
|
*/
|
|
324
573
|
export declare const InvokeEndpointAsyncInputFilterSensitiveLog: (obj: InvokeEndpointAsyncInput) => any;
|
|
574
|
+
/**
|
|
575
|
+
* @internal
|
|
576
|
+
*/
|
|
577
|
+
export declare const InvokeEndpointWithResponseStreamInputFilterSensitiveLog: (obj: InvokeEndpointWithResponseStreamInput) => any;
|
|
578
|
+
/**
|
|
579
|
+
* @internal
|
|
580
|
+
*/
|
|
581
|
+
export declare const PayloadPartFilterSensitiveLog: (obj: PayloadPart) => any;
|
|
582
|
+
/**
|
|
583
|
+
* @internal
|
|
584
|
+
*/
|
|
585
|
+
export declare const ResponseStreamFilterSensitiveLog: (obj: ResponseStream) => any;
|
|
586
|
+
/**
|
|
587
|
+
* @internal
|
|
588
|
+
*/
|
|
589
|
+
export declare const InvokeEndpointWithResponseStreamOutputFilterSensitiveLog: (obj: InvokeEndpointWithResponseStreamOutput) => any;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http";
|
|
2
|
-
import { SerdeContext as __SerdeContext } from "@smithy/types";
|
|
2
|
+
import { EventStreamSerdeContext as __EventStreamSerdeContext, SerdeContext as __SerdeContext } from "@smithy/types";
|
|
3
3
|
import { InvokeEndpointAsyncCommandInput, InvokeEndpointAsyncCommandOutput } from "../commands/InvokeEndpointAsyncCommand";
|
|
4
4
|
import { InvokeEndpointCommandInput, InvokeEndpointCommandOutput } from "../commands/InvokeEndpointCommand";
|
|
5
|
+
import { InvokeEndpointWithResponseStreamCommandInput, InvokeEndpointWithResponseStreamCommandOutput } from "../commands/InvokeEndpointWithResponseStreamCommand";
|
|
5
6
|
/**
|
|
6
7
|
* serializeAws_restJson1InvokeEndpointCommand
|
|
7
8
|
*/
|
|
@@ -10,6 +11,10 @@ export declare const se_InvokeEndpointCommand: (input: InvokeEndpointCommandInpu
|
|
|
10
11
|
* serializeAws_restJson1InvokeEndpointAsyncCommand
|
|
11
12
|
*/
|
|
12
13
|
export declare const se_InvokeEndpointAsyncCommand: (input: InvokeEndpointAsyncCommandInput, context: __SerdeContext) => Promise<__HttpRequest>;
|
|
14
|
+
/**
|
|
15
|
+
* serializeAws_restJson1InvokeEndpointWithResponseStreamCommand
|
|
16
|
+
*/
|
|
17
|
+
export declare const se_InvokeEndpointWithResponseStreamCommand: (input: InvokeEndpointWithResponseStreamCommandInput, context: __SerdeContext) => Promise<__HttpRequest>;
|
|
13
18
|
/**
|
|
14
19
|
* deserializeAws_restJson1InvokeEndpointCommand
|
|
15
20
|
*/
|
|
@@ -18,3 +23,7 @@ export declare const de_InvokeEndpointCommand: (output: __HttpResponse, context:
|
|
|
18
23
|
* deserializeAws_restJson1InvokeEndpointAsyncCommand
|
|
19
24
|
*/
|
|
20
25
|
export declare const de_InvokeEndpointAsyncCommand: (output: __HttpResponse, context: __SerdeContext) => Promise<InvokeEndpointAsyncCommandOutput>;
|
|
26
|
+
/**
|
|
27
|
+
* deserializeAws_restJson1InvokeEndpointWithResponseStreamCommand
|
|
28
|
+
*/
|
|
29
|
+
export declare const de_InvokeEndpointWithResponseStreamCommand: (output: __HttpResponse, context: __SerdeContext & __EventStreamSerdeContext) => Promise<InvokeEndpointWithResponseStreamCommandOutput>;
|
|
@@ -9,6 +9,7 @@ export declare const getRuntimeConfig: (config: SageMakerRuntimeClientConfig) =>
|
|
|
9
9
|
bodyLengthChecker: import("@smithy/types").BodyLengthCalculator;
|
|
10
10
|
credentialDefaultProvider: (input: any) => import("@smithy/types").Provider<import("@aws-sdk/types").Credentials>;
|
|
11
11
|
defaultUserAgentProvider: import("@smithy/types").Provider<import("@smithy/types").UserAgent>;
|
|
12
|
+
eventStreamSerdeProvider: import("@smithy/types").EventStreamSerdeProvider;
|
|
12
13
|
maxAttempts: number | import("@smithy/types").Provider<number>;
|
|
13
14
|
region: string | import("@smithy/types").Provider<any>;
|
|
14
15
|
requestHandler: (import("@smithy/types").RequestHandler<any, any, import("@smithy/types").HttpHandlerOptions> & import("@smithy/protocol-http").HttpHandler) | RequestHandler;
|
|
@@ -9,6 +9,7 @@ export declare const getRuntimeConfig: (config: SageMakerRuntimeClientConfig) =>
|
|
|
9
9
|
bodyLengthChecker: import("@smithy/types").BodyLengthCalculator;
|
|
10
10
|
credentialDefaultProvider: (input: any) => import("@smithy/types").Provider<import("@aws-sdk/types").Credentials>;
|
|
11
11
|
defaultUserAgentProvider: import("@smithy/types").Provider<import("@smithy/types").UserAgent>;
|
|
12
|
+
eventStreamSerdeProvider: import("@smithy/types").EventStreamSerdeProvider;
|
|
12
13
|
maxAttempts: number | import("@smithy/types").Provider<number>;
|
|
13
14
|
region: string | import("@smithy/types").Provider<string>;
|
|
14
15
|
requestHandler: (import("@smithy/types").RequestHandler<any, any, import("@smithy/types").HttpHandlerOptions> & import("@smithy/protocol-http").HttpHandler) | RequestHandler;
|
|
@@ -25,6 +25,7 @@ export declare const getRuntimeConfig: (config: SageMakerRuntimeClientConfig) =>
|
|
|
25
25
|
retryMode: string | import("@smithy/types").Provider<string>;
|
|
26
26
|
logger: import("@smithy/types").Logger;
|
|
27
27
|
extensions: import("./runtimeExtensions").RuntimeExtension[];
|
|
28
|
+
eventStreamSerdeProvider: import("@smithy/types").EventStreamSerdeProvider;
|
|
28
29
|
defaultsMode: import("@smithy/smithy-client").DefaultsMode | import("@smithy/types").Provider<import("@smithy/smithy-client").DefaultsMode>;
|
|
29
30
|
endpoint?: string | import("@smithy/types").Endpoint | import("@smithy/types").Provider<import("@smithy/types").Endpoint> | import("@smithy/types").EndpointV2 | import("@smithy/types").Provider<import("@smithy/types").EndpointV2> | undefined;
|
|
30
31
|
endpointProvider: (endpointParams: import("./endpoint/EndpointParameters").EndpointParameters, context?: {
|
|
@@ -7,6 +7,10 @@ import {
|
|
|
7
7
|
InvokeEndpointCommandInput,
|
|
8
8
|
InvokeEndpointCommandOutput,
|
|
9
9
|
} from "./commands/InvokeEndpointCommand";
|
|
10
|
+
import {
|
|
11
|
+
InvokeEndpointWithResponseStreamCommandInput,
|
|
12
|
+
InvokeEndpointWithResponseStreamCommandOutput,
|
|
13
|
+
} from "./commands/InvokeEndpointWithResponseStreamCommand";
|
|
10
14
|
import { SageMakerRuntimeClient } from "./SageMakerRuntimeClient";
|
|
11
15
|
export interface SageMakerRuntime {
|
|
12
16
|
invokeEndpoint(
|
|
@@ -35,6 +39,19 @@ export interface SageMakerRuntime {
|
|
|
35
39
|
options: __HttpHandlerOptions,
|
|
36
40
|
cb: (err: any, data?: InvokeEndpointAsyncCommandOutput) => void
|
|
37
41
|
): void;
|
|
42
|
+
invokeEndpointWithResponseStream(
|
|
43
|
+
args: InvokeEndpointWithResponseStreamCommandInput,
|
|
44
|
+
options?: __HttpHandlerOptions
|
|
45
|
+
): Promise<InvokeEndpointWithResponseStreamCommandOutput>;
|
|
46
|
+
invokeEndpointWithResponseStream(
|
|
47
|
+
args: InvokeEndpointWithResponseStreamCommandInput,
|
|
48
|
+
cb: (err: any, data?: InvokeEndpointWithResponseStreamCommandOutput) => void
|
|
49
|
+
): void;
|
|
50
|
+
invokeEndpointWithResponseStream(
|
|
51
|
+
args: InvokeEndpointWithResponseStreamCommandInput,
|
|
52
|
+
options: __HttpHandlerOptions,
|
|
53
|
+
cb: (err: any, data?: InvokeEndpointWithResponseStreamCommandOutput) => void
|
|
54
|
+
): void;
|
|
38
55
|
}
|
|
39
56
|
export declare class SageMakerRuntime
|
|
40
57
|
extends SageMakerRuntimeClient
|