From 2a3bb068dbc1e38e1724e980caedf81ea09fb63c Mon Sep 17 00:00:00 2001 From: Soulter <37870767+Soulter@users.noreply.github.com> Date: Wed, 31 May 2023 21:17:47 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20bing=E6=94=AF=E6=8C=81=E8=87=AA?= =?UTF-8?q?=E5=AE=9A=E4=B9=89=E4=BB=A3=E7=90=86=E5=9C=B0=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cores/qqbot/core.py | 2 +- model/provider/provider_rev_edgegpt.py | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/cores/qqbot/core.py b/cores/qqbot/core.py index 8c254f292..7f663c8b8 100644 --- a/cores/qqbot/core.py +++ b/cores/qqbot/core.py @@ -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) diff --git a/model/provider/provider_rev_edgegpt.py b/model/provider/provider_rev_edgegpt.py index 07dcc52bd..6e59cc3ad 100644 --- a/model/provider/provider_rev_edgegpt.py +++ b/model/provider/provider_rev_edgegpt.py @@ -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