@aws-sdk/client-sagemaker-runtime 3.645.0 → 3.648.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
@@ -426,7 +426,8 @@ var se_InvokeEndpointCommand = /* @__PURE__ */ __name(async (input, context) =>
426
426
  [_xastch]: input[_TCH],
427
427
  [_xasii]: input[_II],
428
428
  [_xasee]: input[_EE],
429
- [_xasic]: input[_ICN]
429
+ [_xasic]: input[_ICN],
430
+ [_xassi]: input[_SI]
430
431
  });
431
432
  b.bp("/endpoints/{EndpointName}/invocations");
432
433
  b.p("EndpointName", () => input.EndpointName, "{EndpointName}", false);
@@ -463,7 +464,8 @@ var se_InvokeEndpointWithResponseStreamCommand = /* @__PURE__ */ __name(async (i
463
464
  [_xastv]: input[_TV],
464
465
  [_xastch]: input[_TCH],
465
466
  [_xasii]: input[_II],
466
- [_xasic]: input[_ICN]
467
+ [_xasic]: input[_ICN],
468
+ [_xassi]: input[_SI]
467
469
  });
468
470
  b.bp("/endpoints/{EndpointName}/invocations-response-stream");
469
471
  b.p("EndpointName", () => input.EndpointName, "{EndpointName}", false);
@@ -482,7 +484,9 @@ var de_InvokeEndpointCommand = /* @__PURE__ */ __name(async (output, context) =>
482
484
  $metadata: deserializeMetadata(output),
483
485
  [_CT]: [, output.headers[_ct]],
484
486
  [_IPV]: [, output.headers[_xaipv]],
485
- [_CA]: [, output.headers[_xasca]]
487
+ [_CA]: [, output.headers[_xasca]],
488
+ [_NSI]: [, output.headers[_xasnsi]],
489
+ [_CSI]: [, output.headers[_xascsi]]
486
490
  });
487
491
  const data = await (0, import_smithy_client.collectBody)(output.body, context);
488
492
  contents.Body = data;
@@ -715,6 +719,7 @@ var deserializeMetadata = /* @__PURE__ */ __name((output) => ({
715
719
  var isSerializableHeaderValue = /* @__PURE__ */ __name((value) => value !== void 0 && value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0), "isSerializableHeaderValue");
716
720
  var _A = "Accept";
717
721
  var _CA = "CustomAttributes";
722
+ var _CSI = "ClosedSessionId";
718
723
  var _CT = "ContentType";
719
724
  var _EE = "EnableExplanations";
720
725
  var _FL = "FailureLocation";
@@ -723,8 +728,10 @@ var _II = "InferenceId";
723
728
  var _IL = "InputLocation";
724
729
  var _IPV = "InvokedProductionVariant";
725
730
  var _ITS = "InvocationTimeoutSeconds";
731
+ var _NSI = "NewSessionId";
726
732
  var _OL = "OutputLocation";
727
733
  var _RTTLS = "RequestTTLSeconds";
734
+ var _SI = "SessionId";
728
735
  var _TCH = "TargetContainerHostname";
729
736
  var _TM = "TargetModel";
730
737
  var _TV = "TargetVariant";
@@ -733,6 +740,7 @@ var _ct = "content-type";
733
740
  var _xaipv = "x-amzn-invoked-production-variant";
734
741
  var _xasa = "x-amzn-sagemaker-accept";
735
742
  var _xasca = "x-amzn-sagemaker-custom-attributes";
743
+ var _xascsi = "x-amzn-sagemaker-closed-session-id";
736
744
  var _xasct = "x-amzn-sagemaker-content-type";
737
745
  var _xasee = "x-amzn-sagemaker-enable-explanations";
738
746
  var _xasf = "x-amzn-sagemaker-failurelocation";
@@ -740,8 +748,10 @@ var _xasi = "x-amzn-sagemaker-inputlocation";
740
748
  var _xasi_ = "x-amzn-sagemaker-invocationtimeoutseconds";
741
749
  var _xasic = "x-amzn-sagemaker-inference-component";
742
750
  var _xasii = "x-amzn-sagemaker-inference-id";
751
+ var _xasnsi = "x-amzn-sagemaker-new-session-id";
743
752
  var _xaso = "x-amzn-sagemaker-outputlocation";
744
753
  var _xasr = "x-amzn-sagemaker-requestttlseconds";
754
+ var _xassi = "x-amzn-sagemaker-session-id";
745
755
  var _xastch = "x-amzn-sagemaker-target-container-hostname";
746
756
  var _xastm = "x-amzn-sagemaker-target-model";
747
757
  var _xastv = "x-amzn-sagemaker-target-variant";
@@ -15,6 +15,7 @@ export const se_InvokeEndpointCommand = async (input, context) => {
15
15
  [_xasii]: input[_II],
16
16
  [_xasee]: input[_EE],
17
17
  [_xasic]: input[_ICN],
18
+ [_xassi]: input[_SI],
18
19
  });
19
20
  b.bp("/endpoints/{EndpointName}/invocations");
20
21
  b.p("EndpointName", () => input.EndpointName, "{EndpointName}", false);
@@ -52,6 +53,7 @@ export const se_InvokeEndpointWithResponseStreamCommand = async (input, context)
52
53
  [_xastch]: input[_TCH],
53
54
  [_xasii]: input[_II],
54
55
  [_xasic]: input[_ICN],
56
+ [_xassi]: input[_SI],
55
57
  });
