A simple Telegram bot to interact with Open AI models
-
clone this repo via
git clone https://github.com/m0t9/tg-openai-binder
-
set your parameters in
.env
fileParameter Meaning API_KEY
Your OpenAI API key MODEL
Name of used OpenAI model PROXY
Optional. Proxy server for OpenAI queries processing TOKEN
Telegram bot token START_PLACEHOLDER
Message that bot will send as response to /start
commandPLACEHOLDER
Message that bot will show while request processing CLEAR_CONTEXT_ANSWER
Message that bot will send as response to /delete_context
commandCONTEXT_SIZE
Number of the last messages in the dialogue with bot that will be considered as context. High values affect RAM usage OPEN_AI_ERROR
Message that bot will send if something goes wrong during OpenAI query processing ALLOWED_IDS
List of Telegram users (separated by comma) IDs that are allowed to interact with bot ENABLE_RENDER
True or False. Exposes the web-server on :10000 (required for render.com free-tier web-service deployment) -
execute this command in repo root directory
docker-compose up -d --build
Command | Meaning |
---|---|
/start |
Start dialogue with bot. As response it sends START_PLACEHOLDER |
/delete_context |
Clears the dialogue context with user. Sends CLEAR_CONTEXT_ANSWER |
any other text | Will be considered as a query to OpenAI |