Skip to content
Merged
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
19 changes: 5 additions & 14 deletions google/genai/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@

import asyncio
import os
from types import TracebackType
from typing import Optional, Union
from typing import Any, Optional, Union

import google.auth
import pydantic
Expand Down Expand Up @@ -284,12 +283,8 @@ async def aclose(self) -> None:
async def __aenter__(self) -> 'AsyncClient':
return self

async def __aexit__(
self,
exc_type: Optional[Exception],
exc_value: Optional[Exception],
traceback: Optional[TracebackType],
) -> None:
async def __aexit__(self, *args: Any, **kwargs: Any) -> None:
del args, kwargs
await self.aclose()

def __del__(self) -> None:
Expand Down Expand Up @@ -640,12 +635,8 @@ def close(self) -> None:
def __enter__(self) -> 'Client':
return self

def __exit__(
self,
exc_type: Optional[Exception],
exc_value: Optional[Exception],
traceback: Optional[TracebackType],
) -> None:
def __exit__(self, *args: Any, **kwargs: Any) -> None:
del args, kwargs
self.close()

def __del__(self) -> None:
Expand Down
Loading