diff --git a/home/program/bash/module/Ask.nix b/home/program/bash/module/Ask.nix index d1a9fe7f..59cf648f 100644 --- a/home/program/bash/module/Ask.nix +++ b/home/program/bash/module/Ask.nix @@ -5,9 +5,10 @@ # Usage: ask function ask() { curl http://localhost:11434/api/generate -d "{ - \"model\": \"''${OLLAMA_MODEL}\", + \"model\":\"''${OLLAMA_MODEL}\", + \"raw\":true, \"prompt\":\"''${*}\" - }" 2> /dev/null | parallel -j1 -- "echo {} | jq -r .response | tr -d '\n'" + }" 2> /dev/null | parallel -j1 -- "printf '%s\n' {} | jq -r .response | sed -e 's/^$/\+\+\+/' | tr -d '\n' | sed -e 's/\+\+\+/\n/'" echo } diff --git a/module/Ollama.nix b/module/Ollama.nix index 40cba448..af7f8b09 100644 --- a/module/Ollama.nix +++ b/module/Ollama.nix @@ -24,10 +24,8 @@ in }; config = lib.mkIf cfg.enable { - environment = { - # Specify default model. - variables.OLLAMA_MODEL = cfg.primaryModel; - }; + # Specify default model. + environment.variables.OLLAMA_MODEL = cfg.primaryModel; systemd.services = { # Enable Ollama server.