google-genai 1.21.1__py3-none-any.whl → 1.23.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.
- google/genai/_api_client.py +88 -11
- google/genai/_common.py +181 -1
- google/genai/_extra_utils.py +48 -10
- google/genai/_transformers.py +85 -20
- google/genai/batches.py +4717 -155
- google/genai/caches.py +10 -0
- google/genai/files.py +8 -0
- google/genai/live.py +12 -11
- google/genai/models.py +106 -2
- google/genai/operations.py +4 -0
- google/genai/tunings.py +33 -1
- google/genai/types.py +347 -78
- google/genai/version.py +1 -1
- {google_genai-1.21.1.dist-info → google_genai-1.23.0.dist-info}/METADATA +51 -2
- {google_genai-1.21.1.dist-info → google_genai-1.23.0.dist-info}/RECORD +18 -18
- {google_genai-1.21.1.dist-info → google_genai-1.23.0.dist-info}/WHEEL +0 -0
- {google_genai-1.21.1.dist-info → google_genai-1.23.0.dist-info}/licenses/LICENSE +0 -0
- {google_genai-1.21.1.dist-info → google_genai-1.23.0.dist-info}/top_level.txt +0 -0
google/genai/types.py
CHANGED
@@ -435,8 +435,11 @@ class PersonGeneration(_common.CaseInSensitiveEnum):
|
|
435
435
|
"""Enum that controls the generation of people."""
|
436
436
|
|
437
437
|
DONT_ALLOW = 'DONT_ALLOW'
|
438
|
+
"""Block generation of images of people."""
|
438
439
|
ALLOW_ADULT = 'ALLOW_ADULT'
|
440
|
+
"""Generate images of adults, but not children."""
|
439
441
|
ALLOW_ALL = 'ALLOW_ALL'
|
442
|
+
"""Generate images that include adults and children."""
|
440
443
|
|
441
444
|
|
442
445
|
class ImagePromptLanguage(_common.CaseInSensitiveEnum):
|
@@ -490,6 +493,17 @@ class EditMode(_common.CaseInSensitiveEnum):
|
|
490
493
|
EDIT_MODE_PRODUCT_IMAGE = 'EDIT_MODE_PRODUCT_IMAGE'
|
491
494
|
|
492
495
|
|
496
|
+
class VideoCompressionQuality(_common.CaseInSensitiveEnum):
|
497
|
+
"""Enum that controls the compression quality of the generated videos."""
|
498
|
+
|
499
|
+
OPTIMIZED = 'OPTIMIZED'
|
500
|
+
"""Optimized video compression quality. This will produce videos
|
501
|
+
with a compressed, smaller file size."""
|
502
|
+
LOSSLESS = 'LOSSLESS'
|
503
|
+
"""Lossless video compression quality. This will produce videos
|
504
|
+
with a larger file size."""
|
505
|
+
|
506
|
+
|
493
507
|
class FileState(_common.CaseInSensitiveEnum):
|
494
508
|
"""State for the lifecycle of a File."""
|
495
509
|
|
@@ -3257,7 +3271,7 @@ class ThinkingConfig(_common.BaseModel):
|
|
3257
3271
|
)
|
3258
3272
|
thinking_budget: Optional[int] = Field(
|
3259
3273
|
default=None,
|
3260
|
-
description="""Indicates the thinking budget in tokens.
|
3274
|
+
description="""Indicates the thinking budget in tokens. 0 is DISABLED. -1 is AUTOMATIC. The default values and allowed ranges are model dependent.
|
3261
3275
|
""",
|
3262
3276
|
)
|
3263
3277
|
|
@@ -3270,7 +3284,7 @@ class ThinkingConfigDict(TypedDict, total=False):
|
|
3270
3284
|
"""
|
3271
3285
|
|
3272
3286
|
thinking_budget: Optional[int]
|
3273
|
-
"""Indicates the thinking budget in tokens.
|
3287
|
+
"""Indicates the thinking budget in tokens. 0 is DISABLED. -1 is AUTOMATIC. The default values and allowed ranges are model dependent.
|
3274
3288
|
"""
|
3275
3289
|
|
3276
3290
|
|
@@ -3617,6 +3631,24 @@ class GenerateContentConfig(_common.BaseModel):
|
|
3617
3631
|
Compatible mimetypes: `application/json`: Schema for JSON response.
|
3618
3632
|
""",
|
3619
3633
|
)
|
3634
|
+
response_json_schema: Optional[Any] = Field(
|
3635
|
+
default=None,
|
3636
|
+
description="""Optional. Output schema of the generated response.
|
3637
|
+
This is an alternative to `response_schema` that accepts [JSON
|
3638
|
+
Schema](https://json-schema.org/). If set, `response_schema` must be
|
3639
|
+
omitted, but `response_mime_type` is required. While the full JSON Schema
|
3640
|
+
may be sent, not all features are supported. Specifically, only the
|
3641
|
+
following properties are supported: - `$id` - `$defs` - `$ref` - `$anchor`
|
3642
|
+
- `type` - `format` - `title` - `description` - `enum` (for strings and
|
3643
|
+
numbers) - `items` - `prefixItems` - `minItems` - `maxItems` - `minimum` -
|
3644
|
+
`maximum` - `anyOf` - `oneOf` (interpreted the same as `anyOf`) -
|
3645
|
+
`properties` - `additionalProperties` - `required` The non-standard
|
3646
|
+
`propertyOrdering` property may also be set. Cyclic references are
|
3647
|
+
unrolled to a limited degree and, as such, may only be used within
|
3648
|
+
non-required properties. (Nullable properties are not sufficient.) If
|
3649
|
+
`$ref` is set on a sub-schema, no other properties, except for than those
|
3650
|
+
starting as a `$`, may be set.""",
|
3651
|
+
)
|
3620
3652
|
routing_config: Optional[GenerationConfigRoutingConfig] = Field(
|
3621
3653
|
default=None,
|
3622
3654
|
description="""Configuration for model router requests.
|
@@ -3799,6 +3831,23 @@ class GenerateContentConfigDict(TypedDict, total=False):
|
|
3799
3831
|
Compatible mimetypes: `application/json`: Schema for JSON response.
|
3800
3832
|
"""
|
3801
3833
|
|
3834
|
+
response_json_schema: Optional[Any]
|
3835
|
+
"""Optional. Output schema of the generated response.
|
3836
|
+
This is an alternative to `response_schema` that accepts [JSON
|
3837
|
+
Schema](https://json-schema.org/). If set, `response_schema` must be
|
3838
|
+
omitted, but `response_mime_type` is required. While the full JSON Schema
|
3839
|
+
may be sent, not all features are supported. Specifically, only the
|
3840
|
+
following properties are supported: - `$id` - `$defs` - `$ref` - `$anchor`
|
3841
|
+
- `type` - `format` - `title` - `description` - `enum` (for strings and
|
3842
|
+
numbers) - `items` - `prefixItems` - `minItems` - `maxItems` - `minimum` -
|
3843
|
+
`maximum` - `anyOf` - `oneOf` (interpreted the same as `anyOf`) -
|
3844
|
+
`properties` - `additionalProperties` - `required` The non-standard
|
3845
|
+
`propertyOrdering` property may also be set. Cyclic references are
|
3846
|
+
unrolled to a limited degree and, as such, may only be used within
|
3847
|
+
non-required properties. (Nullable properties are not sufficient.) If
|
3848
|
+
`$ref` is set on a sub-schema, no other properties, except for than those
|
3849
|
+
starting as a `$`, may be set."""
|
3850
|
+
|
3802
3851
|
routing_config: Optional[GenerationConfigRoutingConfigDict]
|
3803
3852
|
"""Configuration for model router requests.
|
3804
3853
|
"""
|
@@ -3908,6 +3957,32 @@ _GenerateContentParametersOrDict = Union[
|
|
3908
3957
|
]
|
3909
3958
|
|
3910
3959
|
|
3960
|
+
class HttpResponse(_common.BaseModel):
|
3961
|
+
"""A wrapper class for the http response."""
|
3962
|
+
|
3963
|
+
headers: Optional[dict[str, str]] = Field(
|
3964
|
+
default=None,
|
3965
|
+
description="""Used to retain the processed HTTP headers in the response.""",
|
3966
|
+
)
|
3967
|
+
body: Optional[str] = Field(
|
3968
|
+
default=None,
|
3969
|
+
description="""The raw HTTP response body, in JSON format.""",
|
3970
|
+
)
|
3971
|
+
|
3972
|
+
|
3973
|
+
class HttpResponseDict(TypedDict, total=False):
|
3974
|
+
"""A wrapper class for the http response."""
|
3975
|
+
|
3976
|
+
headers: Optional[dict[str, str]]
|
3977
|
+
"""Used to retain the processed HTTP headers in the response."""
|
3978
|
+
|
3979
|
+
body: Optional[str]
|
3980
|
+
"""The raw HTTP response body, in JSON format."""
|
3981
|
+
|
3982
|
+
|
3983
|
+
HttpResponseOrDict = Union[HttpResponse, HttpResponseDict]
|
3984
|
+
|
3985
|
+
|
3911
3986
|
class GoogleTypeDate(_common.BaseModel):
|
3912
3987
|
"""Represents a whole or partial calendar date, such as a birthday.
|
3913
3988
|
|
@@ -4773,6 +4848,9 @@ GenerateContentResponseUsageMetadataOrDict = Union[
|
|
4773
4848
|
class GenerateContentResponse(_common.BaseModel):
|
4774
4849
|
"""Response message for PredictionService.GenerateContent."""
|
4775
4850
|
|
4851
|
+
sdk_http_response: Optional[HttpResponse] = Field(
|
4852
|
+
default=None, description="""Used to retain the full HTTP response."""
|
4853
|
+
)
|
4776
4854
|
candidates: Optional[list[Candidate]] = Field(
|
4777
4855
|
default=None,
|
4778
4856
|
description="""Response variations returned by the model.
|
@@ -5025,6 +5103,9 @@ class GenerateContentResponse(_common.BaseModel):
|
|
5025
5103
|
class GenerateContentResponseDict(TypedDict, total=False):
|
5026
5104
|
"""Response message for PredictionService.GenerateContent."""
|
5027
5105
|
|
5106
|
+
sdk_http_response: Optional[HttpResponseDict]
|
5107
|
+
"""Used to retain the full HTTP response."""
|
5108
|
+
|
5028
5109
|
candidates: Optional[list[CandidateDict]]
|
5029
5110
|
"""Response variations returned by the model.
|
5030
5111
|
"""
|
@@ -5316,7 +5397,8 @@ class GenerateImagesConfig(_common.BaseModel):
|
|
5316
5397
|
)
|
5317
5398
|
aspect_ratio: Optional[str] = Field(
|
5318
5399
|
default=None,
|
5319
|
-
description="""Aspect ratio of the generated images.
|
5400
|
+
description="""Aspect ratio of the generated images. Supported values are
|
5401
|
+
"1:1", "3:4", "4:3", "9:16", and "16:9".
|
5320
5402
|
""",
|
5321
5403
|
)
|
5322
5404
|
guidance_scale: Optional[float] = Field(
|
@@ -5401,7 +5483,8 @@ class GenerateImagesConfigDict(TypedDict, total=False):
|
|
5401
5483
|
"""
|
5402
5484
|
|
5403
5485
|
aspect_ratio: Optional[str]
|
5404
|
-
"""Aspect ratio of the generated images.
|
5486
|
+
"""Aspect ratio of the generated images. Supported values are
|
5487
|
+
"1:1", "3:4", "4:3", "9:16", and "16:9".
|
5405
5488
|
"""
|
5406
5489
|
|
5407
5490
|
guidance_scale: Optional[float]
|
@@ -5987,7 +6070,8 @@ class EditImageConfig(_common.BaseModel):
|
|
5987
6070
|
)
|
5988
6071
|
aspect_ratio: Optional[str] = Field(
|
5989
6072
|
default=None,
|
5990
|
-
description="""Aspect ratio of the generated images.
|
6073
|
+
description="""Aspect ratio of the generated images. Supported values are
|
6074
|
+
"1:1", "3:4", "4:3", "9:16", and "16:9".
|
5991
6075
|
""",
|
5992
6076
|
)
|
5993
6077
|
guidance_scale: Optional[float] = Field(
|
@@ -6071,7 +6155,8 @@ class EditImageConfigDict(TypedDict, total=False):
|
|
6071
6155
|
"""
|
6072
6156
|
|
6073
6157
|
aspect_ratio: Optional[str]
|
6074
|
-
"""Aspect ratio of the generated images.
|
6158
|
+
"""Aspect ratio of the generated images. Supported values are
|
6159
|
+
"1:1", "3:4", "4:3", "9:16", and "16:9".
|
6075
6160
|
"""
|
6076
6161
|
|
6077
6162
|
guidance_scale: Optional[float]
|
@@ -6208,6 +6293,19 @@ class _UpscaleImageAPIConfig(_common.BaseModel):
|
|
6208
6293
|
description="""The level of compression if the ``output_mime_type`` is
|
6209
6294
|
``image/jpeg``.""",
|
6210
6295
|
)
|
6296
|
+
enhance_input_image: Optional[bool] = Field(
|
6297
|
+
default=None,
|
6298
|
+
description="""Whether to add an image enhancing step before upscaling.
|
6299
|
+
It is expected to suppress the noise and JPEG compression artifacts
|
6300
|
+
from the input image.""",
|
6301
|
+
)
|
6302
|
+
image_preservation_factor: Optional[float] = Field(
|
6303
|
+
default=None,
|
6304
|
+
description="""With a higher image preservation factor, the original image
|
6305
|
+
pixels are more respected. With a lower image preservation factor, the
|
6306
|
+
output image will have be more different from the input image, but
|
6307
|
+
with finer details and less noise.""",
|
6308
|
+
)
|
6211
6309
|
number_of_images: Optional[int] = Field(default=None, description="""""")
|
6212
6310
|
mode: Optional[str] = Field(default=None, description="""""")
|
6213
6311
|
|
@@ -6233,6 +6331,17 @@ class _UpscaleImageAPIConfigDict(TypedDict, total=False):
|
|
6233
6331
|
"""The level of compression if the ``output_mime_type`` is
|
6234
6332
|
``image/jpeg``."""
|
6235
6333
|
|
6334
|
+
enhance_input_image: Optional[bool]
|
6335
|
+
"""Whether to add an image enhancing step before upscaling.
|
6336
|
+
It is expected to suppress the noise and JPEG compression artifacts
|
6337
|
+
from the input image."""
|
6338
|
+
|
6339
|
+
image_preservation_factor: Optional[float]
|
6340
|
+
"""With a higher image preservation factor, the original image
|
6341
|
+
pixels are more respected. With a lower image preservation factor, the
|
6342
|
+
output image will have be more different from the input image, but
|
6343
|
+
with finer details and less noise."""
|
6344
|
+
|
6236
6345
|
number_of_images: Optional[int]
|
6237
6346
|
""""""
|
6238
6347
|
|
@@ -7266,6 +7375,10 @@ class GenerateVideosConfig(_common.BaseModel):
|
|
7266
7375
|
default=None,
|
7267
7376
|
description="""Image to use as the last frame of generated videos. Only supported for image to video use cases.""",
|
7268
7377
|
)
|
7378
|
+
compression_quality: Optional[VideoCompressionQuality] = Field(
|
7379
|
+
default=None,
|
7380
|
+
description="""Compression quality of the generated videos.""",
|
7381
|
+
)
|
7269
7382
|
|
7270
7383
|
|
7271
7384
|
class GenerateVideosConfigDict(TypedDict, total=False):
|
@@ -7313,6 +7426,9 @@ class GenerateVideosConfigDict(TypedDict, total=False):
|
|
7313
7426
|
last_frame: Optional[ImageDict]
|
7314
7427
|
"""Image to use as the last frame of generated videos. Only supported for image to video use cases."""
|
7315
7428
|
|
7429
|
+
compression_quality: Optional[VideoCompressionQuality]
|
7430
|
+
"""Compression quality of the generated videos."""
|
7431
|
+
|
7316
7432
|
|
7317
7433
|
GenerateVideosConfigOrDict = Union[
|
7318
7434
|
GenerateVideosConfig, GenerateVideosConfigDict
|
@@ -8583,6 +8699,10 @@ class TuningDataset(_common.BaseModel):
|
|
8583
8699
|
default=None,
|
8584
8700
|
description="""GCS URI of the file containing training dataset in JSONL format.""",
|
8585
8701
|
)
|
8702
|
+
vertex_dataset_resource: Optional[str] = Field(
|
8703
|
+
default=None,
|
8704
|
+
description="""The resource name of the Vertex Multimodal Dataset that is used as training dataset. Example: 'projects/my-project-id-or-number/locations/my-location/datasets/my-dataset-id'.""",
|
8705
|
+
)
|
8586
8706
|
examples: Optional[list[TuningExample]] = Field(
|
8587
8707
|
default=None,
|
8588
8708
|
description="""Inline examples with simple input/output text.""",
|
@@ -8595,6 +8715,9 @@ class TuningDatasetDict(TypedDict, total=False):
|
|
8595
8715
|
gcs_uri: Optional[str]
|
8596
8716
|
"""GCS URI of the file containing training dataset in JSONL format."""
|
8597
8717
|
|
8718
|
+
vertex_dataset_resource: Optional[str]
|
8719
|
+
"""The resource name of the Vertex Multimodal Dataset that is used as training dataset. Example: 'projects/my-project-id-or-number/locations/my-location/datasets/my-dataset-id'."""
|
8720
|
+
|
8598
8721
|
examples: Optional[list[TuningExampleDict]]
|
8599
8722
|
"""Inline examples with simple input/output text."""
|
8600
8723
|
|
@@ -8608,6 +8731,10 @@ class TuningValidationDataset(_common.BaseModel):
|
|
8608
8731
|
default=None,
|
8609
8732
|
description="""GCS URI of the file containing validation dataset in JSONL format.""",
|
8610
8733
|
)
|
8734
|
+
vertex_dataset_resource: Optional[str] = Field(
|
8735
|
+
default=None,
|
8736
|
+
description="""The resource name of the Vertex Multimodal Dataset that is used as training dataset. Example: 'projects/my-project-id-or-number/locations/my-location/datasets/my-dataset-id'.""",
|
8737
|
+
)
|
8611
8738
|
|
8612
8739
|
|
8613
8740
|
class TuningValidationDatasetDict(TypedDict, total=False):
|
@@ -8615,6 +8742,9 @@ class TuningValidationDatasetDict(TypedDict, total=False):
|
|
8615
8742
|
gcs_uri: Optional[str]
|
8616
8743
|
"""GCS URI of the file containing validation dataset in JSONL format."""
|
8617
8744
|
|
8745
|
+
vertex_dataset_resource: Optional[str]
|
8746
|
+
"""The resource name of the Vertex Multimodal Dataset that is used as training dataset. Example: 'projects/my-project-id-or-number/locations/my-location/datasets/my-dataset-id'."""
|
8747
|
+
|
8618
8748
|
|
8619
8749
|
TuningValidationDatasetOrDict = Union[
|
8620
8750
|
TuningValidationDataset, TuningValidationDatasetDict
|
@@ -9407,32 +9537,6 @@ _CreateFileParametersOrDict = Union[
|
|
9407
9537
|
]
|
9408
9538
|
|
9409
9539
|
|
9410
|
-
class HttpResponse(_common.BaseModel):
|
9411
|
-
"""A wrapper class for the http response."""
|
9412
|
-
|
9413
|
-
headers: Optional[dict[str, str]] = Field(
|
9414
|
-
default=None,
|
9415
|
-
description="""Used to retain the processed HTTP headers in the response.""",
|
9416
|
-
)
|
9417
|
-
body: Optional[str] = Field(
|
9418
|
-
default=None,
|
9419
|
-
description="""The raw HTTP response body, in JSON format.""",
|
9420
|
-
)
|
9421
|
-
|
9422
|
-
|
9423
|
-
class HttpResponseDict(TypedDict, total=False):
|
9424
|
-
"""A wrapper class for the http response."""
|
9425
|
-
|
9426
|
-
headers: Optional[dict[str, str]]
|
9427
|
-
"""Used to retain the processed HTTP headers in the response."""
|
9428
|
-
|
9429
|
-
body: Optional[str]
|
9430
|
-
"""The raw HTTP response body, in JSON format."""
|
9431
|
-
|
9432
|
-
|
9433
|
-
HttpResponseOrDict = Union[HttpResponse, HttpResponseDict]
|
9434
|
-
|
9435
|
-
|
9436
9540
|
class CreateFileResponse(_common.BaseModel):
|
9437
9541
|
"""Response for the create file method."""
|
9438
9542
|
|
@@ -9556,6 +9660,45 @@ class DeleteFileResponseDict(TypedDict, total=False):
|
|
9556
9660
|
DeleteFileResponseOrDict = Union[DeleteFileResponse, DeleteFileResponseDict]
|
9557
9661
|
|
9558
9662
|
|
9663
|
+
class InlinedRequest(_common.BaseModel):
|
9664
|
+
"""Config for inlined request."""
|
9665
|
+
|
9666
|
+
model: Optional[str] = Field(
|
9667
|
+
default=None,
|
9668
|
+
description="""ID of the model to use. For a list of models, see `Google models
|
9669
|
+
<https://cloud.google.com/vertex-ai/generative-ai/docs/learn/models>`_.""",
|
9670
|
+
)
|
9671
|
+
contents: Optional[ContentListUnion] = Field(
|
9672
|
+
default=None,
|
9673
|
+
description="""Content of the request.
|
9674
|
+
""",
|
9675
|
+
)
|
9676
|
+
config: Optional[GenerateContentConfig] = Field(
|
9677
|
+
default=None,
|
9678
|
+
description="""Configuration that contains optional model parameters.
|
9679
|
+
""",
|
9680
|
+
)
|
9681
|
+
|
9682
|
+
|
9683
|
+
class InlinedRequestDict(TypedDict, total=False):
|
9684
|
+
"""Config for inlined request."""
|
9685
|
+
|
9686
|
+
model: Optional[str]
|
9687
|
+
"""ID of the model to use. For a list of models, see `Google models
|
9688
|
+
<https://cloud.google.com/vertex-ai/generative-ai/docs/learn/models>`_."""
|
9689
|
+
|
9690
|
+
contents: Optional[ContentListUnionDict]
|
9691
|
+
"""Content of the request.
|
9692
|
+
"""
|
9693
|
+
|
9694
|
+
config: Optional[GenerateContentConfigDict]
|
9695
|
+
"""Configuration that contains optional model parameters.
|
9696
|
+
"""
|
9697
|
+
|
9698
|
+
|
9699
|
+
InlinedRequestOrDict = Union[InlinedRequest, InlinedRequestDict]
|
9700
|
+
|
9701
|
+
|
9559
9702
|
class BatchJobSource(_common.BaseModel):
|
9560
9703
|
"""Config for `src` parameter."""
|
9561
9704
|
|
@@ -9575,6 +9718,17 @@ class BatchJobSource(_common.BaseModel):
|
|
9575
9718
|
description="""The BigQuery URI to input table.
|
9576
9719
|
""",
|
9577
9720
|
)
|
9721
|
+
file_name: Optional[str] = Field(
|
9722
|
+
default=None,
|
9723
|
+
description="""The Gemini Developer API's file resource name of the input data
|
9724
|
+
(e.g. "files/12345").
|
9725
|
+
""",
|
9726
|
+
)
|
9727
|
+
inlined_requests: Optional[list[InlinedRequest]] = Field(
|
9728
|
+
default=None,
|
9729
|
+
description="""The Gemini Developer API's inlined input data to run batch job.
|
9730
|
+
""",
|
9731
|
+
)
|
9578
9732
|
|
9579
9733
|
|
9580
9734
|
class BatchJobSourceDict(TypedDict, total=False):
|
@@ -9593,10 +9747,79 @@ class BatchJobSourceDict(TypedDict, total=False):
|
|
9593
9747
|
"""The BigQuery URI to input table.
|
9594
9748
|
"""
|
9595
9749
|
|
9750
|
+
file_name: Optional[str]
|
9751
|
+
"""The Gemini Developer API's file resource name of the input data
|
9752
|
+
(e.g. "files/12345").
|
9753
|
+
"""
|
9754
|
+
|
9755
|
+
inlined_requests: Optional[list[InlinedRequestDict]]
|
9756
|
+
"""The Gemini Developer API's inlined input data to run batch job.
|
9757
|
+
"""
|
9758
|
+
|
9596
9759
|
|
9597
9760
|
BatchJobSourceOrDict = Union[BatchJobSource, BatchJobSourceDict]
|
9598
9761
|
|
9599
9762
|
|
9763
|
+
class JobError(_common.BaseModel):
|
9764
|
+
"""Job error."""
|
9765
|
+
|
9766
|
+
details: Optional[list[str]] = Field(
|
9767
|
+
default=None,
|
9768
|
+
description="""A list of messages that carry the error details. There is a common set of message types for APIs to use.""",
|
9769
|
+
)
|
9770
|
+
code: Optional[int] = Field(default=None, description="""The status code.""")
|
9771
|
+
message: Optional[str] = Field(
|
9772
|
+
default=None,
|
9773
|
+
description="""A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the `details` field.""",
|
9774
|
+
)
|
9775
|
+
|
9776
|
+
|
9777
|
+
class JobErrorDict(TypedDict, total=False):
|
9778
|
+
"""Job error."""
|
9779
|
+
|
9780
|
+
details: Optional[list[str]]
|
9781
|
+
"""A list of messages that carry the error details. There is a common set of message types for APIs to use."""
|
9782
|
+
|
9783
|
+
code: Optional[int]
|
9784
|
+
"""The status code."""
|
9785
|
+
|
9786
|
+
message: Optional[str]
|
9787
|
+
"""A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the `details` field."""
|
9788
|
+
|
9789
|
+
|
9790
|
+
JobErrorOrDict = Union[JobError, JobErrorDict]
|
9791
|
+
|
9792
|
+
|
9793
|
+
class InlinedResponse(_common.BaseModel):
|
9794
|
+
"""Config for `inlined_responses` parameter."""
|
9795
|
+
|
9796
|
+
response: Optional[GenerateContentResponse] = Field(
|
9797
|
+
default=None,
|
9798
|
+
description="""The response to the request.
|
9799
|
+
""",
|
9800
|
+
)
|
9801
|
+
error: Optional[JobError] = Field(
|
9802
|
+
default=None,
|
9803
|
+
description="""The error encountered while processing the request.
|
9804
|
+
""",
|
9805
|
+
)
|
9806
|
+
|
9807
|
+
|
9808
|
+
class InlinedResponseDict(TypedDict, total=False):
|
9809
|
+
"""Config for `inlined_responses` parameter."""
|
9810
|
+
|
9811
|
+
response: Optional[GenerateContentResponseDict]
|
9812
|
+
"""The response to the request.
|
9813
|
+
"""
|
9814
|
+
|
9815
|
+
error: Optional[JobErrorDict]
|
9816
|
+
"""The error encountered while processing the request.
|
9817
|
+
"""
|
9818
|
+
|
9819
|
+
|
9820
|
+
InlinedResponseOrDict = Union[InlinedResponse, InlinedResponseDict]
|
9821
|
+
|
9822
|
+
|
9600
9823
|
class BatchJobDestination(_common.BaseModel):
|
9601
9824
|
"""Config for `des` parameter."""
|
9602
9825
|
|
@@ -9616,6 +9839,22 @@ class BatchJobDestination(_common.BaseModel):
|
|
9616
9839
|
description="""The BigQuery URI to the output table.
|
9617
9840
|
""",
|
9618
9841
|
)
|
9842
|
+
file_name: Optional[str] = Field(
|
9843
|
+
default=None,
|
9844
|
+
description="""The Gemini Developer API's file resource name of the output data
|
9845
|
+
(e.g. "files/12345"). The file will be a JSONL file with a single response
|
9846
|
+
per line. The responses will be GenerateContentResponse messages formatted
|
9847
|
+
as JSON. The responses will be written in the same order as the input
|
9848
|
+
requests.
|
9849
|
+
""",
|
9850
|
+
)
|
9851
|
+
inlined_responses: Optional[list[InlinedResponse]] = Field(
|
9852
|
+
default=None,
|
9853
|
+
description="""The responses to the requests in the batch. Returned when the batch was
|
9854
|
+
built using inlined requests. The responses will be in the same order as
|
9855
|
+
the input requests.
|
9856
|
+
""",
|
9857
|
+
)
|
9619
9858
|
|
9620
9859
|
|
9621
9860
|
class BatchJobDestinationDict(TypedDict, total=False):
|
@@ -9634,6 +9873,20 @@ class BatchJobDestinationDict(TypedDict, total=False):
|
|
9634
9873
|
"""The BigQuery URI to the output table.
|
9635
9874
|
"""
|
9636
9875
|
|
9876
|
+
file_name: Optional[str]
|
9877
|
+
"""The Gemini Developer API's file resource name of the output data
|
9878
|
+
(e.g. "files/12345"). The file will be a JSONL file with a single response
|
9879
|
+
per line. The responses will be GenerateContentResponse messages formatted
|
9880
|
+
as JSON. The responses will be written in the same order as the input
|
9881
|
+
requests.
|
9882
|
+
"""
|
9883
|
+
|
9884
|
+
inlined_responses: Optional[list[InlinedResponseDict]]
|
9885
|
+
"""The responses to the requests in the batch. Returned when the batch was
|
9886
|
+
built using inlined requests. The responses will be in the same order as
|
9887
|
+
the input requests.
|
9888
|
+
"""
|
9889
|
+
|
9637
9890
|
|
9638
9891
|
BatchJobDestinationOrDict = Union[BatchJobDestination, BatchJobDestinationDict]
|
9639
9892
|
|
@@ -9678,6 +9931,14 @@ CreateBatchJobConfigOrDict = Union[
|
|
9678
9931
|
]
|
9679
9932
|
|
9680
9933
|
|
9934
|
+
BatchJobSourceUnion = Union[BatchJobSource, list[InlinedRequest], str]
|
9935
|
+
|
9936
|
+
|
9937
|
+
BatchJobSourceUnionDict = Union[
|
9938
|
+
BatchJobSourceUnion, BatchJobSourceDict, list[InlinedRequestDict]
|
9939
|
+
]
|
9940
|
+
|
9941
|
+
|
9681
9942
|
class _CreateBatchJobParameters(_common.BaseModel):
|
9682
9943
|
"""Config for batches.create parameters."""
|
9683
9944
|
|
@@ -9686,7 +9947,7 @@ class _CreateBatchJobParameters(_common.BaseModel):
|
|
9686
9947
|
description="""The name of the model to produces the predictions via the BatchJob.
|
9687
9948
|
""",
|
9688
9949
|
)
|
9689
|
-
src: Optional[
|
9950
|
+
src: Optional[BatchJobSourceUnion] = Field(
|
9690
9951
|
default=None,
|
9691
9952
|
description="""GCS URI(-s) or BigQuery URI to your input data to run batch job.
|
9692
9953
|
Example: "gs://path/to/input/data" or "bq://projectId.bqDatasetId.bqTableId".
|
@@ -9706,7 +9967,7 @@ class _CreateBatchJobParametersDict(TypedDict, total=False):
|
|
9706
9967
|
"""The name of the model to produces the predictions via the BatchJob.
|
9707
9968
|
"""
|
9708
9969
|
|
9709
|
-
src: Optional[
|
9970
|
+
src: Optional[BatchJobSourceUnionDict]
|
9710
9971
|
"""GCS URI(-s) or BigQuery URI to your input data to run batch job.
|
9711
9972
|
Example: "gs://path/to/input/data" or "bq://projectId.bqDatasetId.bqTableId".
|
9712
9973
|
"""
|
@@ -9721,48 +9982,23 @@ _CreateBatchJobParametersOrDict = Union[
|
|
9721
9982
|
]
|
9722
9983
|
|
9723
9984
|
|
9724
|
-
class JobError(_common.BaseModel):
|
9725
|
-
"""Job error."""
|
9726
|
-
|
9727
|
-
details: Optional[list[str]] = Field(
|
9728
|
-
default=None,
|
9729
|
-
description="""A list of messages that carry the error details. There is a common set of message types for APIs to use.""",
|
9730
|
-
)
|
9731
|
-
code: Optional[int] = Field(default=None, description="""The status code.""")
|
9732
|
-
message: Optional[str] = Field(
|
9733
|
-
default=None,
|
9734
|
-
description="""A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the `details` field.""",
|
9735
|
-
)
|
9736
|
-
|
9737
|
-
|
9738
|
-
class JobErrorDict(TypedDict, total=False):
|
9739
|
-
"""Job error."""
|
9740
|
-
|
9741
|
-
details: Optional[list[str]]
|
9742
|
-
"""A list of messages that carry the error details. There is a common set of message types for APIs to use."""
|
9743
|
-
|
9744
|
-
code: Optional[int]
|
9745
|
-
"""The status code."""
|
9746
|
-
|
9747
|
-
message: Optional[str]
|
9748
|
-
"""A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the `details` field."""
|
9749
|
-
|
9750
|
-
|
9751
|
-
JobErrorOrDict = Union[JobError, JobErrorDict]
|
9752
|
-
|
9753
|
-
|
9754
9985
|
class BatchJob(_common.BaseModel):
|
9755
9986
|
"""Config for batches.create return value."""
|
9756
9987
|
|
9757
9988
|
name: Optional[str] = Field(
|
9758
|
-
default=None,
|
9989
|
+
default=None,
|
9990
|
+
description="""The resource name of the BatchJob. Output only.".
|
9991
|
+
""",
|
9759
9992
|
)
|
9760
9993
|
display_name: Optional[str] = Field(
|
9761
|
-
default=None,
|
9994
|
+
default=None,
|
9995
|
+
description="""The display name of the BatchJob.
|
9996
|
+
""",
|
9762
9997
|
)
|
9763
9998
|
state: Optional[JobState] = Field(
|
9764
9999
|
default=None,
|
9765
|
-
description="""
|
10000
|
+
description="""The state of the BatchJob.
|
10001
|
+
""",
|
9766
10002
|
)
|
9767
10003
|
error: Optional[JobError] = Field(
|
9768
10004
|
default=None,
|
@@ -9770,7 +10006,8 @@ class BatchJob(_common.BaseModel):
|
|
9770
10006
|
)
|
9771
10007
|
create_time: Optional[datetime.datetime] = Field(
|
9772
10008
|
default=None,
|
9773
|
-
description="""
|
10009
|
+
description="""The time when the BatchJob was created.
|
10010
|
+
""",
|
9774
10011
|
)
|
9775
10012
|
start_time: Optional[datetime.datetime] = Field(
|
9776
10013
|
default=None,
|
@@ -9778,11 +10015,13 @@ class BatchJob(_common.BaseModel):
|
|
9778
10015
|
)
|
9779
10016
|
end_time: Optional[datetime.datetime] = Field(
|
9780
10017
|
default=None,
|
9781
|
-
description="""
|
10018
|
+
description="""The time when the BatchJob was completed.
|
10019
|
+
""",
|
9782
10020
|
)
|
9783
10021
|
update_time: Optional[datetime.datetime] = Field(
|
9784
10022
|
default=None,
|
9785
|
-
description="""
|
10023
|
+
description="""The time when the BatchJob was last updated.
|
10024
|
+
""",
|
9786
10025
|
)
|
9787
10026
|
model: Optional[str] = Field(
|
9788
10027
|
default=None,
|
@@ -9805,28 +10044,34 @@ class BatchJobDict(TypedDict, total=False):
|
|
9805
10044
|
"""Config for batches.create return value."""
|
9806
10045
|
|
9807
10046
|
name: Optional[str]
|
9808
|
-
"""
|
10047
|
+
"""The resource name of the BatchJob. Output only.".
|
10048
|
+
"""
|
9809
10049
|
|
9810
10050
|
display_name: Optional[str]
|
9811
|
-
"""The
|
10051
|
+
"""The display name of the BatchJob.
|
10052
|
+
"""
|
9812
10053
|
|
9813
10054
|
state: Optional[JobState]
|
9814
|
-
"""
|
10055
|
+
"""The state of the BatchJob.
|
10056
|
+
"""
|
9815
10057
|
|
9816
10058
|
error: Optional[JobErrorDict]
|
9817
10059
|
"""Output only. Only populated when the job's state is JOB_STATE_FAILED or JOB_STATE_CANCELLED."""
|
9818
10060
|
|
9819
10061
|
create_time: Optional[datetime.datetime]
|
9820
|
-
"""
|
10062
|
+
"""The time when the BatchJob was created.
|
10063
|
+
"""
|
9821
10064
|
|
9822
10065
|
start_time: Optional[datetime.datetime]
|
9823
10066
|
"""Output only. Time when the Job for the first time entered the `JOB_STATE_RUNNING` state."""
|
9824
10067
|
|
9825
10068
|
end_time: Optional[datetime.datetime]
|
9826
|
-
"""
|
10069
|
+
"""The time when the BatchJob was completed.
|
10070
|
+
"""
|
9827
10071
|
|
9828
10072
|
update_time: Optional[datetime.datetime]
|
9829
|
-
"""
|
10073
|
+
"""The time when the BatchJob was last updated.
|
10074
|
+
"""
|
9830
10075
|
|
9831
10076
|
model: Optional[str]
|
9832
10077
|
"""The name of the model that produces the predictions via the BatchJob.
|
@@ -10470,6 +10715,19 @@ class UpscaleImageConfig(_common.BaseModel):
|
|
10470
10715
|
description="""The level of compression if the ``output_mime_type`` is
|
10471
10716
|
``image/jpeg``.""",
|
10472
10717
|
)
|
10718
|
+
enhance_input_image: Optional[bool] = Field(
|
10719
|
+
default=None,
|
10720
|
+
description="""Whether to add an image enhancing step before upscaling.
|
10721
|
+
It is expected to suppress the noise and JPEG compression artifacts
|
10722
|
+
from the input image.""",
|
10723
|
+
)
|
10724
|
+
image_preservation_factor: Optional[float] = Field(
|
10725
|
+
default=None,
|
10726
|
+
description="""With a higher image preservation factor, the original image
|
10727
|
+
pixels are more respected. With a lower image preservation factor, the
|
10728
|
+
output image will have be more different from the input image, but
|
10729
|
+
with finer details and less noise.""",
|
10730
|
+
)
|
10473
10731
|
|
10474
10732
|
|
10475
10733
|
class UpscaleImageConfigDict(TypedDict, total=False):
|
@@ -10494,6 +10752,17 @@ class UpscaleImageConfigDict(TypedDict, total=False):
|
|
10494
10752
|
"""The level of compression if the ``output_mime_type`` is
|
10495
10753
|
``image/jpeg``."""
|
10496
10754
|
|
10755
|
+
enhance_input_image: Optional[bool]
|
10756
|
+
"""Whether to add an image enhancing step before upscaling.
|
10757
|
+
It is expected to suppress the noise and JPEG compression artifacts
|
10758
|
+
from the input image."""
|
10759
|
+
|
10760
|
+
image_preservation_factor: Optional[float]
|
10761
|
+
"""With a higher image preservation factor, the original image
|
10762
|
+
pixels are more respected. With a lower image preservation factor, the
|
10763
|
+
output image will have be more different from the input image, but
|
10764
|
+
with finer details and less noise."""
|
10765
|
+
|
10497
10766
|
|
10498
10767
|
UpscaleImageConfigOrDict = Union[UpscaleImageConfig, UpscaleImageConfigDict]
|
10499
10768
|
|
@@ -12546,7 +12815,7 @@ class AudioChunk(_common.BaseModel):
|
|
12546
12815
|
"""Representation of an audio chunk."""
|
12547
12816
|
|
12548
12817
|
data: Optional[bytes] = Field(
|
12549
|
-
default=None, description="""Raw
|
12818
|
+
default=None, description="""Raw bytes of audio data."""
|
12550
12819
|
)
|
12551
12820
|
mime_type: Optional[str] = Field(
|
12552
12821
|
default=None, description="""MIME type of the audio chunk."""
|
@@ -12561,7 +12830,7 @@ class AudioChunkDict(TypedDict, total=False):
|
|
12561
12830
|
"""Representation of an audio chunk."""
|
12562
12831
|
|
12563
12832
|
data: Optional[bytes]
|
12564
|
-
"""Raw
|
12833
|
+
"""Raw bytes of audio data."""
|
12565
12834
|
|
12566
12835
|
mime_type: Optional[str]
|
12567
12836
|
"""MIME type of the audio chunk."""
|