You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: chatgpt.sh
+36Lines changed: 36 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,10 @@
1
1
#!/bin/bash
2
+
3
+
if [[ -z"$OPENAI_KEY" ]];then
4
+
echo"OPENAI_KEY is not set, exiting"
5
+
exit 1
6
+
fi
7
+
2
8
GLOBIGNORE="*"
3
9
4
10
CHAT_INIT_PROMPT="You are ChatGPT, a Large Language Model trained by OpenAI. You will be answering questions from users. You answer as concisely as possible for each response (e.g. don’t be verbose). If you are generating a list, do not have too many items. Keep the number of items short. Before each user prompt you will be given the chat history in Q&A form. Output your answer directly, with no labels in front. Do not start your answers with A or Anwser. You were trained on data up until 2021. Today's date is $(date +%d/%m/%Y)"
A simple, lightweight shell script to use OpenAI's chatGPT and DALL-E from the terminal without installing python or node.js.
23
+
24
+
Commands:
25
+
image - To generate images, start a prompt with image: If you are using iTerm, you can view the image directly in the terminal. Otherwise the script will ask to open the image in your browser.
26
+
history - To view your chat history, type history
27
+
models - To get a list of the models available at OpenAI API, type models
28
+
model - To view all the information on a specific model, start a prompt with model: and the model id as it appears in the list of models. For example: model:text-babbage:001 will get you all the fields for text-babbage:001 model
29
+
command - To get a command with the specified functionality and run it, just type command: and explain what you want to achieve. The script will always ask you if you want to execute the command. i.e. command: show me all files in this directory that have more than 150 lines of code If a command modifies your file system or dowloads external files the script will show a warning before executing.
30
+
31
+
Options:
32
+
-i, --init-prompt - Provide initial chat prompt to use in context
33
+
--init-prompt-from-file - Provide initial prompt from file
34
+
-p, --prompt - Provide prompt instead of starting chat
35
+
--prompt-from-file - Provide prompt from file
36
+
-t, --temperature - Temperature
37
+
--max-tokens - Max number of tokens
38
+
-m, --model - Model
39
+
-s, --size - Image size. (The sizes that are accepted by the OpenAI API are 256x256, 512x512, 1024x1024)
40
+
-c, --chat-context - Make chatgpt aware of todays date and what data it was trained on
0 commit comments