summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--krebs/2configs/reaktor2.nix22
1 files changed, 22 insertions, 0 deletions
diff --git a/krebs/2configs/reaktor2.nix b/krebs/2configs/reaktor2.nix
index 39039cc11..032932013 100644
--- a/krebs/2configs/reaktor2.nix
+++ b/krebs/2configs/reaktor2.nix
@@ -51,6 +51,27 @@ let
};
};
+ bing = {
+ pattern = "!bing (.*)$";
+ activate = "match";
+ arguments = [1];
+ timeoutSec = 42;
+ command = {
+ filename = pkgs.writeDash "bing" ''
+ set -efu
+ export PATH=${makeBinPath [
+ pkgs.coreutils
+ pkgs.curl
+ pkgs.jq
+ ]}
+ printf '%s' "$*" |
+ curl -SsG http://bing-gpt.r/api/chat --data-urlencode 'prompt@-' |
+ jq -r '.item.messages[1].text' |
+ echo "$_from: $(cat)"
+ '';
+ };
+ };
+
confuse = {
pattern = "!confuse (.*)$";
activate = "match";
@@ -526,6 +547,7 @@ in {
(systemPlugin {
extra_privmsg_hooks = [
confuse
+ bing
];
})
];