Skip to content

Commit 410d25e

Browse files
committed
Fix date format and timestamp
Update the date format used in the `CHAT_INIT_PROMPT` and `SYSTEM_PROMPT` variables from `dd/mm/yyyy` to `mm/dd/yyyy` since it's implied it's written on English language. Additionally, the date format used in the `timestamp` variable was changed from `dd/mm/yyyy HH:MM` to ISO format `yyyy-mm-dd HH:MM`.
1 parent 5e572eb commit 410d25e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

chatgpt.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
GLOBIGNORE="*"
44

5-
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)"
5+
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 +%m/%d/%Y)"
66

7-
SYSTEM_PROMPT="You are ChatGPT, a large language model trained by OpenAI. Answer as concisely as possible. Current date: $(date +%d/%m/%Y). Knowledge cutoff: 9/1/2021."
7+
SYSTEM_PROMPT="You are ChatGPT, a large language model trained by OpenAI. Answer as concisely as possible. Current date: $(date +%m/%d/%Y). Knowledge cutoff: 9/1/2021."
88

99
COMMAND_GENERATION_PROMPT="You are a Command Line Interface expert and your task is to provide functioning shell commands. Return a CLI command and nothing else - do not send it in a code block, quotes, or anything else, just the pure text CONTAINING ONLY THE COMMAND. If possible, return a one-line bash command or chain many commands together. Return ONLY the command ready to run in the terminal. The command should do the following:"
1010

@@ -356,7 +356,7 @@ while $running; do
356356
fi
357357
add_assistant_response_to_chat_message "$(escape "$response_data")"
358358

359-
timestamp=$(date +"%d/%m/%Y %H:%M")
359+
timestamp=$(date +"%Y-%m-%d %H:%M")
360360
echo -e "$timestamp $prompt \n$response_data \n" >>~/.chatgpt_history
361361

362362
elif [[ "$MODEL" =~ ^gpt- ]]; then
@@ -379,7 +379,7 @@ while $running; do
379379
fi
380380
add_assistant_response_to_chat_message "$(escape "$response_data")"
381381

382-
timestamp=$(date +"%d/%m/%Y %H:%M")
382+
timestamp=$(date +"%Y-%m-%d %H:%M")
383383
echo -e "$timestamp $prompt \n$response_data \n" >>~/.chatgpt_history
384384
else
385385
# escape quotation marks, new lines, backslashes...
@@ -408,7 +408,7 @@ while $running; do
408408
maintain_chat_context "$(escape "$response_data")"
409409
fi
410410

411-
timestamp=$(date +"%d/%m/%Y %H:%M")
411+
timestamp=$(date +"%Y-%m-%d %H:%M")
412412
echo -e "$timestamp $prompt \n$response_data \n" >>~/.chatgpt_history
413413
fi
414414
done

0 commit comments

Comments
 (0)