From da781320e46812a10fce132b287a41940a725bb5 Mon Sep 17 00:00:00 2001 From: ned Date: Thu, 8 Dec 2022 11:23:25 +0100 Subject: [PATCH] added proxy as optional configuration --- README.md | 4 +++- main.py | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 3469f1b1..8344b32f 100644 --- a/README.md +++ b/README.md @@ -46,9 +46,11 @@ TELEGRAM_BOT_TOKEN="" Additional optional (but recommended) configuration values: ```bash ALLOWED_TELEGRAM_USER_IDS=",,..." # Defaults to "*" -DEBUG=false # Defaults to TRUE, set to FALSE to disable debug mode +PROXY="" # E.g. "http://localhost:8080", defaults to none +DEBUG=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](https://t.me/getidsbot) to find your user ID). **Important**: by default, *everyone* is allowed (`*`) +* `PROXY`: Proxy to be used when authenticating with OpenAI * `DEBUG`: Enable debug logging for the [revChatGpt](https://github.com/acheong08/ChatGPT) package ### Run diff --git a/main.py b/main.py index c8e70d8b..93252117 100644 --- a/main.py +++ b/main.py @@ -21,6 +21,7 @@ def main(): chatgpt_config = { 'email': os.environ['OPENAI_EMAIL'], 'password': os.environ['OPENAI_PASSWORD'], + 'proxy': os.environ.get('PROXY', ''), } telegram_config = { 'token': os.environ['TELEGRAM_BOT_TOKEN'],