mirror of
https://github.com/RockChinQ/QChatGPT.git
synced 2024-11-16 03:32:33 +08:00
Merge pull request #608 from RockChinQ/fix/reverse-proxy-invalid
Fix: 反向代理设置无效
This commit is contained in:
commit
7890eac3f8
1
main.py
1
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"]
|
||||
|
||||
# 主启动流程
|
||||
|
|
|
@ -33,7 +33,8 @@ class OpenAIInteract:
|
|||
# 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)
|
||||
|
|
Loading…
Reference in New Issue
Block a user