Skip to content

Commit

Permalink
Fix mixed space tab
Browse files Browse the repository at this point in the history
Update tab usage consistency indentation of some lines.
There are no functional changes to the code.
  • Loading branch information
rxaviers committed May 2, 2023
1 parent 5e572eb commit 8830a35
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions chatgpt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}'
}

Expand All @@ -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"'"
}')
}

Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 8830a35

Please sign in to comment.