PipelineValidator

Helpers & Utilities · AiDotNet.RetrievalAugmentedGeneration.Configuration

Validates that a set of components forms a valid AI pipeline at runtime.

For Beginners

Think of this like a pre-flight checklist for your AI pipeline.

Before an airplane takes off, pilots check that all systems are working:

  • Engines? Check.
  • Navigation? Check.
  • Fuel? Check.

Similarly, before running a RAG pipeline, this validator checks:

  • Do you have a retriever? Check.
  • Do you have a generator? Check.
  • Are components in the right stages? Check.

If something is missing or misconfigured, you get a clear error message instead of a confusing crash at runtime.

How It Works

PipelineValidator provides static methods to check whether a collection of components can form a valid pipeline before execution. It catches common misconfigurations early with clear error messages, preventing cryptic runtime failures.

Methods

Method Summary
ValidationResult ValidatePipeline(IReadOnlyList<ValueTuple<ComponentType, PipelineStage>> components) Validates a generic pipeline has no conflicting or missing stages.
ValidationResult ValidateRAGConfiguration(bool hasRetriever, bool hasReranker, bool hasGenerator, bool hasQueryProcessors, bool hasDocumentStore, bool hasKnowledgeGraph, bool hasGraphStore) Validates the RAG components that have been configured on the builder.
ValidationResult ValidateRAGPipeline(IReadOnlyList<PipelineStage> stages, IReadOnlyList<ComponentType> componentTypes) Validates a RAG pipeline has all required stages and compatible components.