ComponentDependencyAttribute
Attributes ยท AiDotNet.Attributes
Declares a dependency that a component requires from another component or interface.
Inheritance: Attribute โ ComponentDependencyAttribute
For Beginners
This tells the pipeline builder what other components this one needs. For example, a retriever might depend on an embedding model, or a reranker might depend on a retriever. The pipeline builder uses this information to validate composition.
How It Works
Usage:
Constructors
| Constructor | Summary |
|---|---|
ComponentDependencyAttribute(Type dependencyType) |
Initializes a new instance of the ComponentDependencyAttribute class. |
ComponentDependencyAttribute(Type dependencyType, string description) |
Initializes a new instance of the ComponentDependencyAttribute class. |
Properties
| Property | Summary |
|---|---|
Type DependencyType { get; } |
Gets the type (typically an interface) that this component depends on. |
bool Required { get; set; } |
Gets or sets whether this dependency is required (true) or optional (false). |
string Description { get; set; } |
Gets or sets a description of why this dependency is needed. |