Coverage for src/qdrant_loader_mcp_server/search/enhanced/cdi/interfaces.py: 100%
14 statements
« prev ^ index » next coverage.py v7.10.6, created at 2025-09-08 06:06 +0000
« prev ^ index » next coverage.py v7.10.6, created at 2025-09-08 06:06 +0000
1from __future__ import annotations
3from collections.abc import Awaitable
4from typing import Protocol
6from ...components.search_result_models import HybridSearchResult
7from ...models import SearchResult
8from .models import (
9 ClusteringStrategy,
10 ComplementaryContent,
11 ConflictAnalysis,
12 DocumentCluster,
13 DocumentSimilarity,
14)
17class EntityExtractor(Protocol):
18 def extract(self, result: SearchResult) -> list[str]: ...
21class RelationExtractor(Protocol):
22 def extract(self, results: list[SearchResult]) -> list[tuple[str, str, str]]: ...
25class GraphBuilder(Protocol):
26 def build(self, results: list[SearchResult]) -> object: ...
29class Ranker(Protocol):
30 def rank(self, results: list[HybridSearchResult]) -> list[HybridSearchResult]: ...
33class Clusterer(Protocol):
34 def cluster(
35 self,
36 results: list[SearchResult],
37 strategy: ClusteringStrategy | None = None,
38 max_clusters: int | None = None,
39 min_cluster_size: int | None = None,
40 ) -> list[DocumentCluster]: ...
43class SimilarityComputer(Protocol):
44 def compute(self, a: SearchResult, b: SearchResult) -> DocumentSimilarity: ...
47class Recommender(Protocol):
48 def recommend(
49 self, target: SearchResult, pool: list[SearchResult]
50 ) -> ComplementaryContent: ...
53class ConflictDetector(Protocol):
54 def detect(
55 self, results: list[SearchResult]
56 ) -> ConflictAnalysis | Awaitable[ConflictAnalysis]: ...