cb1716pics commited on
Commit
c053f96
·
verified ·
1 Parent(s): 1d3e5ce

Upload generator.py

Browse files
Files changed (1) hide show
  1. generator.py +2 -1
generator.py CHANGED
@@ -9,7 +9,8 @@ def generate_response_from_document(query, retrieved_docs):
9
  if not retrieved_docs: # Check if no documents were retrieved
10
  return "I cannot answer the question due to insufficient information in the documents."
11
 
12
- context = " ".join([doc.page_content for doc in retrieved_docs]) # Now iterates over Document objects
 
13
  prompt = (
14
  "You are a highly intelligent assistant tasked with answering a question based strictly on the provided context. "
15
  f"Given Question: {query} \n\n"
 
9
  if not retrieved_docs: # Check if no documents were retrieved
10
  return "I cannot answer the question due to insufficient information in the documents."
11
 
12
+ # context = " ".join([doc.page_content for doc in retrieved_docs]) # Now iterates over Document objects
13
+ context = " ".join([doc for doc in retrieved_docs])
14
  prompt = (
15
  "You are a highly intelligent assistant tasked with answering a question based strictly on the provided context. "
16
  f"Given Question: {query} \n\n"