dissorial / doc-chatbot

Document chatbot — multiple files, topics, chat windows and chat history. Powered by GPT.
813 stars 137 forks source link

Function request: Source Provide #24

Closed samsammax closed 1 year ago

samsammax commented 1 year ago

Is there any way to also provide the source file and when we click the source, it will bring us to the page that the bot mentioned?

dissorial commented 1 year ago

If you're running this locally and want to see the source files, you can uncomment this part in MessageList.tsx:

{/* <p className="mt-2">
  <b>Source:</b>{' '}
  {doc.metadata.source.match(/[^\\]*$/,)?.[0] ?? doc.metadata.source}
</p> */}

Howerver, this won't really work if you plan to deploy this to Vercel and use it there. That's because we don't store the files -- instead, they're uploaded to a /tmp directory on the server, which modifies the file names to something that doesn't convey much meaning. I suppose one could encode some extra metadata during the embedding process and then retrieve those when displaying file sources, but that feature is not in the pipeline right now.

Regarding your question about brining you to the relevant page that the bot mentioned -- that's not currently possible because: