Simatwa / python-tgpt

AI Chat in Terminal + Package + REST-API
https://python-tgpt.onrender.com
MIT License
102 stars 15 forks source link

Support streaming to pipe #43

Closed johnd0e closed 4 months ago

johnd0e commented 4 months ago

Describe the bug When using in terminal text streaming works as it should, but when piping output - it shows up all at once.

To Reproduce

pytgpt generate --quiet --disable-conversation "Write a short story"|less

Expected behavior When I pipe other utilities to less - I see output appear line by line.

Environment:

Simatwa commented 4 months ago

A fix is on the way folk.

Simatwa commented 4 months ago

Actually am loving this idea.

pytgpt generate --raw "Write a short story"

pytgpt interactive --raw Works fine as well.

NB : There's no need for --quiet flag on output redirection since its set automagically.

Kudos.

johnd0e commented 4 months ago

Thank you!