Reenable force search (#1531)

This commit is contained in:
Yuhong Sun 2024-05-28 11:36:02 -07:00 committed by GitHub
parent d2b58bdb40
commit 44d57f1b53
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 4 additions and 2 deletions

View File

@ -14,6 +14,7 @@ from danswer.chat.models import LLMRelevanceFilterResponse
from danswer.chat.models import QADocsResponse
from danswer.chat.models import StreamingError
from danswer.configs.chat_configs import CHAT_TARGET_CHUNK_PERCENTAGE
from danswer.configs.chat_configs import DISABLE_LLM_CHOOSE_SEARCH
from danswer.configs.chat_configs import MAX_CHUNKS_FED_TO_CHAT
from danswer.configs.constants import MessageType
from danswer.db.chat import attach_files_to_chat_message
@ -134,6 +135,7 @@ def _check_should_force_search(
and new_msg_req.retrieval_options.run_search == OptionalSearchSetting.ALWAYS
)
or new_msg_req.search_doc_ids
or DISABLE_LLM_CHOOSE_SEARCH
):
args = (
{"query": new_msg_req.query_override}

View File

@ -22,7 +22,7 @@ prompts:
I have not read or seen any of the documents and do not want to read them.
If there are no relevant documents, refer to the chat history and existing knowledge.
If there are no relevant documents, refer to the chat history and your internal knowledge.
# Inject a statement at the end of system prompt to inform the LLM of the current date/time
# If the DANSWER_DATETIME_REPLACEMENT is set, the date/time is inserted there instead
# Format looks like: "October 16, 2023 14:30"

View File

@ -39,7 +39,7 @@ def add_time_to_system_prompt(system_prompt: str) -> str:
if DANSWER_DATETIME_REPLACEMENT in system_prompt:
return system_prompt.replace(
DANSWER_DATETIME_REPLACEMENT,
get_current_llm_day_time(full_sentence=False, include_day_of_week=False),
get_current_llm_day_time(full_sentence=False, include_day_of_week=True),
)
if system_prompt: