Code Monkey home page Code Monkey logo

python-voice-chat-with-chatgpt-cli's Introduction

Python Command Line Voice Chat with OpenAI ChatGPT

ChatGPT is a Python script that uses the OpenAI API that allows you to converse with chatgpt (OpenAI) using your voice This script can be used to create chatbots or conversational agents for a variety of purposes.

Readme.md

Hi, guys! ๐Ÿ‘‹

Welcome to ChatGPT on the command line used with API!

This project, "Python-Voice-Chat-with-ChatGPT-CLI" allows you to converse with chatgpt (OpenAI) using your voice, utilizes the OpenAI GPT-3 model and speech recognition to facilitate a chat interaction between users and a bot through voice input. By leveraging the microphone and computer capabilities, users can engage in conversations with the bot, with the dialogue history logged into a text file. The bot's responses are also audibly communicated using Pyttsx3.

PowerShell

GitHub last commit GitHub issues

Languages

Python

OS

Linux Windows


I'm Rangersmyth (internet name), and I'm currently learning Python and Bash coding.


๐Ÿง About:

This script uses the OpenAI GPT-3 model and speech recognition to generate a chat between the user and the bot using the microphone and computer to talk to each other. The conversation history is logged to a text file, and the bot's responses are spoken aloud using Pyttsx3.

๐Ÿ” GPT-3 Voice Chat

This script uses the OpenAI GPT-3 model and speech recognition to generate a chat between the user and the bot using the microphone and computer to talk to each other. The conversation history is logged to a text file, and the bot's responses are spoken aloud using Pyttsx3.

๐Ÿ†˜ Installation and Usage

  1. Clone or download this repository. This will work for all platforms.
  2. Install the required modules by running pip install -r requirements.txt. ๐Ÿ’ก Just use the following module to install on either Windows or Linux. ๐Ÿ’ก The module SpeechRecognition for Windows and speech_recognition is for Linux
    ๐Ÿ’ก pip install PyAudio & pip install SpeechRecognition for Windows.
  3. Make sure you have an OpenAI API key. If you don't have one, go to https://beta.openai.com/signup/ to sign up for early access and get an API key.
  4. In the script, replace "YOUR_API_KEY" with your API key.
  5. Run the script using python gpt_voice_chat.py.
  6. A text file called gpt_voice.txt will be created once you have started the voice recognition script, this will save the conversation with timestamps.

๐Ÿ’ป Modules Requirements:

๐Ÿฅท Prerequisites:

๐Ÿ€ Signup to OpenAI:

Make sure you have an OpenAI API key. If you don't have one, go to https://beta.openai.com/signup/ to sign up for early access and get an API key.

  • The script requires the following modules: If any problem is encountered install manually $ pip install or pip3 install modulename.
  • speech_recognition is a Linux module and SpeechRecognition is for Windows.

๐Ÿ” Pip Modules to Install

pyttsx3
speech_recognition
openai
sounddevice
soundfile
SpeechRecognition
alive_progress
PyAduio

๐Ÿ› ๏ธ Improvements

  • Add error handling for cases where the mic or sound devices are not available.
  • Implement a GUI to make the chat more user-friendly.
  • Allow the user to choose which voice the bot should use.
  • Improve the accuracy of speech recognition by using a custom language model.
  • Add support for multiple languages.

๐Ÿ› ๏ธ Functions

๐Ÿค Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

๐Ÿ“œ License

This project is licensed under the MIT License.

python-voice-chat-with-chatgpt-cli's People

Contributors

davidtkeane avatar

Stargazers

 avatar  avatar

Watchers

 avatar  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.