Skip to content

Commit

Permalink
Limit source documents sent via websockets to 5
Browse files Browse the repository at this point in the history
  • Loading branch information
bmquinn committed Aug 23, 2024
1 parent 5b0f811 commit d23561b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion chat/src/helpers/response.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def debug_response_passthrough(self):
def original_question_passthrough(self):
def get_and_send_original_question(docs):
source_documents = []
for doc in docs["context"]:
for doc in docs["context"][:5]:
doc.metadata = {key: extract_prompt_value(doc.metadata.get(key)) for key in self.config.attributes if key in doc.metadata}
source_document = doc.metadata.copy()
source_document["content"] = doc.page_content
Expand Down

0 comments on commit d23561b

Please sign in to comment.