zhayujie
GitHub
vor 1 Jahr
Ursprung
Commit
1dc39af423
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 4AEE18F83AFDEB23
3 geänderte Dateien mit
3 neuen und
0 gelöschten Zeilen
-
bot/chatgpt/chat_gpt_bot.py
-
bot/openai/open_ai_bot.py
-
config-template.json
|
|
@@ -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 |
|
|
|
|
|
@@ -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): |
|
|
|
|
|
@@ -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] ", |
|
|
|