Inital Comit Upload Config Files
This commit is contained in:
18
scripts/ai-stuff/ollama-common.sh
Executable file
18
scripts/ai-stuff/ollama-common.sh
Executable file
@@ -0,0 +1,18 @@
|
||||
#!/bin/bash
|
||||
|
||||
OLLAMA_URL="http://10.0.0.15:11434"
|
||||
OLLAMA_MODEL="llama3.1"
|
||||
|
||||
ask_ollama() {
|
||||
local PROMPT="$1"
|
||||
|
||||
local RAW
|
||||
RAW=$(curl -s "$OLLAMA_URL/api/generate" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "$(jq -n \
|
||||
--arg model "$OLLAMA_MODEL" \
|
||||
--arg prompt "$PROMPT" \
|
||||
'{model:$model,prompt:$prompt,stream:false}')")
|
||||
|
||||
echo "$RAW" | jq -r '.response // .error // "Fehler: Ungültige Antwort vom Ollama-Server."'
|
||||
}
|
||||
Reference in New Issue
Block a user