mirror of
https://github.com/0xacx/chatGPT-shell-cli.git
synced 2024-11-24 11:25:31 +00:00
Merge pull request #102 from rxaviers/fix-date-format
Fix date format and timestamp
This commit is contained in:
commit
4162ac49f6
10
chatgpt.sh
10
chatgpt.sh
@ -2,9 +2,9 @@
|
||||
|
||||
GLOBIGNORE="*"
|
||||
|
||||
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)"
|
||||
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)"
|
||||
|
||||
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."
|
||||
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."
|
||||
|
||||
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:"
|
||||
|
||||
@ -401,7 +401,7 @@ while $running; do
|
||||
fi
|
||||
add_assistant_response_to_chat_message "$(escape "$response_data")"
|
||||
|
||||
timestamp=$(date +"%d/%m/%Y %H:%M")
|
||||
timestamp=$(date +"%Y-%m-%d %H:%M")
|
||||
echo -e "$timestamp $prompt \n$response_data \n" >>~/.chatgpt_history
|
||||
|
||||
elif [[ "$MODEL" =~ ^gpt- ]]; then
|
||||
@ -423,7 +423,7 @@ while $running; do
|
||||
fi
|
||||
add_assistant_response_to_chat_message "$(escape "$response_data")"
|
||||
|
||||
timestamp=$(date +"%d/%m/%Y %H:%M")
|
||||
timestamp=$(date +"%Y-%m-%d %H:%M")
|
||||
echo -e "$timestamp $prompt \n$response_data \n" >>~/.chatgpt_history
|
||||
else
|
||||
# escape quotation marks, new lines, backslashes...
|
||||
@ -452,7 +452,7 @@ while $running; do
|
||||
maintain_chat_context "$(escape "$response_data")"
|
||||
fi
|
||||
|
||||
timestamp=$(date +"%d/%m/%Y %H:%M")
|
||||
timestamp=$(date +"%Y-%m-%d %H:%M")
|
||||
echo -e "$timestamp $prompt \n$response_data \n" >>~/.chatgpt_history
|
||||
fi
|
||||
done
|
||||
|
Loading…
Reference in New Issue
Block a user