From 44e5979a0300519f411061baa1420ecaf4fb19c1 Mon Sep 17 00:00:00 2001 From: zhayujie Date: Sun, 5 Mar 2023 01:18:46 +0800 Subject: [PATCH] docs: update README.md --- bot/chatgpt/chat_gpt_bot.py | 4 +++- config-template.json | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/bot/chatgpt/chat_gpt_bot.py b/bot/chatgpt/chat_gpt_bot.py index 279ca80..405499a 100644 --- a/bot/chatgpt/chat_gpt_bot.py +++ b/bot/chatgpt/chat_gpt_bot.py @@ -16,7 +16,9 @@ else: class ChatGPTBot(Bot): def __init__(self): openai.api_key = conf().get('open_ai_api_key') - openai.proxy = conf().get('proxy') + proxy = conf().get('proxy') + if proxy: + openai.proxy = proxy def reply(self, query, context=None): # acquire reply content diff --git a/config-template.json b/config-template.json index f83c344..fd6d46a 100644 --- a/config-template.json +++ b/config-template.json @@ -1,5 +1,6 @@ { "open_ai_api_key": "YOUR API KEY", + "proxy": "", "single_chat_prefix": ["bot", "@bot"], "single_chat_reply_prefix": "[bot] ", "group_chat_prefix": ["@bot"],