Subha95 commited on
Commit
967d8a3
·
verified ·
1 Parent(s): ec49bb3

Update chatbot_rag.py

Browse files
Files changed (1) hide show
  1. chatbot_rag.py +14 -11
chatbot_rag.py CHANGED
@@ -78,19 +78,22 @@ def build_qa():
78
  # 4. Retriever
79
  retriever = vectorstore.as_retriever(search_kwargs={"k": 3})
80
 
81
- prompt = PromptTemplate(
82
- input_variables=["context", "question"],
83
- template="""
84
- You are a helpful assistant.
85
- Use the following context to answer the question.
86
- - If the answer is in the context, provide it in ONE short, plain sentence.
87
- - If not in the context, say: "I don't know."
88
 
89
- Context:
90
  {context}
91
- Question: {question}
92
- Answer:
93
- """,
 
 
 
94
  )
95
 
96
 
 
78
  # 4. Retriever
79
  retriever = vectorstore.as_retriever(search_kwargs={"k": 3})
80
 
81
+ prompt = PromptTemplate(
82
+ input_variables=["context", "question"],
83
+ template="""
84
+ Use the following context to answer the question. -
85
+ Answer from the docs - Answer in plain natural language. -
86
+ Do not include code, imports, functions, or explanations of how to implement code. -
87
+ If you don't know, just say "I don't know."
88
 
89
+ Context:
90
  {context}
91
+
92
+
93
+ Question:
94
+ {question}
95
+
96
+ Answer (one short sentence): """,
97
  )
98
 
99