GithubHelp home page GithubHelp logo

brayanjeshua / chatgpt-to-speech Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 12 KB

CHATGPT Text-to-Speech Application

JavaScript 100.00%
chatgpt elevenlabs elevenlabs-api express gpt-3 gpt-3-5-turbo gpt-4 text-to-audio text-to-speech text-to-speech-app text-to-speech-javascript texto-a-voz

chatgpt-to-speech's Introduction

🗣️ GPT-4 Text-to-Speech Application

This is an interactive application that uses the OpenAI API to generate responses from GPT-4, and then converts them to speech using the Eleven Labs API. 🎙️

🛠️ Prerequisites

You will need the following tools installed:

And you'll also need API keys for the following services:

🚀 Getting Started

Follow these steps to get the app up and running! 🏃‍♀️

1️⃣ Clone the Repository

Clone this repository to your local machine:

git clone https://github.com/brayanjeshua/chatgpt-to-speech.git
cd chatgpt-to-speech

2️⃣ Install Dependencies Install the necessary dependencies:

npm install

3️⃣ Configure Environment Variables Create a .env file in the project root and populate it with your API keys:

touch .env

Then, open the .env file and add the following, replacing your_key_here with your actual keys:

.env

OPENAI_API_KEY=your_key_here
ELEVEN_API_KEY=your_key_here
VOICE_ID=your_voice_id_here
CHATGPT_MODEL=your_model_here

4️⃣ Run the Application Start your application:

node server.js

The server is now running at http://localhost:3000 🎉

You can now send a POST request to http://localhost:3000/chat with a JSON body containing a 'prompt' key. The server will return an audio file containing the AI's response!

Additionally you can set the temperature and the modality

5️⃣ Example: You can use curl to test the API:

curl -X POST -H "Content-Type: application/json" -d '{"modality":"Be ironic and acid in a short response", "prompt":"Hello, world!", "temperature":0.9 }' http://localhost:3000/chat --output response.mp3

This command will download a response.mp3 file with the response from GPT-4 converted to speech! 🗣️🎶

chatgpt-to-speech's People

Contributors

brayanjeshua avatar

Stargazers

 avatar  avatar

Watchers

 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.