updateReward method
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.
May throw AccessDeniedException.
May throw ConflictException.
May throw InternalServiceError.
May throw ResourceNotFoundException.
May throw ServiceQuotaExceededException.
May throw ThrottlingException.
May throw ValidationException.
Parameter jobArn :
The job ARN.
Parameter rewards :
The list of reward values to assign to this trajectory. Provide one reward
value per turn in the trajectory.
Parameter trajectoryId :
The trajectory ID to update with reward values.
Parameter clientToken :
A unique, case-sensitive identifier that you provide to ensure the
idempotency of the request.
Implementation
Future<void> updateReward({
required String jobArn,
required List<double> rewards,
required String trajectoryId,
String? clientToken,
}) async {
final headers = <String, String>{
'X-Amzn-SageMaker-Job-Arn': jobArn.toString(),
};
final $payload = <String, dynamic>{
'Rewards': rewards,
'TrajectoryId': trajectoryId,
'ClientToken': clientToken ?? _s.generateIdempotencyToken(),
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/update-reward',
headers: headers,
exceptionFnMap: _exceptionFns,
);
}