mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-04-08 11:58:34 +02:00
Reenable force search (#1531)
This commit is contained in:
parent
d2b58bdb40
commit
44d57f1b53
@ -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}
|
||||
|
@ -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"
|
||||
|
@ -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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user