From e5ff9ce23018be0a2ebc806c26d0e7fa4e925567 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Mon, 20 May 2024 02:04:52 +0200 Subject: [PATCH] Remove unused DALLE command --- functions/dalle.fish | 20 -------------------- 1 file changed, 20 deletions(-) delete mode 100644 functions/dalle.fish diff --git a/functions/dalle.fish b/functions/dalle.fish deleted file mode 100644 index f20f5bb..0000000 --- a/functions/dalle.fish +++ /dev/null @@ -1,20 +0,0 @@ -function dalle -set base_url "https://api.openai.com" - -set response (curl --silent "$base_url/v1/images/generations" -H 'Content-Type: application/json' -H "Authorization: Bearer $OPENAI_API_KEY" -d '{"n": 1, "size": "1024x1024", "prompt":"'$argv[1]'"}') - -echo "$response" | jq - -set error (echo "$response" | jq '.error') - -if test "$error" != "null" -return 1 -end - -set timestamp (echo "$response" | jq --raw-output '.created') -set image_url (echo "$response" | jq --raw-output '.data[0].url') - -set output "/home/steffo/Pictures/DALL·E²/$timestamp - "$argv[1]".png" -wget --quiet --output-document="$output" "$image_url" -open "$output" > /dev/null 2> /dev/null -end