https://github.com/faizanf33/openprompt
Create personalized chat bots using flask
https://github.com/faizanf33/openprompt
chat-application chatbot flask flask-application openai
Last synced: 3 months ago
JSON representation
Create personalized chat bots using flask
- Host: GitHub
- URL: https://github.com/faizanf33/openprompt
- Owner: Faizanf33
- Created: 2023-11-29T02:12:55.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-11-29T04:38:30.000Z (over 2 years ago)
- Last Synced: 2025-02-22T23:17:05.736Z (over 1 year ago)
- Topics: chat-application, chatbot, flask, flask-application, openai
- Language: CSS
- Homepage: https://open-prompt.onrender.com/
- Size: 326 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Personalized Chat Bot Application
A custom chat bot application that can be used to create personalized chat bots for any purpose. The application is built using Python and Flask.
## Dependencies
- Python 3.9+
- Flask
- OPENAI API Key (set inside the .env file)
## Setup
- Copy the `.env.example` file to `.env`
- Fill in the all the variables
| Variable | Data |
| ----------------------- | ---------------------------------------------------- |
| `PORT` | Port to serve the API at |
| `OPENAI_API_KEY` | Connection string of the MongoDB database |
| `GPT_MODEL` | GPT model to use for generating the response |
| `GPT_TEMPERATURE` | Temperature to use for generating the response |
| `GPT_MAX_TOKENS` | Maximum number of tokens to generate |
| `GPT_FREQUENCY_PENALTY` | Frequency penalty to use for generating the response |
| `GPT_PRESENCE_PENALTY` | Presence penalty to use for generating the response |
| `UPLOAD_FOLDER` | Folder to store the chats |
After that the application can be started either in development or production mode.
### Extract the zip file
```bash
unzip chat_application.zip
```
### Go to the project folder
```bash
cd chat_app
```
### Create a virtual environment
```bash
python3 -m venv .venv
```
### Activate the virtual environment
```bash
source .venv/bin/activate # linux/macOS
```
```bash
.venv\Scripts\activate # windows
```
### Install the dependencies
```bash
pip install --upgrade pip wheel
pip install -r requirements.txt
```
### Set the environment variables
```bash
export FLASK_APP=app.py FLASK_ENV=development # linux/macOS
```
```bash
set FLASK_APP=app.py FLASK_ENV=development # windows
```
### Optional environment variables
```bash
export FLASK_DEBUG=1 # linux/macOS
```
```bash
set FLASK_DEBUG=1 # windows
```
### Run the application
```bash
flask run --host=0.0.0.0 --port=5000
```