mirror of
https://github.com/0xacx/chatGPT-shell-cli.git
synced 2025-12-01 18:27:46 -05:00
replace sed for escaping newlines with the escape function
This commit is contained in:
parent
a69c998d47
commit
a5c3ddf0e4
@ -125,8 +125,8 @@ request_to_image() {
|
|||||||
# $1 should be the message(s) formatted with role and content
|
# $1 should be the message(s) formatted with role and content
|
||||||
request_to_chat() {
|
request_to_chat() {
|
||||||
local message="$1"
|
local message="$1"
|
||||||
# escape quotation marks and newlines in the prompt
|
escaped_system_prompt=$(escape "$SYSTEM_PROMPT")
|
||||||
escaped_system_prompt=$(echo "$SYSTEM_PROMPT" | sed 's/"/\\"/g' | sed ':a;N;$!ba;s/\n/\\n/g')
|
|
||||||
curl https://api.openai.com/v1/chat/completions \
|
curl https://api.openai.com/v1/chat/completions \
|
||||||
-sS \
|
-sS \
|
||||||
-H 'Content-Type: application/json' \
|
-H 'Content-Type: application/json' \
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user