Skip to content

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.

License

Notifications You must be signed in to change notification settings

davidtkeane/Python-Voice-Chat-with-ChatGPT-CLI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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.

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.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages