Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: always use stream unless set --no-stream explicitly #415

Merged
merged 1 commit into from
Apr 15, 2024

Conversation

sigoden
Copy link
Owner

@sigoden sigoden commented Apr 15, 2024

Aichat will detect whether tdout is terminal. If it is not, Aichat will automatically switch to non-stream mode.
This will not be true after this PR.

There will be only two conditions for Aichat use non-stream mode:

  • explicitly pass --no-stream option
  • pass -c/--code option and stdout is not terminal (for extracting code from markdown)

Users who use aichat in a script should explicitly pass --no-stream.

solve #414

@sigoden sigoden changed the title feat: use non-stream when stdout is not terminal unless --no-stream feat: use stream unless pass --no-stream Apr 15, 2024
@sigoden sigoden changed the title feat: use stream unless pass --no-stream feat: always use stream unless set --no-stream explicitly Apr 15, 2024
@sigoden sigoden merged commit 9149954 into main Apr 15, 2024
3 checks passed
@sigoden sigoden deleted the feat-non-stream branch April 15, 2024 03:28
@johnd0e
Copy link

johnd0e commented Apr 19, 2024

Thank you.
However, piped output behaves slightly differently: it appears line by line rather than word by word.
Is it possible to fix?

@sigoden
Copy link
Owner Author

sigoden commented Apr 19, 2024

a9a2ca fixed it.

@johnd0e
Copy link

johnd0e commented Apr 20, 2024

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants