This is a Mirai ChatBot plugin based on OpenAI GPT-3 API.
-
Download the JAR file from https://github.com/RIvance/mirai-openai-gpt-chatbot/releases
-
Copy the JAR file to
$MCL_ROOT/plugins
-
Start MCL
-
Replace
YOUR_OPENAI_API_KEY_HERE
in the$MCL_ROOT/config/org.ivance.chatbot/ChatBotPluginConfig.yml
config file with your OpenAI API key, like:# Your OpenAI API key, starts with `sk-`. # See https://beta.openai.com/account/api-keys token: sk-kA6y0qWzk6lFEq7SVTr7bpHoduNI9bheqUNkbQm7ZJjG39BA
-
Add the trigger prefixes / trigger keywords to the
triggerPrefixes
/triggerWords
list, for example:# Prefixes used to trigger the response. # e.g. "/chat How are you today?" triggerPrefixes: - '/chat' - '/聊天' # Keywords used to trigger the response. # e.g. "What is GPT3?" triggerWords: - 'what is' - 'how to' - '为什么' - '怎样'
-
Restart MCL
See https://zhuanlan.zhihu.com/p/589287744
Visit https://beta.openai.com/account/api-keys
Please change the maxToken
attribute in the config file:
# The maximum number of tokens to generate.
# Requests can use up to 2048 tokens shared between prompt and completion.
# (One token is roughly 4 characters for normal English text)
# Notice that a large `maxToken` value may cause request timeout.
maxTokens: 500