Spaces:
Sleeping
Sleeping
Update src/RAGSample.py
Browse files- src/RAGSample.py +11 -6
src/RAGSample.py
CHANGED
@@ -352,12 +352,17 @@ def setup_rag_chain() -> Runnable:
|
|
352 |
"""Sets up the RAG chain with a prompt template and an LLM."""
|
353 |
# Define the prompt template for the LLM
|
354 |
prompt = PromptTemplate(
|
355 |
-
template="""You are
|
356 |
-
|
357 |
-
|
358 |
-
Use
|
359 |
-
|
360 |
-
|
|
|
|
|
|
|
|
|
|
|
361 |
Answer:
|
362 |
""",
|
363 |
input_variables=["question", "documents"],
|
|
|
352 |
"""Sets up the RAG chain with a prompt template and an LLM."""
|
353 |
# Define the prompt template for the LLM
|
354 |
prompt = PromptTemplate(
|
355 |
+
template="""You are a knowledgeable medical information assistant providing answers based on verified medical documents and FAQs.
|
356 |
+
Instructions:
|
357 |
+
- Answer based solely on the provided documents - do not use external knowledge
|
358 |
+
- Use clear, patient-friendly language while maintaining medical accuracy
|
359 |
+
- If the documents don't contain sufficient information, state "I don't have enough information in the provided documents to answer this question"
|
360 |
+
- For serious symptoms or concerns, always recommend consulting healthcare professionals
|
361 |
+
- Keep responses concise (2-4 sentences maximum)
|
362 |
+
- This information is for educational purposes only
|
363 |
+
|
364 |
+
Question: {question}
|
365 |
+
Documents: {documents}
|
366 |
Answer:
|
367 |
""",
|
368 |
input_variables=["question", "documents"],
|