直接點選連結 加入 Line Bot 後使用
https://liff.line.me/1645278921-kWRPP32q/?accountId=728wsrjq
- 專案簡介 (Project Introduction)
- 功能 (Features)
- 安裝與執行 (Installation and Running)
- 環境變數 (Environment Variables)
- 使用 Docker (Using Docker)
- 授權 (License)
此專案是一個基於 LINE Messaging API 的 Line Bot,並整合了 OpenAI GPT-4 來處理用戶的對話內容。
This project is a Line Bot based on the LINE Messaging API, integrated with OpenAI GPT-4 to handle user conversations.
-
通過環境變數配置 OpenAI 和 LINE API 的金鑰
-
支援 Docker 容器化
-
OpenAI and LINE API keys are configured via environment variables.
-
Supports Docker containerization.
-
克隆此倉庫到本地:
Clone this repository to your local machine:
git clone https://github.com/tbdavid2019/line-bot-gpt.git cd line-bot-gpt
-
安裝相依套件:
Install dependencies:
npm install
-
複製並修改環境變數文件:
Copy and modify the environment variables file:
mv example.env .env # 然後打開 .env 文件,填入您的 LINE 和 OpenAI API 金鑰 # Then open the .env file and enter your LINE and OpenAI API keys
-
啟動應用程式:
Start the application:
node index.js
在 .env
文件中,您需要配置以下環境變數:
In the .env
file, you need to configure the following environment variables:
LINE_CHANNEL_ACCESS_TOKEN=your_line_channel_access_token
LINE_CHANNEL_SECRET=your_line_channel_secret
OPEN_AI_LINE_SECRET=your_openai_api_key
PORT=8111
-
您可以從 Docker Hub 拉取現成的映像:
You can pull the ready-to-use image from Docker Hub:
sudo docker pull tbdavid2019/line-bot-gpt:latest
-
在
.env
文件中,您需要配置以下環境變數: (可以 mv example.env .env)
In the .env
file, you need to configure the following environment variables:
LINE_CHANNEL_ACCESS_TOKEN=your_line_channel_access_token
LINE_CHANNEL_SECRET=your_line_channel_secret
OPEN_AI_LINE_SECRET=your_openai_api_key
PORT=8111
-
使用 Docker 啟動容器:
Run the Docker container:
sudo docker run -dp 8111:8111 --env-file .env tbdavid2019/line-bot-gpt:latest
本項目使用 MIT 許可證,詳細資訊請參閱 LICENSE 文件。
This project is licensed under the MIT License. For more details, see the LICENSE file.