Use readline to read lines
This commit is contained in:
parent
101db8cada
commit
f2987fd85e
2
ai-chat
2
ai-chat
@ -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"
|
||||||
|
Loading…
Reference in New Issue
Block a user