The is an AI Assistant powered by Azure Open AI. helps users have their queries on order status (from a database) or questions answered from knowledge based, using AI Search
This bot has been created using Bot Framework, it shows how to create a simple bot that accepts input from the user and echoes it back.
This Bot application showcases the following: - Function calling - Extract intent and entities and branch off into different systems for RAG - Calls AI Search or calls database query
It is based on version 1 of open ai library in python. Does not work with 0.28.1
towards the end of this page, refer to the steps that were to be performed to get this deployed to azure
This sample requires prerequisites in order to run.
- Run
pip install -r requirements.txt
to install all dependencies - Run
python app.py
Bot Framework Emulator is a desktop application that allows bot developers to test and debug their bots on localhost or running remotely through a tunnel.
- Install the Bot Framework Emulator version 4.3.0 or greater from here
- Launch Bot Framework Emulator
- Enter a Bot URL of
http://localhost:3978/api/messages
- Bot Framework Documentation
- Bot Basics
- Dialogs
- Gathering Input Using Prompts
- Activity processing
- Azure Bot Service Introduction
- Azure Bot Service Documentation
- Azure CLI
- Azure Portal
- Language Understanding using LUIS
- Channels and Bot Connector Service
Follow the steps that are documented already, to create an App Service plan, a Web app in it and an Azure Bot Service App. Get the AppID, generate a Secret. this needs to be added to the Config section in the VS Code Project
Steps to be performed in the Web App:
- In the Application settings, under configuration, add -> SCM_DO_BUILD_DURING_DEPLOYMENT, and set the value to true
- In the General Settings, add the start up script below (note that we need to install the ODBC Driver for SQL Sever)
#!/bin/bash
apt-get update
apt-get install -y unixodbc-dev
ACCEPT_EULA=Y apt-get install msodbcsql18
gunicorn --bind 0.0.0.0 --worker-class aiohttp.worker.GunicornWebWorker app:APP
In the VS Code project, the requirements.txt only required the following
openai==1.11.1 botbuilder-integration-aiohttp>=4.14.0 pyodbc
Used the ZIP file method and cli command
az webapp deployment source config-zip --resource-group "rpay-app-rg" --name "nlp2sql-bot-web" --src "nlp2sqlbot-app.zip"
In the Web app, permitted the following CORS
https://botservice.hosting.portal.azure.net
https://hosting.onecloud.azure-test.net