Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions pydantic_ai_slim/pydantic_ai/providers/google.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,5 +219,6 @@ class _NonClosingApiClient(BaseApiClient):
async def aclose(self) -> None:
# The original implementation also calls `await self._async_httpx_client.aclose()`, but we don't want to close our `cached_async_http_client` or the one the user passed in.
# TODO: Remove once https://github.com/googleapis/python-genai/issues/1566 is solved.
if self._aiohttp_session:
await self._aiohttp_session.close() # pragma: no cover
session = getattr(self, '_aiohttp_session', None)
if session is not None:
await session.close() # pragma: no cover