change of sub-question answer if no docs recovered

This commit is contained in:
joachim-danswer 2025-01-23 13:23:10 -08:00 committed by Evan Lohn
parent 71eafe04a8
commit 3b298e19bc
2 changed files with 5 additions and 5 deletions

View File

@ -22,7 +22,7 @@ from onyx.agents.agent_search.shared_graph_utils.prompts import (
from onyx.agents.agent_search.shared_graph_utils.prompts import (
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 parse_question_id
from onyx.chat.models import AgentAnswerPiece
@ -47,7 +47,7 @@ def answer_generation(
persona_prompt = get_persona_prompt(agent_search_config.search_request.persona)
if len(context_docs) == 0:
answer_str = UNKNOWN_ANSWER
answer_str = NO_RECOVERED_DOCS
dispatch_custom_event(
"sub_answers",
AgentAnswerPiece(

View File

@ -1,6 +1,6 @@
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"""
@ -48,7 +48,7 @@ BASE_RAG_PROMPT = (
question based on the context, say """
+ 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!
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:
- 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.
- If the information is empty or irrelevant, just say """
- If the information is irrelevant, just say """
+ f'"{UNKNOWN_ANSWER}"'
+ """.
- If the information is relevant but not fully conclusive, specify that the information is not conclusive and say why.