This is an alternative app (frontend and backend) for the ChatGPT + Enterprise data with Azure OpenAI and Cognitive Search project.
EnterPrompt - ChatGPT-powered bot which only uses your enterprise data
First, run the development server:
cd app
npm install
npm run dev
Open http://localhost:3000 with your browser to see the result.
There are 2 options available:
- running API from external server (hosted demo). You can only use the data that is already there.
- locally. Then you can upload your own data and create your own flavor of assistant (and deploy it if you wish). Running locally requires Azure account - you can get one with $200 credit for free here.
Just rename .env.external-api.local
to .env.local
and you are good to go. You will use https://enterprise.promptengineering.rocks/api as a backend proxied via Rapid API to deal with CORS.
-
Install Python 3+, Azure CLI, and Azure Functions Core Tools
-
In your Azure account create a new resource group with the following services (free or lowest tier is fine):
- Azure OpenAI Service with 2 model deployments: text-davinci-003 and gpt-35-turbo
- Azure Cognitive Search service. Free tier is fine.
- Form Recognizer. Free tier is fine.
- Azure Storage
- Azure Static Web Apps (if you want to deploy your app later). Free tier is fine.
- Prepare your data.
- Replace PDFs in the data folder with your own ones.
- Rename
scripts/.env.template
toscripts/.env
and enter services names and keys from the previous step there. - Run
./scripts/prepdocs.ps1
or./scripts/prepdocs.sh
(depending on your OS). This script will upload your PDFs to Azure Storage (split into pages) and create a new index in Azure Cognitive Search.
-
In
app/api/
folder renamelocal.settings.template.json
tolocal.settings.json
and fill in the values there by the names, endpoints, keys from the first step. -
Run
func start
inapp/api/
folder. This will start Azure Functions locally. -
You might also want to fine-tune prompts, quickstarts, and suggestions in JSON files located in
app/api/promptengineering
andapp/promptengineering
folders.
You are fully ready to interact with your own assistant now!
Maxim Salnikov. Feel free to contact me if you have any questions about the project, PWA, Web Push, etc.
This project is licensed under the terms of the MIT license.