Coverage for src / qdrant_loader_mcp_server / config_reranking.py: 100%

7 statements  

« prev     ^ index     » next       coverage.py v7.13.5, created at 2026-03-18 04:51 +0000

1from pydantic import BaseModel, ConfigDict, Field, PositiveInt 

2 

3 

4class MCPReranking(BaseModel): 

5 

6 model_config = ConfigDict(extra='forbid') 

7 

8 enabled: bool = Field( 

9 default=True, 

10 description="Enable or disable reranking" 

11 ) 

12 model: str = Field( 

13 default="cross-encoder/ms-marco-MiniLM-L-12-v2", 

14 description="Reranking model to use", 

15 ) 

16 device: str | None = Field( 

17 default=None, 

18 description="Device to run the reranking model (auto-detects if not specified)", 

19 ) 

20 batch_size: PositiveInt = Field( 

21 default=32, 

22 description="Batch size for reranking model inference (must be >= 1)", 

23 )