Interface SageMakerTrainingSessionRuntimeAsyncClient
- All Superinterfaces:
AutoCloseable,AwsClient,SdkAutoCloseable,SdkClient
builder() method.The asynchronous client performs non-blocking I/O when configured with any
SdkAsyncHttpClient supported in the SDK. However, full non-blocking is not guaranteed as the async client may
perform blocking calls in some cases such as credentials retrieval and endpoint discovery as part of the async API
call.
Amazon SageMaker Training Session Runtime provides APIs for executing training operations and sampling operations against a running training session. Use these APIs to submit asynchronous training steps (such as forward-backward passes, optimizer steps, and checkpoint saves) and to generate text samples from the model being trained.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringValue for looking up the service's metadata from theServiceMetadataProvider.static final String -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Create a builder that can be used to configure and create aSageMakerTrainingSessionRuntimeAsyncClient.create()Create aSageMakerTrainingSessionRuntimeAsyncClientwith the region loaded from theDefaultAwsRegionProviderChainand credentials loaded from theDefaultCredentialsProvider.executeSamplingOperation(Consumer<ExecuteSamplingOperationRequest.Builder> executeSamplingOperationRequest) Submits an asynchronous sampling operation to generate text or compute log-probabilities from the model associated with the specified training session.executeSamplingOperation(ExecuteSamplingOperationRequest executeSamplingOperationRequest) Submits an asynchronous sampling operation to generate text or compute log-probabilities from the model associated with the specified training session.executeTrainingOperation(Consumer<ExecuteTrainingOperationRequest.Builder> executeTrainingOperationRequest) Submits an asynchronous training operation to the specified training session.executeTrainingOperation(ExecuteTrainingOperationRequest executeTrainingOperationRequest) Submits an asynchronous training operation to the specified training session.getSamplingOperationResult(Consumer<GetSamplingOperationResultRequest.Builder> getSamplingOperationResultRequest) Retrieves the current status and result of a previously submitted sampling operation.getSamplingOperationResult(GetSamplingOperationResultRequest getSamplingOperationResultRequest) Retrieves the current status and result of a previously submitted sampling operation.getTrainingOperationResult(Consumer<GetTrainingOperationResultRequest.Builder> getTrainingOperationResultRequest) Retrieves the current status and result of a previously submitted training operation.getTrainingOperationResult(GetTrainingOperationResultRequest getTrainingOperationResultRequest) Retrieves the current status and result of a previously submitted training operation.sampleTrainingSession(Consumer<SampleTrainingSessionRequest.Builder> sampleTrainingSessionRequest) Sends an inference request to the model associated with the specified training session and returns the response synchronously.sampleTrainingSession(SampleTrainingSessionRequest sampleTrainingSessionRequest) Sends an inference request to the model associated with the specified training session and returns the response synchronously.sampleTrainingSessionWithResponseStream(Consumer<SampleTrainingSessionWithResponseStreamRequest.Builder> sampleTrainingSessionWithResponseStreamRequest, Path destinationPath) Streams inference responses from the model associated with the specified training session.default <ReturnT> CompletableFuture<ReturnT> sampleTrainingSessionWithResponseStream(Consumer<SampleTrainingSessionWithResponseStreamRequest.Builder> sampleTrainingSessionWithResponseStreamRequest, AsyncResponseTransformer<SampleTrainingSessionWithResponseStreamResponse, ReturnT> asyncResponseTransformer) Streams inference responses from the model associated with the specified training session.sampleTrainingSessionWithResponseStream(SampleTrainingSessionWithResponseStreamRequest sampleTrainingSessionWithResponseStreamRequest, Path destinationPath) Streams inference responses from the model associated with the specified training session.default <ReturnT> CompletableFuture<ReturnT> sampleTrainingSessionWithResponseStream(SampleTrainingSessionWithResponseStreamRequest sampleTrainingSessionWithResponseStreamRequest, AsyncResponseTransformer<SampleTrainingSessionWithResponseStreamResponse, ReturnT> asyncResponseTransformer) Streams inference responses from the model associated with the specified training session.The SDK service client configuration exposes client settings to the user, e.g., ClientOverrideConfigurationMethods inherited from interface software.amazon.awssdk.utils.SdkAutoCloseable
closeMethods inherited from interface software.amazon.awssdk.core.SdkClient
serviceName
-
Field Details
-
SERVICE_NAME
- See Also:
-
SERVICE_METADATA_ID
Value for looking up the service's metadata from theServiceMetadataProvider.- See Also:
-
-
Method Details
-
executeSamplingOperation
default CompletableFuture<ExecuteSamplingOperationResponse> executeSamplingOperation(ExecuteSamplingOperationRequest executeSamplingOperationRequest) Submits an asynchronous sampling operation to generate text or compute log-probabilities from the model associated with the specified training session. The session must be in
RunningorBlockedstate. UseGetSamplingOperationResultto poll for the result.- Parameters:
executeSamplingOperationRequest-- Returns:
- A Java Future containing the result of the ExecuteSamplingOperation operation returned by the service.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()to retrieve the underlying exception.- ConflictException The training session is in a state that cannot accept new operations. The session
must be in
RunningorBlockedstate to accept requests. - ResourceNotFoundException The specified training session or operation does not exist, or the operation does not belong to the specified training session.
- ThrottlingException The request was throttled. Retry the request after a brief wait using exponential backoff.
- InternalServerException An internal service error occurred. Retry the request using exponential backoff.
- ValidationException The request is not valid. Check the request syntax and parameters. Examples include invalid sequence numbers, malformed client tokens, missing required fields, or invalid operation configuration.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- SageMakerTrainingSessionRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- ConflictException The training session is in a state that cannot accept new operations. The session
must be in
- See Also:
-
executeSamplingOperation
default CompletableFuture<ExecuteSamplingOperationResponse> executeSamplingOperation(Consumer<ExecuteSamplingOperationRequest.Builder> executeSamplingOperationRequest) Submits an asynchronous sampling operation to generate text or compute log-probabilities from the model associated with the specified training session. The session must be in
RunningorBlockedstate. UseGetSamplingOperationResultto poll for the result.
This is a convenience which creates an instance of the
ExecuteSamplingOperationRequest.Builderavoiding the need to create one manually viaExecuteSamplingOperationRequest.builder()- Parameters:
executeSamplingOperationRequest- AConsumerthat will call methods onExecuteSamplingOperationRequest.Builderto create a request.- Returns:
- A Java Future containing the result of the ExecuteSamplingOperation operation returned by the service.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()to retrieve the underlying exception.- ConflictException The training session is in a state that cannot accept new operations. The session
must be in
RunningorBlockedstate to accept requests. - ResourceNotFoundException The specified training session or operation does not exist, or the operation does not belong to the specified training session.
- ThrottlingException The request was throttled. Retry the request after a brief wait using exponential backoff.
- InternalServerException An internal service error occurred. Retry the request using exponential backoff.
- ValidationException The request is not valid. Check the request syntax and parameters. Examples include invalid sequence numbers, malformed client tokens, missing required fields, or invalid operation configuration.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- SageMakerTrainingSessionRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- ConflictException The training session is in a state that cannot accept new operations. The session
must be in
- See Also:
-
executeTrainingOperation
default CompletableFuture<ExecuteTrainingOperationResponse> executeTrainingOperation(ExecuteTrainingOperationRequest executeTrainingOperationRequest) Submits an asynchronous training operation to the specified training session. The service executes operations in sequence number order. The session must be in
RunningorBlockedstate. UseGetTrainingOperationResultto poll for the result. Supported operation types:forward,forwardBackward,optimizerStep,saveWeights,saveState, andloadState.- Parameters:
executeTrainingOperationRequest-- Returns:
- A Java Future containing the result of the ExecuteTrainingOperation operation returned by the service.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()to retrieve the underlying exception.- ConflictException The training session is in a state that cannot accept new operations. The session
must be in
RunningorBlockedstate to accept requests. - ThrottlingException The request was throttled. Retry the request after a brief wait using exponential backoff.
- ResourceNotFoundException The specified training session or operation does not exist, or the operation does not belong to the specified training session.
- InternalServerException An internal service error occurred. Retry the request using exponential backoff.
- ValidationException The request is not valid. Check the request syntax and parameters. Examples include invalid sequence numbers, malformed client tokens, missing required fields, or invalid operation configuration.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- SageMakerTrainingSessionRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- ConflictException The training session is in a state that cannot accept new operations. The session
must be in
- See Also:
-
executeTrainingOperation
default CompletableFuture<ExecuteTrainingOperationResponse> executeTrainingOperation(Consumer<ExecuteTrainingOperationRequest.Builder> executeTrainingOperationRequest) Submits an asynchronous training operation to the specified training session. The service executes operations in sequence number order. The session must be in
RunningorBlockedstate. UseGetTrainingOperationResultto poll for the result. Supported operation types:forward,forwardBackward,optimizerStep,saveWeights,saveState, andloadState.
This is a convenience which creates an instance of the
ExecuteTrainingOperationRequest.Builderavoiding the need to create one manually viaExecuteTrainingOperationRequest.builder()- Parameters:
executeTrainingOperationRequest- AConsumerthat will call methods onExecuteTrainingOperationRequest.Builderto create a request.- Returns:
- A Java Future containing the result of the ExecuteTrainingOperation operation returned by the service.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()to retrieve the underlying exception.- ConflictException The training session is in a state that cannot accept new operations. The session
must be in
RunningorBlockedstate to accept requests. - ThrottlingException The request was throttled. Retry the request after a brief wait using exponential backoff.
- ResourceNotFoundException The specified training session or operation does not exist, or the operation does not belong to the specified training session.
- InternalServerException An internal service error occurred. Retry the request using exponential backoff.
- ValidationException The request is not valid. Check the request syntax and parameters. Examples include invalid sequence numbers, malformed client tokens, missing required fields, or invalid operation configuration.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- SageMakerTrainingSessionRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- ConflictException The training session is in a state that cannot accept new operations. The session
must be in
- See Also:
-
getSamplingOperationResult
default CompletableFuture<GetSamplingOperationResultResponse> getSamplingOperationResult(GetSamplingOperationResultRequest getSamplingOperationResultRequest) Retrieves the current status and result of a previously submitted sampling operation. Poll this operation until the status reaches a terminal state (Completed or Failed).
- Parameters:
getSamplingOperationResultRequest-- Returns:
- A Java Future containing the result of the GetSamplingOperationResult operation returned by the service.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()to retrieve the underlying exception.- ResourceNotFoundException The specified training session or operation does not exist, or the operation does not belong to the specified training session.
- ThrottlingException The request was throttled. Retry the request after a brief wait using exponential backoff.
- InternalServerException An internal service error occurred. Retry the request using exponential backoff.
- ValidationException The request is not valid. Check the request syntax and parameters. Examples include invalid sequence numbers, malformed client tokens, missing required fields, or invalid operation configuration.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- SageMakerTrainingSessionRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
getSamplingOperationResult
default CompletableFuture<GetSamplingOperationResultResponse> getSamplingOperationResult(Consumer<GetSamplingOperationResultRequest.Builder> getSamplingOperationResultRequest) Retrieves the current status and result of a previously submitted sampling operation. Poll this operation until the status reaches a terminal state (Completed or Failed).
This is a convenience which creates an instance of the
GetSamplingOperationResultRequest.Builderavoiding the need to create one manually viaGetSamplingOperationResultRequest.builder()- Parameters:
getSamplingOperationResultRequest- AConsumerthat will call methods onGetSamplingOperationResultRequest.Builderto create a request.- Returns:
- A Java Future containing the result of the GetSamplingOperationResult operation returned by the service.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()to retrieve the underlying exception.- ResourceNotFoundException The specified training session or operation does not exist, or the operation does not belong to the specified training session.
- ThrottlingException The request was throttled. Retry the request after a brief wait using exponential backoff.
- InternalServerException An internal service error occurred. Retry the request using exponential backoff.
- ValidationException The request is not valid. Check the request syntax and parameters. Examples include invalid sequence numbers, malformed client tokens, missing required fields, or invalid operation configuration.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- SageMakerTrainingSessionRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
getTrainingOperationResult
default CompletableFuture<GetTrainingOperationResultResponse> getTrainingOperationResult(GetTrainingOperationResultRequest getTrainingOperationResultRequest) Retrieves the current status and result of a previously submitted training operation. Poll this operation until the status reaches a terminal state (Completed, Failed, or Skipped).
- Parameters:
getTrainingOperationResultRequest-- Returns:
- A Java Future containing the result of the GetTrainingOperationResult operation returned by the service.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()to retrieve the underlying exception.- ResourceNotFoundException The specified training session or operation does not exist, or the operation does not belong to the specified training session.
- ThrottlingException The request was throttled. Retry the request after a brief wait using exponential backoff.
- InternalServerException An internal service error occurred. Retry the request using exponential backoff.
- ValidationException The request is not valid. Check the request syntax and parameters. Examples include invalid sequence numbers, malformed client tokens, missing required fields, or invalid operation configuration.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- SageMakerTrainingSessionRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
getTrainingOperationResult
default CompletableFuture<GetTrainingOperationResultResponse> getTrainingOperationResult(Consumer<GetTrainingOperationResultRequest.Builder> getTrainingOperationResultRequest) Retrieves the current status and result of a previously submitted training operation. Poll this operation until the status reaches a terminal state (Completed, Failed, or Skipped).
This is a convenience which creates an instance of the
GetTrainingOperationResultRequest.Builderavoiding the need to create one manually viaGetTrainingOperationResultRequest.builder()- Parameters:
getTrainingOperationResultRequest- AConsumerthat will call methods onGetTrainingOperationResultRequest.Builderto create a request.- Returns:
- A Java Future containing the result of the GetTrainingOperationResult operation returned by the service.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()to retrieve the underlying exception.- ResourceNotFoundException The specified training session or operation does not exist, or the operation does not belong to the specified training session.
- ThrottlingException The request was throttled. Retry the request after a brief wait using exponential backoff.
- InternalServerException An internal service error occurred. Retry the request using exponential backoff.
- ValidationException The request is not valid. Check the request syntax and parameters. Examples include invalid sequence numbers, malformed client tokens, missing required fields, or invalid operation configuration.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- SageMakerTrainingSessionRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
sampleTrainingSession
default CompletableFuture<SampleTrainingSessionResponse> sampleTrainingSession(SampleTrainingSessionRequest sampleTrainingSessionRequest) Sends an inference request to the model associated with the specified training session and returns the response synchronously. The service passes the request and response bodies to and from the model without modification.
- Parameters:
sampleTrainingSessionRequest-- Returns:
- A Java Future containing the result of the SampleTrainingSession operation returned by the service.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()to retrieve the underlying exception.- ConflictException The training session is in a state that cannot accept new operations. The session
must be in
RunningorBlockedstate to accept requests. - ResourceNotFoundException The specified training session or operation does not exist, or the operation does not belong to the specified training session.
- ThrottlingException The request was throttled. Retry the request after a brief wait using exponential backoff.
- InternalServerException An internal service error occurred. Retry the request using exponential backoff.
- ValidationException The request is not valid. Check the request syntax and parameters. Examples include invalid sequence numbers, malformed client tokens, missing required fields, or invalid operation configuration.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- SageMakerTrainingSessionRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- ConflictException The training session is in a state that cannot accept new operations. The session
must be in
- See Also:
-
sampleTrainingSession
default CompletableFuture<SampleTrainingSessionResponse> sampleTrainingSession(Consumer<SampleTrainingSessionRequest.Builder> sampleTrainingSessionRequest) Sends an inference request to the model associated with the specified training session and returns the response synchronously. The service passes the request and response bodies to and from the model without modification.
This is a convenience which creates an instance of the
SampleTrainingSessionRequest.Builderavoiding the need to create one manually viaSampleTrainingSessionRequest.builder()- Parameters:
sampleTrainingSessionRequest- AConsumerthat will call methods onSampleTrainingSessionRequest.Builderto create a request.- Returns:
- A Java Future containing the result of the SampleTrainingSession operation returned by the service.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()to retrieve the underlying exception.- ConflictException The training session is in a state that cannot accept new operations. The session
must be in
RunningorBlockedstate to accept requests. - ResourceNotFoundException The specified training session or operation does not exist, or the operation does not belong to the specified training session.
- ThrottlingException The request was throttled. Retry the request after a brief wait using exponential backoff.
- InternalServerException An internal service error occurred. Retry the request using exponential backoff.
- ValidationException The request is not valid. Check the request syntax and parameters. Examples include invalid sequence numbers, malformed client tokens, missing required fields, or invalid operation configuration.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- SageMakerTrainingSessionRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- ConflictException The training session is in a state that cannot accept new operations. The session
must be in
- See Also:
-
sampleTrainingSessionWithResponseStream
default <ReturnT> CompletableFuture<ReturnT> sampleTrainingSessionWithResponseStream(SampleTrainingSessionWithResponseStreamRequest sampleTrainingSessionWithResponseStreamRequest, AsyncResponseTransformer<SampleTrainingSessionWithResponseStreamResponse, ReturnT> asyncResponseTransformer) Streams inference responses from the model associated with the specified training session. Use this operation for real-time token-by-token generation. The service passes the request body to the model without modification.
- Parameters:
sampleTrainingSessionWithResponseStreamRequest-asyncResponseTransformer- The response transformer for processing the streaming response in a non-blocking manner. SeeAsyncResponseTransformerfor details on how this callback should be implemented and for links to precanned implementations for common scenarios like downloading to a file. The service documentation for the response content is as follows 'The streaming inference response from the model, delivered as a series of chunks.
'.- Returns:
- A future to the transformed result of the AsyncResponseTransformer.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()to retrieve the underlying exception.- ConflictException The training session is in a state that cannot accept new operations. The session
must be in
RunningorBlockedstate to accept requests. - ResourceNotFoundException The specified training session or operation does not exist, or the operation does not belong to the specified training session.
- ThrottlingException The request was throttled. Retry the request after a brief wait using exponential backoff.
- InternalServerException An internal service error occurred. Retry the request using exponential backoff.
- ValidationException The request is not valid. Check the request syntax and parameters. Examples include invalid sequence numbers, malformed client tokens, missing required fields, or invalid operation configuration.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- SageMakerTrainingSessionRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- ConflictException The training session is in a state that cannot accept new operations. The session
must be in
- See Also:
-
sampleTrainingSessionWithResponseStream
default <ReturnT> CompletableFuture<ReturnT> sampleTrainingSessionWithResponseStream(Consumer<SampleTrainingSessionWithResponseStreamRequest.Builder> sampleTrainingSessionWithResponseStreamRequest, AsyncResponseTransformer<SampleTrainingSessionWithResponseStreamResponse, ReturnT> asyncResponseTransformer) Streams inference responses from the model associated with the specified training session. Use this operation for real-time token-by-token generation. The service passes the request body to the model without modification.
This is a convenience which creates an instance of the
SampleTrainingSessionWithResponseStreamRequest.Builderavoiding the need to create one manually viaSampleTrainingSessionWithResponseStreamRequest.builder()- Parameters:
sampleTrainingSessionWithResponseStreamRequest- AConsumerthat will call methods onSampleTrainingSessionWithResponseStreamRequest.Builderto create a request.asyncResponseTransformer- The response transformer for processing the streaming response in a non-blocking manner. SeeAsyncResponseTransformerfor details on how this callback should be implemented and for links to precanned implementations for common scenarios like downloading to a file. The service documentation for the response content is as follows 'The streaming inference response from the model, delivered as a series of chunks.
'.- Returns:
- A future to the transformed result of the AsyncResponseTransformer.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()to retrieve the underlying exception.- ConflictException The training session is in a state that cannot accept new operations. The session
must be in
RunningorBlockedstate to accept requests. - ResourceNotFoundException The specified training session or operation does not exist, or the operation does not belong to the specified training session.
- ThrottlingException The request was throttled. Retry the request after a brief wait using exponential backoff.
- InternalServerException An internal service error occurred. Retry the request using exponential backoff.
- ValidationException The request is not valid. Check the request syntax and parameters. Examples include invalid sequence numbers, malformed client tokens, missing required fields, or invalid operation configuration.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- SageMakerTrainingSessionRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- ConflictException The training session is in a state that cannot accept new operations. The session
must be in
- See Also:
-
sampleTrainingSessionWithResponseStream
default CompletableFuture<SampleTrainingSessionWithResponseStreamResponse> sampleTrainingSessionWithResponseStream(SampleTrainingSessionWithResponseStreamRequest sampleTrainingSessionWithResponseStreamRequest, Path destinationPath) Streams inference responses from the model associated with the specified training session. Use this operation for real-time token-by-token generation. The service passes the request body to the model without modification.
- Parameters:
sampleTrainingSessionWithResponseStreamRequest-destinationPath-Pathto file that response contents will be written to. The file must not exist or this method will throw an exception. If the file is not writable by the current user then an exception will be thrown. The service documentation for the response content is as follows 'The streaming inference response from the model, delivered as a series of chunks.
'.- Returns:
- A future to the transformed result of the AsyncResponseTransformer.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()to retrieve the underlying exception.- ConflictException The training session is in a state that cannot accept new operations. The session
must be in
RunningorBlockedstate to accept requests. - ResourceNotFoundException The specified training session or operation does not exist, or the operation does not belong to the specified training session.
- ThrottlingException The request was throttled. Retry the request after a brief wait using exponential backoff.
- InternalServerException An internal service error occurred. Retry the request using exponential backoff.
- ValidationException The request is not valid. Check the request syntax and parameters. Examples include invalid sequence numbers, malformed client tokens, missing required fields, or invalid operation configuration.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- SageMakerTrainingSessionRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- ConflictException The training session is in a state that cannot accept new operations. The session
must be in
- See Also:
-
sampleTrainingSessionWithResponseStream
default CompletableFuture<SampleTrainingSessionWithResponseStreamResponse> sampleTrainingSessionWithResponseStream(Consumer<SampleTrainingSessionWithResponseStreamRequest.Builder> sampleTrainingSessionWithResponseStreamRequest, Path destinationPath) Streams inference responses from the model associated with the specified training session. Use this operation for real-time token-by-token generation. The service passes the request body to the model without modification.
This is a convenience which creates an instance of the
SampleTrainingSessionWithResponseStreamRequest.Builderavoiding the need to create one manually viaSampleTrainingSessionWithResponseStreamRequest.builder()- Parameters:
sampleTrainingSessionWithResponseStreamRequest- AConsumerthat will call methods onSampleTrainingSessionWithResponseStreamRequest.Builderto create a request.destinationPath-Pathto file that response contents will be written to. The file must not exist or this method will throw an exception. If the file is not writable by the current user then an exception will be thrown. The service documentation for the response content is as follows 'The streaming inference response from the model, delivered as a series of chunks.
'.- Returns:
- A future to the transformed result of the AsyncResponseTransformer.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()to retrieve the underlying exception.- ConflictException The training session is in a state that cannot accept new operations. The session
must be in
RunningorBlockedstate to accept requests. - ResourceNotFoundException The specified training session or operation does not exist, or the operation does not belong to the specified training session.
- ThrottlingException The request was throttled. Retry the request after a brief wait using exponential backoff.
- InternalServerException An internal service error occurred. Retry the request using exponential backoff.
- ValidationException The request is not valid. Check the request syntax and parameters. Examples include invalid sequence numbers, malformed client tokens, missing required fields, or invalid operation configuration.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- SageMakerTrainingSessionRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- ConflictException The training session is in a state that cannot accept new operations. The session
must be in
- See Also:
-
serviceClientConfiguration
Description copied from interface:SdkClientThe SDK service client configuration exposes client settings to the user, e.g., ClientOverrideConfiguration- Specified by:
serviceClientConfigurationin interfaceAwsClient- Specified by:
serviceClientConfigurationin interfaceSdkClient- Returns:
- SdkServiceClientConfiguration
-
create
Create aSageMakerTrainingSessionRuntimeAsyncClientwith the region loaded from theDefaultAwsRegionProviderChainand credentials loaded from theDefaultCredentialsProvider. -
builder
Create a builder that can be used to configure and create aSageMakerTrainingSessionRuntimeAsyncClient.
-