diff --git a/libs/ktem/ktem/index/file/pipelines.py b/libs/ktem/ktem/index/file/pipelines.py index 9697904a5..076242693 100644 --- a/libs/ktem/ktem/index/file/pipelines.py +++ b/libs/ktem/ktem/index/file/pipelines.py @@ -30,7 +30,7 @@ from kotaemon.embeddings import BaseEmbeddings from kotaemon.indices import VectorIndexing, VectorRetrieval from kotaemon.indices.ingests.files import KH_DEFAULT_FILE_EXTRACTORS -from kotaemon.indices.rankings import BaseReranking, LLMReranking +from kotaemon.indices.rankings import BaseReranking, LLMReranking, CohereReranking from kotaemon.indices.splitters import BaseSplitter, TokenSplitter from .base import BaseFileIndexIndexing, BaseFileIndexRetriever @@ -245,10 +245,11 @@ def get_pipeline(cls, user_settings, index_settings, selected): ) ], retrieval_mode=user_settings["retrieval_mode"], + reranker=CohereReranking() ) if not user_settings["use_reranking"]: retriever.reranker = None # type: ignore - else: + elif isinstance(retriever.reranker, LLMReranking): retriever.reranker.llm = llms.get( user_settings["reranking_llm"], llms.get_default() ) diff --git a/libs/ktem/ktem/reasoning/simple.py b/libs/ktem/ktem/reasoning/simple.py index 150865a81..a8259fbc2 100644 --- a/libs/ktem/ktem/reasoning/simple.py +++ b/libs/ktem/ktem/reasoning/simple.py @@ -585,7 +585,7 @@ def prepare_citations(self, answer, docs) -> tuple[list[Document], list[Document Document( channel="info", content=Render.collapsible( - header=id2docs[id].metadata["file_name"], + header=f'{id2docs[id].metadata["file_name"]}- Relevance score: {id2docs[id].metadata.get("relevance_score")}', content=Render.table(text), open=True, ), @@ -612,7 +612,7 @@ def prepare_citations(self, answer, docs) -> tuple[list[Document], list[Document Document( channel="info", content=Render.collapsible( - header=doc.metadata["file_name"], + header=f'{doc.metadata["file_name"]}- Relevance score: {doc.metadata.get("relevance_score")}', content=Render.table(doc.text), open=True, ),