A Telegram bot that integrates with OpenAI's ChatGPT to provide answers with typing status support
10K+
n3d1117 is back! Use this.
2023.3.2 Use official ChatGPT API
Customize the configuration by create a file named .env, then editing the settings as desired:
OPENAI_API_KEY="<YOUR_OPENAI_API_KEY>"
TELEGRAM_BOT_TOKEN="<YOUR_TELEGRAM_BOT_TOKEN>"
OPENAI_API_KEY: Your OpenAI api key. Steps to followTELEGRAM_BOT_TOKEN: Your Telegram bot's token, obtained using BotFather (see tutorial)Additional optional configuration values:
OPENAI_MODEL="<ANY_MODEL_AVAILABLE_FROM_OPENAI>" # Defaults to "gpt-3.5-turbo"
Create a file named docker-compose.yml(same directory as .env)
services:
chatgpt:
image: sheepgreen/chatgpt
container_name: chatgpt
volumes:
- ./.env:/home/appuser/.env
restart: always
Then run docker-compose up -d,that's all!
I found a great project which also based on n3d1117 and acheong08, thanks to his awesome job. You should use this instead of mine.
A branch for bot to interact with chatgpt official api ( comes with n3d1117 and acheong08 ), with showing typing status and streaming responses support
Customize the configuration by create a file named .env, then editing the settings as desired (choose only one method ):
//method 1
OPENAI_EMAIL="<YOUR_OPENAI_EMAIL>"
OPENAI_PASSWORD="<YOUR_OPENAI_PASSWORD>"
//method 2
OPENAI_SESSION_TOKEN="<YOUR_OPENAI_SESSION_TOKEN>"
//method 3
OPENAI_ACCESS_TOKEN="<YOUR_OPENAI_ACCESS_TOKEN>"
//below is a must
TELEGRAM_BOT_TOKEN="<YOUR_TELEGRAM_BOT_TOKEN>"
OPENAI_EMAIL,OPENAI_PASSWORD: Your OpenAI credentials (these are only sent to the OpenAI server to periodically refresh the access token and never shared). You can read more about it hereOPENAI_SESSION_TOKEN: Follow steps belowF12.__Secure-next-auth.session-token cookie in Application > Storage > Cookies > https://chat.openai.com.Cookie Value field.OPENAI_ACCESS_TOKEN: https://chat.openai.com/api/auth/sessionTELEGRAM_BOT_TOKEN: Your Telegram bot's token, obtained using BotFather (see tutorial)Additional optional (but recommended) configuration values:
ALLOWED_TELEGRAM_USER_IDS="<USER_ID_1>,<USER_ID_2>,..." # Defaults to "*"
PROXY="<HTTP/HTTPS_PROXY>" # E.g. "http://localhost:8080", defaults to none
USE_STREAM=false # Defaults to true
ALLOWED_TELEGRAM_USER_IDS: A comma-separated list of Telegram user IDs that are allowed to interact with the bot (use getidsbot to find your user ID). Important: by default, everyone is allowed (*)PROXY: Proxy to be used when authenticating with OpenAIUSE_STREAM: Streams the response as the bot types. Set to false to only answer once the response is fully generatedCreate a file named docker-compose.yml(same directory as .env)
services:
chatgpt:
image: sheepgreen/chatgpt:proxy
container_name: chatgpt
# environment:
# - CHATGPT_BASE_URL=YOUR_PROXY_ENDPOINT(by default uses the author's, may have problems sometimes)
volumes:
- ./.env:/home/appuser/.env
restart: always
Then run docker-compose up -d,that's all!
Content type
Image
Digest
sha256:8c8cf6a5b…
Size
102.3 MB
Last updated
about 3 years ago
docker pull sheepgreen/chatgpt