mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-09 07:42:39 +02:00
fix: Fix rerank_documents node in sub_section_writer & qna_agent
This commit is contained in:
parent
3e1db2ac6b
commit
671984acbd
6 changed files with 2708 additions and 1923 deletions
|
|
@ -1,8 +1,8 @@
|
|||
from app.utils.reranker_service import RerankerService
|
||||
from .configuration import Configuration
|
||||
from langchain_core.runnables import RunnableConfig
|
||||
from .state import State
|
||||
from typing import Any, Dict
|
||||
from app.config import config as app_config
|
||||
from .prompts import get_qna_citation_system_prompt, get_qna_no_documents_system_prompt
|
||||
from langchain_core.messages import HumanMessage, SystemMessage
|
||||
from ..utils import (
|
||||
|
|
@ -35,7 +35,7 @@ async def rerank_documents(state: State, config: RunnableConfig) -> Dict[str, An
|
|||
}
|
||||
|
||||
# Get reranker service from app config
|
||||
reranker_service = getattr(app_config, "reranker_service", None)
|
||||
reranker_service = RerankerService.get_reranker_instance()
|
||||
|
||||
# Use documents as is if no reranker service is available
|
||||
reranked_docs = documents
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue