summaryrefslogtreecommitdiffstats
path: root/g4f/requests
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/requests
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 'g4f/requests')
-rw-r--r--g4f/requests/curl_cffi.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/g4f/requests/curl_cffi.py b/g4f/requests/curl_cffi.py
index 000448fe..e955d640 100644
--- a/g4f/requests/curl_cffi.py
+++ b/g4f/requests/curl_cffi.py
@@ -34,15 +34,13 @@ class StreamResponse:
"""Asynchronously parse the JSON response content."""
return json.loads(await self.inner.acontent(), **kwargs)
- async def iter_lines(self) -> AsyncGenerator[bytes, None]:
+ def iter_lines(self) -> AsyncGenerator[bytes, None]:
"""Asynchronously iterate over the lines of the response."""
- async for line in self.inner.aiter_lines():
- yield line
+ return self.inner.aiter_lines()
- async def iter_content(self) -> AsyncGenerator[bytes, None]:
+ def iter_content(self) -> AsyncGenerator[bytes, None]:
"""Asynchronously iterate over the response content."""
- async for chunk in self.inner.aiter_content():
- yield chunk
+ return self.inner.aiter_content()
async def __aenter__(self):
"""Asynchronously enter the runtime context for the response object."""