Spaces:
Sleeping
Sleeping
Update chatbot_rag.py
Browse files- 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 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
|
| 89 |
-
Context:
|
| 90 |
{context}
|
| 91 |
-
|
| 92 |
-
|
| 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 |
|