Skip to main content

GPT chatbot using OpenAI API

Project description

Streamlit App

GitHub

Contributors Welcome Linting Tests codecov

pyRobBot: Talk and Chat with GPT LLMs

An interface to OpenAI's GPT large language models (LLMs) that implements:

  • A conventional chatbot that can be used either via web UI or terminal
  • A personal assistant that can actually interact with you by voice

The package is written in Python. The web chatbot UI is made with Streamlit.

See and try the demo web app on Streamlit!

Features

  • Text to speech and speech to text (rob voice)
    • Talk to the GPT assistant!
    • You can choose your preferred language (e.g., rob voice --lang pt-br)
  • Web UI
    • Add/remove conversations dynamically
    • Automatic/editable conversation summary title
  • Fully configurable
    • Support for multiple GPT LLMs
    • Control over the parameters passed to the OpenAI API, with (hopefully) sensible defaults
    • Ability to pass base directives to the LLM
      • E.g., to make it adopt a persona, but you decide which directived to pass
    • Dynamically modifiable AI parameters in each chat separately
      • No need to restart the chat
  • Autosave & retrieve chat history
  • Chat context handling using embeddings
  • Estimated API token usage and associated costs
  • OpenAI API key is never stored on disk

System Requirements

  • Python >= 3.9
  • A valid OpenAI API key
    • Set in the Web UI or through the environment variable OPENAI_API_KEY
  • Optionally, to enable voice chat, you also need:
    • PortAudio
      • Install on Ubuntu with sudo apt-get --assume-yes install portaudio19-dev python-all-dev
      • Install on CentOS/RHEL with sudo yum install portaudio portaudio-devel

Installation

This, naturally, assumes your systems fulfills all requirements.

Using pip

pip install pyrobbot

From source

pip install git+https://github.com/paulovcmedeiros/pyRobBot.git

Basic Usage

Upon succesfull installation, you should be able to run

rob [opts] SUBCOMMAND [subcommand_opts]

where [opts] and [subcommand_opts] denote optional command line arguments that apply, respectively, to rob in general and to SUBCOMMAND specifically.

Please run rob -h for information about the supported subcommands and general rob options. For info about specific subcommands and the options that apply to them only, please run rob SUBCOMMAND -h (note that the -h goes after the subcommand in this case).

Using the Web UI

rob

Chatting by Voice

rob voice

Running on the Terminal

rob .

Disclaimers

This project's main purpose is to serve as a learning exercise for me, as well as tool for experimenting with OpenAI API, GPT LLMs and text-to-voice/voice-to-text. It does not claim to be the best or more robust OpenAI-powered chatbot out there.

Having said this, this project does aim to provide a friendly user interface that is easy to use and configure. Feel free to open an issue or submit a pull request if you find a bug or have a suggestion.

Last but not least: this project is not affiliated with OpenAI in any way.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyrobbot-0.2.2.tar.gz (128.6 kB view details)

Uploaded Source

Built Distribution

pyrobbot-0.2.2-py3-none-any.whl (129.1 kB view details)

Uploaded Python 3

File details

Details for the file pyrobbot-0.2.2.tar.gz.

File metadata

  • Download URL: pyrobbot-0.2.2.tar.gz
  • Upload date:
  • Size: 128.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.9.16 Linux/5.14.0-284.30.1.el9_2.x86_64

File hashes

Hashes for pyrobbot-0.2.2.tar.gz
Algorithm Hash digest
SHA256 e706a539996e80d2f2868fa18a87bcce81ef9ab3a7121c3374688e94e4d9ba64
MD5 0d66e239ffc701b4cbf52abba106d9fd
BLAKE2b-256 a69fdd0ce97227c20c8281910b55883ea641b2473b0c8de518fd54ea071ef3ac

See more details on using hashes here.

File details

Details for the file pyrobbot-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: pyrobbot-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 129.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.9.16 Linux/5.14.0-284.30.1.el9_2.x86_64

File hashes

Hashes for pyrobbot-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a84c99d745300e339137954c4ad1dfed291b22690621c168956c62043b7c0541
MD5 08369d97583031409ef0022c72c31361
BLAKE2b-256 73d6b6f12f232f0e3111348ab9bb0b0922781988f5db4d4e650da5083b9866e6

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page