diff options
author | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2025-08-25 00:06:19 +0200 |
---|---|---|
committer | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2025-08-25 00:06:19 +0200 |
commit | 28a1f5d4eddab6eb7c9ca77346c6fa9608856dd5 (patch) | |
tree | 563ffd32f1a6f5705c1fbf6230d5d226fd0e0e48 /rag/generator/prompt.py | |
parent | 6afba9079eebe867ac4f1b6073b5277513e7491b (diff) |
Diffstat (limited to 'rag/generator/prompt.py')
-rw-r--r-- | rag/generator/prompt.py | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/rag/generator/prompt.py b/rag/generator/prompt.py index 75966e8..16ea447 100644 --- a/rag/generator/prompt.py +++ b/rag/generator/prompt.py @@ -4,10 +4,8 @@ from typing import List from rag.retriever.vector import Document ANSWER_INSTRUCTION = ( - "Do not attempt to answer the query without relevant context, and do not use " - "prior knowledge or training data!\n" - "If the context does not contain the answer or is empty, only reply that you " - "cannot answer the query given the context." + "Using the information contained in the context, give a comprehensive answer to the question.\n" + "If the answer cannot be deduced from the context, do not give an answer.\n\n" ) @@ -30,8 +28,7 @@ class Prompt: else: return ( "<|begin_of_text|><|start_header_id|>user<|end_header_id|>\n" - "Using the information contained in the context, give a comprehensive answer to the question.\n" - "If the answer cannot be deduced from the context, do not give an answer.\n\n" + f"{ANSWER_INSTRUCTION}" "Context:\n" "---\n" f"{self.__context(self.documents)}\n\n" |