Giter Club home page Giter Club logo

smart-chatbot-ui's Introduction

Smart Chatbot UI

This repo is forked from chatbot-ui.

This repository is highly experimental, so please do not expect compatibility when performing updates.

  • Do not input personal information. conversation, prompts, folders are stored in mongodb.
  • streaming response is not working in vercel environment.
  • plugins are not working for vercel timeout limitation.

Additional Features

  • SSO Auth(Google, GitHub)
  • ChatGPT compatible plugins
  • Python Interpreter Plugin
  • Persitent storage(MongoDB)
  • IME support

Chatbot UI

Updates

Chatbot UI will be updated over time. Expect frequent improvements.

Recent updates:

  • Python Interpreter (5/8/23)
  • Multiple Users with MongoDB Support (4/19/23)
  • Plugins(ChatGPT compatible) (4/17/23)
  • SSO Auth(email pattern matching only) (4/15/23)
  • Prompt templates (3/27/23)
  • Regenerate & edit responses (3/25/23)
  • Folders (3/24/23)
  • Search chat content (3/23/23)
  • Stop message generation (3/22/23)
  • Import/Export chats (3/22/23)
  • Custom system prompt (3/21/23)
  • Error handling (3/20/23)
  • GPT-4 support (access required) (3/20/23)
  • Search conversations (3/19/23)
  • Code syntax highlighting (3/18/23)
  • Toggle sidebar (3/18/23)
  • Conversation naming (3/18/23)
  • GitHub flavored markdown (3/18/23)
  • Add OpenAI API key in app (3/18/23)
  • Markdown support (3/17/23)

Deploy

Docker

Setup enviroment variables:

cp .env.local.example .env.local
# specify OPENAI_API_KEY, MONGODB_URI, MONGO_INITDB_ROOT_USERNAME, MONGO_INITDB_ROOT_PASSWORD
vim .env.local

Run with docker-compose:

docker compose up -d

Running Locally

1. Clone Repo

git clone https://github.com/dotneet/smart-chatbot-ui.git

2. Install Dependencies

npm i

3. Provide OpenAI API Key

Create a .env.local file in the root of the repo with your OpenAI API Key:

cp .env.local.example .env.local
# Specify OPENAI_API_KEY
vim .env.local

You can set OPENAI_API_HOST where access to the official OpenAI host is restricted or unavailable, allowing users to configure an alternative host for their specific needs.

Additionally, if you have multiple OpenAI Organizations, you can set OPENAI_ORGANIZATION to specify one.

4. Run MongoDB

docker compose -f docker-compose.dev.yml up -d

5. Run App

npm run dev

6. Use It

You should be able to start chatting.

Configuration

When deploying the application, the following environment variables can be set:

Environment Variable Default value Description
OPENAI_API_KEY The default API key used for authentication with OpenAI
OPENAI_API_HOST https://api.openai.com The base url, for Azure use https://<endpoint>.openai.azure.com
OPENAI_API_TYPE openai The API type, options are openai or azure
OPENAI_API_VERSION 2023-03-15-preview Only applicable for Azure OpenAI
AZURE_DEPLOYMENT_ID Needed when Azure OpenAI, Ref Azure OpenAI API
OPENAI_ORGANIZATION Your OpenAI organization ID
DEFAULT_MODEL gpt-3.5-turbo The default model to use on new conversations, for Azure use gpt-35-turbo
NEXT_PUBLIC_DEFAULT_SYSTEM_PROMPT see here The default system prompt to use on new conversations
GOOGLE_API_KEY See Custom Search JSON API documentation
GOOGLE_CSE_ID See Custom Search JSON API documentation
MONGODB_URI See Official Document
MONGODB_DB chatui MongoDB database name
NEXTAUTH_ENABLED false Enable SSO authentication. set 'true' or 'false'
NEXTAUTH_EMAIL_PATTERN The email regex pattern granted access to chatbot-ui
NEXTAUTH_URL http://localhost:3000 NextAuth Settings. See Official Document
NEXTAUTH_SECRET NextAuth Settings. See Official Document
GITHUB_CLIENT_ID GitHub OAuth Client ID for NextAuth
GITHUB_CLIENT_SECRET GitHub OAuth Client Secret for NextAuth
GOOGLE_CLIENT_ID Google OAuth Client ID for NextAuth
GOOGLE_CLIENT_SECRET Google OAuth Client Secret for NextAuth

If you do not provide an OpenAI API key with OPENAI_API_KEY, users will have to provide their own key. If you don't have an OpenAI API key, you can get one here.

Plugin Settings

ChatGPT compatible plugin

You can add a ChatGPT compatible plugin to urls field in plugins.json.

Internal Tools

You can control the tools you want to use with the environment variable PLUGINS_INTERNAL.

Supported Internal Tools

  • wikipedia_search
  • google_search
  • python_interpreter

Python Interpreter

Recommended for use with GPT-4

To enable python interpreter, you need to specify codeapi endpoint to PYTHON_INTERPRETER_BACKEND in .env.local and add python_interpreter to PLUGINS_INTERNAL.

# ex.
PLUGINS_INTERNAL=wikipedia_search,google_search,python_interpreter
PYTHON_INTERPRETER_BACKEND=http://localhost:8080/api/run

Vercel

  • streaming response is not supported in vercel.
  • plugin executing fails because of the timeout limit is too short in free plan.

Contact

If you have any questions, feel free to reach out to me on Twitter.

smart-chatbot-ui's People

Contributors

dotneet avatar mckaywrigley avatar dependabot[bot] avatar thomasleveil avatar nauxliu avatar bcullman avatar syedmuzamilm avatar chanzhaoyu avatar gypsy1234 avatar dasunnimantha avatar alanpog avatar riande avatar matriq avatar spctechdev avatar ryanhex53 avatar oznav2 avatar itbm avatar hyena459 avatar adiestel avatar aweshchoudhary avatar liby avatar ch4r4f avatar ernestobarrera avatar jdban avatar huuphongnguyen avatar srsholmes avatar nahid18 avatar khairulhaaziq avatar llegomark avatar matias-casal 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.