aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorHsieh Chin Fan <pham@topo.tw>2023-03-22 07:36:32 +0800
committerHsieh Chin Fan <pham@topo.tw>2023-03-22 07:36:32 +0800
commit3f1fb23e21a37a15469e42cdda610fb42a9001b7 (patch)
tree2afd4e0ac36a57e687eb83a0458921281851c1e7
parent3b8b1fcdb12c91d5a8d43f2006c9a7f9a83ad485 (diff)
Update
-rwxr-xr-xbin/gpt/gpt2
-rwxr-xr-xbin/gpt/gpt.image2
2 files changed, 2 insertions, 2 deletions
diff --git a/bin/gpt/gpt b/bin/gpt/gpt
index ebb1d4b..ab4b64c 100755
--- a/bin/gpt/gpt
+++ b/bin/gpt/gpt
@@ -86,7 +86,7 @@ temperature=${temperature:-0.7}
86n=${n:-1} 86n=${n:-1}
87 87
88# Read content from terminal 88# Read content from terminal
89[ -z "$content" ] && read -r -p "Let's Chat: " content </dev/tty 89[ -z "$content" ] && read -e -r -p "Let's Chat: " content </dev/tty
90[ -z "$content" ] && { echo -e "No message is given\n"; _print_helper_message; exit 1; } 90[ -z "$content" ] && { echo -e "No message is given\n"; _print_helper_message; exit 1; }
91[ ! -t 0 ] && data="$(cat)" 91[ ! -t 0 ] && data="$(cat)"
92[ -n "$data" ] && content="$(printf "%s\\n\\n%s" "$content" "$data")" 92[ -n "$data" ] && content="$(printf "%s\\n\\n%s" "$content" "$data")"
diff --git a/bin/gpt/gpt.image b/bin/gpt/gpt.image
index 5f85fc0..34f93f2 100755
--- a/bin/gpt/gpt.image
+++ b/bin/gpt/gpt.image
@@ -59,7 +59,7 @@ response_format=${response_format:-url}
59n=${n:-1} 59n=${n:-1}
60 60
61# Read content from terminal 61# Read content from terminal
62[ -z "$prompt" ] && read -r -p "What image you want? " prompt </dev/tty 62[ -z "$prompt" ] && read -e -r -p "What image you want? " prompt </dev/tty
63 63
64# Create request body 64# Create request body
65body="$(cat <<EOF 65body="$(cat <<EOF