Use readline to read lines

This commit is contained in:
vlad 2023-03-16 17:45:01 -07:00
parent 101db8cada
commit f2987fd85e

View File

@ -7,7 +7,7 @@ prompt="You are Mr.Helper. You are an assistant that lives in a floating termina
echo -n "$prompt" | jq -sR '{"role": "system", "content": .}' > "$conversation_file" echo -n "$prompt" | jq -sR '{"role": "system", "content": .}' > "$conversation_file"
while read -rp '> ' prompt ; do while read -rep '> ' prompt ; do
[ -n "$prompt" ] || continue [ -n "$prompt" ] || continue
echo -n "$prompt" | jq -sR '{"role": "user", "content": .}' >> "$conversation_file" echo -n "$prompt" | jq -sR '{"role": "user", "content": .}' >> "$conversation_file"