microsoft / sample-app-aoai-chatGPT

Sample code for a simple web chat experience through Azure OpenAI, including Azure OpenAI On Your Data.
MIT License
1.45k stars 2.16k forks source link

Render entire PDF's instead of single page in citation #811

Open VikashLalit opened 2 months ago

VikashLalit commented 2 months ago

Describe the bug When we open citation then currently it just shows content of some particular chunk but it will be better if we can see the entire doc .

To Reproduce Steps to reproduce the behavior:

  1. ask any question to bot
  2. Click on citation
  3. It will just show Content of particular chunk

Expected behavior It should render entire pdf data after clicking on citation.

Screenshots If applicable, add screenshots to help explain your problem.

Configuration: Please provide the following

Additional context Add any other context about the problem here.

VikashLalit commented 2 months ago

@sarah-widder @pamelafox It will be a great help if you can guide me for this one.

VikashLalit commented 2 months ago

@sarah-widder can you please guide me for above issue?

sarah-widder commented 2 months ago

Hi @VikashLalit, currently the chunks displayed are what is returned by the Azure OpenAI On Your Data API, which returns what it has retrieved from the search index. The index contains chunked data for best quality when using with the chat models. If you want to fetch the original documents, you can use the filename or url properties of the citation, and write your own logic to retrieve the source documents from blob storage to display.

VikashLalit commented 2 months ago

@sarah-widder I have added source url of confluence at the end of every document and also included in system message to add the source url of every reference document at the end of the answer...but its not working...so wanted your suggestions like what i should do so that model will include source confluence url in citation or at the end of answer.

v-hsalman commented 1 month ago

@VikashLalit Not sure if you're a developer or not, but if you want to implement that functionality then try going here which is a different repository, but also by microsoft. If you go here then you can see what the app would look like. Additionally, go here to find the differences between this repo and the one I linked earlier in my message.