startBatchEvaluation method
Starts a batch evaluation job that evaluates agent performance across multiple sessions. Batch evaluations pull agent traces from CloudWatch Logs or an existing online evaluation configuration and run specified evaluators and insights against them.
May throw AccessDeniedException.
May throw ConflictException.
May throw InternalServerException.
May throw ServiceQuotaExceededException.
May throw ThrottlingException.
May throw UnauthorizedException.
May throw ValidationException.
Parameter batchEvaluationName :
The name of the batch evaluation. Must be unique within your account.
Parameter dataSourceConfig :
The data source configuration that specifies where to pull agent session
traces from for evaluation.
Parameter clientToken :
A unique, case-sensitive identifier to ensure that the API request
completes no more than one time. If this token matches a previous request,
the service ignores the request, but does not return an error.
Parameter description :
The description of the batch evaluation.
Parameter evaluationMetadata :
Optional metadata for the evaluation, including session-specific ground
truth data and test scenario identifiers.
Parameter evaluators :
The list of evaluators to apply during the batch evaluation. Can include
both built-in evaluators and custom evaluators. Maximum of 10 evaluators.
Implementation
Future<StartBatchEvaluationResponse> startBatchEvaluation({
required String batchEvaluationName,
required DataSourceConfig dataSourceConfig,
String? clientToken,
String? description,
EvaluationMetadata? evaluationMetadata,
List<Evaluator>? evaluators,
}) async {
final $payload = <String, dynamic>{
'batchEvaluationName': batchEvaluationName,
'dataSourceConfig': dataSourceConfig,
'clientToken': clientToken ?? _s.generateIdempotencyToken(),
if (description != null) 'description': description,
if (evaluationMetadata != null) 'evaluationMetadata': evaluationMetadata,
if (evaluators != null) 'evaluators': evaluators,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/evaluations/batch-evaluate',
exceptionFnMap: _exceptionFns,
);
return StartBatchEvaluationResponse.fromJson(response);
}