BhanuPrakashSamoju commited on
Commit
bac0d19
·
1 Parent(s): 8e9d72d

CHECKING FOR CONTEXT

Browse files
Files changed (1) hide show
  1. Index.py +5 -0
Index.py CHANGED
@@ -220,6 +220,7 @@ def _search(query, extractor, question=None):
220
 
221
  # return {"question": question, "answer": llm_chain.run(question)}
222
  print(extractor([("answer", query, _prompt(question), False)]))
 
223
  return extractor([("answer", query, _prompt(question), False)])[0][1]
224
 
225
 
@@ -248,4 +249,8 @@ def rag(domain: str, question: str):
248
  # else:
249
  print("before doing Q&A")
250
  answer = _search(question, extractor)
 
 
 
 
251
  return {"question": question, "answer": answer}
 
220
 
221
  # return {"question": question, "answer": llm_chain.run(question)}
222
  print(extractor([("answer", query, _prompt(question), False)]))
223
+
224
  return extractor([("answer", query, _prompt(question), False)])[0][1]
225
 
226
 
 
249
  # else:
250
  print("before doing Q&A")
251
  answer = _search(question, extractor)
252
+ text = _prompt(question)
253
+ text += "\n" + "\n".join(x["text"]for x in embeddings.search(question))
254
+ print(text)
255
+
256
  return {"question": question, "answer": answer}