Coverage for src/app/ports/similarity_search_port.py: 100%
6 statements
« prev ^ index » next coverage.py v7.7.0, created at 2025-04-02 22:46 +0200
« prev ^ index » next coverage.py v7.7.0, created at 2025-04-02 22:46 +0200
1from abc import ABC, abstractmethod
2from models.context_model import ContextModel
3from models.question_model import QuestionModel
5class SimilaritySearchPort(ABC):
6 """
7 Interface for the similarity search port.
8 """
9 @abstractmethod
10 def similarity_search(self, question_model: QuestionModel) -> list[ContextModel]:
11 """
12 Perform a similarity search using the provided question model.
14 Args:
15 question_model (QuestionModel): The model containing the question to search for.
17 Returns:
18 list[ContextModel]: A list of context models that are similar to the question.
19 """