/ChatGptClone

ChatGptClone is a clone of OpenAI's ChatGPT virtual assistant, built using Python and the openai api

Primary LanguageCSS

install

  1. Install the necessary dependencies using this command
pip install -r requirements.txt
  1. Generate a self-signed SSL certificate and key pair
openssl req -x509 -newkey rsa:4096 -nodes -out cert.pem -keyout key.pem -days 365

Configuration

Server

  1. Obtain your openai api key from here
  2. Create a .env file in the root directory of your project.
  3. Inside the .env file, set the OPENAI_API_KEY environment variable to your API key using the KEY=VALUE syntax, like so:
OPENAI_API_KEY=<your_openai_api_key_here>
  1. Set the remaining MySQL environment variables in the .env file as follows:
MYSQL_USER=<your_mysql_username_here>
MYSQL_PASSWORD=<your_mysql_password_here>
MYSQL_HOST=<your_mysql_host_here>
MYSQL_DATABASE=<your_mysql_database_name_here>
  1. For Google authentication, obtain a client_id and client_secret by creating a new project in the Google Developers Console
  2. Set the GOOGLE_CLIENT_ID and GOOGLE_CLIENT_SECRET environment variables in the .env file, replacing the placeholder values with your own:
GOOGLE_CLIENT_ID=<your_google_client_id_here>
GOOGLE_CLIENT_SECRET=<your_google_client_secret_here>
  1. Save the .env file

run

python3 app.py or flask run --cert=adhoc

Tech used

  • openai API
  • Google Cloud Console
  • html
  • css
  • javascript
  • flask
  • mysql

credits

📝 License © CyberRide

This project is released under the Apache License 2.0 license. See LICENSE for details.