Skip to content

A simple Python application that sends a user prompt to OpenAI's ChatGPT, retrieves the model's response, converts it into speech using AWS Polly, and plays the audio response.

Notifications You must be signed in to change notification settings

gaultierlecaillon/chatgpt-speech

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ChatGPT Audio Responder

A simple Python application that sends a user prompt to OpenAI's ChatGPT, retrieves the model's response, converts it into speech using AWS Polly, and plays the audio response.

Requirements

Dependencies

  • requests
  • boto3
  • pygame
  • python-dotenv

Setup & Installation

  1. Install Dependencies

    pip install -r requirements.txt
  2. Configure API Keys

    • Create a .env file in the project root.
    • Add your API keys:
      OPENAI_API_KEY=your_openai_api_key
      AWS_ACCESS_KEY=your_aws_access_key
      AWS_SECRET_KEY=your_aws_secret_key
      AWS_REGION=your_aws_region
      

Usage

  1. Run the Script
    python main.py
  2. Interact with the Bot
    • Enter your message when prompted.
    • Listen to the audio response from ChatGPT.
    • Type exit or quit to end the session.

Disclaimer

Ensure that you handle your API keys securely and abide by the usage policies of OpenAI and AWS.

License

MIT License. See LICENSE for more details.

About

A simple Python application that sends a user prompt to OpenAI's ChatGPT, retrieves the model's response, converts it into speech using AWS Polly, and plays the audio response.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages