Skip to content

A Python Script that uses Cohere Language API and Elevenlabs Speech API to combine AI Chat and Speech.

License

Notifications You must be signed in to change notification settings

diluteoxygen/AI-Chat-with-Speech

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

AI Chat with Speech

This Python script combines the AI language model of Cohere and the AI speech API of Elevenlabs to generate speech from text input. The script uses the API of both technologies, so before running the script, you need to install the latest version of Python and pip. You also need to install the requests and cohere libraries.

Getting API Keys

Get all items

To access the Cohere and Elevenlabs APIs, you need to obtain API keys from both services:

  1. To get your Cohere API key, go to https://dashboard.cohere.ai/api-keys and sign up for an account if you haven't already done so. Once you're logged in, you can find your API key on the API Keys page.

  2. To get your Elevenlabs API key, go to https://beta.elevenlabs.io/speech-synthesis and sign up for an account if you haven't already done so. Once you're logged in, you can find your API key on the Speech Synthesis page.

Install dependencies

pip install cohere
pip install requests

Adding API Keys to the Program

To use the Cohere and Elevenlabs APIs in the program, you need to add your API keys to the main.py file. Open the file and look for the following lines:

API_KEY_COHERE = 'YOUR_COHERE_API_KEY'
API_KEY_ELEVEN = 'YOUR_ELEVENLABS_API_KEY'

Replace YOUR_COHERE_API_KEY and YOUR_ELEVENLABS_API_KEY with your actual API keys, respectively.

Running the Script

To run the script, navigate to the project directory in a terminal or command prompt and type:

python main.py

The script will prompt you to enter a text input. Once you've entered your text, the script will generate speech using the Cohere and Elevenlabs APIs and play the speech for you.

Demo

AI.Test.mp4

About

A Python Script that uses Cohere Language API and Elevenlabs Speech API to combine AI Chat and Speech.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages