|
|
@@ -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
|