NiborKowon commited on
Commit
dfdba51
·
verified ·
1 Parent(s): 88c2f0a

more specific prompt template

Browse files
Files changed (1) hide show
  1. rag.py +17 -6
rag.py CHANGED
@@ -137,18 +137,29 @@ def get_query_pipeline(
137
  "retriever", InMemoryEmbeddingRetriever(document_store=document_store, top_k=10)
138
  )
139
 
140
- # template for the PromptBuilder
141
  template = """
142
- Given the following information, answer the question. If the information is insufficient, answer with "Answer is not possible". Please do not provide any additional information and ask clarifying questions.
143
-
144
- Context:
 
 
 
 
 
 
 
145
  {% for document in documents %}
146
  {{ document.content }}
147
  {% endfor %}
148
-
149
- Question: {{ query }}?
 
 
 
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