Skip to main content

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

  1. Clone the repository:

    git clone https://github.com/yourusername/can_01_chatbot.git
    cd can_01_chatbot
    
  2. Create and activate a virtual environment:

    python3 -m venv venv
    source venv/bin/activate
    
  3. Install the dependencies:

    pip install -r requirements.txt
    
  4. 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

  1. Run the chatbot:

    python can_01_chatbot/can01.py
    
  2. 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

Acknowledgements

Additional Information

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

can_01_chatbot-0.1.0.tar.gz (5.6 kB view hashes)

Uploaded Source

Built Distribution

can_01_chatbot-0.1.0-py3-none-any.whl (6.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page