From 097563caa0a5e178c2f569c609f2c5d269e9ff0a Mon Sep 17 00:00:00 2001 From: 0xacx <99351112+0xacx@users.noreply.github.com> Date: Tue, 28 Feb 2023 15:38:25 +0200 Subject: [PATCH] Update README.md --- README.md | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 924e437..cb5e543 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,7 @@ The script uses the `completions` endpoint and the `text-davinci-003` model for - Generate images from a text prompt - View your chat history - Chat context, GPT remembers previous chat questions and answers +- Pass the input prompt with pipe, as a script parameter or normal chat mode - List all available OpenAI models - Set OpenAI request parameters @@ -18,6 +19,26 @@ The script uses the `completions` endpoint and the `text-davinci-003` model for ![Screenshot 2023-01-13 at 16 39 27](https://user-images.githubusercontent.com/99351112/212346562-ea568cce-2ca2-4b03-9ebc-ece8902c923d.png) +Chat mode: +```shell +$ chatgpt +Welcome to chatgpt. You can quit with 'exit'. + +Enter a prompt: + +``` + +Using pipe: +```shell +echo "How to view running processes on Ubuntu?" | chatgpt +``` +Using script arguments +```shell +chatgpt -p "What is the regex to match an email address?" +``` + + + ## Getting Started ### Prerequisites @@ -87,7 +108,7 @@ This script relies on curl for the requests to the api and jq to parse the json - max number of tokens, `--max-tokens` - image size, `-s` or `--size` (The sizes that are accepted by the OpenAI API are 256x256, 512x512, 1024x1024) - prompt, `p` or `--prompt` - - prompt from a file, `--prompt-from-file` + - prompt from a file in your file system, `--prompt-from-file` To learn more about these parameters you can view the [API documentation](https://platform.openai.com/docs/api-reference/completions/create)