create static method
ReportingConfiguration
create(
- String storageRootPath,
- Iterable<
Evaluator> evaluators, { - ChatConfiguration? chatConfiguration,
- bool enableResponseCaching = false,
- Duration responseTimeToLive = const Duration(days: 14),
- Iterable<
String> ? cachingKeys, - String? executionName,
- EvaluationMetricInterpretation? evaluationMetricInterpreter()?,
- Iterable<
String> ? tags,
Creates a ReportingConfiguration that persists ScenarioRunResults and
optionally caches AI responses on disk under storageRootPath.
Implementation
static ReportingConfiguration create(
String storageRootPath,
Iterable<Evaluator> evaluators, {
ChatConfiguration? chatConfiguration,
bool enableResponseCaching = false,
Duration responseTimeToLive = const Duration(days: 14),
Iterable<String>? cachingKeys,
String? executionName,
EvaluationMetricInterpretation? Function(EvaluationMetric)?
evaluationMetricInterpreter,
Iterable<String>? tags,
}) {
final rootPath = Directory(storageRootPath).absolute.path;
final resultStore = DiskBasedResultStore(rootPath);
final responseCacheProvider =
(chatConfiguration != null && enableResponseCaching)
? DiskBasedResponseCacheProvider(
rootPath,
timeToLive: responseTimeToLive,
)
: null;
return ReportingConfiguration(
evaluators,
resultStore,
chatConfiguration: chatConfiguration,
responseCacheProvider: responseCacheProvider,
cachingKeys: cachingKeys,
executionName: executionName,
evaluationMetricInterpreter: evaluationMetricInterpreter,
tags: tags,
);
}