Postprocessors_configuration

This module contains functionality related to the the postprocessors_configuration module for augmentation.bootstrap.configuration.components.

Postprocessors_configuration

PostProcessorConfiguration

Bases: BaseConfiguration

Base configuration for post-processors.

Post-processors refine search results after initial retrieval to improve relevance and quality. Each post-processor implementation should inherit from this class and add its specific configuration parameters.

Source code in src/augmentation/bootstrap/configuration/components/postprocessors_configuration.py
19
20
21
22
23
24
25
26
27
28
29
class PostProcessorConfiguration(BaseConfiguration):
    """Base configuration for post-processors.

    Post-processors refine search results after initial retrieval to improve relevance and quality.
    Each post-processor implementation should inherit from this class and add its specific
    configuration parameters.
    """

    name: PostProcessorName = Field(
        ..., description="The name of the postprocessor."
    )

PostProcessorConfigurationRegistry

Bases: ConfigurationRegistry

Registry for post-processor configurations.

This registry maintains a collection of available post-processor configurations and provides methods for retrieving them based on the PostProcessorName.

Attributes:
  • _key_class (Type) –

    The enumeration class for post-processor names.

Source code in src/augmentation/bootstrap/configuration/components/postprocessors_configuration.py
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
class PostProcessorConfigurationRegistry(ConfigurationRegistry):
    """Registry for post-processor configurations.

    This registry maintains a collection of available post-processor configurations
    and provides methods for retrieving them based on the PostProcessorName.

    Attributes:
        _key_class: The enumeration class for post-processor names.
    """

    _key_class: Type = PostProcessorName

    @classmethod
    def get_union_type(self) -> List[PostProcessorConfiguration]:
        """Returns the union type of all registered post-processor configurations.

        This method is used for type validation and dynamic configuration loading,
        allowing the system to work with any of the registered post-processor types.

        Returns:
            List[PostProcessorConfiguration]: A type representing all available post-processor configurations.
        """
        return List[super().get_union_type()]

get_union_type() classmethod

Returns the union type of all registered post-processor configurations.

This method is used for type validation and dynamic configuration loading, allowing the system to work with any of the registered post-processor types.

Returns:
  • List[PostProcessorConfiguration]

    List[PostProcessorConfiguration]: A type representing all available post-processor configurations.

Source code in src/augmentation/bootstrap/configuration/components/postprocessors_configuration.py
44
45
46
47
48
49
50
51
52
53
54
@classmethod
def get_union_type(self) -> List[PostProcessorConfiguration]:
    """Returns the union type of all registered post-processor configurations.

    This method is used for type validation and dynamic configuration loading,
    allowing the system to work with any of the registered post-processor types.

    Returns:
        List[PostProcessorConfiguration]: A type representing all available post-processor configurations.
    """
    return List[super().get_union_type()]

PostProcessorName

Bases: str, Enum

Enumeration of supported post-processor names.

These identify the different post-processing options available for refining search results.

Source code in src/augmentation/bootstrap/configuration/components/postprocessors_configuration.py
10
11
12
13
14
15
16
class PostProcessorName(str, Enum):
    """Enumeration of supported post-processor names.

    These identify the different post-processing options available for refining search results.
    """

    COLBERT_RERANK = "colbert_reranker"