Pyrobbot: GPT chatbot Streamlit App. Supports voice interaction

Hello everyone :slight_smile:

Just sharing an app I built recently using Streamlit. It’s a simple chatbot that uses OpenAI API to get responses from GPT LLMs. It is written completely in Python.

You can try the demo app on Streamlit :slight_smile:

This is a multipage app where new pages are created (and removed) dynamically. Since I’ve seen in my searches that this is a topic people tend to be interested in when it comes to Streamlit, I though it could be useful for other if I shared my code.

Here are some of the features:

  • Speech recognition and text to voice: Interact with GPT by voice :slight_smile:
  • Web UI (streamlit)
    • 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
  • Terminal UI (for a more “Wake up, Neo” experience")
  • OpenAI API key is never stored on disk

This project’s main purpose is to serve as a learning exercise for me, as well as a tool for and experimenting with OpenAI API, GPT LLMs and Streamlit. While it does not claim to be the best or more robust OpenAI-powered chatbot out there, it does aim to have a friendly user interface and to be easy to use and configure.

The source code is available on GitHub too. Feel free to open issues or submit pull requests if you find a bug or have a suggestion.

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

Have fun :slight_smile:

1 Like

What an amazing app, @paulovcmedeiros! :hugs:

Thanks for sharing - I’ll share internally.

Best,
Charly

1 Like

Thanks, Charly! Great to hear :slight_smile:

Feel free to get in touch if you guys wish.

It has been a very pleasant experience to build an UI using Streamlit, by the way. I came across it by chance about two weeks ago after searching for “package to create python apps quickly” (or something along these lines), and it has indeed been a quite smooth process. Kudos to the team.

2 Likes

Update with new features, most prominently voice chat in the streamlit app .
Take a look at the project’s [GitHub page] for further information on installation and usage and have fun! :slight_smile:

PyRobBot is a python package that uses OpenAI’s GPT large language models (LLMs) to implement a fully configurable personal assistant that, on top of the traditional chatbot interface, can also speak and listen to you using AI-generated human-like voices.

Features

Features include, but are not limited to:

  • Voice Chat

    • Continuous voice input and output
    • No need to press a button: the assistant will keep listening until you stop talking
  • Internet access: The assistent will search the web to find the answers it doesn’t have in its training data

    • E.g. latest news, current events, weather forecasts, etc.
    • Powered by DuckDuckGo Search
  • Web browser user interface

    • See our demo app on Streamlit Community Cloud
    • Voice chat with:
    • A familiar text interface integrated with the voice chat, for those who prefer a traditional chatbot experience
      • Your voice prompts and the assistant’s voice replies are shown as text in the chat window
      • You may also send promts as text even when voice detection is enabled
    • Add/remove conversations dynamically
    • Automatic/editable conversation summary title
    • Autosave & retrieve chat history
      • Resume even the text & voice conversations started outside the web interface
  • Chat via terminal

    • For a more “Wake up, Neo” experience
  • Fully configurable

    • Large number of supported languages (e.g., rob --lang pt-br)
    • Support for multiple LLMs through the OpenAI API
    • Choose your preferred Text-to-Speech (TTS) and Speech-To-Text (STT) engines (google/openai)
    • 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
  • Chat context handling using embeddings

  • Estimated API token usage and associated costs

  • OpenAI API key is never stored on disk