Combine Cognitive Search, Bing Search, TTS, STT with ChatGPT to provide Q&A chatbot
This is a demo application build upon this Github repo.
Visit https://github.com/Azure-Samples/azure-search-openai-demo
- Python 3.10+
- Node.js 14+
- Azure CLI
- Azure Subscription
- Azure Cognitive Search
- Azure Bing Search Service
- Azure Speech Service
- Azure App Service
Install python libraries
pip install -r requirements.txtBuild front end
cd frontend
npm install
npm run buildaz loginaz group create --name <resource-group-name> --location <location>Create a new Azure Storage Account resource. You can use the Azure Portal or Azure CLI. The following example uses the Azure CLI.
az storage account create --name <storage-account-name> --resource-group <resource-group-name> --sku <sku> --location <location>Create a new Azure Cognitive Search resource. You can use the Azure Portal or Azure CLI. The following example uses the Azure CLI.
az search service create --name <search-service-name> --resource-group <resource-group-name> --sku <sku> --location <location>Note: You should change the cognitive search endpoint in app.py to match the endpoint of your cognitive search resource.
Create a new Azure Cognitive Search index. You can use the Azure Portal or Azure CLI. The following example uses the Azure CLI.
az search index create --service-name <search-service-name> --resource-group <resource-group-name> --name <index-name> --fields <fields>Create a new Azure Cognitive Search data source. You can use the Azure Portal or Azure CLI. The following example uses the Azure CLI.
az search datasource create --service-name <search-service-name> --resource-group <resource-group-name> --name <data-source-name> --type <data-source-type> --credentials <credentials> --container <container> --data-change-impact <data-change-impact> --data-deletion-impact <data-deletion-impact> --description <description> --data-format <data-format> --eTag <eTag> --name <name> --query <query> --schedule <schedule> --type <type>Create a new Azure Cognitive Search indexer. You can use the Azure Portal or Azure CLI. The following example uses the Azure CLI.
az search indexer create --service-name <search-service-name> --resource-group <resource-group-name> --name <indexer-name> --data-source-name <data-source-name> --target-index-name <index-name> --skillset-name <skillset-name>Create a new Azure Bing Search Service resource. You can use the Azure Portal or Azure CLI.
Create a new Azure Speech Service resource. You can use the Azure Portal or Azure CLI. The following example uses the Azure CLI.
az cognitiveservices account create --name <speech-service-name> --resource-group <resource-group-name> --kind <kind> --sku <sku> --location <location>Create a new Azure App Service Plan resource. You can use the Azure Portal or Azure CLI. The following example uses the Azure CLI.
az appservice plan create --name <app-service-plan-name> --resource-group <resource-group-name> --sku <sku> --location <location>Create a new Azure Web App resource. You can use the Azure Portal or Azure CLI. The following example uses the Azure CLI.
az webapp create --name <web-app-name> --resource-group <resource-group-name> --plan <app-service-plan-name>cd frontend
npm install
npm run build
cd ..
cd backend
python app.pyOpen Azure portal and navigate to your web app resource. Click on the Deployment Center and select GitHub as the source. Select the repository and branch you want to deploy. Click on Save and deploy. The web app will be deployed to Azure.
Note: before deploying to Azure, you should remove these two lines in app.py:
from dot_env import load_dotenv
load_dotenv()
