google-genai 1.21.0__py3-none-any.whl → 1.22.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 +5 -5
- 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 +9 -11
- google/genai/models.py +106 -2
- google/genai/operations.py +4 -0
- google/genai/tunings.py +9 -1
- google/genai/types.py +331 -76
- google/genai/version.py +1 -1
- {google_genai-1.21.0.dist-info → google_genai-1.22.0.dist-info}/METADATA +1 -1
- {google_genai-1.21.0.dist-info → google_genai-1.22.0.dist-info}/RECORD +18 -18
- {google_genai-1.21.0.dist-info → google_genai-1.22.0.dist-info}/WHEEL +0 -0
- {google_genai-1.21.0.dist-info → google_genai-1.22.0.dist-info}/licenses/LICENSE +0 -0
- {google_genai-1.21.0.dist-info → google_genai-1.22.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
|
@@ -9407,32 +9523,6 @@ _CreateFileParametersOrDict = Union[
|
|
9407
9523
|
]
|
9408
9524
|
|
9409
9525
|
|
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
9526
|
class CreateFileResponse(_common.BaseModel):
|
9437
9527
|
"""Response for the create file method."""
|
9438
9528
|
|
@@ -9556,6 +9646,45 @@ class DeleteFileResponseDict(TypedDict, total=False):
|
|
9556
9646
|
DeleteFileResponseOrDict = Union[DeleteFileResponse, DeleteFileResponseDict]
|
9557
9647
|
|
9558
9648
|
|
9649
|
+
class InlinedRequest(_common.BaseModel):
|
9650
|
+
"""Config for inlined request."""
|
9651
|
+
|
9652
|
+
model: Optional[str] = Field(
|
9653
|
+
default=None,
|
9654
|
+
description="""ID of the model to use. For a list of models, see `Google models
|
9655
|
+
<https://cloud.google.com/vertex-ai/generative-ai/docs/learn/models>`_.""",
|
9656
|
+
)
|
9657
|
+
contents: Optional[ContentListUnion] = Field(
|
9658
|
+
default=None,
|
9659
|
+
description="""Content of the request.
|
9660
|
+
""",
|
9661
|
+
)
|
9662
|
+
config: Optional[GenerateContentConfig] = Field(
|
9663
|
+
default=None,
|
9664
|
+
description="""Configuration that contains optional model parameters.
|
9665
|
+
""",
|
9666
|
+
)
|
9667
|
+
|
9668
|
+
|
9669
|
+
class InlinedRequestDict(TypedDict, total=False):
|
9670
|
+
"""Config for inlined request."""
|
9671
|
+
|
9672
|
+
model: Optional[str]
|
9673
|
+
"""ID of the model to use. For a list of models, see `Google models
|
9674
|
+
<https://cloud.google.com/vertex-ai/generative-ai/docs/learn/models>`_."""
|
9675
|
+
|
9676
|
+
contents: Optional[ContentListUnionDict]
|
9677
|
+
"""Content of the request.
|
9678
|
+
"""
|
9679
|
+
|
9680
|
+
config: Optional[GenerateContentConfigDict]
|
9681
|
+
"""Configuration that contains optional model parameters.
|
9682
|
+
"""
|
9683
|
+
|
9684
|
+
|
9685
|
+
InlinedRequestOrDict = Union[InlinedRequest, InlinedRequestDict]
|
9686
|
+
|
9687
|
+
|
9559
9688
|
class BatchJobSource(_common.BaseModel):
|
9560
9689
|
"""Config for `src` parameter."""
|
9561
9690
|
|
@@ -9575,6 +9704,17 @@ class BatchJobSource(_common.BaseModel):
|
|
9575
9704
|
description="""The BigQuery URI to input table.
|
9576
9705
|
""",
|
9577
9706
|
)
|
9707
|
+
file_name: Optional[str] = Field(
|
9708
|
+
default=None,
|
9709
|
+
description="""The Gemini Developer API's file resource name of the input data
|
9710
|
+
(e.g. "files/12345").
|
9711
|
+
""",
|
9712
|
+
)
|
9713
|
+
inlined_requests: Optional[list[InlinedRequest]] = Field(
|
9714
|
+
default=None,
|
9715
|
+
description="""The Gemini Developer API's inlined input data to run batch job.
|
9716
|
+
""",
|
9717
|
+
)
|
9578
9718
|
|
9579
9719
|
|
9580
9720
|
class BatchJobSourceDict(TypedDict, total=False):
|
@@ -9593,10 +9733,79 @@ class BatchJobSourceDict(TypedDict, total=False):
|
|
9593
9733
|
"""The BigQuery URI to input table.
|
9594
9734
|
"""
|
9595
9735
|
|
9736
|
+
file_name: Optional[str]
|
9737
|
+
"""The Gemini Developer API's file resource name of the input data
|
9738
|
+
(e.g. "files/12345").
|
9739
|
+
"""
|
9740
|
+
|
9741
|
+
inlined_requests: Optional[list[InlinedRequestDict]]
|
9742
|
+
"""The Gemini Developer API's inlined input data to run batch job.
|
9743
|
+
"""
|
9744
|
+
|
9596
9745
|
|
9597
9746
|
BatchJobSourceOrDict = Union[BatchJobSource, BatchJobSourceDict]
|
9598
9747
|
|
9599
9748
|
|
9749
|
+
class JobError(_common.BaseModel):
|
9750
|
+
"""Job error."""
|
9751
|
+
|
9752
|
+
details: Optional[list[str]] = Field(
|
9753
|
+
default=None,
|
9754
|
+
description="""A list of messages that carry the error details. There is a common set of message types for APIs to use.""",
|
9755
|
+
)
|
9756
|
+
code: Optional[int] = Field(default=None, description="""The status code.""")
|
9757
|
+
message: Optional[str] = Field(
|
9758
|
+
default=None,
|
9759
|
+
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.""",
|
9760
|
+
)
|
9761
|
+
|
9762
|
+
|
9763
|
+
class JobErrorDict(TypedDict, total=False):
|
9764
|
+
"""Job error."""
|
9765
|
+
|
9766
|
+
details: Optional[list[str]]
|
9767
|
+
"""A list of messages that carry the error details. There is a common set of message types for APIs to use."""
|
9768
|
+
|
9769
|
+
code: Optional[int]
|
9770
|
+
"""The status code."""
|
9771
|
+
|
9772
|
+
message: Optional[str]
|
9773
|
+
"""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
|
+
JobErrorOrDict = Union[JobError, JobErrorDict]
|
9777
|
+
|
9778
|
+
|
9779
|
+
class InlinedResponse(_common.BaseModel):
|
9780
|
+
"""Config for `inlined_responses` parameter."""
|
9781
|
+
|
9782
|
+
response: Optional[GenerateContentResponse] = Field(
|
9783
|
+
default=None,
|
9784
|
+
description="""The response to the request.
|
9785
|
+
""",
|
9786
|
+
)
|
9787
|
+
error: Optional[JobError] = Field(
|
9788
|
+
default=None,
|
9789
|
+
description="""The error encountered while processing the request.
|
9790
|
+
""",
|
9791
|
+
)
|
9792
|
+
|
9793
|
+
|
9794
|
+
class InlinedResponseDict(TypedDict, total=False):
|
9795
|
+
"""Config for `inlined_responses` parameter."""
|
9796
|
+
|
9797
|
+
response: Optional[GenerateContentResponseDict]
|
9798
|
+
"""The response to the request.
|
9799
|
+
"""
|
9800
|
+
|
9801
|
+
error: Optional[JobErrorDict]
|
9802
|
+
"""The error encountered while processing the request.
|
9803
|
+
"""
|
9804
|
+
|
9805
|
+
|
9806
|
+
InlinedResponseOrDict = Union[InlinedResponse, InlinedResponseDict]
|
9807
|
+
|
9808
|
+
|
9600
9809
|
class BatchJobDestination(_common.BaseModel):
|
9601
9810
|
"""Config for `des` parameter."""
|
9602
9811
|
|
@@ -9616,6 +9825,22 @@ class BatchJobDestination(_common.BaseModel):
|
|
9616
9825
|
description="""The BigQuery URI to the output table.
|
9617
9826
|
""",
|
9618
9827
|
)
|
9828
|
+
file_name: Optional[str] = Field(
|
9829
|
+
default=None,
|
9830
|
+
description="""The Gemini Developer API's file resource name of the output data
|
9831
|
+
(e.g. "files/12345"). The file will be a JSONL file with a single response
|
9832
|
+
per line. The responses will be GenerateContentResponse messages formatted
|
9833
|
+
as JSON. The responses will be written in the same order as the input
|
9834
|
+
requests.
|
9835
|
+
""",
|
9836
|
+
)
|
9837
|
+
inlined_responses: Optional[list[InlinedResponse]] = Field(
|
9838
|
+
default=None,
|
9839
|
+
description="""The responses to the requests in the batch. Returned when the batch was
|
9840
|
+
built using inlined requests. The responses will be in the same order as
|
9841
|
+
the input requests.
|
9842
|
+
""",
|
9843
|
+
)
|
9619
9844
|
|
9620
9845
|
|
9621
9846
|
class BatchJobDestinationDict(TypedDict, total=False):
|
@@ -9634,6 +9859,20 @@ class BatchJobDestinationDict(TypedDict, total=False):
|
|
9634
9859
|
"""The BigQuery URI to the output table.
|
9635
9860
|
"""
|
9636
9861
|
|
9862
|
+
file_name: Optional[str]
|
9863
|
+
"""The Gemini Developer API's file resource name of the output data
|
9864
|
+
(e.g. "files/12345"). The file will be a JSONL file with a single response
|
9865
|
+
per line. The responses will be GenerateContentResponse messages formatted
|
9866
|
+
as JSON. The responses will be written in the same order as the input
|
9867
|
+
requests.
|
9868
|
+
"""
|
9869
|
+
|
9870
|
+
inlined_responses: Optional[list[InlinedResponseDict]]
|
9871
|
+
"""The responses to the requests in the batch. Returned when the batch was
|
9872
|
+
built using inlined requests. The responses will be in the same order as
|
9873
|
+
the input requests.
|
9874
|
+
"""
|
9875
|
+
|
9637
9876
|
|
9638
9877
|
BatchJobDestinationOrDict = Union[BatchJobDestination, BatchJobDestinationDict]
|
9639
9878
|
|
@@ -9678,6 +9917,14 @@ CreateBatchJobConfigOrDict = Union[
|
|
9678
9917
|
]
|
9679
9918
|
|
9680
9919
|
|
9920
|
+
BatchJobSourceUnion = Union[BatchJobSource, list[InlinedRequest], str]
|
9921
|
+
|
9922
|
+
|
9923
|
+
BatchJobSourceUnionDict = Union[
|
9924
|
+
BatchJobSourceUnion, BatchJobSourceDict, list[InlinedRequestDict]
|
9925
|
+
]
|
9926
|
+
|
9927
|
+
|
9681
9928
|
class _CreateBatchJobParameters(_common.BaseModel):
|
9682
9929
|
"""Config for batches.create parameters."""
|
9683
9930
|
|
@@ -9686,7 +9933,7 @@ class _CreateBatchJobParameters(_common.BaseModel):
|
|
9686
9933
|
description="""The name of the model to produces the predictions via the BatchJob.
|
9687
9934
|
""",
|
9688
9935
|
)
|
9689
|
-
src: Optional[
|
9936
|
+
src: Optional[BatchJobSourceUnion] = Field(
|
9690
9937
|
default=None,
|
9691
9938
|
description="""GCS URI(-s) or BigQuery URI to your input data to run batch job.
|
9692
9939
|
Example: "gs://path/to/input/data" or "bq://projectId.bqDatasetId.bqTableId".
|
@@ -9706,7 +9953,7 @@ class _CreateBatchJobParametersDict(TypedDict, total=False):
|
|
9706
9953
|
"""The name of the model to produces the predictions via the BatchJob.
|
9707
9954
|
"""
|
9708
9955
|
|
9709
|
-
src: Optional[
|
9956
|
+
src: Optional[BatchJobSourceUnionDict]
|
9710
9957
|
"""GCS URI(-s) or BigQuery URI to your input data to run batch job.
|
9711
9958
|
Example: "gs://path/to/input/data" or "bq://projectId.bqDatasetId.bqTableId".
|
9712
9959
|
"""
|
@@ -9721,48 +9968,23 @@ _CreateBatchJobParametersOrDict = Union[
|
|
9721
9968
|
]
|
9722
9969
|
|
9723
9970
|
|
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
9971
|
class BatchJob(_common.BaseModel):
|
9755
9972
|
"""Config for batches.create return value."""
|
9756
9973
|
|
9757
9974
|
name: Optional[str] = Field(
|
9758
|
-
default=None,
|
9975
|
+
default=None,
|
9976
|
+
description="""The resource name of the BatchJob. Output only.".
|
9977
|
+
""",
|
9759
9978
|
)
|
9760
9979
|
display_name: Optional[str] = Field(
|
9761
|
-
default=None,
|
9980
|
+
default=None,
|
9981
|
+
description="""The display name of the BatchJob.
|
9982
|
+
""",
|
9762
9983
|
)
|
9763
9984
|
state: Optional[JobState] = Field(
|
9764
9985
|
default=None,
|
9765
|
-
description="""
|
9986
|
+
description="""The state of the BatchJob.
|
9987
|
+
""",
|
9766
9988
|
)
|
9767
9989
|
error: Optional[JobError] = Field(
|
9768
9990
|
default=None,
|
@@ -9770,7 +9992,8 @@ class BatchJob(_common.BaseModel):
|
|
9770
9992
|
)
|
9771
9993
|
create_time: Optional[datetime.datetime] = Field(
|
9772
9994
|
default=None,
|
9773
|
-
description="""
|
9995
|
+
description="""The time when the BatchJob was created.
|
9996
|
+
""",
|
9774
9997
|
)
|
9775
9998
|
start_time: Optional[datetime.datetime] = Field(
|
9776
9999
|
default=None,
|
@@ -9778,11 +10001,13 @@ class BatchJob(_common.BaseModel):
|
|
9778
10001
|
)
|
9779
10002
|
end_time: Optional[datetime.datetime] = Field(
|
9780
10003
|
default=None,
|
9781
|
-
description="""
|
10004
|
+
description="""The time when the BatchJob was completed.
|
10005
|
+
""",
|
9782
10006
|
)
|
9783
10007
|
update_time: Optional[datetime.datetime] = Field(
|
9784
10008
|
default=None,
|
9785
|
-
description="""
|
10009
|
+
description="""The time when the BatchJob was last updated.
|
10010
|
+
""",
|
9786
10011
|
)
|
9787
10012
|
model: Optional[str] = Field(
|
9788
10013
|
default=None,
|
@@ -9805,28 +10030,34 @@ class BatchJobDict(TypedDict, total=False):
|
|
9805
10030
|
"""Config for batches.create return value."""
|
9806
10031
|
|
9807
10032
|
name: Optional[str]
|
9808
|
-
"""
|
10033
|
+
"""The resource name of the BatchJob. Output only.".
|
10034
|
+
"""
|
9809
10035
|
|
9810
10036
|
display_name: Optional[str]
|
9811
|
-
"""The
|
10037
|
+
"""The display name of the BatchJob.
|
10038
|
+
"""
|
9812
10039
|
|
9813
10040
|
state: Optional[JobState]
|
9814
|
-
"""
|
10041
|
+
"""The state of the BatchJob.
|
10042
|
+
"""
|
9815
10043
|
|
9816
10044
|
error: Optional[JobErrorDict]
|
9817
10045
|
"""Output only. Only populated when the job's state is JOB_STATE_FAILED or JOB_STATE_CANCELLED."""
|
9818
10046
|
|
9819
10047
|
create_time: Optional[datetime.datetime]
|
9820
|
-
"""
|
10048
|
+
"""The time when the BatchJob was created.
|
10049
|
+
"""
|
9821
10050
|
|
9822
10051
|
start_time: Optional[datetime.datetime]
|
9823
10052
|
"""Output only. Time when the Job for the first time entered the `JOB_STATE_RUNNING` state."""
|
9824
10053
|
|
9825
10054
|
end_time: Optional[datetime.datetime]
|
9826
|
-
"""
|
10055
|
+
"""The time when the BatchJob was completed.
|
10056
|
+
"""
|
9827
10057
|
|
9828
10058
|
update_time: Optional[datetime.datetime]
|
9829
|
-
"""
|
10059
|
+
"""The time when the BatchJob was last updated.
|
10060
|
+
"""
|
9830
10061
|
|
9831
10062
|
model: Optional[str]
|
9832
10063
|
"""The name of the model that produces the predictions via the BatchJob.
|
@@ -10470,6 +10701,19 @@ class UpscaleImageConfig(_common.BaseModel):
|
|
10470
10701
|
description="""The level of compression if the ``output_mime_type`` is
|
10471
10702
|
``image/jpeg``.""",
|
10472
10703
|
)
|
10704
|
+
enhance_input_image: Optional[bool] = Field(
|
10705
|
+
default=None,
|
10706
|
+
description="""Whether to add an image enhancing step before upscaling.
|
10707
|
+
It is expected to suppress the noise and JPEG compression artifacts
|
10708
|
+
from the input image.""",
|
10709
|
+
)
|
10710
|
+
image_preservation_factor: Optional[float] = Field(
|
10711
|
+
default=None,
|
10712
|
+
description="""With a higher image preservation factor, the original image
|
10713
|
+
pixels are more respected. With a lower image preservation factor, the
|
10714
|
+
output image will have be more different from the input image, but
|
10715
|
+
with finer details and less noise.""",
|
10716
|
+
)
|
10473
10717
|
|
10474
10718
|
|
10475
10719
|
class UpscaleImageConfigDict(TypedDict, total=False):
|
@@ -10494,6 +10738,17 @@ class UpscaleImageConfigDict(TypedDict, total=False):
|
|
10494
10738
|
"""The level of compression if the ``output_mime_type`` is
|
10495
10739
|
``image/jpeg``."""
|
10496
10740
|
|
10741
|
+
enhance_input_image: Optional[bool]
|
10742
|
+
"""Whether to add an image enhancing step before upscaling.
|
10743
|
+
It is expected to suppress the noise and JPEG compression artifacts
|
10744
|
+
from the input image."""
|
10745
|
+
|
10746
|
+
image_preservation_factor: Optional[float]
|
10747
|
+
"""With a higher image preservation factor, the original image
|
10748
|
+
pixels are more respected. With a lower image preservation factor, the
|
10749
|
+
output image will have be more different from the input image, but
|
10750
|
+
with finer details and less noise."""
|
10751
|
+
|
10497
10752
|
|
10498
10753
|
UpscaleImageConfigOrDict = Union[UpscaleImageConfig, UpscaleImageConfigDict]
|
10499
10754
|
|
google/genai/version.py
CHANGED