graph LR
rerankers_reranker_Reranker["rerankers.reranker.Reranker"]
rerankers_reranker__get_model_type["rerankers.reranker._get_model_type"]
rerankers_reranker__get_api_provider["rerankers.reranker._get_api_provider"]
rerankers_reranker__get_defaults["rerankers.reranker._get_defaults"]
rerankers_reranker_Reranker -- "Queries" --> rerankers_reranker__get_model_type
rerankers_reranker_Reranker -- "Queries" --> rerankers_reranker__get_api_provider
rerankers_reranker__get_model_type -- "Informs" --> rerankers_reranker__get_defaults
rerankers_reranker__get_defaults -- "Provides configuration to" --> rerankers_reranker_Reranker
The rerankers subsystem is centered around the Reranker component, which serves as the primary interface for all reranking operations. This component dynamically determines the appropriate reranking strategy by querying _get_model_type to identify the model type and _get_api_provider to ascertain any required external API services. The _get_model_type component, in turn, informs _get_defaults, allowing for the generation of context-specific default configurations. These tailored defaults are then provided back to the Reranker, enabling it to initialize and execute the correct reranking logic, abstracting the underlying complexities from the user.
This is the central entry point and the primary facade for the entire reranking library. It provides a unified rank() method, abstracting away the complexities of various underlying reranker implementations. It acts as a factory, dynamically selecting and instantiating the correct reranker strategy (e.g., CrossEncoder, API-based) based on configuration and identified model type.
Related Classes/Methods:
This internal helper function is responsible for identifying and returning the specific type of reranker model intended for use (e.g., CrossEncoder, T5, API-based). This determination is crucial for the Reranker component to select and instantiate the appropriate concrete reranker strategy.
Related Classes/Methods:
This internal helper function determines and returns the specific external API provider (e.g., Cohere, Jina, MixedBread) that should be utilized if the reranking operation involves an external service. It ensures the correct API client is identified for external reranking tasks.
Related Classes/Methods:
This internal helper function provides default configuration parameters for the reranker. It ensures sensible baseline settings are applied, potentially tailoring them based on the identified model type, thus simplifying user configuration.
Related Classes/Methods: