diff --git a/bot/chatgpt/chat_gpt_bot.py b/bot/chatgpt/chat_gpt_bot.py index 78e344f..1898d05 100644 --- a/bot/chatgpt/chat_gpt_bot.py +++ b/bot/chatgpt/chat_gpt_bot.py @@ -16,6 +16,7 @@ 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') proxy = conf().get('proxy') if proxy: openai.proxy = proxy diff --git a/bot/openai/open_ai_bot.py b/bot/openai/open_ai_bot.py index c948a7c..1c12989 100644 --- a/bot/openai/open_ai_bot.py +++ b/bot/openai/open_ai_bot.py @@ -12,6 +12,7 @@ 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') def reply(self, query, context=None): diff --git a/config-template.json b/config-template.json index 9ad9f5d..87fbc00 100644 --- a/config-template.json +++ b/config-template.json @@ -1,5 +1,6 @@ { "open_ai_api_key": "YOUR API KEY", + "open_ai_api_base":"", "proxy": "", "single_chat_prefix": ["bot", "@bot"], "single_chat_reply_prefix": "[bot] ",