2026/06/02 - Sagemaker Job Runtime Service - 4 new api methods
Changes Amazon SageMaker Job Runtime is a new service for managing trajectory data during multi-turn customization jobs. It provides APIs to send inference requests to models during job execution, mark rollouts as complete, and submit reward values for training trajectories.
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.
See also: AWS API Documentation
Request Syntax
client.update_reward(
JobArn='string',
TrajectoryId='string',
Rewards=[
123.0,
],
ClientToken='string'
)
string
[REQUIRED]
The job ARN.
string
[REQUIRED]
The trajectory ID to update with reward values.
list
[REQUIRED]
The list of reward values to assign to this trajectory. Provide one reward value per turn in the trajectory.
(float) --
string
A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.
This field is autopopulated if not provided.
dict
Response Syntax
{}
Response Structure
(dict) --
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.
See also: AWS API Documentation
Request Syntax
client.complete_rollout(
JobArn='string',
TrajectoryId='string',
Status='ready'|'failed',
ClientToken='string'
)
string
[REQUIRED]
The job ARN.
string
[REQUIRED]
The trajectory ID to mark as complete.
string
The target status for the trajectory. Defaults to READY if not specified. Set to FAILED if the rollout encountered an error and the trajectory should not be used for processing.
string
A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.
This field is autopopulated if not provided.
dict
Response Syntax
{}
Response Structure
(dict) --
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.
See also: AWS API Documentation
Request Syntax
client.sample_with_response_stream(
JobArn='string',
TrajectoryId='string',
Body=b'bytes'|file
)
string
[REQUIRED]
The job ARN that identifies which model session to route the inference request to.
string
[REQUIRED]
The trajectory ID for grouping turns into a single rollout. Each turn is captured for later use.
bytes or seekable file-like object
[REQUIRED]
The raw inference request body in OpenAI-compatible JSON format.
dict
Response Syntax
{
'ContentType': 'string',
'Body': StreamingBody()
}
Response Structure
(dict) --
ContentType (string) --
MIME type of the streaming inference result.
Body (:class:`.StreamingBody`) --
The streaming response body, delivered as a series of PayloadPart events.
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.
See also: AWS API Documentation
Request Syntax
client.sample(
JobArn='string',
TrajectoryId='string',
Body=b'bytes'|file
)
string
[REQUIRED]
The job ARN that identifies which model session to route the inference request to.
string
[REQUIRED]
The trajectory ID for grouping turns into a single rollout. Each turn (prompt and response) is captured for later use.
bytes or seekable file-like object
[REQUIRED]
The raw inference request body in OpenAI-compatible JSON format.
dict
Response Syntax
{
'ContentType': 'string',
'Body': StreamingBody()
}
Response Structure
(dict) --
ContentType (string) --
MIME type of the inference result.
Body (:class:`.StreamingBody`) --
The raw inference response body from the model.