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

A python package that uses OpenAI's GPT large language models (LLMs) to implement:

  • A fully configurable personal assistant that can speak and listen to you
  • An equally fully configurable text-based chatbot that can be used either via web UI or terminal

Features

  • Text to speech and speech to text
    • Talk to the GPT assistant and the assistant will talk back to you!
    • Choose your preferred language (e.g., rob --lang pt-br)
    • Choose your preferred Text-to-Speech (TTS) engine (e.g., rob --tts google)
    • Choose your preferred Speech-to-Text (STT) engine
      • Also between OpenAI and Google (default)
  • Web browser UI (made with Streamlit)
    • Add/remove conversations dynamically
    • Automatic/editable conversation summary title
  • Terminal UI
    • For a more "Wake up, Neo" experience
  • The chat will search the web and try to find the answers it does not have (e.g. current events)
  • 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
    • In the browser UI, you can even read the transcripts of your voice conversations with the AI
  • 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
  • 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
    • ffmpeg
      • Install on Ubuntu with sudo apt-get --assume-yes install ffmpeg
      • Install on CentOS/RHEL with sudo yum install ffmpeg

Installation

This, naturally, assumes your system 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).

Chatting by Voice (default)

rob

Using the Web UI

rob ui

Running on the Terminal

rob .

Disclaimers

This project's main purpose has been to serve as a learning exercise for me, as well as tool for experimenting with OpenAI API, GPT LLMs and text-to-speech/speech-to-text.

While it does not claim to be the best or more robust OpenAI-powered chatbot out there, it does aim to provide a friendly user interface that is easy to install, use and configure.

Feel free to open an issue or, even better, 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.6.0.tar.gz (138.3 kB view details)

Uploaded Source

Built Distribution

pyrobbot-0.6.0-py3-none-any.whl (139.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pyrobbot-0.6.0.tar.gz
  • Upload date:
  • Size: 138.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.9.18 Linux/5.14.0-362.18.1.el9_3.x86_64

File hashes

Hashes for pyrobbot-0.6.0.tar.gz
Algorithm Hash digest
SHA256 a10d281caf848900b85cd13fd4afd9d78f47f25e2e1f92f9c95685aaa198e1a0
MD5 bf73d4bf346e265cdcd551ef07c224ea
BLAKE2b-256 69c7d6d24e6d4bd70a57c76fef0729ddbf3f629a9ef0cee2352453a79e73f166

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyrobbot-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 139.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.9.18 Linux/5.14.0-362.18.1.el9_3.x86_64

File hashes

Hashes for pyrobbot-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 013f42a946716847e8b622fc46b300007b797e4775e1f1cd713b94233b775a65
MD5 6234d3e5c7f8638d15273853e3925a88
BLAKE2b-256 e5d3e6974ca3740b897033821642ec9d71d7f29a3ad45ab677bbc6f6597c866a

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