Skip to content

Commit

Permalink
Dry
Browse files Browse the repository at this point in the history
  • Loading branch information
lukechilds committed Aug 6, 2023
1 parent 62240e9 commit c7b2e97
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions humanscript
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,14 @@ $(cat "${humanscript_path}")
### Output script:"

# Format JSON payload
stringified_system_prompt=$(echo "${system_prompt}"| jq -sRr @json)
stringified_user_prompt=$(echo "${user_prompt}"| jq -sRr @json)
function json_string() {
echo "${1}" | jq --raw-input --raw-output --slurp @json
}
data=$(echo '{
"model": "'$HUMANSCRIPT_MODEL'",
"messages": [
{"role": "system", "content": '$stringified_system_prompt'},
{"role": "user", "content": '$stringified_user_prompt'}
{"role": "system", "content": '$(json_string "${system_prompt}")'},
{"role": "user", "content": '$(json_string "${user_prompt}")'}
],
"temperature": 0.7,
"max_tokens": 1000,
Expand Down

0 comments on commit c7b2e97

Please sign in to comment.