Browse Source

Merge pull request #330 from alin299/master

feat:add proxy option
master
zhayujie GitHub 1 year ago
parent
commit
7be9e7d0a8
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 0 deletions
  1. +1
    -0
      bot/chatgpt/chat_gpt_bot.py
  2. +1
    -0
      config-template.json

+ 1
- 0
bot/chatgpt/chat_gpt_bot.py View File

@@ -12,6 +12,7 @@ user_session = dict()
class ChatGPTBot(Bot):
def __init__(self):
openai.api_key = conf().get('open_ai_api_key')
openai.proxy = conf().get('proxy')

def reply(self, query, context=None):
# acquire reply content


+ 1
- 0
config-template.json View File

@@ -1,5 +1,6 @@
{
"open_ai_api_key": "YOUR API KEY",
"proxy": "http://127.0.0.1:10801",
"wechaty_puppet_service_token": "WECHATY PUPPET SERVICE TOKEN",
"single_chat_prefix": ["bot", "@bot"],
"single_chat_reply_prefix": "[bot] ",


Loading…
Cancel
Save