From a54eb3b754638c81a27f89b9cf2789f6279d2ce8 Mon Sep 17 00:00:00 2001 From: Hsieh Chin Fan Date: Fri, 24 Mar 2023 09:50:11 +0800 Subject: Update --- bin/gpt/gpt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'bin/gpt') diff --git a/bin/gpt/gpt b/bin/gpt/gpt index 9a0e830..34f7635 100755 --- a/bin/gpt/gpt +++ b/bin/gpt/gpt @@ -3,8 +3,7 @@ # TODO # - Use suggested block to wrap data: # https://help.openai.com/en/articles/6654000-best-practices-for-prompt-engineering-with-openai-api -# - Print token usage when exit -# - For the chat +# - Cowork with https://github.com/openai/chatgpt-retrieval-plugin # Necessary commands stacks=( curl jq ) @@ -118,7 +117,7 @@ _get_content() { [[ "$content" =~ ^\. ]] && echo && _configure_options && echo -e '\n======\n' && continue [ -n "$content" ] && break done - elif [[ "$count" -eq 0 && -z "$data" ]]; then + elif [[ "$count" -eq 0 && -z "${content}${data}" ]]; then echo -e "No data from STDIN\n" exit 1; fi -- cgit v1.2.3-70-g09d2