brendon-ai commited on
Commit
3471e03
·
verified ·
1 Parent(s): e3ad131

Update src/RAGSample.py

Browse files
Files changed (1) hide show
  1. 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 an assistant for question-answering tasks.
356
- Use the following documents to answer the question.
357
- If you don't know the answer, just say that you don't know.
358
- Use three sentences maximum and keep the answer concise:
359
- Question: {question}
360
- Documents: {documents}
 
 
 
 
 
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"],