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

FR: cancel stream #13

Open
7flash opened this issue Feb 19, 2024 · 0 comments
Open

FR: cancel stream #13

7flash opened this issue Feb 19, 2024 · 0 comments

Comments

@7flash
Copy link

7flash commented Feb 19, 2024

I would like to be able cancel generating tokens at any iteration

async for output in emoji_stream("Hey there, how is it going?"):
    if (is_not_emoji(output.data.content)) break;
    print(output.data.content, end="")

Would it work?

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

No branches or pull requests

1 participant