Skip to content

Commit 4162ac4

Browse files
authored
Merge pull request #102 from rxaviers/fix-date-format
Fix date format and timestamp
2 parents 2e25138 + 410d25e commit 4162ac4

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

@@ -401,7 +401,7 @@ while $running; do
401401
fi
402402
add_assistant_response_to_chat_message "$(escape "$response_data")"
403403

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

407407
elif [[ "$MODEL" =~ ^gpt- ]]; then
@@ -423,7 +423,7 @@ while $running; do
423423
fi
424424
add_assistant_response_to_chat_message "$(escape "$response_data")"
425425

426-
timestamp=$(date +"%d/%m/%Y %H:%M")
426+
timestamp=$(date +"%Y-%m-%d %H:%M")
427427
echo -e "$timestamp $prompt \n$response_data \n" >>~/.chatgpt_history
428428
else
429429
# escape quotation marks, new lines, backslashes...
@@ -452,7 +452,7 @@ while $running; do
452452
maintain_chat_context "$(escape "$response_data")"
453453
fi
454454

455-
timestamp=$(date +"%d/%m/%Y %H:%M")
455+
timestamp=$(date +"%Y-%m-%d %H:%M")
456456
echo -e "$timestamp $prompt \n$response_data \n" >>~/.chatgpt_history
457457
fi
458458
done

0 commit comments

Comments
 (0)