File tree Expand file tree Collapse file tree 2 files changed +6
-8
lines changed
Expand file tree Collapse file tree 2 files changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -267,13 +267,7 @@ async def __anext__(self) -> Any:
267267
268268 @property
269269 def json (self ) -> Any :
270- # Handle case where response_stream is not a list (e.g., aiohttp.ClientResponse)
271- # This can happen when the API returns an error and the response object
272- # is passed directly instead of being wrapped in a list.
273- # See: https://github.com/googleapis/python-genai/issues/1897
274- if not isinstance (self .response_stream , list ):
275- return None
276- if not self .response_stream or not self .response_stream [0 ]: # Empty response
270+ if not self .response_stream [0 ]: # Empty response
277271 return ''
278272 return self ._load_json_from_response (self .response_stream [0 ])
279273
Original file line number Diff line number Diff line change @@ -40,7 +40,11 @@ def test_patch_http_options_with_copies_all_fields():
4040
4141 for key in http_options_keys :
4242 assert hasattr (patched , key )
43- if key not in ['httpx_client' , 'httpx_async_client' , 'aiohttp_client' ]:
43+ if key not in [
44+ 'httpx_client' ,
45+ 'httpx_async_client' ,
46+ 'aiohttp_client' ,
47+ ]:
4448 assert getattr (patched , key ) is not None
4549 assert patched .base_url == 'https://fake-url.com/'
4650 assert patched .api_version == 'v1'
You can’t perform that action at this time.
0 commit comments