UpdateReward
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.
Request Syntax
POST /update-reward HTTP/1.1
X-Amzn-SageMaker-Job-Arn: JobArn
Content-type: application/json
{
"ClientToken": "string",
"Rewards": [ number ],
"TrajectoryId": "string"
}
URI Request Parameters
The request uses the following URI parameters.
- JobArn
-
The job ARN.
Length Constraints: Minimum length of 1. Maximum length of 256.
Pattern:
arn:aws[a-z\-]*:sagemaker:[a-z0-9\-]*:[0-9]{12}:job/[a-zA-Z0-9_\-]+/[a-zA-Z0-9](-*[a-zA-Z0-9]){0,62}Required: Yes
Request Body
The request accepts the following data in JSON format.
- ClientToken
-
A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.
Type: String
Required: No
- Rewards
-
The list of reward values to assign to this trajectory. Provide one reward value per turn in the trajectory.
Type: Array of doubles
Required: Yes
- TrajectoryId
-
The trajectory ID to update with reward values.
Type: String
Length Constraints: Minimum length of 1. Maximum length of 256.
Required: Yes
Response Syntax
HTTP/1.1 200
Response Elements
If the action is successful, the service sends back an HTTP 200 response with an empty HTTP body.
Errors
For information about the errors that are common to all actions, see Common Error Types.
- AccessDeniedException
-
You do not have permission to perform this operation.
HTTP Status Code: 403
- ConflictException
-
The request conflicts with the current state of the resource.
HTTP Status Code: 409
- InternalServiceError
-
An internal service error occurred. Retry the request.
HTTP Status Code: 500
- ResourceNotFoundException
-
The specified resource was not found.
HTTP Status Code: 404
- ServiceQuotaExceededException
-
You have exceeded a service quota.
HTTP Status Code: 402
- ThrottlingException
-
The request was throttled. Retry the request after a brief wait.
HTTP Status Code: 429
- ValidationException
-
The request is not valid. Check the request syntax and parameters.
HTTP Status Code: 400
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the following: