Giter VIP home page Giter VIP logo

gpt-shell's Introduction

GPT-Shell

GPT-Shell is an OpenAI based chat-bot that is similar to OpenAI's ChatGPT (https://chat.openai.com/).

It allows users to converse with a virtual companion. It uses nodejs and typescript, as well as modern yarn, to create a seamless conversation experience.

bandicam.2022-12-13.06-34-59-804.mp4

Try it out

You can try the bot on the official Discord server:

Usage

Set up a discord bot and add it to your server.

Follow the setup instructions below.

To interact with GPT-Shell, users can:

  • Use the /chat-gpt command to start a conversation with the bot
  • Ping the bot in a channel it's in
  • Message the bot directly

The /chat-gpt command will start a new conversation thread, and whenever the user types something, the bot will respond.

The bot is able to handle multiple conversations at once, so you can start as many conversations as you like.

Setup

Prerequisites:

Nodejs: https://nodejs.org/en/ (18 or above) Yarn: https://nodejs.org/en/ (after installing nodejs)

To use GPT-Shell, you will need to:

  • Clone the project
  • Open the terminal in the project's folder
    • (in windows, right click somewhere in the folder and select "Open In Terminal")
    • if you see something about powershell, type cmd and hit enter, to go to the simpler command line terminal.
  • Run yarn install

You can also fork the replit:

https://replit.com/@Ephemeros/GPT-Shell

Set up the environment variables as described below.

Then to start a development environment, run yarn dev. To build and run, run yarn build and then yarn start.

Environment Variables

The following environment variables are required for GPT-Shell to work properly.

MongoDB:

  • MONGODB_URI: The MongoDB connection string.
    • Should look something like this: mongodb+srv://:..mongodb.net/?retryWrites=true&w=majority
  • DB_NAME: The name of the collection in MongoDB

Bot Token:

Commands:

  • COMMAND_NAME: The name of the chat-gpt command
  • API_KEY_COMMAND_NAME: The name of the chat-gpt-openai-api-key command (if you want users to add the bot to their server)

OpenAI API Key:

  • OPENAI_API_KEY: The API key for your OpenAI account

Discord Server Details:

  • MAIN_SERVER_ID: The Discord server where the bot lives
  • LOG_CHANNEL_ID: (Optional) The channel for log messages
  • MAIN_SERVER_INVITE: (Optional) The ideally non-expiring server invite link (if you want users to add the bot to their server)
  • USE_SAME_API_KEY_FOR_ALL: (Optional) When set to 'true', it will allow any server or user to use the bot without needing to provide their own API keys.

You can set the environment variables in any way you like, or place an .env.local file at the root of your project, next to package.json, that looks like this:

# MongoDB:
MONGODB_URI=
DB_NAME=

# Bot Token:
BOT_TOKEN=

# Commands:
COMMAND_NAME=chat-gpt
# API_KEY_COMMAND_NAME=chat-gpt-openai-api-key # enable this if you want the bot to be installed in other servers.

# OpenAI API Key:
OPENAI_API_KEY=

# Discord Server Details:
MAIN_SERVER_ID=
LOG_CHANNEL_ID=
MAIN_SERVER_INVITE=
USE_SAME_API_KEY_FOR_ALL=

Contributions

We welcome contributions to GPT-Shell. If you have an idea for a new feature or have found a bug, please open an issue on GitHub. We would also appreciate any sponsorships or donations.

You can sponsor us through our GitHub sponsor page here.

License

GPT-Shell is released under the MIT License.

gpt-shell's People

Contributors

firtoz avatar

Watchers

 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.