GithubHelp home page GithubHelp logo

bburgarella / flaskgpt Goto Github PK

View Code? Open in Web Editor NEW
12.0 1.0 3.0 1.62 MB

This is a simple Flask application that allows anyone to use the OpenAI ChatGPT API with a Graphical User Interface (GUI) built with PyWebview. This app uses SQLite to store user login credentials.

Python 56.58% Batchfile 0.11% CSS 19.76% HTML 23.56%

flaskgpt's Introduction

A Flask ChatGPT App with PyWebview GUI

Demo image

This is a simple Flask application that allows anyone to use the OpenAI ChatGPT API with a Graphical User Interface (GUI) built with PyWebview. This app uses SQLite to store user login credentials.

The release .exe was built using Bat2Exe

Dependencies

This app requires the following dependencies:

  • sqlite3
  • Flask
  • Werkzeug
  • PyWebview
  • openai

Installation

  1. Clone this repository: git clone https://github.com/BBurgarella/FlaskGPT.git
  2. Install the required dependencies by running pip install -r requirements.txt from the root directory.
  3. Register for an OpenAI API key and and create an environement variable named "OPENAI_API_KEY" with the key in it
  4. Run the app by executing python app.py from the command line.

Usage

To start the chatbot, run the following command:

python chatbot.py [agent_name]

Replace [agent_name] with the name of the agent you want the chatbot to use (optional). If no agent name is provided, the chatbot will use the default agent. Example:

python chatbot.py Funny

This will start the chatbot using the Funny example agent. If you want to use the default agent, simply run:

python chatbot.py

to customize agents or add your own, use json format as per the examples in the agent folder, your new agents should always be in this folder

  1. Upon starting the app, you will be prompted to create an account. Follow the instructions to create a new account. (this account is local and stored on your disk)
  2. After logging in, you will be directed to the chat interface. Type in your message and hit 'Send' to get a response from the OpenAI ChatGPT API.

-> if you are unfamiliar with python and on windows, you can download the latest release to directly access to the GUI through a .exe file

Known issues

  • if running on mac OC with conda, some user seems to experience the keyboard being captured by the terminal instead of the app window, this is a known issue from the PyWebView library Link to the issue the solution is to run: >>> conda install python.app and then run the app using >>> pythonw app.py

Future Improvements

  • Allow users to select from a systemprompt library
  • avoid having to re-create a username and password if using the compiled version

License

This project is licensed under the MIT License.

Copyright (c) 2023 Boris Burgarella

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

flaskgpt's People

Contributors

bburgarella avatar

Stargazers

 avatar Deeokay avatar  avatar Jonas Klein avatar  avatar Aliyan Anwar avatar  avatar Label avatar  avatar Little Chaos avatar  avatar mv avatar

Watchers

 avatar

flaskgpt's Issues

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.