more specific prompt template
Browse files
rag.py
CHANGED
@@ -137,18 +137,29 @@ def get_query_pipeline(
|
|
137 |
"retriever", InMemoryEmbeddingRetriever(document_store=document_store, top_k=10)
|
138 |
)
|
139 |
|
140 |
-
#
|
141 |
template = """
|
142 |
-
|
143 |
-
|
144 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
145 |
{% for document in documents %}
|
146 |
{{ document.content }}
|
147 |
{% endfor %}
|
148 |
-
|
149 |
-
Question:
|
|
|
|
|
|
|
150 |
"""
|
151 |
|
|
|
152 |
# PromptBuilder
|
153 |
query_pipeline.add_component("prompt_builder", PromptBuilder(template=template))
|
154 |
|
|
|
137 |
"retriever", InMemoryEmbeddingRetriever(document_store=document_store, top_k=10)
|
138 |
)
|
139 |
|
140 |
+
# Template für den PromptBuilder
|
141 |
template = """
|
142 |
+
You are an expert on gender strategies and sustainable development. Your task is to provide detailed, well-structured, and informative answers based on the given context.
|
143 |
+
|
144 |
+
### Instructions:
|
145 |
+
- Provide a **comprehensive** and **well-structured** response.
|
146 |
+
- Include **specific details, key concepts, and relevant examples** where applicable.
|
147 |
+
- Explain **how and why** aspects of the Gender Strategy are relevant to the given question.
|
148 |
+
- If necessary, cite relevant sections from the provided context.
|
149 |
+
- If the available information is insufficient, state clearly: **"The available information does not provide a full answer."** However, summarize the most relevant points that can still help address the question.
|
150 |
+
|
151 |
+
### Context:
|
152 |
{% for document in documents %}
|
153 |
{{ document.content }}
|
154 |
{% endfor %}
|
155 |
+
|
156 |
+
### Question:
|
157 |
+
{{ query }}
|
158 |
+
|
159 |
+
### Answer:
|
160 |
"""
|
161 |
|
162 |
+
|
163 |
# PromptBuilder
|
164 |
query_pipeline.add_component("prompt_builder", PromptBuilder(template=template))
|
165 |
|