This repository contains a Line chatbot application that leverages the OpenAI ChatGPT API to provide intelligent responses. The bot is designed to handle various user queries by integrating with multiple APIs and providing relevant responses.
-
Clone the repository:
git clone https://github.com/seiching/aicoachcrm.git cd aicoachcrm -
Install the required dependencies:
pip install -r requirements.txt
-
Create a
config.inifile in the root directory and add your configuration settings. An exampleconfig.inifile is provided below:[Line] CHANNEL_SECRET=your_channel_secret CHANNEL_ACCESS_TOKEN=your_channel_access_token [openai] API_KEY=your_openai_api_key [model] modelname=gpt-3.5-turbo-0125 [ngrok] NGROK_AUTH_TOKEN=your_ngrok_auth_token [google] key_file=your_google_key_filename
-
Update the
config.inifile with your actual credentials.
-
Run the application:
python app.py
-
Set up a tunnel using ngrok to expose your local server to the internet:
ngrok http 5000
-
Update your Line Developer Console with the ngrok URL to receive webhook events.
-
Ensure you have a Google Drive with a worksheet named
LLMWorksheet. The chatbot will read prompts from this worksheet to provide responses.
LICENSE: License file.README.md: This file.app.py: Main application script.config.ini: Configuration file.requirements.txt: Python dependencies.test_googleapi.py: Unit tests for Google API integration.test_linebot.py: Unit tests for Line bot functionality.test_ngrok.py: Unit tests for ngrok integration.test_openAI.py: Unit tests for OpenAI API integration.util.py: Utility functions used across the application.
Run the unit tests to ensure everything is working correctly.
This project is licensed under the MIT License - see the LICENSE file for details.
ShawnLee - @shawnlee103