Giter Club home page Giter Club logo

chat-wtf's Introduction

ChatWTF

This is a ChatGPT-like chatbot that uses the ChatGPT API. It was created for my YouTube channel. You can find the playlist of videos here.

Quick Start

  1. Clone the repository
  2. Add your OpenAI API key to settings.php (see settings.sample.php)
  3. Start a server
$ php -S localhost:8080
  1. Go to http://localhost:8080

Docker

$ sudo docker build -t chatwtf .
$ sudo docker run -p 8080:80 chatwtf

Note: If you get caught SIGWINCH, shutting down gracefully, add the -d flag to run it in the background.

Database

The chatbot uses PHP sessions to store the conversations by default. You can also use an SQL database. There is a SQLite dump and a MySQL dump in the db folder. You can install the SQLite version by running the install_sqlite.php script.

Database config has to be put into settings.php (see settings.sample.php). You need to also change storage_type to sql in the settings in order to use a database.

API key

You will need an API key from OpenAI to use the code. The API key must be added to the settings.sample.php file, which you will need to rename to settings.php.

Modify to your liking

You can change the system message in the settings to make the chatbot do what you want.

Support

If you like this code or use it in some useful way, consider buying me a coffee: https://www.buymeacoffee.com/unconv

chat-wtf's People

Contributors

unconv avatar debyx91 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.