mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-09-27 12:29:41 +02:00
change of sub-question answer if no docs recovered
This commit is contained in:
committed by
Evan Lohn
parent
71eafe04a8
commit
3b298e19bc
@@ -22,7 +22,7 @@ from onyx.agents.agent_search.shared_graph_utils.prompts import (
|
|||||||
from onyx.agents.agent_search.shared_graph_utils.prompts import (
|
from onyx.agents.agent_search.shared_graph_utils.prompts import (
|
||||||
ASSISTANT_SYSTEM_PROMPT_PERSONA,
|
ASSISTANT_SYSTEM_PROMPT_PERSONA,
|
||||||
)
|
)
|
||||||
from onyx.agents.agent_search.shared_graph_utils.prompts import UNKNOWN_ANSWER
|
from onyx.agents.agent_search.shared_graph_utils.prompts import NO_RECOVERED_DOCS
|
||||||
from onyx.agents.agent_search.shared_graph_utils.utils import get_persona_prompt
|
from onyx.agents.agent_search.shared_graph_utils.utils import get_persona_prompt
|
||||||
from onyx.agents.agent_search.shared_graph_utils.utils import parse_question_id
|
from onyx.agents.agent_search.shared_graph_utils.utils import parse_question_id
|
||||||
from onyx.chat.models import AgentAnswerPiece
|
from onyx.chat.models import AgentAnswerPiece
|
||||||
@@ -47,7 +47,7 @@ def answer_generation(
|
|||||||
persona_prompt = get_persona_prompt(agent_search_config.search_request.persona)
|
persona_prompt = get_persona_prompt(agent_search_config.search_request.persona)
|
||||||
|
|
||||||
if len(context_docs) == 0:
|
if len(context_docs) == 0:
|
||||||
answer_str = UNKNOWN_ANSWER
|
answer_str = NO_RECOVERED_DOCS
|
||||||
dispatch_custom_event(
|
dispatch_custom_event(
|
||||||
"sub_answers",
|
"sub_answers",
|
||||||
AgentAnswerPiece(
|
AgentAnswerPiece(
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
UNKNOWN_ANSWER = "I do not have enough information to answer this question."
|
UNKNOWN_ANSWER = "I do not have enough information to answer this question."
|
||||||
|
|
||||||
NO_RECOVERED_DOCS = "No relevant documents recovered"
|
NO_RECOVERED_DOCS = "No relevant information recovered"
|
||||||
|
|
||||||
DATE_PROMPT = """Today is {date}.\n\n"""
|
DATE_PROMPT = """Today is {date}.\n\n"""
|
||||||
|
|
||||||
@@ -48,7 +48,7 @@ BASE_RAG_PROMPT = (
|
|||||||
question based on the context, say """
|
question based on the context, say """
|
||||||
+ f'"{UNKNOWN_ANSWER}"'
|
+ f'"{UNKNOWN_ANSWER}"'
|
||||||
+ """.
|
+ """.
|
||||||
It is a matter of life and death that you do NOT use your internal knowledge, just the provided
|
It is a matter of life and death that you do NOT use your internal knowledge, just the provided`
|
||||||
information!
|
information!
|
||||||
|
|
||||||
Make sure that you keep all relevant information, specifically as it concerns to the ultimate goal.
|
Make sure that you keep all relevant information, specifically as it concerns to the ultimate goal.
|
||||||
@@ -660,7 +660,7 @@ The information provided below consists of:
|
|||||||
IMPORTANT RULES:
|
IMPORTANT RULES:
|
||||||
- If you cannot reliably answer the question solely using the provided information, say that you cannot reliably answer.
|
- If you cannot reliably answer the question solely using the provided information, say that you cannot reliably answer.
|
||||||
You may give some additional facts you learned, but do not try to invent an answer.
|
You may give some additional facts you learned, but do not try to invent an answer.
|
||||||
- If the information is empty or irrelevant, just say """
|
- If the information is irrelevant, just say """
|
||||||
+ f'"{UNKNOWN_ANSWER}"'
|
+ f'"{UNKNOWN_ANSWER}"'
|
||||||
+ """.
|
+ """.
|
||||||
- If the information is relevant but not fully conclusive, specify that the information is not conclusive and say why.
|
- If the information is relevant but not fully conclusive, specify that the information is not conclusive and say why.
|
||||||
|
Reference in New Issue
Block a user