[IMPORTANT NOTE Azure OpenAI is currently in limited public preview. Please request access here https://aka.ms/oaiapply. You will need this access in order to create OpenAI resources and try out the last OpenAI portion of the notebook.]
This repository contains a Python Notebook that shows you how easy it is to deploy and use Azure OpenAI along with Azure Cognitive Search, Azure Storage and Visual Studio Code to make sense of large amounts of data.
Figure 1: End-to-end ArchitectureFollowing are detailed step by step instructions to setup an environment to try out this solution notebook for yourself:
I Setup the Azure Developer Environment using azd up
- Install Azure Developer CLI
- Open VSCode. Create an empty folder and open this folder in VSCode using Open Folder. Install the extension for GitHub
- In the VSCode Terminal run
azd up --template summarization-python-openai
[NOTE: OpenAI creation will fail if your Azure subscription is not yet whitelisted or if it has more than the number of OpenAI instances allowed per your quota]
- Copy the resource group (rg*) and storage account (st*) names somewhere. You will need them later.
- Ctrl-Shift-P, then select Python: Create Environment (see here for more guidance Using Python Environments in Visual Studio Code). Pick venv and the Python interpreter. Wait for the environment to get created, this will also take a while (see the bottom right for status)
II Configure Notebook
- Open the qbs_end_to_end.ipynb notebook file in the src folder. Change the environment to the above .venv (top right hand corner, might say base or Select Kernel or Python <version>).
- Run the cells in the notebook to setup the enviroment completing the step where the dataset is uploaded into Storage.
IIa [KNOWN ISSUE. THIS SECTION WILL BE AUTOMATED POST GA VIA THE SDK] Configure Cognitive Search Preview
- Go to the Search Service under the rg* resource group. Select Keys and check Role-based access control. Return to Search Service page. Click Import data and fill in the settings as below
Data Source: Azure Blob Storage
Data Source Name: azureblob-index
Data to extract: Content and metadata
Parsing mode: JSON array
Connection string - Choose an existing connection - Storage Account (copied above) - Container (openaiblob)
- (Click Next then ...) Skip to Customize target index. Check the fields id/article/highlights making all 3 retrievable and the latter 2 searchable. Create indexer and Submit.
III Query based summarization
- Run cells in the notebook that use Cognitive Search
- [Optional] Run cells that use OpenAI (if you have access to the preview)
[Optional] Cleanup
- Go to rg* in https://portal.azure.com.
- [KNOWN ISSUE] Select the OpenAI Service under the rg* resource group. Click on Deploy (or Model Deployments on the left side of the page). Click on each deployed model and select delete. Wait for one deletion to complete before deleting the next one.
- Return to rg* page. Click Delete and fill in the name of the resource group and click delete.