From e15f3595b3101eb35bd60c2aba4a93e34bf3fb67 Mon Sep 17 00:00:00 2001 From: RockChinQ <1010553892@qq.com> Date: Tue, 21 Nov 2023 15:44:07 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=8F=8D=E5=90=91=E4=BB=A3=E7=90=86?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E6=97=A0=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 1 + pkg/openai/manager.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index 5d8717da..1a96f1a4 100644 --- a/main.py +++ b/main.py @@ -241,6 +241,7 @@ def start(first_time_init=False): # 配置openai api_base if "reverse_proxy" in config.openai_config and config.openai_config["reverse_proxy"] is not None: + logging.debug("设置反向代理: "+config.openai_config['reverse_proxy']) openai.base_url = config.openai_config["reverse_proxy"] # 主启动流程 diff --git a/pkg/openai/manager.py b/pkg/openai/manager.py index 4236c630..385f4346 100644 --- a/pkg/openai/manager.py +++ b/pkg/openai/manager.py @@ -33,7 +33,8 @@ def __init__(self, api_key: str): # logging.info("文字总使用量:%d", self.audit_mgr.get_total_text_length()) self.client = openai.Client( - api_key=self.key_mgr.get_using_key() + api_key=self.key_mgr.get_using_key(), + base_url=openai.base_url ) context.set_openai_manager(self)