Skip to content

Commit 671ed5d

Browse files
authored
Warn the user if OPENAI_API_KEY is not set
1 parent 5e6ddd9 commit 671ed5d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

gpt3

+5
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@ set -- "${POSITIONAL[@]}" # restore positional parameter
4141
[ -z "$2" ] && MAX_TOKENS=64 || MAX_TOKENS="$2"
4242
[ -z "$OPENAI_KEY" ] && KEY="$OPENAI_API_KEY" || KEY="$OPENAI_KEY"
4343

44+
if [ -z "$KEY" ]; then
45+
echo "You must set OPENAI_API_KEY or OPENAI_KEY"
46+
exit 1
47+
fi
48+
4449
line_buffered="-l"
4550
if sed --version | grep GNU >/dev/null; then
4651
line_buffered="-u"

0 commit comments

Comments
 (0)