Quote:
Originally Posted by luketheduke
Bash-gpt looks like an ideal solution. Needs `jq` to parse JSON, though.
You'd either have to: - Cross-compile `jq` for the Kindle.
- Modify the script to use regex or something.
|
Thank you very much.
It took me a long time to response, but I finally replaced my non-jailbroken Kindle8 with a jailbreakable PW2.
When I tried this solution, I encountered some issues.
Here's steps:
1. Jailbreak
2. Installing KUAL, Usbnetwork, kterm
3. Download
bash-gpt, execute and encountered an error in kterm:
line 137: syntax error: bad substitution
4. Then, I did some more searching and found another script called
ai-bash-gpt, but it still has same error:
line 103: syntax error: unexpected redirection
I have no knowledge of Linux and Bash, so I have no idea how to fix it.
edited:
some code lines around line137 in bash-gpt:
Code:
133 bash_gpt_save_message() {
134 role="$1"
135 shift
136 content=$(echo "$@" | tr -d '\n')
137 content="${content@Q}"
138 content=$(echo "${content:1:-1}" | jq -R -s '.') # | sed 's/[$`]/\\&/g')
139 filepath=$(bash_gpt_subject_file $BASH_GPT_SUBJECT)
140 echo "{\"role\": \"$role\", \"content\": ${content}}" >> "$filepath"
141 }
some code line around line103 in ai-bash-gpt:
Code:
103 input=$(jq ".[-$CONVERSATION_BUFFER_LEN:]" <<<"$@")
104 while true; do
105 msg_buf_size=$(wc -c <<<"$input" | numfmt --to=iec)