google-genai 1.34.0__py3-none-any.whl → 1.36.0__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.
@@ -1344,7 +1344,7 @@ def _FunctionCall_to_vertex(
1344
1344
  ) -> dict[str, Any]:
1345
1345
  to_object: dict[str, Any] = {}
1346
1346
  if getv(from_object, ['id']) is not None:
1347
- raise ValueError('id parameter is not supported in Vertex AI.')
1347
+ setv(to_object, ['id'], getv(from_object, ['id']))
1348
1348
 
1349
1349
  if getv(from_object, ['args']) is not None:
1350
1350
  setv(to_object, ['args'], getv(from_object, ['args']))
@@ -3166,6 +3166,8 @@ def _FunctionCall_from_vertex(
3166
3166
  parent_object: Optional[dict[str, Any]] = None,
3167
3167
  ) -> dict[str, Any]:
3168
3168
  to_object: dict[str, Any] = {}
3169
+ if getv(from_object, ['id']) is not None:
3170
+ setv(to_object, ['id'], getv(from_object, ['id']))
3169
3171
 
3170
3172
  if getv(from_object, ['args']) is not None:
3171
3173
  setv(to_object, ['args'], getv(from_object, ['args']))
google/genai/caches.py CHANGED
@@ -711,7 +711,7 @@ def _FunctionCall_to_vertex(
711
711
  ) -> dict[str, Any]:
712
712
  to_object: dict[str, Any] = {}
713
713
  if getv(from_object, ['id']) is not None:
714
- raise ValueError('id parameter is not supported in Vertex AI.')
714
+ setv(to_object, ['id'], getv(from_object, ['id']))
715
715
 
716
716
  if getv(from_object, ['args']) is not None:
717
717
  setv(to_object, ['args'], getv(from_object, ['args']))
google/genai/models.py CHANGED
@@ -1392,6 +1392,9 @@ def _GenerateVideosConfig_to_mldev(
1392
1392
  'reference_images parameter is not supported in Gemini API.'
1393
1393
  )
1394
1394
 
1395
+ if getv(from_object, ['mask']) is not None:
1396
+ raise ValueError('mask parameter is not supported in Gemini API.')
1397
+
1395
1398
  if getv(from_object, ['compression_quality']) is not None:
