diff options
Diffstat (limited to 'krebs')
-rw-r--r-- | krebs/2configs/reaktor2.nix | 19 | ||||
-rw-r--r-- | krebs/5pkgs/simple/vicuna-chat/default.nix | 33 |
2 files changed, 0 insertions, 52 deletions
diff --git a/krebs/2configs/reaktor2.nix b/krebs/2configs/reaktor2.nix index e84827656..7cc6c7550 100644 --- a/krebs/2configs/reaktor2.nix +++ b/krebs/2configs/reaktor2.nix @@ -253,24 +253,6 @@ let }; }; - vicuna = { - pattern = "^!vicuna (.*)$"; - activate = "match"; - arguments = [1]; - timeoutSec = 1337; - command = { - filename = pkgs.writeDash "vicuna" '' - set -efu - - mkdir -p ${stateDir}/vicuna - export CONTEXT=${stateDir}/vicuna/"$_msgtarget".context - ${pkgs.vicuna-chat}/bin/vicuna-chat "$@" | - echo "$_from: $(cat)" | - fold -s -w 426 - ''; - }; - }; - locationsLib = pkgs.writeText "locations.sh" '' ENDPOINT=http://c.r/poi.json get_locations() { @@ -431,7 +413,6 @@ let hooks.sed interrogate say - vicuna (generators.command_hook { inherit (commands) dance random-emoji nixos-version; tell = { diff --git a/krebs/5pkgs/simple/vicuna-chat/default.nix b/krebs/5pkgs/simple/vicuna-chat/default.nix deleted file mode 100644 index db15899d6..000000000 --- a/krebs/5pkgs/simple/vicuna-chat/default.nix +++ /dev/null @@ -1,33 +0,0 @@ -{ pkgs, ... }: -pkgs.writers.writeDashBin "vicuna-chat" '' - set -efu - - export PATH=${with pkgs; lib.makeBinPath [ - coreutils - curl - jq - ]} - - CONTEXT=''${CONTEXT:-$(date -Id)} - PROMPT=$* - - if ! test -e "$CONTEXT"; then - echo -n 'null' > "$CONTEXT" - fi - - add_to_context() { - jq -rc --argjson message "$1" '. + [$message]' "$CONTEXT" > "$CONTEXT.tmp" - mv "$CONTEXT.tmp" "$CONTEXT" - } - - add_to_context "{\"role\": \"user\", \"content\": \"$PROMPT\"}" - response=$( - jq -nc --slurpfile context "$CONTEXT" '{ - model: "vicuna-13b-v1.5-16k", - messages: $context[0], - }' | - curl -Ss http://vicuna.r/v1/chat/completions -H 'Content-Type: application/json' -d @- - ) - add_to_context "$(jq -rcn --argjson response "$response" '$response.choices[0].message')" - jq -rcn --argjson response "$response" '$response.choices[0].message.content' -'' |