createEvaluationJob method
- required EvaluationConfig evaluationConfig,
- required EvaluationInferenceConfig inferenceConfig,
- required String jobName,
- required EvaluationOutputDataConfig outputDataConfig,
- required String roleArn,
- ApplicationType? applicationType,
- String? clientRequestToken,
- String? customerEncryptionKeyId,
- String? jobDescription,
- List<
Tag> ? jobTags,
Creates an evaluation job.
May throw AccessDeniedException.
May throw ConflictException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ServiceQuotaExceededException.
May throw ThrottlingException.
May throw ValidationException.
Parameter evaluationConfig :
Contains the configuration details of either an automated or human-based
evaluation job.
Parameter inferenceConfig :
Contains the configuration details of the inference model for the
evaluation job.
For model evaluation jobs, automated jobs support a single model or inference profile, and jobs that use human workers support two models or inference profiles.
Parameter jobName :
A name for the evaluation job. Names must unique with your Amazon Web
Services account, and your account's Amazon Web Services region.
Parameter outputDataConfig :
Contains the configuration details of the Amazon S3 bucket for storing the
results of the evaluation job.
Parameter roleArn :
The Amazon Resource Name (ARN) of an IAM service role that Amazon Bedrock
can assume to perform tasks on your behalf. To learn more about the
required permissions, see Required
permissions for model evaluations.
Parameter applicationType :
Specifies whether the evaluation job is for evaluating a model or
evaluating a knowledge base (retrieval and response generation).
Parameter clientRequestToken :
A unique, case-sensitive identifier to ensure that the API request
completes no more than one time. If this token matches a previous request,
Amazon Bedrock ignores the request, but does not return an error. For more
information, see Ensuring
idempotency.
Parameter customerEncryptionKeyId :
Specify your customer managed encryption key Amazon Resource Name (ARN)
that will be used to encrypt your evaluation job.
Parameter jobDescription :
A description of the evaluation job.
Parameter jobTags :
Tags to attach to the model evaluation job.
Implementation
Future<CreateEvaluationJobResponse> createEvaluationJob({
required EvaluationConfig evaluationConfig,
required EvaluationInferenceConfig inferenceConfig,
required String jobName,
required EvaluationOutputDataConfig outputDataConfig,
required String roleArn,
ApplicationType? applicationType,
String? clientRequestToken,
String? customerEncryptionKeyId,
String? jobDescription,
List<Tag>? jobTags,
}) async {
final $payload = <String, dynamic>{
'evaluationConfig': evaluationConfig,
'inferenceConfig': inferenceConfig,
'jobName': jobName,
'outputDataConfig': outputDataConfig,
'roleArn': roleArn,
if (applicationType != null) 'applicationType': applicationType.value,
'clientRequestToken': clientRequestToken ?? _s.generateIdempotencyToken(),
if (customerEncryptionKeyId != null)
'customerEncryptionKeyId': customerEncryptionKeyId,
if (jobDescription != null) 'jobDescription': jobDescription,
if (jobTags != null) 'jobTags': jobTags,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/evaluation-jobs',
exceptionFnMap: _exceptionFns,
);
return CreateEvaluationJobResponse.fromJson(response);
}