mirror of
https://github.com/zhayujie/chatgpt-on-wechat.git
synced 2026-02-22 08:28:42 +08:00
fix: openai_base_url load
This commit is contained in:
@@ -16,7 +16,8 @@ else:
|
||||
class ChatGPTBot(Bot):
|
||||
def __init__(self):
|
||||
openai.api_key = conf().get('open_ai_api_key')
|
||||
openai.api_base = conf().get('open_ai_api_base')
|
||||
if conf().get('open_ai_api_base'):
|
||||
openai.api_base = conf().get('open_ai_api_base')
|
||||
proxy = conf().get('proxy')
|
||||
if proxy:
|
||||
openai.proxy = proxy
|
||||
|
||||
@@ -12,8 +12,11 @@ user_session = dict()
|
||||
class OpenAIBot(Bot):
|
||||
def __init__(self):
|
||||
openai.api_key = conf().get('open_ai_api_key')
|
||||
openai.api_base = conf().get('open_ai_api_base')
|
||||
|
||||
if conf().get('open_ai_api_base'):
|
||||
openai.api_base = conf().get('open_ai_api_base')
|
||||
proxy = conf().get('proxy')
|
||||
if proxy:
|
||||
openai.proxy = proxy
|
||||
|
||||
def reply(self, query, context=None):
|
||||
# acquire reply content
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
{
|
||||
"open_ai_api_key": "YOUR API KEY",
|
||||
"open_ai_api_base":"",
|
||||
"proxy": "",
|
||||
"single_chat_prefix": ["bot", "@bot"],
|
||||
"single_chat_reply_prefix": "[bot] ",
|
||||
|
||||
Reference in New Issue
Block a user