chatGPTon Line Bot- Runs on
docker-compose - Published on
Docker Hub - Uses
Python3 DjangowithSQLite - Only the first response is processed each time
- Knowledge of setting up a
Line Bot- Reference: LINE Bot Tutorial
- Obtain an
OpenAIAPI KEY - Using
ngrokto build tunnel.
Linebot config path is located at src/config.json
{
"OPENAI_API": {
"openai_api_key": "ENTER YOUR OPENAPI KEY",
"model": "gpt-3.5-turbo",
"max_token": 1024,
"temperature": 0.8,
"timeout": 30
},
"LINE_CHANNEL_SECRET": "YOUR LINE SECRET",
"LINE_CHANNEL_ACCESS_TOKEN": "YOUR LINE ACCESS TOKEN"
}- "OPENAI_API" detal can watch Open AI Chat
openai_api_key: Your OpenAI keymodelmax_tokentemperaturetimeout: Timeout for each request
- "LINE_CHANNEL_SECRET"
- "LINE_CHANNEL_ACCESS_TOKEN"
All history session storage in
src/history.json.
Ngrok config at init/ngrok/ngrok.yml
# Enter you ngrok authtoken
authtoken: INPUT AUTHTOKEN- Clone the repository locally
- Install Docker and Docker Compose
- Set
config.jsoninsrc/config.jsonandngrok.ymlininit/ngrok/ngrok.yml - In
chatGPT-Linebotdirectory, rundocker-compose up -d - Linebot will be listening at
localhost:8000/chatGPT/callback - Using
curl -s localhost:4040/api/tunnelsget the ngrok tunnel address, or look atdocker compose upoutput. - Edit the Line Webhook URL
- Can have a continuous conversation.
- When you want to end a session, enter
#cleanto clean the history session.