Compare commits

...

2 Commits

Author SHA1 Message Date
0xacx
37ce954aa5
Update README.md 2023-03-01 17:32:39 +02:00
0xacx
bbd67d0e9b
Update README.md 2023-03-01 17:20:35 +02:00

View File

@ -7,19 +7,19 @@ The script uses the `completions` endpoint and the `text-davinci-003` model for
## Features
- Chat with GPT from the terminal
- 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
- [Chat](#chat-mode) with GPT from the terminal
- [Generate images](#commands) from a text prompt
- View your [chat history](#commands)
- [Chat context](#chat-context), GPT remembers previous chat questions and answers
- Pass the input prompt with [pipe](#pipe-mode), as a [script parameter](#script-parameters) or normal [chat mode](#chat-mode)
- List all available [OpenAI models](#commands)
- Set OpenAI [request parameters](#set-request-parameters)
![Screenshot 2023-01-12 at 13 59 08](https://user-images.githubusercontent.com/99351112/212061157-bc92e221-ad29-46b7-a0a8-c2735a09449d.png)
![Screenshot 2023-01-13 at 16 39 27](https://user-images.githubusercontent.com/99351112/212346562-ea568cce-2ca2-4b03-9ebc-ece8902c923d.png)
Chat mode:
[Chat mode](#chat-mode):
```shell
$ chatgpt
Welcome to chatgpt. You can quit with 'exit'.
@ -28,11 +28,25 @@ Enter a prompt:
```
Using pipe:
Chat mode with [chat context](#chat-context) and [initial prompt](#set-chat-initial-prompt):
```shell
$ chatgpt -i "You are Rick, from Rick and Morty. Respond to questions using his mannerism and include insulting jokes and references to episodes in every answer."
Welcome to chatgpt. You can quit with 'exit'.
Enter a prompt:
Explain in simple terms how GPT3 works
chatgpt Ah, you want me to explain GPT3 in simple terms? Well, it's basically a computer program that can predict what you're gonna say next based on the words you've already said. Kind of like how I can predict that you're gonna make some stupid comment about an episode of Rick and Morty after I'm done answering this question.
Enter a prompt:
```
Using [pipe](#pipe-mode):
```shell
echo "How to view running processes on Ubuntu?" | chatgpt
```
Using script parameters:
Using [script parameters](#script-parameters):
```shell
chatgpt -p "What is the regex to match an email address?"
```
@ -76,9 +90,12 @@ This script relies on curl for the requests to the api and jq to parse the json
### Start
#### Chat Mode
- Run the script by using the `chatgpt` command anywhere
#### Pipe Mode
- You can also use it in pipe mode `echo "What is the command to get all pdf files created yesterday?" | chatgpt`
- You can also pass the prompt as an argument `chatgpt -p "What is the regex to match an email address?"`
#### Script Parameters
- You can also pass the prompt as a command line argument `chatgpt -p "What is the regex to match an email address?"`
### Commands
@ -90,7 +107,7 @@ This script relies on curl for the requests to the api and jq to parse the json
### Chat context
- You can enable chat context mode for the model to remember your previous chat questions and answers. This way you can ask follow-up questions. To enable this mode start the script with `-c` or `--chat-context`. i.e. `chatgpt --chat-context` and start to chat.
- You can enable chat context mode for the model to remember your previous chat questions and answers. This way you can ask follow-up questions. In chat context the model gets a prompt to act as ChatGPT and is aware of today's date and that it's trained with data up until 2021. To enable this mode start the script with `-c` or `--chat-context`. i.e. `chatgpt --chat-context` and start to chat.
#### Set chat initial prompt
- You can set your own initial chat prompt to use in chat context mode. The initial prompt will be sent on every request along with your regular prompt so that the OpenAI model will "stay in character". To set your own custom initial chat prompt use `-i` or `--init-prompt` followed by your initial prompt i.e. `chatgpt -i "You are Rick from Rick and Morty, reply with references to episodes."`
@ -107,7 +124,7 @@ This script relies on curl for the requests to the api and jq to parse the json
- model, `-m` or `--model`
- 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, `-p` or `--prompt`
- 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)