diff options
| author | Hsieh Chin Fan <pham@topo.tw> | 2023-03-24 09:50:11 +0800 |
|---|---|---|
| committer | Hsieh Chin Fan <pham@topo.tw> | 2023-03-24 09:50:11 +0800 |
| commit | a54eb3b754638c81a27f89b9cf2789f6279d2ce8 (patch) | |
| tree | cb1ace9ce6c3cc7c4308a92a4f65b37af3e6061c /bin | |
| parent | 1c6752b5dfbd026d7b56b81474c052e6bb92c4d8 (diff) | |
Update
Diffstat (limited to 'bin')
| -rwxr-xr-x | bin/gpt/gpt | 5 |
1 files changed, 2 insertions, 3 deletions
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 @@ | |||
| 3 | # TODO | 3 | # TODO |
| 4 | # - Use suggested block to wrap data: | 4 | # - Use suggested block to wrap data: |
| 5 | # https://help.openai.com/en/articles/6654000-best-practices-for-prompt-engineering-with-openai-api | 5 | # https://help.openai.com/en/articles/6654000-best-practices-for-prompt-engineering-with-openai-api |
| 6 | # - Print token usage when exit | 6 | # - Cowork with https://github.com/openai/chatgpt-retrieval-plugin |
| 7 | # - For the chat | ||
| 8 | 7 | ||
| 9 | # Necessary commands | 8 | # Necessary commands |
| 10 | stacks=( curl jq ) | 9 | stacks=( curl jq ) |
| @@ -118,7 +117,7 @@ _get_content() { | |||
| 118 | [[ "$content" =~ ^\. ]] && echo && _configure_options && echo -e '\n======\n' && continue | 117 | [[ "$content" =~ ^\. ]] && echo && _configure_options && echo -e '\n======\n' && continue |
| 119 | [ -n "$content" ] && break | 118 | [ -n "$content" ] && break |
| 120 | done | 119 | done |
| 121 | elif [[ "$count" -eq 0 && -z "$data" ]]; then | 120 | elif [[ "$count" -eq 0 && -z "${content}${data}" ]]; then |
| 122 | echo -e "No data from STDIN\n" | 121 | echo -e "No data from STDIN\n" |
| 123 | exit 1; | 122 | exit 1; |
| 124 | fi | 123 | fi |