create static method

ReportingConfiguration create(
  1. String storageRootPath,
  2. Iterable<Evaluator> evaluators, {
  3. ChatConfiguration? chatConfiguration,
  4. bool enableResponseCaching = false,
  5. Duration responseTimeToLive = const Duration(days: 14),
  6. Iterable<String>? cachingKeys,
  7. String? executionName,
  8. EvaluationMetricInterpretation? evaluationMetricInterpreter(
    1. EvaluationMetric
    )?,
  9. 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,
  );
}