Interface SagemakerJobRuntimeAsyncClient
- 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.
Agentic RFT Runtime Service - manages trajectory and transition data for reinforcement fine-tuning jobs.
-
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 aSagemakerJobRuntimeAsyncClient.default CompletableFuture<CompleteRolloutResponse> completeRollout(Consumer<CompleteRolloutRequest.Builder> completeRolloutRequest) Marks a rollout as complete, indicating that no further turns will be appended to the trajectory.default CompletableFuture<CompleteRolloutResponse> completeRollout(CompleteRolloutRequest completeRolloutRequest) Marks a rollout as complete, indicating that no further turns will be appended to the trajectory.create()Create aSagemakerJobRuntimeAsyncClientwith the region loaded from theDefaultAwsRegionProviderChainand credentials loaded from theDefaultCredentialsProvider.default CompletableFuture<SampleResponse> sample(Consumer<SampleRequest.Builder> sampleRequest) Sends an inference request to the model during a job execution.default CompletableFuture<SampleResponse> sample(SampleRequest sampleRequest) Sends an inference request to the model during a job execution.sampleWithResponseStream(Consumer<SampleWithResponseStreamRequest.Builder> sampleWithResponseStreamRequest, Path destinationPath) Sends a streaming inference request to the model during a job execution.default <ReturnT> CompletableFuture<ReturnT> sampleWithResponseStream(Consumer<SampleWithResponseStreamRequest.Builder> sampleWithResponseStreamRequest, AsyncResponseTransformer<SampleWithResponseStreamResponse, ReturnT> asyncResponseTransformer) Sends a streaming inference request to the model during a job execution.sampleWithResponseStream(SampleWithResponseStreamRequest sampleWithResponseStreamRequest, Path destinationPath) Sends a streaming inference request to the model during a job execution.default <ReturnT> CompletableFuture<ReturnT> sampleWithResponseStream(SampleWithResponseStreamRequest sampleWithResponseStreamRequest, AsyncResponseTransformer<SampleWithResponseStreamResponse, ReturnT> asyncResponseTransformer) Sends a streaming inference request to the model during a job execution.The SDK service client configuration exposes client settings to the user, e.g., ClientOverrideConfigurationdefault CompletableFuture<UpdateRewardResponse> updateReward(Consumer<UpdateRewardRequest.Builder> updateRewardRequest) Updates the reward values for a trajectory and transitions it to reward-received status, signaling that it is eligible for processing.default CompletableFuture<UpdateRewardResponse> updateReward(UpdateRewardRequest updateRewardRequest) Updates the reward values for a trajectory and transitions it to reward-received status, signaling that it is eligible for processing.Methods 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
-
completeRollout
default CompletableFuture<CompleteRolloutResponse> completeRollout(CompleteRolloutRequest completeRolloutRequest) Marks a rollout as complete, indicating that no further turns will be appended to the trajectory. After calling this operation, the trajectory is sealed and eligible for reward submission via the UpdateReward operation.
- Parameters:
completeRolloutRequest-- Returns:
- A Java Future containing the result of the CompleteRollout 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 resource was not found.
- InternalServiceErrorException An internal service error occurred. Retry the request.
- ValidationException The request is not valid. Check the request syntax and parameters
- ConflictException The request conflicts with the current state of the resource.
- ServiceQuotaExceededException You have exceeded a service quota.
- ThrottlingException The request was throttled. Retry the request after a brief wait.
- AccessDeniedException You do not have permission to perform this operation.
- 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.
- SagemakerJobRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
completeRollout
default CompletableFuture<CompleteRolloutResponse> completeRollout(Consumer<CompleteRolloutRequest.Builder> completeRolloutRequest) Marks a rollout as complete, indicating that no further turns will be appended to the trajectory. After calling this operation, the trajectory is sealed and eligible for reward submission via the UpdateReward operation.
This is a convenience which creates an instance of the
CompleteRolloutRequest.Builderavoiding the need to create one manually viaCompleteRolloutRequest.builder()- Parameters:
completeRolloutRequest- AConsumerthat will call methods onCompleteRolloutRequest.Builderto create a request.- Returns:
- A Java Future containing the result of the CompleteRollout 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 resource was not found.
- InternalServiceErrorException An internal service error occurred. Retry the request.
- ValidationException The request is not valid. Check the request syntax and parameters
- ConflictException The request conflicts with the current state of the resource.
- ServiceQuotaExceededException You have exceeded a service quota.
- ThrottlingException The request was throttled. Retry the request after a brief wait.
- AccessDeniedException You do not have permission to perform this operation.
- 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.
- SagemakerJobRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
sample
Sends an inference request to the model during a job execution. The request and response bodies are forwarded to and from the model without modification. Each turn (prompt and response) is captured for later use.
- Parameters:
sampleRequest-- Returns:
- A Java Future containing the result of the Sample 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 resource was not found.
- InternalServiceErrorException An internal service error occurred. Retry the request.
- ValidationException The request is not valid. Check the request syntax and parameters
- ServiceQuotaExceededException You have exceeded a service quota.
- ThrottlingException The request was throttled. Retry the request after a brief wait.
- AccessDeniedException You do not have permission to perform this operation.
- 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.
- SagemakerJobRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
sample
Sends an inference request to the model during a job execution. The request and response bodies are forwarded to and from the model without modification. Each turn (prompt and response) is captured for later use.
This is a convenience which creates an instance of the
SampleRequest.Builderavoiding the need to create one manually viaSampleRequest.builder()- Parameters:
sampleRequest- AConsumerthat will call methods onSampleRequest.Builderto create a request.- Returns:
- A Java Future containing the result of the Sample 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 resource was not found.
- InternalServiceErrorException An internal service error occurred. Retry the request.
- ValidationException The request is not valid. Check the request syntax and parameters
- ServiceQuotaExceededException You have exceeded a service quota.
- ThrottlingException The request was throttled. Retry the request after a brief wait.
- AccessDeniedException You do not have permission to perform this operation.
- 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.
- SagemakerJobRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
sampleWithResponseStream
default <ReturnT> CompletableFuture<ReturnT> sampleWithResponseStream(SampleWithResponseStreamRequest sampleWithResponseStreamRequest, AsyncResponseTransformer<SampleWithResponseStreamResponse, ReturnT> asyncResponseTransformer) Sends a streaming inference request to the model during a job execution. Returns the response as a stream of payload chunks. Each turn is captured for later use.
- Parameters:
sampleWithResponseStreamRequest-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 response body, delivered as a series of PayloadPart events.
'.- 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.- ResourceNotFoundException The specified resource was not found.
- InternalServiceErrorException An internal service error occurred. Retry the request.
- ValidationException The request is not valid. Check the request syntax and parameters
- ServiceQuotaExceededException You have exceeded a service quota.
- ThrottlingException The request was throttled. Retry the request after a brief wait.
- AccessDeniedException You do not have permission to perform this operation.
- 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.
- SagemakerJobRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
sampleWithResponseStream
default <ReturnT> CompletableFuture<ReturnT> sampleWithResponseStream(Consumer<SampleWithResponseStreamRequest.Builder> sampleWithResponseStreamRequest, AsyncResponseTransformer<SampleWithResponseStreamResponse, ReturnT> asyncResponseTransformer) Sends a streaming inference request to the model during a job execution. Returns the response as a stream of payload chunks. Each turn is captured for later use.
This is a convenience which creates an instance of the
SampleWithResponseStreamRequest.Builderavoiding the need to create one manually viaSampleWithResponseStreamRequest.builder()- Parameters:
sampleWithResponseStreamRequest- AConsumerthat will call methods onSampleWithResponseStreamRequest.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 response body, delivered as a series of PayloadPart events.
'.- 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.- ResourceNotFoundException The specified resource was not found.
- InternalServiceErrorException An internal service error occurred. Retry the request.
- ValidationException The request is not valid. Check the request syntax and parameters
- ServiceQuotaExceededException You have exceeded a service quota.
- ThrottlingException The request was throttled. Retry the request after a brief wait.
- AccessDeniedException You do not have permission to perform this operation.
- 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.
- SagemakerJobRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
sampleWithResponseStream
default CompletableFuture<SampleWithResponseStreamResponse> sampleWithResponseStream(SampleWithResponseStreamRequest sampleWithResponseStreamRequest, Path destinationPath) Sends a streaming inference request to the model during a job execution. Returns the response as a stream of payload chunks. Each turn is captured for later use.
- Parameters:
sampleWithResponseStreamRequest-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 response body, delivered as a series of PayloadPart events.
'.- 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.- ResourceNotFoundException The specified resource was not found.
- InternalServiceErrorException An internal service error occurred. Retry the request.
- ValidationException The request is not valid. Check the request syntax and parameters
- ServiceQuotaExceededException You have exceeded a service quota.
- ThrottlingException The request was throttled. Retry the request after a brief wait.
- AccessDeniedException You do not have permission to perform this operation.
- 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.
- SagemakerJobRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
sampleWithResponseStream
default CompletableFuture<SampleWithResponseStreamResponse> sampleWithResponseStream(Consumer<SampleWithResponseStreamRequest.Builder> sampleWithResponseStreamRequest, Path destinationPath) Sends a streaming inference request to the model during a job execution. Returns the response as a stream of payload chunks. Each turn is captured for later use.
This is a convenience which creates an instance of the
SampleWithResponseStreamRequest.Builderavoiding the need to create one manually viaSampleWithResponseStreamRequest.builder()- Parameters:
sampleWithResponseStreamRequest- AConsumerthat will call methods onSampleWithResponseStreamRequest.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 response body, delivered as a series of PayloadPart events.
'.- 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.- ResourceNotFoundException The specified resource was not found.
- InternalServiceErrorException An internal service error occurred. Retry the request.
- ValidationException The request is not valid. Check the request syntax and parameters
- ServiceQuotaExceededException You have exceeded a service quota.
- ThrottlingException The request was throttled. Retry the request after a brief wait.
- AccessDeniedException You do not have permission to perform this operation.
- 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.
- SagemakerJobRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
updateReward
default CompletableFuture<UpdateRewardResponse> updateReward(UpdateRewardRequest updateRewardRequest) Updates the reward values for a trajectory and transitions it to reward-received status, signaling that it is eligible for processing. Call this operation after CompleteRollout to provide the computed reward scores.
- Parameters:
updateRewardRequest-- Returns:
- A Java Future containing the result of the UpdateReward 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 resource was not found.
- InternalServiceErrorException An internal service error occurred. Retry the request.
- ValidationException The request is not valid. Check the request syntax and parameters
- ConflictException The request conflicts with the current state of the resource.
- ServiceQuotaExceededException You have exceeded a service quota.
- ThrottlingException The request was throttled. Retry the request after a brief wait.
- AccessDeniedException You do not have permission to perform this operation.
- 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.
- SagemakerJobRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
updateReward
default CompletableFuture<UpdateRewardResponse> updateReward(Consumer<UpdateRewardRequest.Builder> updateRewardRequest) Updates the reward values for a trajectory and transitions it to reward-received status, signaling that it is eligible for processing. Call this operation after CompleteRollout to provide the computed reward scores.
This is a convenience which creates an instance of the
UpdateRewardRequest.Builderavoiding the need to create one manually viaUpdateRewardRequest.builder()- Parameters:
updateRewardRequest- AConsumerthat will call methods onUpdateRewardRequest.Builderto create a request.- Returns:
- A Java Future containing the result of the UpdateReward 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 resource was not found.
- InternalServiceErrorException An internal service error occurred. Retry the request.
- ValidationException The request is not valid. Check the request syntax and parameters
- ConflictException The request conflicts with the current state of the resource.
- ServiceQuotaExceededException You have exceeded a service quota.
- ThrottlingException The request was throttled. Retry the request after a brief wait.
- AccessDeniedException You do not have permission to perform this operation.
- 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.
- SagemakerJobRuntimeException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- 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 aSagemakerJobRuntimeAsyncClientwith the region loaded from theDefaultAwsRegionProviderChainand credentials loaded from theDefaultCredentialsProvider. -
builder
Create a builder that can be used to configure and create aSagemakerJobRuntimeAsyncClient.
-