Subha95 commited on
Commit
fb273e0
·
verified ·
1 Parent(s): 50c217a

Update chatbot_rag.py

Browse files
Files changed (1) hide show
  1. chatbot_rag.py +10 -11
chatbot_rag.py CHANGED
@@ -78,24 +78,23 @@ def build_qa():
78
 
79
  prompt = PromptTemplate(
80
  input_variables=["context", "question"],
81
- template="""
82
- Use the context to answer the question in short factual sentence.
83
- Answer ONLY in vert particular ONE short, plain sentence.
84
- Do not explain, speculate, or roleplay.
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
 
90
- Question:
91
- {question}
92
 
93
- Answer :
94
- """,
95
  )
96
 
97
 
98
 
 
99
  # 6. Helper functions
100
  def format_docs(docs):
101
  """Join document contents into a single string, skipping empty ones."""
 
78
 
79
  prompt = PromptTemplate(
80
  input_variables=["context", "question"],
81
+ template="""
82
+ Answer the question using the context below.
83
+ Respond in ONE short factual sentence only.
84
+ If you don't know, say "I don't know."
 
 
 
85
 
86
+ Context:
87
+ {context}
88
 
89
+ Question:
90
+ {question}
91
 
92
+ Answer:""",
 
93
  )
94
 
95
 
96
 
97
+
98
  # 6. Helper functions
99
  def format_docs(docs):
100
  """Join document contents into a single string, skipping empty ones."""