mirror of
https://github.com/0xacx/chatGPT-shell-cli.git
synced 2024-11-24 11:25:31 +00:00
Cleanup debug log
This commit is contained in:
parent
c3681f6cdc
commit
706b4d2ea4
10
chatgpt.sh
10
chatgpt.sh
@ -71,7 +71,7 @@ request_to_chat() {
|
||||
}
|
||||
|
||||
# build chat context before each request for /completions (all models except
|
||||
# gpt turbo)
|
||||
# gpt turbo and gpt 4)
|
||||
# $1 should be the chat context
|
||||
# $2 should be the escaped prompt
|
||||
build_chat_context() {
|
||||
@ -85,7 +85,8 @@ build_chat_context() {
|
||||
request_prompt="${chat_context//$'\n'/\\n}"
|
||||
}
|
||||
|
||||
# maintain chat context function for /completions (all models except gpt turbo)
|
||||
# maintain chat context function for /completions (all models except
|
||||
# gpt turbo and gpt 4)
|
||||
# builds chat context from response,
|
||||
# keeps chat context length under max token limit
|
||||
# $1 should be the chat context
|
||||
@ -349,9 +350,8 @@ while $running; do
|
||||
escaped_response_data=$(echo "$response_data" | sed 's/"/\\"/g')
|
||||
maintain_chat_context "$chat_context" "$escaped_response_data"
|
||||
fi
|
||||
echo "this"
|
||||
echo $response_data
|
||||
|
||||
timestamp=$(date +"%d/%m/%Y %H:%M")
|
||||
echo -e "$timestamp $prompt \n$response_data \n" >>~/.chatgpt_history
|
||||
fi
|
||||
done
|
||||
done
|
||||
|
Loading…
Reference in New Issue
Block a user