1396
1399
  raise ValueError(
1397
1400
  'compression_quality parameter is not supported in Gemini API.'
@@ -1504,7 +1507,7 @@ def _FunctionCall_to_vertex(
1504
1507
  ) -> dict[str, Any]:
1505
1508
  to_object: dict[str, Any] = {}
1506
1509
  if getv(from_object, ['id']) is not None:
1507
- raise ValueError('id parameter is not supported in Vertex AI.')
1510
+ setv(to_object, ['id'], getv(from_object, ['id']))
1508
1511
 
1509
1512
  if getv(from_object, ['args']) is not None:
1510
1513
  setv(to_object, ['args'], getv(from_object, ['args']))
@@ -3536,6 +3539,24 @@ def _VideoGenerationReferenceImage_to_vertex(
3536
3539
  return to_object
3537
3540
 
3538
3541
 
3542
+ def _VideoGenerationMask_to_vertex(
3543
+ from_object: Union[dict[str, Any], object],
3544
+ parent_object: Optional[dict[str, Any]] = None,
3545
+ ) -> dict[str, Any]:
3546
+ to_object: dict[str, Any] = {}
3547
+ if getv(from_object, ['image']) is not None:
3548
+ setv(
3549
+ to_object,
3550
+ ['_self'],
3551
+ _Image_to_vertex(getv(from_object, ['image']), to_object),
3552
+ )
3553
+
3554
+ if getv(from_object, ['mask_mode']) is not None:
3555
+ setv(to_object, ['maskMode'], getv(from_object, ['mask_mode']))
3556
+
3557
+ return to_object
3558
+
3559
+
3539
3560
  def _GenerateVideosConfig_to_vertex(
3540
3561
  from_object: Union[dict[str, Any], object],
3541
3562
  parent_object: Optional[dict[str, Any]] = None,
@@ -3635,6 +3656,13 @@ def _GenerateVideosConfig_to_vertex(
3635
3656
  ],
3636
3657
  )
3637
3658
 
3659
+ if getv(from_object, ['mask']) is not None:
3660
+ setv(
3661
+ parent_object,
3662
+ ['instances[0]', 'mask'],
3663
+ _VideoGenerationMask_to_vertex(getv(from_object, ['mask']), to_object),
3664
+ )
3665
+
3638
3666
  if getv(from_object, ['compression_quality']) is not None:
3639
3667
  setv(
3640
3668
  parent_object,
@@ -4448,6 +4476,8 @@ def _FunctionCall_from_vertex(
4448
4476
  parent_object: Optional[dict[str, Any]] = None,
4449
4477
  ) -> dict[str, Any]:
4450
4478
  to_object: dict[str, Any] = {}
4479
+ if getv(from_object, ['id']) is not None:
4480
+ setv(to_object, ['id'], getv(from_object, ['id']))
4451
4481
 
4452
4482
  if getv(from_object, ['args']) is not None:
4453
4483
  setv(to_object, ['args'], getv(from_object, ['args']))
google/genai/tunings.py CHANGED
@@ -209,6 +209,9 @@ def _CreateTuningJobConfig_to_mldev(
209
209
  'evaluation_config parameter is not supported in Gemini API.'
210
210
  )
211
211
 
212
+ if getv(from_object, ['labels']) is not None:
213
+ raise ValueError('labels parameter is not supported in Gemini API.')
214
+
212
215
  return to_object
213
216
 
214
217
 
@@ -507,6 +510,9 @@ def _CreateTuningJobConfig_to_vertex(
507
510
  ),
508
511
  )
509
512
 
513
+ if getv(from_object, ['labels']) is not None:
514
+ setv(parent_object, ['labels'], getv(from_object, ['labels']))
515
+
510
516
  return to_object
511
517
 
512
518
 
google/genai/types.py CHANGED
@@ -8415,6 +8415,36 @@ VideoGenerationReferenceImageOrDict = Union[
8415
8415
  ]
8416
8416
 
8417
8417
 
8418
+ class VideoGenerationMask(_common.BaseModel):
8419
+ """A mask for video generation."""
8420
+
8421
+ image: Optional[Image] = Field(
8422
+ default=None,
8423
+ description="""The image mask to use for generating videos.""",
8424
+ )
8425
+ mask_mode: Optional[str] = Field(
8426
+ default=None,
8427
+ description="""Describes how the mask will be used. Inpainting masks must
8428
+ match the aspect ratio of the input video. Outpainting masks can be
8429
+ either 9:16 or 16:9.""",
8430
+ )
8431
+
8432
+
8433
+ class VideoGenerationMaskDict(TypedDict, total=False):
8434
+ """A mask for video generation."""
8435
+
8436
+ image: Optional[ImageDict]
8437
+ """The image mask to use for generating videos."""
8438
+
8439
+ mask_mode: Optional[str]
8440
+ """Describes how the mask will be used. Inpainting masks must
8441
+ match the aspect ratio of the input video. Outpainting masks can be
8442
+ either 9:16 or 16:9."""
8443
+
8444
+
8445
+ VideoGenerationMaskOrDict = Union[VideoGenerationMask, VideoGenerationMaskDict]
8446
+
8447
+
8418
8448
  class GenerateVideosConfig(_common.BaseModel):
8419
8449
  """Configuration for generating videos."""
8420
8450
 
@@ -8487,6 +8517,9 @@ class GenerateVideosConfig(_common.BaseModel):
8487
8517
  be associated with a type. Veo 2 supports up to 3 asset images *or* 1
8488
8518
  style image.""",
8489
8519
  )
8520
+ mask: Optional[VideoGenerationMask] = Field(
8521
+ default=None, description="""The mask to use for generating videos."""
8522
+ )
8490
8523
  compression_quality: Optional[VideoCompressionQuality] = Field(
8491
8524
  default=None,
8492
8525
  description="""Compression quality of the generated videos.""",
@@ -8554,6 +8587,9 @@ class GenerateVideosConfigDict(TypedDict, total=False):
8554
8587
  be associated with a type. Veo 2 supports up to 3 asset images *or* 1
8555
8588
  style image."""
8556
8589
 
8590
+ mask: Optional[VideoGenerationMaskDict]
8591
+ """The mask to use for generating videos."""
8592
+
8557
8593
  compression_quality: Optional[VideoCompressionQuality]
8558
8594
  """Compression quality of the generated videos."""
8559
8595
 
@@ -10374,6 +10410,10 @@ class CreateTuningJobConfig(_common.BaseModel):
10374
10410
  evaluation_config: Optional[EvaluationConfig] = Field(
10375
10411
  default=None, description="""Evaluation config for the tuning job."""
10376
10412
  )
10413
+ labels: Optional[dict[str, str]] = Field(
10414
+ default=None,
10415
+ description="""Optional. The labels with user-defined metadata to organize TuningJob and generated resources such as Model and Endpoint. Label keys and values can be no longer than 64 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. See https://goo.gl/xmQnxf for more information and examples of labels.""",
10416
+ )
10377
10417
 
10378
10418
 
10379
10419
  class CreateTuningJobConfigDict(TypedDict, total=False):
@@ -10415,6 +10455,9 @@ class CreateTuningJobConfigDict(TypedDict, total=False):
10415
10455
  evaluation_config: Optional[EvaluationConfigDict]
10416
10456
  """Evaluation config for the tuning job."""
10417
10457
 
10458
+ labels: Optional[dict[str, str]]
10459
+ """Optional. The labels with user-defined metadata to organize TuningJob and generated resources such as Model and Endpoint. Label keys and values can be no longer than 64 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. See https://goo.gl/xmQnxf for more information and examples of labels."""
10460
+
10418
10461
 
10419
10462
  CreateTuningJobConfigOrDict = Union[
10420
10463
  CreateTuningJobConfig, CreateTuningJobConfigDict
google/genai/version.py CHANGED
@@ -13,4 +13,4 @@
13
13
  # limitations under the License.
14
14
  #
15
15
 
16
- __version__ = '1.34.0' # x-release-please-version
16
+ __version__ = '1.36.0' # x-release-please-version
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: google-genai
3
- Version: 1.34.0
3
+ Version: 1.36.0
4
4
  Summary: GenAI Python SDK
5
5
  Author-email: Google LLC <googleapis-packages@google.com>
6
6
  License: Apache-2.0
@@ -7,7 +7,7 @@ google/genai/_base_transformers.py,sha256=wljA6m4tLl4XLGlBC2DNOls5N9-X9tffBq0M7i
7
7
  google/genai/_base_url.py,sha256=E5H4dew14Y16qfnB3XRnjSCi19cJVlkaMNoM_8ip-PM,1597
8
8
  google/genai/_common.py,sha256=VziliVbesmNtke6Fh2wk-kQlCOxEpmkqYb0y4qfKIo4,20074
9
9
  google/genai/_extra_utils.py,sha256=myEPyU_-RXExXtMGitJUKEMWUPiDudScgTN9LqFC8h4,20468
10
- google/genai/_live_converters.py,sha256=OBKnJD7zgrfG6TOVSXoo9TkVHwXvLzudod0U40MqtZw,103192
10
+ google/genai/_live_converters.py,sha256=MMyDkferhBJiR3-dI8k8Rqr9LVzONtf4ibGq9FNzoew,103278
11
11
  google/genai/_local_tokenizer_loader.py,sha256=cGN1F0f7hNjRIGCGTLeox7IGAZf_YcvZjSp2rCyhUak,7465
12
12
  google/genai/_mcp_utils.py,sha256=HuWJ8FUjquv40Mf_QjcL5r5yXWrS-JjINsjlOSbbyAc,3870
13
13
  google/genai/_operations_converters.py,sha256=I1b46qhGCeB5uHNuyrMxpFqmzWuvSFQ5pS52csd1J4E,9080
@@ -16,7 +16,7 @@ google/genai/_test_api_client.py,sha256=4ruFIy5_1qcbKqqIBu3HSQbpSOBrxiecBtDZaTGF
16
16
  google/genai/_tokens_converters.py,sha256=42xx5Inv3YMqEdarb3lmt-w54D2tpb9QEBy0DSUATQk,24963
17
17
  google/genai/_transformers.py,sha256=rtaCagL4htyu8MzuxqQJ_xnJqRwwuQKR7CWXYpydBZ4,40260
18
18
  google/genai/batches.py,sha256=UJ-zc2UXqQfej8bqqtgeNrepc7zDQBzRlmkRf4Wlr4U,102880
19
- google/genai/caches.py,sha256=0LVzGcF1t5tHq5QUZzstEGfOqbUPV3B8eywknqFWKD8,67650
19
+ google/genai/caches.py,sha256=OuWOomIf7McQk0_jKivA-aBv__5vDc249rBEPqOh_XE,67637
20
20
  google/genai/chats.py,sha256=pIBw8d13llupLn4a7vP6vnpbzDcvCCrZZ-Q2r8Cvo7g,16652
21
21
  google/genai/client.py,sha256=wXnfZBSv9p-yKtX_gabUrfBXoYHuqHhzK_VgwRttMgY,10777
22
22
  google/genai/errors.py,sha256=GlEvypbRgF3h5BxlocmWVf-S9kzERA_lwGLCMyAvpcY,5714
@@ -24,16 +24,16 @@ google/genai/files.py,sha256=T8uDgqCQheFwYYYJdN4lax4NOR_q6bJyr0jQf079VeE,40607
24
24
  google/genai/live.py,sha256=BUyIOt-PON4SuJtKXA6l3ujzA3GUbYWMGSgZvsyKjrg,39674
25
25
  google/genai/live_music.py,sha256=3GG9nsto8Vhkohcs-4CPMS4DFp1ZtMuLYzHfvEPYAeg,6971
26
26
  google/genai/local_tokenizer.py,sha256=ZYOdZFS2nJbgDGOMrVzn2hZ_1G8I4_PuVsh6HU8jEgo,14055
27
- google/genai/models.py,sha256=84KEXFWSVaE9vLgPwUWZCE-MXldBZUlHAiI3WBoW7qM,267291
27
+ google/genai/models.py,sha256=eyvuAh7Ky-rpWYBFNnXz8cjgGjvP08EYxgHBY8VInBM,268195
28
28
  google/genai/operations.py,sha256=Ccm4EW13cT_EtCq8Fa3n8jlQySyy9KqJ98ZK4pF0DDA,12815
29
29
  google/genai/pagers.py,sha256=m0SfWWn1EJs2k1On3DZx371qb8g2BRm_188ExsicIRc,7098
30
30
  google/genai/py.typed,sha256=RsMFoLwBkAvY05t6izop4UHZtqOPLiKp3GkIEizzmQY,40
31
31
  google/genai/tokens.py,sha256=8RbZ0kgvyKT3SwbgIUOHr6TTZL24v4fqYarhlA8r1ac,12503
32
- google/genai/tunings.py,sha256=vVV9NvrtzoWDLzcTLSrgD5lzFeSRJdCB1QtfzL3yj3c,63275
33
- google/genai/types.py,sha256=X_EJw9XImkNUV-kei6sX_EyamVh3ZcllCyhDY6oGIKg,537135
34
- google/genai/version.py,sha256=pq67EsG5-MVW2erGgNTP2s1tkENaUdCa412taBfzfhM,627
35
- google_genai-1.34.0.dist-info/licenses/LICENSE,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
36
- google_genai-1.34.0.dist-info/METADATA,sha256=hfQsErEKbSrvHuHNO9w49pDdJnDcjIdj5mDKNAst85o,43556
37
- google_genai-1.34.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
38
- google_genai-1.34.0.dist-info/top_level.txt,sha256=_1QvSJIhFAGfxb79D6DhB7SUw2X6T4rwnz_LLrbcD3c,7
39
- google_genai-1.34.0.dist-info/RECORD,,
32
+ google/genai/tunings.py,sha256=TVohav5pT5jOj4RgnPdvLI6iDdOVGnPRB8XRBNuyP2E,63513
33
+ google/genai/types.py,sha256=fspcawXVefHjztCcyaVWm9A9EmujLyIeTenKFAG1n2c,539186
34
+ google/genai/version.py,sha256=Rk9SxRsO8FUdbqZ7sGPZhwBPi5FC7Dq5vMf2ArZQChs,627
35
+ google_genai-1.36.0.dist-info/licenses/LICENSE,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
36
+ google_genai-1.36.0.dist-info/METADATA,sha256=ehuHCcSvnNNaG8eLakJRyvYAkq7213E7ZAFsosqiE88,43556
37
+ google_genai-1.36.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
38
+ google_genai-1.36.0.dist-info/top_level.txt,sha256=_1QvSJIhFAGfxb79D6DhB7SUw2X6T4rwnz_LLrbcD3c,7
39
+ google_genai-1.36.0.dist-info/RECORD,,