From a39ae2ee9daa5380950f84ba2316d6aceaaa2634 Mon Sep 17 00:00:00 2001 From: Rafael Xavier de Souza Date: Tue, 7 Nov 2023 08:03:04 -0300 Subject: [PATCH] Allow dall-e-3 model for image generation --- chatgpt.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/chatgpt.sh b/chatgpt.sh index 81df29a..a9669f4 100755 --- a/chatgpt.sh +++ b/chatgpt.sh @@ -115,6 +115,7 @@ request_to_image() { -H 'Content-Type: application/json' \ -H "Authorization: Bearer $OPENAI_KEY" \ -d '{ + "model": "'"$MODEL"'", "prompt": "'"${prompt#*image:}"'", "n": 1, "size": "'"$SIZE"'" @@ -341,7 +342,8 @@ while $running; do if [[ $prompt =~ ^(exit|q)$ ]]; then running=false elif [[ "$prompt" =~ ^image: ]]; then - request_to_image "$prompt" + escaped_prompt=$(escape "$prompt") + request_to_image "$escaped_prompt" handle_error "$image_response" image_url=$(echo "$image_response" | jq -r '.data[0].url') echo -e "$OVERWRITE_PROCESSING_LINE"