feat: /ia — chat question-and-answer backed by MiniMax
Adds an `ia` module: `/ia <pergunta>` sends the question to an OpenAI-compatible chat-completions endpoint (MiniMax by default) and posts the reply to chat. Access is gated by `canalhandia.ia`, declared `default: op` so the operator has it out of the box and LuckPerms can grant it to anyone else. The model can only ever produce chat text: - the reply goes to sendMessage and nowhere else — it is never passed to the command dispatcher; - no `tools`/`tool_choice` are sent, so there is nothing for the model to call; - the system prompt states it has no server, shell or command access; - replies are sanitised — colour codes stripped so they cannot forge server messages, newlines folded so one answer is one chat entry, and leading slashes removed so nothing reads as a command to run. The API key is deliberately not a config value, since config.yml is committed. It is read from MINIMAX_API_KEY or from plugins/Canalhandia/minimax.key, which is now gitignored. Cost is bounded by a per-player cooldown and a server-wide daily cap, both visible in /canalhandia status. The HTTP call runs off the main thread; only the delivery hops back onto it.
This commit is contained in:
@@ -1 +1,4 @@
|
||||
target/
|
||||
|
||||
# The MiniMax API key lives beside the plugin on the server, never in git.
|
||||
minimax.key
|
||||
|
||||
Reference in New Issue
Block a user