Slack LLM Filter Enabled by Default (#943)

This commit is contained in:
Yuhong Sun 2024-01-13 17:37:51 -08:00 committed by GitHub
parent 4ff3bee605
commit 22fb7c3352
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 2 deletions

View File

@ -223,8 +223,9 @@ def handle_message(
time_cutoff=None,
)
# Default True because no other ways to apply filters in Slack (no nice UI)
auto_detect_filters = (
persona.llm_filter_extraction if persona is not None else False
persona.llm_filter_extraction if persona is not None else True
)
if disable_auto_detect_filters:
auto_detect_filters = False

View File

@ -18,10 +18,14 @@ from danswer.search.models import SearchQuery
from danswer.search.models import SearchType
from danswer.secondary_llm_flows.source_filter import extract_source_filter
from danswer.secondary_llm_flows.time_filter import extract_time_filter
from danswer.utils.logger import setup_logger
from danswer.utils.threadpool_concurrency import FunctionCall
from danswer.utils.threadpool_concurrency import run_functions_in_parallel
logger = setup_logger()
def retrieval_preprocessing(
query: str,
retrieval_details: RetrievalDetails,
@ -57,15 +61,19 @@ def retrieval_preprocessing(
auto_detect_time_filter = False
auto_detect_source_filter = False
elif retrieval_details.enable_auto_detect_filters is False:
logger.debug("Retrieval details disables auto detect filters")
auto_detect_time_filter = False
auto_detect_source_filter = False
elif persona.llm_filter_extraction is False:
logger.debug("Persona disables auto detect filters")
auto_detect_time_filter = False
auto_detect_source_filter = False
if time_filter is not None and persona.recency_bias != RecencyBiasSetting.AUTO:
auto_detect_time_filter = False
logger.debug("Not extract time filter - already provided")
if source_filter is not None:
logger.debug("Not extract source filter - already provided")
auto_detect_source_filter = False
# Based on the query figure out if we should apply any hard time filters /

View File

@ -53,9 +53,11 @@ startretries=5
startsecs=60
# Pushes all logs from the above programs to stdout
# No log rotation here, since it's stdout it's handled by the Docker container loglevel
# To be standard across all the services
[program:log-redirect-handler]
command=tail -qF /var/log/update.log /var/log/celery_worker.log /var/log/celery_worker_supervisor.log /var/log/celery_beat.log /var/log/celery_beat_supervisor.log /var/log/slack_bot_listener.log
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=52428800
stdout_logfile_maxbytes=0
redirect_stderr=true
autorestart=true