google-genai 1.50.0__py3-none-any.whl → 1.50.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.
@@ -628,15 +628,15 @@ class BaseApiClient:
628
628
  )
629
629
  self.api_key = None
630
630
 
631
- if not self.location and not self.api_key:
632
- self.location = 'global'
633
-
634
631
  self.custom_base_url = (
635
632
  validated_http_options.base_url
636
633
  if validated_http_options.base_url
637
634
  else None
638
635
  )
639
636
 
637
+ if not self.location and not self.api_key and not self.custom_base_url:
638
+ self.location = 'global'
639
+
640
640
  # Skip fetching project from ADC if base url is provided in http options.
641
641
  if (
642
642
  not self.project
@@ -1836,12 +1836,17 @@ class BaseApiClient:
1836
1836
 
1837
1837
  def close(self) -> None:
1838
1838
  """Closes the API client."""
1839
- self._httpx_client.close()
1839
+ # Let users close the custom client explicitly by themselves. Otherwise,
1840
+ # close the client when the object is garbage collected.
1841
+ if not self._http_options.httpx_client:
1842
+ self._httpx_client.close()
1840
1843
 
1841
1844
  async def aclose(self) -> None:
1842
1845
  """Closes the API async client."""
1843
-
1844
- await self._async_httpx_client.aclose()
1846
+ # Let users close the custom client explicitly by themselves. Otherwise,
1847
+ # close the client when the object is garbage collected.
1848
+ if not self._http_options.httpx_async_client:
1849
+ await self._async_httpx_client.aclose()
1845
1850
  if self._aiohttp_session:
1846
1851
  await self._aiohttp_session.close()
1847
1852
 
@@ -1853,17 +1858,12 @@ class BaseApiClient:
1853
1858
  """
1854
1859
 
1855
1860
  try:
1856
- # Let users close the custom client explicitly by themselves. Otherwise,
1857
- # close the client when the object is garbage collected.
1858
1861
  if not self._http_options.httpx_client:
1859
1862
  self.close()
1860
1863
  except Exception: # pylint: disable=broad-except
1861
1864
  pass
1862
1865
 
1863
1866
  try:
1864
- # Let users close the custom client explicitly by themselves. Otherwise,
1865
- # close the client when the object is garbage collected.
1866
- if not self._http_options.httpx_async_client:
1867
- asyncio.get_running_loop().create_task(self.aclose())
1867
+ asyncio.get_running_loop().create_task(self.aclose())
1868
1868
  except Exception: # pylint: disable=broad-except
1869
1869
  pass
google/genai/version.py CHANGED
@@ -13,4 +13,4 @@
13
13
  # limitations under the License.
14
14
  #
15
15
 
16
- __version__ = '1.50.0' # x-release-please-version
16
+ __version__ = '1.50.1' # x-release-please-version
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: google-genai
3
- Version: 1.50.0
3
+ Version: 1.50.1
4
4
  Summary: GenAI Python SDK
5
5
  Author-email: Google LLC <googleapis-packages@google.com>
6
6
  License-Expression: 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=ItKsLMD2rwIgWOmJZ09zJWXiPLPogK4YoFz4DrphRXI,65018
3
+ google/genai/_api_client.py,sha256=HB7TPN_H-rGnpy3Ainz91To7SaGr0lr0hlYZopJ8ZXc,65082
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
@@ -33,9 +33,9 @@ google/genai/py.typed,sha256=RsMFoLwBkAvY05t6izop4UHZtqOPLiKp3GkIEizzmQY,40
33
33
  google/genai/tokens.py,sha256=4BPW0gGWFeFVk3INkuY2tfREnsrvzQDhouvRI6_F9Q8,12235
34
34
  google/genai/tunings.py,sha256=8JTTXCwrmzS6gGorMhOmgXJKy8VjEw83gtrymPpPYkQ,73623
35
35
  google/genai/types.py,sha256=cdy0ToeFt9ycois5ko9IQtFqG7jWhlnOSGWJxWzooEE,632574
36
- google/genai/version.py,sha256=1LnldNVkn2VUYI77boUb9dPuBjRRI2-1RYzKXj5Oc4I,627
37
- google_genai-1.50.0.dist-info/licenses/LICENSE,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
38
- google_genai-1.50.0.dist-info/METADATA,sha256=UmC-Fq1t96UogS4m0vexc_NndRtywEaMGNKvkHJLoMM,46732
39
- google_genai-1.50.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
40
- google_genai-1.50.0.dist-info/top_level.txt,sha256=_1QvSJIhFAGfxb79D6DhB7SUw2X6T4rwnz_LLrbcD3c,7
41
- google_genai-1.50.0.dist-info/RECORD,,
36
+ google/genai/version.py,sha256=QTQcmOJcS1u0J9Tdf08J-gfHndryKlFvsa4zxWDEHBA,627
37
+ google_genai-1.50.1.dist-info/licenses/LICENSE,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
38
+ google_genai-1.50.1.dist-info/METADATA,sha256=N58MYvisL5EJ-5Uw041nICsdaiZ6h3OTaZnzCv-Da40,46732
39
+ google_genai-1.50.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
40
+ google_genai-1.50.1.dist-info/top_level.txt,sha256=_1QvSJIhFAGfxb79D6DhB7SUw2X6T4rwnz_LLrbcD3c,7
41
+ google_genai-1.50.1.dist-info/RECORD,,