Skip to content

Commit

Permalink
adapt source in context
Browse files Browse the repository at this point in the history
  • Loading branch information
RobinFrasch committed May 11, 2024
1 parent 2d358d5 commit da69eb1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion apps/slackbot/ai_fcts.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,10 @@
def format_docs(docs):
context = ""
for index, doc in enumerate(docs):
context += f"Document Rank {index + 1}. Source: https://www.notion.so/{doc.metadata['page_id']}. Content: {doc.page_content}\n\n"
if doc.metadata['type'] == 'notion:':
context += f"Document Rank {index + 1}. Source: https://www.notion.so/{doc.metadata['page_id']}. Content: {doc.page_content}\n\n"
else:
context += f"Document Rank {index + 1}. Source: {doc.metadata['type']}. Content: {doc.page_content}\n\n"
return context

# create function to invoke the retrievalQA
Expand Down

0 comments on commit da69eb1

Please sign in to comment.