Allowing users to set Search Settings (#2106)

This commit is contained in:
Yuhong Sun
2024-08-10 20:48:58 -07:00
committed by GitHub
parent 7358ece008
commit d60fb15ad3
30 changed files with 281 additions and 115 deletions

View File

@@ -4,6 +4,7 @@ from danswer.configs.constants import DocumentSource
from danswer.search.enums import LLMEvaluationType
from danswer.search.enums import SearchType
from danswer.search.models import ChunkContext
from danswer.search.models import RerankingDetails
from danswer.search.models import RetrievalDetails
from danswer.server.manage.models import StandardAnswer
@@ -23,8 +24,8 @@ class DocumentSearchRequest(ChunkContext):
retrieval_options: RetrievalDetails
recency_bias_multiplier: float = 1.0
evaluation_type: LLMEvaluationType
# This is to forcibly skip (or run) the step, if None it uses the system defaults
skip_rerank: bool | None = None
# None to use system defaults for reranking
rerank_settings: RerankingDetails | None = None
class BasicCreateChatMessageRequest(ChunkContext):

View File

@@ -63,7 +63,7 @@ def handle_search_request(
persona=None, # For simplicity, default settings should be good for this search
offset=search_request.retrieval_options.offset,
limit=search_request.retrieval_options.limit,
skip_rerank=search_request.skip_rerank,
rerank_settings=search_request.rerank_settings,
evaluation_type=search_request.evaluation_type,
chunks_above=search_request.chunks_above,
chunks_below=search_request.chunks_below,