56
58
  b.bp("/endpoints/{EndpointName}/invocations-response-stream");
57
59
  b.p("EndpointName", () => input.EndpointName, "{EndpointName}", false);
@@ -71,6 +73,8 @@ export const de_InvokeEndpointCommand = async (output, context) => {
71
73
  [_CT]: [, output.headers[_ct]],
72
74
  [_IPV]: [, output.headers[_xaipv]],
73
75
  [_CA]: [, output.headers[_xasca]],
76
+ [_NSI]: [, output.headers[_xasnsi]],
77
+ [_CSI]: [, output.headers[_xascsi]],
74
78
  });
75
79
  const data = await collectBody(output.body, context);
76
80
  contents.Body = data;
@@ -308,6 +312,7 @@ const isSerializableHeaderValue = (value) => value !== undefined &&
308
312
  (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
309
313
  const _A = "Accept";
310
314
  const _CA = "CustomAttributes";
315
+ const _CSI = "ClosedSessionId";
311
316
  const _CT = "ContentType";
312
317
  const _EE = "EnableExplanations";
313
318
  const _FL = "FailureLocation";
@@ -316,8 +321,10 @@ const _II = "InferenceId";
316
321
  const _IL = "InputLocation";
317
322
  const _IPV = "InvokedProductionVariant";
318
323
  const _ITS = "InvocationTimeoutSeconds";
324
+ const _NSI = "NewSessionId";
319
325
  const _OL = "OutputLocation";
320
326
  const _RTTLS = "RequestTTLSeconds";
327
+ const _SI = "SessionId";
321
328
  const _TCH = "TargetContainerHostname";
322
329
  const _TM = "TargetModel";
323
330
  const _TV = "TargetVariant";
@@ -326,6 +333,7 @@ const _ct = "content-type";
326
333
  const _xaipv = "x-amzn-invoked-production-variant";
327
334
  const _xasa = "x-amzn-sagemaker-accept";
328
335
  const _xasca = "x-amzn-sagemaker-custom-attributes";
336
+ const _xascsi = "x-amzn-sagemaker-closed-session-id";
329
337
  const _xasct = "x-amzn-sagemaker-content-type";
330
338
  const _xasee = "x-amzn-sagemaker-enable-explanations";
331
339
  const _xasf = "x-amzn-sagemaker-failurelocation";
@@ -333,8 +341,10 @@ const _xasi = "x-amzn-sagemaker-inputlocation";
333
341
  const _xasi_ = "x-amzn-sagemaker-invocationtimeoutseconds";
334
342
  const _xasic = "x-amzn-sagemaker-inference-component";
335
343
  const _xasii = "x-amzn-sagemaker-inference-id";
344
+ const _xasnsi = "x-amzn-sagemaker-new-session-id";
336
345
  const _xaso = "x-amzn-sagemaker-outputlocation";
337
346
  const _xasr = "x-amzn-sagemaker-requestttlseconds";
347
+ const _xassi = "x-amzn-sagemaker-session-id";
338
348
  const _xastch = "x-amzn-sagemaker-target-container-hostname";
339
349
  const _xastm = "x-amzn-sagemaker-target-model";
340
350
  const _xastv = "x-amzn-sagemaker-target-variant";
@@ -77,6 +77,7 @@ declare const InvokeEndpointCommand_base: {
77
77
  * InferenceId: "STRING_VALUE",
78
78
  * EnableExplanations: "STRING_VALUE",
79
79
  * InferenceComponentName: "STRING_VALUE",
80
+ * SessionId: "STRING_VALUE",
80
81
  * };
81
82
  * const command = new InvokeEndpointCommand(input);
82
83
  * const response = await client.send(command);
@@ -85,6 +86,8 @@ declare const InvokeEndpointCommand_base: {
85
86
  * // ContentType: "STRING_VALUE",
86
87
  * // InvokedProductionVariant: "STRING_VALUE",
87
88
  * // CustomAttributes: "STRING_VALUE",
89
+ * // NewSessionId: "STRING_VALUE",
90
+ * // ClosedSessionId: "STRING_VALUE",
88
91
  * // };
89
92
  *
90
93
  * ```
@@ -73,6 +73,7 @@ declare const InvokeEndpointWithResponseStreamCommand_base: {
73
73
  * TargetContainerHostname: "STRING_VALUE",
74
74
  * InferenceId: "STRING_VALUE",
75
75
  * InferenceComponentName: "STRING_VALUE",
76
+ * SessionId: "STRING_VALUE",
76
77
  * };
77
78
  * const command = new InvokeEndpointWithResponseStreamCommand(input);
78
79
  * const response = await client.send(command);
@@ -115,6 +115,27 @@ export interface InvokeEndpointInput {
115
115
  * @public
116
116
  */
117
117
  InferenceComponentName?: string;
118
+ /**
119
+ * <p>Creates a stateful session or identifies an existing one. You can do one of the
120
+ * following:</p>
121
+ * <ul>
122
+ * <li>
123
+ * <p>Create a stateful session by specifying the value
124
+ * <code>NEW_SESSION</code>.</p>
125
+ * </li>
126
+ * <li>
127
+ * <p>Send your request to an existing stateful session by specifying the ID of that
128
+ * session.</p>
129
+ * </li>
130
+ * </ul>
131
+ * <p>With a stateful session, you can send multiple requests to a stateful model. When you
132
+ * create a session with a stateful model, the model must create the session ID and set the
133
+ * expiration time. The model must also provide that information in the response to your
134
+ * request. You can get the ID and timestamp from the <code>NewSessionId</code> response
135
+ * parameter. For any subsequent request where you specify that session ID, SageMaker routes the request to the same instance that supports the session.</p>
136
+ * @public
137
+ */
138
+ SessionId?: string;
118
139
  }
119
140
  /**
120
141
  * @public
@@ -160,6 +181,17 @@ export interface InvokeEndpointOutput {
160
181
  * @public
161
182
  */
162
183
  CustomAttributes?: string;
184
+ /**
185
+ * <p>If you created a stateful session with your request, the ID and expiration time that
186
+ * the model assigns to that session.</p>
187
+ * @public
188
+ */
189
+ NewSessionId?: string;
190
+ /**
191
+ * <p>If you closed a stateful session with your request, the ID of that session.</p>
192
+ * @public
193
+ */
194
+ ClosedSessionId?: string;
163
195
  }
164
196
  /**
165
197
  * <p> Model (owned by the customer in the container) returned 4xx or 5xx error code.
@@ -403,6 +435,19 @@ export interface InvokeEndpointWithResponseStreamInput {
403
435
  * @public
404
436
  */
405
437
  InferenceComponentName?: string;
438
+ /**
439
+ * <p>The ID of a stateful session to handle your request.</p>
440
+ * <p>You can't create a stateful session by using the
441
+ * <code>InvokeEndpointWithResponseStream</code> action. Instead, you can create one by
442
+ * using the <code>
443
+ * <a>InvokeEndpoint</a>
444
+ * </code> action. In your request, you
445
+ * specify <code>NEW_SESSION</code> for the <code>SessionId</code> request parameter. The
446
+ * response to that request provides the session ID for the <code>NewSessionId</code>
447
+ * response parameter.</p>
448
+ * @public
449
+ */
450
+ SessionId?: string;
406
451
  }
407
452
  /**
408
453
  * <p> An error occurred while streaming the response body. This error can have the
@@ -26,12 +26,15 @@ export interface InvokeEndpointInput {
26
26
  InferenceId?: string;
27
27
  EnableExplanations?: string;
28
28
  InferenceComponentName?: string;
29
+ SessionId?: string;
29
30
  }
30
31
  export interface InvokeEndpointOutput {
31
32
  Body: Uint8Array | undefined;
32
33
  ContentType?: string;
33
34
  InvokedProductionVariant?: string;
34
35
  CustomAttributes?: string;
36
+ NewSessionId?: string;
37
+ ClosedSessionId?: string;
35
38
  }
36
39
  export declare class ModelError extends __BaseException {
37
40
  readonly name: "ModelError";
@@ -95,6 +98,7 @@ export interface InvokeEndpointWithResponseStreamInput {
95
98
  TargetContainerHostname?: string;
96
99
  InferenceId?: string;
97
100
  InferenceComponentName?: string;
101
+ SessionId?: string;
98
102
  }
99
103
  export declare class ModelStreamError extends __BaseException {
100
104
  readonly name: "ModelStreamError";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aws-sdk/client-sagemaker-runtime",
3
3
  "description": "AWS SDK for JavaScript Sagemaker Runtime Client for Node.js, Browser and React Native",
4
- "version": "3.645.0",
4
+ "version": "3.648.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-sagemaker-runtime",