mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-07-28 13:53:28 +02:00
Introduce Time Filters (#610)
This commit is contained in:
@@ -8,11 +8,13 @@ from typing import TextIO
|
||||
import yaml
|
||||
from sqlalchemy.orm import Session
|
||||
|
||||
from danswer.access.access import get_acl_for_user
|
||||
from danswer.db.engine import get_sqlalchemy_engine
|
||||
from danswer.direct_qa.answer_question import answer_qa_query
|
||||
from danswer.direct_qa.models import LLMMetricsContainer
|
||||
from danswer.search.models import RerankMetricsContainer
|
||||
from danswer.search.models import RetrievalMetricsContainer
|
||||
from danswer.server.models import IndexFilters
|
||||
from danswer.server.models import QuestionRequest
|
||||
from danswer.utils.callbacks import MetricsHander
|
||||
|
||||
@@ -74,11 +76,18 @@ def get_answer_for_question(
|
||||
RerankMetricsContainer | None,
|
||||
LLMMetricsContainer | None,
|
||||
]:
|
||||
filters = IndexFilters(
|
||||
source_type=None,
|
||||
document_set=None,
|
||||
time_cutoff=None,
|
||||
access_control_list=list(get_acl_for_user(user=None)),
|
||||
)
|
||||
question = QuestionRequest(
|
||||
query=query,
|
||||
collection="danswer_index",
|
||||
use_keyword=False,
|
||||
filters=None,
|
||||
filters=filters,
|
||||
enable_auto_detect_filters=False,
|
||||
offset=None,
|
||||
)
|
||||
|
||||
|
Reference in New Issue
Block a user