@@ -16,7 +16,9 @@ else: | |||||
class ChatGPTBot(Bot): | class ChatGPTBot(Bot): | ||||
def __init__(self): | def __init__(self): | ||||
openai.api_key = conf().get('open_ai_api_key') | 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): | def reply(self, query, context=None): | ||||
# acquire reply content | # acquire reply content | ||||
@@ -1,5 +1,6 @@ | |||||
{ | { | ||||
"open_ai_api_key": "YOUR API KEY", | "open_ai_api_key": "YOUR API KEY", | ||||
"proxy": "", | |||||
"single_chat_prefix": ["bot", "@bot"], | "single_chat_prefix": ["bot", "@bot"], | ||||
"single_chat_reply_prefix": "[bot] ", | "single_chat_reply_prefix": "[bot] ", | ||||
"group_chat_prefix": ["@bot"], | "group_chat_prefix": ["@bot"], | ||||