mirror of
https://github.com/zhayujie/chatgpt-on-wechat.git
synced 2026-07-21 22:27:13 +08:00
feat:add proxy option
This commit is contained in:
@@ -12,6 +12,7 @@ user_session = dict()
|
|||||||
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')
|
||||||
|
|
||||||
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": "http://127.0.0.1:10801",
|
||||||
"wechaty_puppet_service_token": "WECHATY PUPPET SERVICE TOKEN",
|
"wechaty_puppet_service_token": "WECHATY PUPPET SERVICE TOKEN",
|
||||||
"single_chat_prefix": ["bot", "@bot"],
|
"single_chat_prefix": ["bot", "@bot"],
|
||||||
"single_chat_reply_prefix": "[bot] ",
|
"single_chat_reply_prefix": "[bot] ",
|
||||||
|
|||||||
Reference in New Issue
Block a user