summaryrefslogtreecommitdiffstats
path: root/g4f/client/async_client.py
diff options
context:
space:
mode:
authorH Lohaus <hlohaus@users.noreply.github.com>2024-04-12 18:01:54 +0200
committerGitHub <noreply@github.com>2024-04-12 18:01:54 +0200
commit0b712c2bde77fe7e3e347d71d5de3c9e62f26738 (patch)
treebd93b8b64705c74be6feff9cc2f7cba7837c8da8 /g4f/client/async_client.py
parentMerge pull request #1825 from hlohaus/ws (diff)
downloadgpt4free-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 '')
-rw-r--r--g4f/client/async_client.py7
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,