Azure-Samples / azure-search-openai-demo

A sample app for the Retrieval-Augmented Generation pattern running in Azure, using Azure AI Search for retrieval and Azure OpenAI large language models to power ChatGPT-style and Q&A experiences.
https://azure.microsoft.com/products/search
MIT License
5.95k stars 4.09k forks source link

Comparison between this sample app and the Azure OAI studio's default app sample #508

Closed pasindu-pr closed 1 year ago

pasindu-pr commented 1 year ago

Hi, This is just a general question than an issue. Currently, we are looking at a few approaches that we can take to work with our own data with Azure OpenAI for a customer demo. First, we took a look at this sample app repo which we can get from OpenAIStudio.

https://github.com/microsoft/sample-app-aoai-chatGPT

And then the sample that exists inside this repo. Inside the above-mentioned repo, the approach that the app has taken is really simpler than the approach that has been taken inside this repo's app. For the above-mentioned app, to use our own data we only need the Open ai studio, Blob storage instance, and a Cognitive Search instance. But in order to function the sample we have inside this repo we have to have a Form Recognizer resource as well. Therefore this app takes one additional resource and additional cost as well.

I would like to know the differences between this sample app and the app that exists in the above-mentioned repo. What are you doing differently in the application that exists in this repo?

pamelafox commented 1 year ago

@pasindu-pr The other repo is designed for use by customers using Azure OpenAI studio, though I also added azd support for folks who want to deploy it completely from scratch. When you are setting it up in the studio, then you can use the UI there to upload documents, and it takes care of the analysis (I presume, I've only used it from scratch). If you were to deploy this completely from scratch, then you would still need a Form Recognizer for processing the documents locally and indexing them.

So here's how I would describe the differences:

Hope that helps!

subrotomGitHub commented 1 year ago

@pamelafox Thanks for the explanation. Is there any flow you can provide , how this works. Like, I had opened a ticket with the support for the Azure Open AI studio playground and I was being told to add an indexer, so new data files can be updated. How does new data files gets picked up by the Model in this case?

pamelafox commented 1 year ago

@subrotomGitHub I'm afraid I do not know how the Azure OpenAI studio indexer works behind the scene, that's a better question for a support ticket. My expertise is with the open source code in this repository (which uses prepdocs.py).

Closing this issue since I've added this question as an FAQ to the repo README.

pasindu-pr commented 1 year ago

@pamelafox Thanks for clearing things up. Could you give us an explanation about one additional thing? This demo creates three model deployments in Azure OpenAI Studio: davinci, chat, and embedding. But on the Open AI default app, it only makes one model deployment. Could you explain how this app interacts with these three deployments?

pamelafox commented 1 year ago

This app only actually uses chat and embedding deployments, I just removed the no longer used davinci (as that's deprecated). The reason we use embedding is that this sample supports vector search, the other app does not yet support it.

pamelafox commented 1 year ago

You can look at chatreadretrieveread.py to see how this app calls OpenAI and Azure Cognitive Search, it makes a few calls and chains results together.