diff options
author | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2024-06-18 01:37:32 +0200 |
---|---|---|
committer | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2024-06-18 01:37:32 +0200 |
commit | b1ff0c55422d7b0af2c379679b8721014ef36926 (patch) | |
tree | 52aa88b2a8a0bba07f968c6ae24c002ce2d44226 /rag/retriever/rerank/abstract.py | |
parent | b8c6a78f70d84f3360461aa91864e8538569d450 (diff) |
Wip rewrite
Diffstat (limited to 'rag/retriever/rerank/abstract.py')
-rw-r--r-- | rag/retriever/rerank/abstract.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/rag/retriever/rerank/abstract.py b/rag/retriever/rerank/abstract.py index b96b70a..f32ee77 100644 --- a/rag/retriever/rerank/abstract.py +++ b/rag/retriever/rerank/abstract.py @@ -1,6 +1,8 @@ from abc import abstractmethod +from typing import List -from rag.generator.prompt import Prompt +from rag.memory import Message +from rag.retriever.vector import Document class AbstractReranker(type): @@ -13,5 +15,9 @@ class AbstractReranker(type): return cls._instances[cls] @abstractmethod - def rank(self, prompt: Prompt) -> Prompt: - return prompt + def rerank_documents(self, query: str, documents: List[Document]) -> List[Document]: + pass + + @abstractmethod + def rerank_messages(self, query: str, messages: List[Message]) -> List[Message]: + pass |