google-genai 1.39.0__py3-none-any.whl → 1.39.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1775,3 +1775,20 @@ class BaseApiClient:
1775
1775
  await self._async_httpx_client.aclose()
1776
1776
  if self._aiohttp_session:
1777
1777
  await self._aiohttp_session.close()
1778
+
1779
+ def __del__(self) -> None:
1780
+ """Closes the API client when the object is garbage collected.
1781
+
1782
+ ADK uses this client so cannot rely on the genai.[Async]Client.__del__
1783
+ for cleanup.
1784
+ """
1785
+
1786
+ try:
1787
+ self.close()
1788
+ except Exception: # pylint: disable=broad-except
1789
+ pass
1790
+
1791
+ try:
1792
+ asyncio.get_running_loop().create_task(self.aclose())
1793
+ except Exception: # pylint: disable=broad-except
1794
+ pass
google/genai/client.py CHANGED
@@ -13,6 +13,7 @@
13
13
  # limitations under the License.
14
14
  #
15
15
 
16
+ import asyncio
16
17
  import os
17
18
  from types import TracebackType
18
19
  from typing import Optional, Union
@@ -125,7 +126,6 @@ class AsyncClient:
125
126
  await self.aclose()
126
127
 
127
128
  def __del__(self) -> None:
128
- import asyncio
129
129
  try:
130
130
  asyncio.get_running_loop().create_task(self.aclose())
131
131
  except Exception:
google/genai/version.py CHANGED
@@ -13,4 +13,4 @@
13
13
  # limitations under the License.
14
14
  #
15
15
 
16
- __version__ = '1.39.0' # x-release-please-version
16
+ __version__ = '1.39.1' # x-release-please-version
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: google-genai
3
- Version: 1.39.0
3
+ Version: 1.39.1
4
4
  Summary: GenAI Python SDK
5
5
  Author-email: Google LLC <googleapis-packages@google.com>
6
6
  License: Apache-2.0
@@ -1,6 +1,6 @@
1
1
  google/genai/__init__.py,sha256=SKz_9WQKA3R4OpJIDJlgssVfizLNDG2tuWtOD9pxrPE,729
2
2
  google/genai/_adapters.py,sha256=Kok38miNYJff2n--l0zEK_hbq0y2rWOH7k75J7SMYbQ,1744
3
- google/genai/_api_client.py,sha256=nYn0nHR5FvZrNpO8cKCd1OqwtelIaS1tTaR9pSsrBo8,61630
3
+ google/genai/_api_client.py,sha256=MjXU31z7dtbix5hSVM0dkM_TFvpUfonyvRhEdQ-NX-k,62056
4
4
  google/genai/_api_module.py,sha256=lj8eUWx8_LBGBz-49qz6_ywWm3GYp3d8Bg5JoOHbtbI,902
5
5
  google/genai/_automatic_function_calling_util.py,sha256=xXNkJR-pzSMkeSXMz3Jw-kMHFbTJEiRJ3wocuwtWW4I,11627
6
6
  google/genai/_base_transformers.py,sha256=wljA6m4tLl4XLGlBC2DNOls5N9-X9tffBq0M7i8jgpw,1034
@@ -18,7 +18,7 @@ google/genai/_transformers.py,sha256=-1GIrDNS4fH6Qx2jNm-VhcmlTSjWxanna7N7Tp_ctQ8
18
18
  google/genai/batches.py,sha256=x0KyOuj98NABrnZ4SNpGolNIsod6VB92NhGVM1dTnlY,102044
19
19
  google/genai/caches.py,sha256=-0TIzBDlVSCZNKR1PQb7q7pNQ0kwnRbb2MQYRwALMAc,67187
20
20
  google/genai/chats.py,sha256=pIBw8d13llupLn4a7vP6vnpbzDcvCCrZZ-Q2r8Cvo7g,16652
21
- google/genai/client.py,sha256=Ps5chw6BJc6F2CjNO_SjsOatepYrNxZa6-weIJxBPWw,13070
21
+ google/genai/client.py,sha256=bwKV5gHKpxzmfFTtoudQ_hEz5QfUzKYMJHYT-AnQfNU,13066
22
22
  google/genai/errors.py,sha256=zaPEs_GrtZuypvSPnOe32CTHO6nEVtshvc3Av2ug2Ac,5822
23
23
  google/genai/files.py,sha256=wNM0k9Hab8I7STThiZtA8BdRDaj6fNIdN7DxMr8zzxc,40211
24
24
  google/genai/live.py,sha256=BUyIOt-PON4SuJtKXA6l3ujzA3GUbYWMGSgZvsyKjrg,39674
@@ -31,9 +31,9 @@ google/genai/py.typed,sha256=RsMFoLwBkAvY05t6izop4UHZtqOPLiKp3GkIEizzmQY,40
31
31
  google/genai/tokens.py,sha256=8RbZ0kgvyKT3SwbgIUOHr6TTZL24v4fqYarhlA8r1ac,12503
32
32
  google/genai/tunings.py,sha256=_VzlKhlqFQHB7Lt4vU1HfGD11E5iolDfPdWrnigu5pw,62885
33
33
  google/genai/types.py,sha256=WfXL6BFOYhuHMLZKoVnPwvNoi0s73ajwtoW-0jK8C88,550882
34
- google/genai/version.py,sha256=oCGQ5OGKyiE6IO3Y5csyCr5Tksusrb17BGSSo0HZn28,627
35
- google_genai-1.39.0.dist-info/licenses/LICENSE,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
36
- google_genai-1.39.0.dist-info/METADATA,sha256=cH1U0b3lbxWeig3S3UUbUK_yBufjSsFwfzvw-f9eNfE,45381
37
- google_genai-1.39.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
38
- google_genai-1.39.0.dist-info/top_level.txt,sha256=_1QvSJIhFAGfxb79D6DhB7SUw2X6T4rwnz_LLrbcD3c,7
39
- google_genai-1.39.0.dist-info/RECORD,,
34
+ google/genai/version.py,sha256=9kaezsq7iGydw527Yusdh0fiol0CTkWV4TaMWjGEbww,627
35
+ google_genai-1.39.1.dist-info/licenses/LICENSE,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
36
+ google_genai-1.39.1.dist-info/METADATA,sha256=VzVw-MudwcrpSVi0l1SaSda3t1StnVuJ6qxoxm-cdRI,45381
37
+ google_genai-1.39.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
38
+ google_genai-1.39.1.dist-info/top_level.txt,sha256=_1QvSJIhFAGfxb79D6DhB7SUw2X6T4rwnz_LLrbcD3c,7
39
+ google_genai-1.39.1.dist-info/RECORD,,