Skip to content

Commit

Permalink
hotfix source doc data
Browse files Browse the repository at this point in the history
  • Loading branch information
dartpain committed Dec 22, 2023
1 parent 3da2a00 commit 015bc7c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions application/api/answer/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,10 @@ def complete_stream(question, docsearch, chat_history, api_key, prompt_id, conve
source_log_docs = []
for doc in docs:
if doc.metadata:
data = json.dumps({"type": "source", "doc": doc.page_content, "metadata": doc.metadata})
data = json.dumps({"type": "source", "doc": doc.page_content[:10], "metadata": doc.metadata})
source_log_docs.append({"title": doc.metadata['title'].split('/')[-1], "text": doc.page_content})
else:
data = json.dumps({"type": "source", "doc": doc.page_content})
data = json.dumps({"type": "source", "doc": doc.page_content[:10]})
source_log_docs.append({"title": doc.page_content, "text": doc.page_content})
yield f"data:{data}\n\n"

Expand Down

2 comments on commit 015bc7c

@vercel
Copy link

@vercel vercel bot commented on 015bc7c Dec 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

docs-gpt – ./frontend

docs-gpt-git-main-arc53.vercel.app
docs-gpt-arc53.vercel.app
docs-gpt-brown.vercel.app

@vercel
Copy link

@vercel vercel bot commented on 015bc7c Dec 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

nextra-docsgpt – ./docs

nextra-docsgpt-git-main-arc53.vercel.app
nextra-docsgpt-arc53.vercel.app
docs.docsgpt.co.uk
nextra-docsgpt.vercel.app

Please sign in to comment.