A chatbot project that uses OpenAI, Google Cloud Speech-to-Text, and Text-to-Speech APIs.
Project description
CAN.01 Chatbot
This is a chatbot project developed in Python. The chatbot, named Ming, is a 40-year-old pilot from Hong Kong who speaks Cantonese fluently. Ming loves sharing travel experiences and stories, and is passionate about different cultures and foods.
Features
- Real-time speech recognition using Google Cloud Speech-to-Text
- Generates responses using OpenAI's GPT-3.5 model
- Converts text responses to Cantonese speech using Google Cloud Text-to-Speech
- Continuous listening and response capabilities
Requirements
- Python 3.6 or higher
- Google Cloud service account with Speech-to-Text and Text-to-Speech APIs enabled
- OpenAI API key
Installation
-
Clone the repository:
git clone https://github.com/yourusername/can_01_chatbot.git cd can_01_chatbot
-
Create and activate a virtual environment:
python3 -m venv venv source venv/bin/activate
-
Install the dependencies:
pip install -r requirements.txt
-
Set up environment variables:
-
Set your OpenAI API key:
openai.api_key = 'your_openai_api_key'
-
Set the path to your Google Cloud service account key JSON file:
export GOOGLE_APPLICATION_CREDENTIALS="path/to/SA_Carefirst.json"
-
Usage
-
Run the chatbot:
python can_01_chatbot/can01.py
-
Interaction:
- The program will start listening for your speech input.
- Once it recognizes your speech, it will generate a response using the OpenAI GPT-3.5 model.
- The response will be converted to Cantonese speech and played back.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Authors
- Michelle - Initial work - YourGitHubProfile
Acknowledgements
- Special thanks to Contributor1 for their help.
Additional Information
- Google Cloud Speech-to-Text: Documentation
- Google Cloud Text-to-Speech: Documentation
- OpenAI GPT-3: Documentation
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for can_01_chatbot-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8c282d75adb323098340bc0dcf567f74192db0a9a82716c2e6267896fe3daab4 |
|
MD5 | 5243c8ffe1f0ec4ad0a3ed51e8da5af5 |
|
BLAKE2b-256 | 03a5abba88b8429834356dd3b46439ed1b50437615a093100fa8985a14403982 |