Interface SagemakerJobRuntimeClient
- All Superinterfaces:
AutoCloseable,AwsClient,SdkAutoCloseable,SdkClient
builder()
method.
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 aSagemakerJobRuntimeClient.default CompleteRolloutResponsecompleteRollout(Consumer<CompleteRolloutRequest.Builder> completeRolloutRequest) Marks a rollout as complete, indicating that no further turns will be appended to the trajectory.default CompleteRolloutResponsecompleteRollout(CompleteRolloutRequest completeRolloutRequest) Marks a rollout as complete, indicating that no further turns will be appended to the trajectory.static SagemakerJobRuntimeClientcreate()Create aSagemakerJobRuntimeClientwith the region loaded from theDefaultAwsRegionProviderChainand credentials loaded from theDefaultCredentialsProvider.default SampleResponsesample(Consumer<SampleRequest.Builder> sampleRequest) Sends an inference request to the model during a job execution.default SampleResponsesample(SampleRequest sampleRequest) Sends an inference request to the model during a job execution.sampleWithResponseStream(Consumer<SampleWithResponseStreamRequest.Builder> sampleWithResponseStreamRequest) Sends a streaming inference request to the model during a job execution.default SampleWithResponseStreamResponsesampleWithResponseStream(Consumer<SampleWithResponseStreamRequest.Builder> sampleWithResponseStreamRequest, Path destinationPath) Sends a streaming inference request to the model during a job execution.default <ReturnT> ReturnTsampleWithResponseStream(Consumer<SampleWithResponseStreamRequest.Builder> sampleWithResponseStreamRequest, ResponseTransformer<SampleWithResponseStreamResponse, ReturnT> responseTransformer) Sends a streaming inference request to the model during a job execution.sampleWithResponseStream(SampleWithResponseStreamRequest sampleWithResponseStreamRequest) Sends a streaming inference request to the model during a job execution.default SampleWithResponseStreamResponsesampleWithResponseStream(SampleWithResponseStreamRequest sampleWithResponseStreamRequest, Path destinationPath) Sends a streaming inference request to the model during a job execution.default <ReturnT> ReturnTsampleWithResponseStream(SampleWithResponseStreamRequest sampleWithResponseStreamRequest, ResponseTransformer<SampleWithResponseStreamResponse, ReturnT> responseTransformer) Sends a streaming inference request to the model during a job execution.sampleWithResponseStreamAsBytes(Consumer<SampleWithResponseStreamRequest.Builder> sampleWithResponseStreamRequest) Sends a streaming inference request to the model during a job execution.sampleWithResponseStreamAsBytes(SampleWithResponseStreamRequest sampleWithResponseStreamRequest) 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., ClientOverrideConfigurationstatic ServiceMetadatadefault UpdateRewardResponseupdateReward(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 UpdateRewardResponseupdateReward(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 CompleteRolloutResponse completeRollout(CompleteRolloutRequest completeRolloutRequest) throws ResourceNotFoundException, InternalServiceErrorException, ValidationException, ConflictException, ServiceQuotaExceededException, ThrottlingException, AccessDeniedException, AwsServiceException, SdkClientException, SagemakerJobRuntimeException 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:
- Result of the CompleteRollout operation returned by the service.
- See Also:
-
completeRollout
default CompleteRolloutResponse completeRollout(Consumer<CompleteRolloutRequest.Builder> completeRolloutRequest) throws ResourceNotFoundException, InternalServiceErrorException, ValidationException, ConflictException, ServiceQuotaExceededException, ThrottlingException, AccessDeniedException, AwsServiceException, SdkClientException, SagemakerJobRuntimeException 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:
- Result of the CompleteRollout operation returned by the service.
- See Also:
-
sample
default SampleResponse sample(SampleRequest sampleRequest) throws ResourceNotFoundException, InternalServiceErrorException, ValidationException, ServiceQuotaExceededException, ThrottlingException, AccessDeniedException, AwsServiceException, SdkClientException, SagemakerJobRuntimeException 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:
- Result of the Sample operation returned by the service.
- See Also:
-
sample
default SampleResponse sample(Consumer<SampleRequest.Builder> sampleRequest) throws ResourceNotFoundException, InternalServiceErrorException, ValidationException, ServiceQuotaExceededException, ThrottlingException, AccessDeniedException, AwsServiceException, SdkClientException, SagemakerJobRuntimeException 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:
- Result of the Sample operation returned by the service.
- See Also:
-
sampleWithResponseStream
default <ReturnT> ReturnT sampleWithResponseStream(SampleWithResponseStreamRequest sampleWithResponseStreamRequest, ResponseTransformer<SampleWithResponseStreamResponse, ReturnT> responseTransformer) throws ResourceNotFoundException, InternalServiceErrorException, ValidationException, ServiceQuotaExceededException, ThrottlingException, AccessDeniedException, AwsServiceException, SdkClientException, SagemakerJobRuntimeExceptionSends 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-responseTransformer- Functional interface for processing the streamed response content. The unmarshalled SampleWithResponseStreamResponse and an InputStream to the response content are provided as parameters to the callback. The callback may return a transformed type which will be the return value of this method. SeeResponseTransformerfor details on implementing this interface and for links to pre-canned 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:
- The transformed result of the ResponseTransformer.
- See Also:
-
sampleWithResponseStream
default <ReturnT> ReturnT sampleWithResponseStream(Consumer<SampleWithResponseStreamRequest.Builder> sampleWithResponseStreamRequest, ResponseTransformer<SampleWithResponseStreamResponse, ReturnT> responseTransformer) throws ResourceNotFoundException, InternalServiceErrorException, ValidationException, ServiceQuotaExceededException, ThrottlingException, AccessDeniedException, AwsServiceException, SdkClientException, SagemakerJobRuntimeExceptionSends 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.responseTransformer- Functional interface for processing the streamed response content. The unmarshalled SampleWithResponseStreamResponse and an InputStream to the response content are provided as parameters to the callback. The callback may return a transformed type which will be the return value of this method. SeeResponseTransformerfor details on implementing this interface and for links to pre-canned 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:
- The transformed result of the ResponseTransformer.
- See Also:
-
sampleWithResponseStream
default SampleWithResponseStreamResponse sampleWithResponseStream(SampleWithResponseStreamRequest sampleWithResponseStreamRequest, Path destinationPath) throws ResourceNotFoundException, InternalServiceErrorException, ValidationException, ServiceQuotaExceededException, ThrottlingException, AccessDeniedException, AwsServiceException, SdkClientException, SagemakerJobRuntimeException 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:
- The transformed result of the ResponseTransformer.
- See Also:
-
sampleWithResponseStream
default SampleWithResponseStreamResponse sampleWithResponseStream(Consumer<SampleWithResponseStreamRequest.Builder> sampleWithResponseStreamRequest, Path destinationPath) throws ResourceNotFoundException, InternalServiceErrorException, ValidationException, ServiceQuotaExceededException, ThrottlingException, AccessDeniedException, AwsServiceException, SdkClientException, SagemakerJobRuntimeException 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:
- The transformed result of the ResponseTransformer.
- See Also:
-
sampleWithResponseStream
default ResponseInputStream<SampleWithResponseStreamResponse> sampleWithResponseStream(SampleWithResponseStreamRequest sampleWithResponseStreamRequest) throws ResourceNotFoundException, InternalServiceErrorException, ValidationException, ServiceQuotaExceededException, ThrottlingException, AccessDeniedException, AwsServiceException, SdkClientException, SagemakerJobRuntimeException 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-- Returns:
- A
ResponseInputStreamcontaining data streamed from service. Note that this is an unmanaged reference to the underlying HTTP connection so great care must be taken to ensure all data if fully read from the input stream and that it is properly closed. Failure to do so may result in sub-optimal behavior and exhausting connections in the connection pool. The unmarshalled response object can be obtained viaResponseInputStream.response(). The service documentation for the response content is as follows 'The streaming response body, delivered as a series of PayloadPart events.
'. - See Also:
-
sampleWithResponseStream
default ResponseInputStream<SampleWithResponseStreamResponse> sampleWithResponseStream(Consumer<SampleWithResponseStreamRequest.Builder> sampleWithResponseStreamRequest) throws ResourceNotFoundException, InternalServiceErrorException, ValidationException, ServiceQuotaExceededException, ThrottlingException, AccessDeniedException, AwsServiceException, SdkClientException, SagemakerJobRuntimeException 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.- Returns:
- A
ResponseInputStreamcontaining data streamed from service. Note that this is an unmanaged reference to the underlying HTTP connection so great care must be taken to ensure all data if fully read from the input stream and that it is properly closed. Failure to do so may result in sub-optimal behavior and exhausting connections in the connection pool. The unmarshalled response object can be obtained viaResponseInputStream.response(). The service documentation for the response content is as follows 'The streaming response body, delivered as a series of PayloadPart events.
'. - See Also:
-
sampleWithResponseStreamAsBytes
default ResponseBytes<SampleWithResponseStreamResponse> sampleWithResponseStreamAsBytes(SampleWithResponseStreamRequest sampleWithResponseStreamRequest) throws ResourceNotFoundException, InternalServiceErrorException, ValidationException, ServiceQuotaExceededException, ThrottlingException, AccessDeniedException, AwsServiceException, SdkClientException, SagemakerJobRuntimeException 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-- Returns:
- A
ResponseBytesthat loads the data streamed from the service into memory and exposes it in convenient in-memory representations like a byte buffer or string. The unmarshalled response object can be obtained viaResponseBytes.response(). The service documentation for the response content is as follows 'The streaming response body, delivered as a series of PayloadPart events.
'. - See Also:
-
sampleWithResponseStreamAsBytes
default ResponseBytes<SampleWithResponseStreamResponse> sampleWithResponseStreamAsBytes(Consumer<SampleWithResponseStreamRequest.Builder> sampleWithResponseStreamRequest) throws ResourceNotFoundException, InternalServiceErrorException, ValidationException, ServiceQuotaExceededException, ThrottlingException, AccessDeniedException, AwsServiceException, SdkClientException, SagemakerJobRuntimeException 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.- Returns:
- A
ResponseBytesthat loads the data streamed from the service into memory and exposes it in convenient in-memory representations like a byte buffer or string. The unmarshalled response object can be obtained viaResponseBytes.response(). The service documentation for the response content is as follows 'The streaming response body, delivered as a series of PayloadPart events.
'. - See Also:
-
updateReward
default UpdateRewardResponse updateReward(UpdateRewardRequest updateRewardRequest) throws ResourceNotFoundException, InternalServiceErrorException, ValidationException, ConflictException, ServiceQuotaExceededException, ThrottlingException, AccessDeniedException, AwsServiceException, SdkClientException, SagemakerJobRuntimeException 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:
- Result of the UpdateReward operation returned by the service.
- See Also:
-
updateReward
default UpdateRewardResponse updateReward(Consumer<UpdateRewardRequest.Builder> updateRewardRequest) throws ResourceNotFoundException, InternalServiceErrorException, ValidationException, ConflictException, ServiceQuotaExceededException, ThrottlingException, AccessDeniedException, AwsServiceException, SdkClientException, SagemakerJobRuntimeException 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:
- Result of the UpdateReward operation returned by the service.
- See Also:
-
create
Create aSagemakerJobRuntimeClientwith the region loaded from theDefaultAwsRegionProviderChainand credentials loaded from theDefaultCredentialsProvider. -
builder
Create a builder that can be used to configure and create aSagemakerJobRuntimeClient. -
serviceMetadata
-
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
-