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

Support for asyncio ? #54

Open
skrawani opened this issue Oct 31, 2023 · 2 comments
Open

Support for asyncio ? #54

skrawani opened this issue Oct 31, 2023 · 2 comments

Comments

@skrawani
Copy link

I noticed that there is no mention of asyncio support. Are there any plans to support asyncio in the future? Currently, when async generators are used, it throws a TypeError: 'async_generator' object is not an iterator.

@daggaz
Copy link
Owner

daggaz commented Oct 31, 2023

It's something I've considered adding, but I've no immediate plans

@pmeier
Copy link

pmeier commented Jan 31, 2024

Just adding a real-world use case: the generative models from Google AI return a JSON stream. However, since json-stream does not support async iterators, I need to make a sync API call. And this has to be done on a thread to avoid blocking the main thread with mostly just waiting for the API to respond.

Since there is workaround, I can still use json-stream here, but it is somewhat inconvenient.

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

3 participants