diff options
author | H Lohaus <hlohaus@users.noreply.github.com> | 2024-04-12 18:01:54 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-12 18:01:54 +0200 |
commit | 0b712c2bde77fe7e3e347d71d5de3c9e62f26738 (patch) | |
tree | bd93b8b64705c74be6feff9cc2f7cba7837c8da8 /g4f/client/async_client.py | |
parent | Merge pull request #1825 from hlohaus/ws (diff) | |
download | gpt4free-0b712c2bde77fe7e3e347d71d5de3c9e62f26738.tar gpt4free-0b712c2bde77fe7e3e347d71d5de3c9e62f26738.tar.gz gpt4free-0b712c2bde77fe7e3e347d71d5de3c9e62f26738.tar.bz2 gpt4free-0b712c2bde77fe7e3e347d71d5de3c9e62f26738.tar.lz gpt4free-0b712c2bde77fe7e3e347d71d5de3c9e62f26738.tar.xz gpt4free-0b712c2bde77fe7e3e347d71d5de3c9e62f26738.tar.zst gpt4free-0b712c2bde77fe7e3e347d71d5de3c9e62f26738.zip |
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, |