File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -125,14 +125,16 @@ request_to_image() {
125125# $1 should be the message(s) formatted with role and content
126126request_to_chat () {
127127 local message=" $1 "
128+ escaped_system_prompt=$( escape " $SYSTEM_PROMPT " )
129+
128130 curl https://api.openai.com/v1/chat/completions \
129131 -sS \
130132 -H ' Content-Type: application/json' \
131133 -H " Authorization: Bearer $OPENAI_KEY " \
132134 -d ' {
133135 "model": "' " $MODEL " ' ",
134136 "messages": [
135- {"role": "system", "content": "' " $SYSTEM_PROMPT " ' "},
137+ {"role": "system", "content": "' " $escaped_system_prompt " ' "},
136138 ' " $message " '
137139 ],
138140 "max_tokens": ' $MAX_TOKENS ' ,
@@ -319,7 +321,7 @@ while $running; do
319321 if [ -z " $pipe_mode_prompt " ]; then
320322 if [ $MULTI_LINE_PROMPT = true ]; then
321323 echo -e " \nEnter a prompt: (Press Enter then Ctrl-D to send)"
322- cat > " ${USER_INPUT_TEMP_FILE} "
324+ cat > " ${USER_INPUT_TEMP_FILE} "
323325 input_from_temp_file=$( cat " ${USER_INPUT_TEMP_FILE} " )
324326 prompt=$( escape " $input_from_temp_file " )
325327 else
You can’t perform that action at this time.
0 commit comments