DataBase
AI Processor
Simple tool that extracts information from an SQLite source using human language queries. The stack uses a NextJs
frontend and a Django
(API) for users management and OpenAI interface.
Download Sources: private repository, for access contact AppSeed
$ git clone https://github.com/app-generator/priv-ai-processor.git
$ cd priv-ai-processor
Django Backend
Edit backend/.env
and add you own OpenAI API KEY
.
$ cd backend # change DIR to the backend code
$ virtualenv env # create a new virtual environment
$ source env/bin/activate # activate the VENV
$ pip install -r requirements.txt # install modules
$ python manage.py makemigrations # migrate DB
$ python manage.py migrate # apply DB changes
$ python manage.py runserver # Start the development Server
The backend starts on Django's default address: http://localhost:8000
NextJS UI
$ cd frontend # change DIR to the frontend code
$ npm install -g next # Install NextJs globally
$ npm i # install dependencies
$ npm run dev # Start the development Next Server
Create a new user or authenticate using the default one:
- user :
test
- email :
[email protected]
- password :
pass
Add your own OPEN API Key
Access the settings page and save your OpenAI API key
Upload a new SQLite file
Navigate to the SQLite Uploads file and add a new file. Once uploaded, we can query start quering the database.
Query the information using OpenAI console
Here are some query samples:
List all tables registered in the database
List all products starting with the cheapest
Once another SQLite file is uploaded, we can query other specific questions.
Outside UI, we can query different sources like PDF files or distant APIs:
$ cd tools
$ virtualenv env # create a new virtual environment
$ source env/bin/activate # activate the VENV
$ pip install -r requirements.txt # install modules
$ vi .env # Save OpenAI KEY
$ python ai-over-api-meteo.py # Extract METEO information using distant API
$ python ai-over-pdf.py # Extract information from a local PDF file
DataBase
AI Processor - AI/ML Starter provideed AppSeed.