This is a demonstration application that leverages the capabilities Azure Speech Service to enable users to talk with ChatGPT . This repository hosts the codebase, instructions, and resources needed to set up and run the application.
chatgpt-azure-speech-demo.mp4
- Use Azure Speech for ASR and TTS when talking with ChatGPT
To get started, follow these steps:
- Clone the repository:
git clone https://github.com/linjungz/chatgpt-azure-speech.git
- Change into the
chatgpt-azure-speech
directory:
cd chatgpt-azure-speech
- Install the required Python packages:
Create virtual environment:
python3 -m venv .venv
source .venv/bin/activate
Install depenancies:
pip install -r requirements.txt
- Obtain your Azure OpenAI API key, Endpoint and Deployment Name from the Azure Portal.
- Obtain your Azure Speech Key and Region from Azure Portal.
- Create
.env
in the root dir and set the environment variables in the file:
OPENAI_API_BASE=https://your-endpoint.openai.azure.com
OPENAI_API_KEY=your-key-here
OPENAI_DEPLOYMENT=your-gpt-deployment-name
OPENAI_API_VERSION=2023-07-01-preview
SPEECH_KEY=your-key-here
SPEECH_REGION=region
Here's where you can find the deployment names for GPT:
For supported openai version, you could check this link for more information.
Here's where you can find key and region:
This will initialize the application based on Streamlit
and open up the user interface in your default web browser.
$ streamlit run app.py --server.address '0.0.0.0'
Collecting usage statistics. To deactivate, set browser.gatherUsageStats to False.
You can now view your Streamlit app in your browser.
URL: http://0.0.0.0:8501```
- Reference blog: https://vahidmirjalili.com/blog/posts/chatgpt-voice-assistant/