From 2ee56d22f71d7152fb72d0fa4cef3c9955b3b5bc Mon Sep 17 00:00:00 2001 From: Haoyang Ma <62474794+SeleneXX@users.noreply.github.com> Date: Thu, 21 May 2026 10:31:47 +0800 Subject: [PATCH] fix: remove unsupported max_line_length arg from aiohttp readline() aiohttp.StreamReader.readline() does not accept any arguments. The line length limit is already controlled by read_bufsize set on the ClientSession --- google/genai/_api_client.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/google/genai/_api_client.py b/google/genai/_api_client.py index e6202815e..6d7da7819 100644 --- a/google/genai/_api_client.py +++ b/google/genai/_api_client.py @@ -447,9 +447,7 @@ async def _aiter_response_stream(self) -> AsyncIterator[str]: try: while True: # Read a line from the stream. This returns bytes. - line_bytes = await self.response_stream.content.readline( - max_line_length=READ_BUFFER_SIZE - ) + line_bytes = await self.response_stream.content.readline() if not line_bytes: break # Decode the bytes and remove trailing whitespace and newlines.