diff options
Diffstat (limited to 'g4f/client/async_client.py')
-rw-r--r-- | g4f/client/async_client.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/g4f/client/async_client.py b/g4f/client/async_client.py index bab2fde9..51a9cf83 100644 --- a/g4f/client/async_client.py +++ b/g4f/client/async_client.py @@ -16,6 +16,13 @@ from ..errors import NoImageResponseError from ..image import ImageResponse as ImageProviderResponse from ..providers.base_provider import AsyncGeneratorProvider +try: + anext +except NameError: + async def anext(iter): + async for chunk in iter: + return chunk + async def iter_response( response: AsyncIterator[str], stream: bool, |