Configuration

This module contains functionality related to the the configuration module for augmentation.components.retrievers.auto.

Configuration

AutoRetrieverConfiguration

Bases: RetrieverConfiguration

Configuration for the Auto Retriever component.

The Auto Retriever automatically determines the most appropriate retrieval strategy based on the query content, using an LLM to analyze and extract relevant metadata from the query.

Source code in src/augmentation/components/retrievers/auto/configuration.py
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
class AutoRetrieverConfiguration(RetrieverConfiguration):
    """
    Configuration for the Auto Retriever component.

    The Auto Retriever automatically determines the most appropriate retrieval
    strategy based on the query content, using an LLM to analyze and extract
    relevant metadata from the query.
    """

    name: Literal[RetrieverName.AUTO] = Field(
        ..., description="The name of the retriever."
    )
    llm: Any = Field(
        ...,
        description="The LLM configuration used to extract metadata from the query.",
    )

    @field_validator("llm")
    @classmethod
    def _validate_llm(cls, value: Any, info: ValidationInfo) -> Any:
        """
        Validates the LLM configuration using the LLMConfigurationRegistry.

        This validator ensures that the provided LLM configuration is valid
        according to the registered LLM configuration classes.

        Args:
            value: The LLM configuration value to validate.
            info: ValidationInfo object containing context about the validation.

        Returns:
            The validated LLM configuration object.
        """
        return super()._validate(
            value,
            info=info,
            registry=LLMConfigurationRegistry,
        )