feat: bing支持自定义代理地址

This commit is contained in:
Soulter
2023-05-31 21:17:47 +08:00
parent 1aa4384ca3
commit 2a3bb068db
2 changed files with 6 additions and 2 deletions
+1 -1
View File
@@ -121,7 +121,7 @@ cnt_valid = 0
# 新版配置文件
cc.init_attributes(["qq_forward_threshold"], 200)
cc.init_attributes(["qq_welcome"], "欢迎加入本群!\n欢迎给https://github.com/Soulter/QQChannelChatGPT项目一个Star😊~\n输入help查看帮助~\n")
cc.init_attributes(["bing_proxy"], "")
def new_sub_thread(func, args=()):
thread = threading.Thread(target=func, args=args, daemon=True)
+5 -1
View File
@@ -3,6 +3,7 @@ from EdgeGPT import Chatbot, ConversationStyle
import json
import os
from util import general_utils as gu
from util.cmd_config import CmdConfig as cc
class ProviderRevEdgeGPT(Provider):
@@ -11,7 +12,10 @@ class ProviderRevEdgeGPT(Provider):
self.wait_stack = []
with open('./cookies.json', 'r') as f:
cookies = json.load(f)
self.bot = Chatbot(cookies=cookies)
proxy = cc.get("bing_proxy", None)
if proxy == "":
proxy = None
self.bot = Chatbot(cookies=cookies, proxy = proxy)
def is_busy(self):
return self.busy