A lightweight SaaS platform that leverages OpenAI to execute specialized tasks using prompt-engineered approaches.
Install with pip:
$ pip install -r requirements.txt
.
|────static/
| |────css/
| | |────main.css
| |────js/
| | |────script.js
| |────input.css
|────templates/
| |────index.html
|────main.py
|────requirements.txt
|────tailwind.config.js
from flask_pymongo import PyMongo
from dotenv import load_dotenv
import openai
import os
load_dotenv()
app = Flask(__name__ )
# Flask-PyMongo configuration
app.config["MONGO_URI"] = os.getenv('MONGO_URI')
app.secret_key = os.getenv('SECRET_KEY')
mongo = PyMongo(app)
openai.api_key = os.getenv('OPENAI_API_KEY')
# MongoDB
MONGO_URI="mongodb+srv://user:password@cluster-url/database-name?retryWrites=true&w=majority"
# Flask Secret Key
SECRET_KEY='your-secret-key'
# OpenAI API Key
OPENAI_API_KEY="your-openai-api-key"
# Flask App Config
FLASK_APP=run.py
# Flask Environment
FLASK_ENV=development # development/production
# Flask Debug Mode
# Set to 1 to enable debug mode, 0 to disable it
FLASK_DEBUG=1
SERVER_NAME: the name and port number of the server.
JSON_SORT_KEYS : By default Flask will serialize JSON objects in a way that the keys are ordered.
$ python main.py
In flask, Default port is 5000
AIServices document page: http://127.0.0.1:5000/api
** Run with gunicorn **
In aiservices.pro/
$ gunicorn -w 4 -b 127.0.0.1:5000 main:app
- -w : number of worker
- -b : Socket to bind
Offical Website
Tutorial


