From d20f847568ae66aea38996557843b6fc016689f1 Mon Sep 17 00:00:00 2001 From: Rafael Xavier de Souza Date: Tue, 2 May 2023 13:50:33 -0300 Subject: [PATCH] Fix mixed space tab Update tab usage consistency of some lines indentation. There are no functional changes to the code. --- chatgpt.sh | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/chatgpt.sh b/chatgpt.sh index 7c5f76c..f0f6834 100755 --- a/chatgpt.sh +++ b/chatgpt.sh @@ -70,10 +70,10 @@ request_to_completions() { -H 'Content-Type: application/json' \ -H "Authorization: Bearer $OPENAI_KEY" \ -d '{ - "model": "'"$MODEL"'", - "prompt": "'"$prompt"'", - "max_tokens": '$MAX_TOKENS', - "temperature": '$TEMPERATURE' + "model": "'"$MODEL"'", + "prompt": "'"$prompt"'", + "max_tokens": '$MAX_TOKENS', + "temperature": '$TEMPERATURE' }' } @@ -86,9 +86,9 @@ request_to_image() { -H 'Content-Type: application/json' \ -H "Authorization: Bearer $OPENAI_KEY" \ -d '{ - "prompt": "'"${prompt#*image:}"'", - "n": 1, - "size": "'"$SIZE"'" + "prompt": "'"${prompt#*image:}"'", + "n": 1, + "size": "'"$SIZE"'" }') } @@ -101,14 +101,14 @@ request_to_chat() { -H 'Content-Type: application/json' \ -H "Authorization: Bearer $OPENAI_KEY" \ -d '{ - "model": "'"$MODEL"'", - "messages": [ - {"role": "system", "content": "'"$SYSTEM_PROMPT"'"}, - '"$message"' - ], - "max_tokens": '$MAX_TOKENS', - "temperature": '$TEMPERATURE' - }' + "model": "'"$MODEL"'", + "messages": [ + {"role": "system", "content": "'"$SYSTEM_PROMPT"'"}, + '"$message"' + ], + "max_tokens": '$MAX_TOKENS', + "temperature": '$TEMPERATURE' + }' } # build chat context before each request for /completions (all models except @@ -125,7 +125,7 @@ build_chat_context() { } escape(){ - echo "$1" | jq -Rrs 'tojson[1:-1]' + echo "$1" | jq -Rrs 'tojson[1:-1]' } # maintain chat context function for /completions (all models except