diff --git a/clients/client-sagemaker-runtime/src/commands/InvokeEndpointCommand.ts b/clients/client-sagemaker-runtime/src/commands/InvokeEndpointCommand.ts index d627288c53443..8a0e54062def8 100644 --- a/clients/client-sagemaker-runtime/src/commands/InvokeEndpointCommand.ts +++ b/clients/client-sagemaker-runtime/src/commands/InvokeEndpointCommand.ts @@ -85,6 +85,7 @@ export interface InvokeEndpointCommandOutput extends InvokeEndpointCommandOutput * InferenceId: "STRING_VALUE", * EnableExplanations: "STRING_VALUE", * InferenceComponentName: "STRING_VALUE", + * SessionId: "STRING_VALUE", * }; * const command = new InvokeEndpointCommand(input); * const response = await client.send(command); @@ -93,6 +94,8 @@ export interface InvokeEndpointCommandOutput extends InvokeEndpointCommandOutput * // ContentType: "STRING_VALUE", * // InvokedProductionVariant: "STRING_VALUE", * // CustomAttributes: "STRING_VALUE", + * // NewSessionId: "STRING_VALUE", + * // ClosedSessionId: "STRING_VALUE", * // }; * * ``` diff --git a/clients/client-sagemaker-runtime/src/commands/InvokeEndpointWithResponseStreamCommand.ts b/clients/client-sagemaker-runtime/src/commands/InvokeEndpointWithResponseStreamCommand.ts index cf2a9aa6d10dc..6c5c6d8b97b53 100644 --- a/clients/client-sagemaker-runtime/src/commands/InvokeEndpointWithResponseStreamCommand.ts +++ b/clients/client-sagemaker-runtime/src/commands/InvokeEndpointWithResponseStreamCommand.ts @@ -86,6 +86,7 @@ export interface InvokeEndpointWithResponseStreamCommandOutput * TargetContainerHostname: "STRING_VALUE", * InferenceId: "STRING_VALUE", * InferenceComponentName: "STRING_VALUE", + * SessionId: "STRING_VALUE", * }; * const command = new InvokeEndpointWithResponseStreamCommand(input); * const response = await client.send(command); diff --git a/clients/client-sagemaker-runtime/src/models/models_0.ts b/clients/client-sagemaker-runtime/src/models/models_0.ts index 509d9e3fda919..32ac554fb1cac 100644 --- a/clients/client-sagemaker-runtime/src/models/models_0.ts +++ b/clients/client-sagemaker-runtime/src/models/models_0.ts @@ -146,6 +146,28 @@ export interface InvokeEndpointInput { * @public */ InferenceComponentName?: string; + + /** + *
Creates a stateful session or identifies an existing one. You can do one of the + * following:
+ *Create a stateful session by specifying the value
+ * NEW_SESSION
.
Send your request to an existing stateful session by specifying the ID of that + * session.
+ *With a stateful session, you can send multiple requests to a stateful model. When you
+ * create a session with a stateful model, the model must create the session ID and set the
+ * expiration time. The model must also provide that information in the response to your
+ * request. You can get the ID and timestamp from the NewSessionId
response
+ * parameter. For any subsequent request where you specify that session ID, SageMaker routes the request to the same instance that supports the session.
If you created a stateful session with your request, the ID and expiration time that + * the model assigns to that session.
+ * @public + */ + NewSessionId?: string; + + /** + *If you closed a stateful session with your request, the ID of that session.
+ * @public + */ + ClosedSessionId?: string; } /** @@ -508,6 +543,20 @@ export interface InvokeEndpointWithResponseStreamInput { * @public */ InferenceComponentName?: string; + + /** + *The ID of a stateful session to handle your request.
+ *You can't create a stateful session by using the
+ * InvokeEndpointWithResponseStream
action. Instead, you can create one by
+ * using the
+ * InvokeEndpoint
+ *
action. In your request, you
+ * specify NEW_SESSION
for the SessionId
request parameter. The
+ * response to that request provides the session ID for the NewSessionId
+ * response parameter.
If the endpoint hosts one or more inference components, this parameter specifies the\n name of inference component to invoke.
", "smithy.api#httpHeader": "X-Amzn-SageMaker-Inference-Component" } + }, + "SessionId": { + "target": "com.amazonaws.sagemakerruntime#SessionIdOrNewSessionConstantHeader", + "traits": { + "smithy.api#documentation": "Creates a stateful session or identifies an existing one. You can do one of the\n following:
\nCreate a stateful session by specifying the value\n NEW_SESSION
.
Send your request to an existing stateful session by specifying the ID of that\n session.
\nWith a stateful session, you can send multiple requests to a stateful model. When you\n create a session with a stateful model, the model must create the session ID and set the\n expiration time. The model must also provide that information in the response to your\n request. You can get the ID and timestamp from the NewSessionId
response\n parameter. For any subsequent request where you specify that session ID, SageMaker routes the request to the same instance that supports the session.
Provides additional information in the response about the inference returned by a\n model hosted at an Amazon SageMaker endpoint. The information is an opaque value that is\n forwarded verbatim. You could use this value, for example, to return an ID received in\n the CustomAttributes
header of a request or other metadata that a service\n endpoint was programmed to produce. The value must consist of no more than 1024 visible\n US-ASCII characters as specified in Section 3.3.6. Field Value\n Components of the Hypertext Transfer Protocol (HTTP/1.1). If the customer\n wants the custom attribute returned, the model must set the custom attribute to be\n included on the way back.
The code in your model is responsible for setting or updating any custom attributes in\n the response. If your code does not set this value in the response, an empty value is\n returned. For example, if a custom attribute represents the trace ID, your model can\n prepend the custom attribute with Trace ID:
in your post-processing\n function.
This feature is currently supported in the Amazon Web Services SDKs but not in the Amazon SageMaker\n Python SDK.
", "smithy.api#httpHeader": "X-Amzn-SageMaker-Custom-Attributes" } + }, + "NewSessionId": { + "target": "com.amazonaws.sagemakerruntime#NewSessionResponseHeader", + "traits": { + "smithy.api#documentation": "If you created a stateful session with your request, the ID and expiration time that\n the model assigns to that session.
", + "smithy.api#httpHeader": "X-Amzn-SageMaker-New-Session-Id" + } + }, + "ClosedSessionId": { + "target": "com.amazonaws.sagemakerruntime#SessionIdHeader", + "traits": { + "smithy.api#documentation": "If you closed a stateful session with your request, the ID of that session.
", + "smithy.api#httpHeader": "X-Amzn-SageMaker-Closed-Session-Id" + } } }, "traits": { @@ -1598,6 +1619,13 @@ "smithy.api#documentation": "If the endpoint hosts one or more inference components, this parameter specifies the\n name of inference component to invoke for a streaming response.
", "smithy.api#httpHeader": "X-Amzn-SageMaker-Inference-Component" } + }, + "SessionId": { + "target": "com.amazonaws.sagemakerruntime#SessionIdHeader", + "traits": { + "smithy.api#documentation": "The ID of a stateful session to handle your request.
\nYou can't create a stateful session by using the\n InvokeEndpointWithResponseStream
action. Instead, you can create one by\n using the \n InvokeEndpoint\n
action. In your request, you\n specify NEW_SESSION
for the SessionId
request parameter. The\n response to that request provides the session ID for the NewSessionId
\n response parameter.