google-genai 1.14.0__py3-none-any.whl → 1.15.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 +21 -17
- google/genai/_automatic_function_calling_util.py +1 -1
- google/genai/_live_converters.py +106 -12
- google/genai/caches.py +54 -6
- google/genai/models.py +165 -12
- google/genai/tunings.py +53 -0
- google/genai/types.py +282 -118
- google/genai/version.py +1 -1
- {google_genai-1.14.0.dist-info → google_genai-1.15.0.dist-info}/METADATA +104 -19
- {google_genai-1.14.0.dist-info → google_genai-1.15.0.dist-info}/RECORD +13 -13
- {google_genai-1.14.0.dist-info → google_genai-1.15.0.dist-info}/WHEEL +1 -1
- {google_genai-1.14.0.dist-info → google_genai-1.15.0.dist-info}/licenses/LICENSE +0 -0
- {google_genai-1.14.0.dist-info → google_genai-1.15.0.dist-info}/top_level.txt +0 -0
google/genai/tunings.py
CHANGED
@@ -173,6 +173,11 @@ def _CreateTuningJobConfig_to_mldev(
|
|
173
173
|
getv(from_object, ['learning_rate_multiplier']),
|
174
174
|
)
|
175
175
|
|
176
|
+
if getv(from_object, ['export_last_checkpoint_only']) is not None:
|
177
|
+
raise ValueError(
|
178
|
+
'export_last_checkpoint_only parameter is not supported in Gemini API.'
|
179
|
+
)
|
180
|
+
|
176
181
|
if getv(from_object, ['adapter_size']) is not None:
|
177
182
|
raise ValueError('adapter_size parameter is not supported in Gemini API.')
|
178
183
|
|
@@ -367,6 +372,13 @@ def _CreateTuningJobConfig_to_vertex(
|
|
367
372
|
getv(from_object, ['learning_rate_multiplier']),
|
368
373
|
)
|
369
374
|
|
375
|
+
if getv(from_object, ['export_last_checkpoint_only']) is not None:
|
376
|
+
setv(
|
377
|
+
parent_object,
|
378
|
+
['supervisedTuningSpec', 'exportLastCheckpointOnly'],
|
379
|
+
getv(from_object, ['export_last_checkpoint_only']),
|
380
|
+
)
|
381
|
+
|
370
382
|
if getv(from_object, ['adapter_size']) is not None:
|
371
383
|
setv(
|
372
384
|
parent_object,
|
@@ -413,6 +425,16 @@ def _CreateTuningJobParameters_to_vertex(
|
|
413
425
|
return to_object
|
414
426
|
|
415
427
|
|
428
|
+
def _TunedModelCheckpoint_from_mldev(
|
429
|
+
api_client: BaseApiClient,
|
430
|
+
from_object: Union[dict[str, Any], object],
|
431
|
+
parent_object: Optional[dict[str, Any]] = None,
|
432
|
+
) -> dict[str, Any]:
|
433
|
+
to_object: dict[str, Any] = {}
|
434
|
+
|
435
|
+
return to_object
|
436
|
+
|
437
|
+
|
416
438
|
def _TunedModel_from_mldev(
|
417
439
|
api_client: BaseApiClient,
|
418
440
|
from_object: Union[dict[str, Any], object],
|
@@ -548,6 +570,27 @@ def _Operation_from_mldev(
|
|
548
570
|
return to_object
|
549
571
|
|
550
572
|
|
573
|
+
def _TunedModelCheckpoint_from_vertex(
|
574
|
+
api_client: BaseApiClient,
|
575
|
+
from_object: Union[dict[str, Any], object],
|
576
|
+
parent_object: Optional[dict[str, Any]] = None,
|
577
|
+
) -> dict[str, Any]:
|
578
|
+
to_object: dict[str, Any] = {}
|
579
|
+
if getv(from_object, ['checkpointId']) is not None:
|
580
|
+
setv(to_object, ['checkpoint_id'], getv(from_object, ['checkpointId']))
|
581
|
+
|
582
|
+
if getv(from_object, ['epoch']) is not None:
|
583
|
+
setv(to_object, ['epoch'], getv(from_object, ['epoch']))
|
584
|
+
|
585
|
+
if getv(from_object, ['step']) is not None:
|
586
|
+
setv(to_object, ['step'], getv(from_object, ['step']))
|
587
|
+
|
588
|
+
if getv(from_object, ['endpoint']) is not None:
|
589
|
+
setv(to_object, ['endpoint'], getv(from_object, ['endpoint']))
|
590
|
+
|
591
|
+
return to_object
|
592
|
+
|
593
|
+
|
551
594
|
def _TunedModel_from_vertex(
|
552
595
|
api_client: BaseApiClient,
|
553
596
|
from_object: Union[dict[str, Any], object],
|
@@ -560,6 +603,16 @@ def _TunedModel_from_vertex(
|
|
560
603
|
if getv(from_object, ['endpoint']) is not None:
|
561
604
|
setv(to_object, ['endpoint'], getv(from_object, ['endpoint']))
|
562
605
|
|
606
|
+
if getv(from_object, ['checkpoints']) is not None:
|
607
|
+
setv(
|
608
|
+
to_object,
|
609
|
+
['checkpoints'],
|
610
|
+
[
|
611
|
+
_TunedModelCheckpoint_from_vertex(api_client, item, to_object)
|
612
|
+
for item in getv(from_object, ['checkpoints'])
|
613
|
+
],
|
614
|
+
)
|
615
|
+
|
563
616
|
return to_object
|
564
617
|
|
565
618
|
|
google/genai/types.py
CHANGED
@@ -405,6 +405,38 @@ class TurnCoverage(_common.CaseInSensitiveEnum):
|
|
405
405
|
TURN_INCLUDES_ALL_INPUT = 'TURN_INCLUDES_ALL_INPUT'
|
406
406
|
|
407
407
|
|
408
|
+
class Blob(_common.BaseModel):
|
409
|
+
"""Content blob."""
|
410
|
+
|
411
|
+
display_name: Optional[str] = Field(
|
412
|
+
default=None,
|
413
|
+
description="""Optional. Display name of the blob. Used to provide a label or filename to distinguish blobs. This field is not currently used in the Gemini GenerateContent calls.""",
|
414
|
+
)
|
415
|
+
data: Optional[bytes] = Field(
|
416
|
+
default=None, description="""Required. Raw bytes."""
|
417
|
+
)
|
418
|
+
mime_type: Optional[str] = Field(
|
419
|
+
default=None,
|
420
|
+
description="""Required. The IANA standard MIME type of the source data.""",
|
421
|
+
)
|
422
|
+
|
423
|
+
|
424
|
+
class BlobDict(TypedDict, total=False):
|
425
|
+
"""Content blob."""
|
426
|
+
|
427
|
+
display_name: Optional[str]
|
428
|
+
"""Optional. Display name of the blob. Used to provide a label or filename to distinguish blobs. This field is not currently used in the Gemini GenerateContent calls."""
|
429
|
+
|
430
|
+
data: Optional[bytes]
|
431
|
+
"""Required. Raw bytes."""
|
432
|
+
|
433
|
+
mime_type: Optional[str]
|
434
|
+
"""Required. The IANA standard MIME type of the source data."""
|
435
|
+
|
436
|
+
|
437
|
+
BlobOrDict = Union[Blob, BlobDict]
|
438
|
+
|
439
|
+
|
408
440
|
class VideoMetadata(_common.BaseModel):
|
409
441
|
"""Metadata describes the input video content."""
|
410
442
|
|
@@ -588,31 +620,6 @@ class FunctionResponseDict(TypedDict, total=False):
|
|
588
620
|
FunctionResponseOrDict = Union[FunctionResponse, FunctionResponseDict]
|
589
621
|
|
590
622
|
|
591
|
-
class Blob(_common.BaseModel):
|
592
|
-
"""Content blob."""
|
593
|
-
|
594
|
-
data: Optional[bytes] = Field(
|
595
|
-
default=None, description="""Required. Raw bytes."""
|
596
|
-
)
|
597
|
-
mime_type: Optional[str] = Field(
|
598
|
-
default=None,
|
599
|
-
description="""Required. The IANA standard MIME type of the source data.""",
|
600
|
-
)
|
601
|
-
|
602
|
-
|
603
|
-
class BlobDict(TypedDict, total=False):
|
604
|
-
"""Content blob."""
|
605
|
-
|
606
|
-
data: Optional[bytes]
|
607
|
-
"""Required. Raw bytes."""
|
608
|
-
|
609
|
-
mime_type: Optional[str]
|
610
|
-
"""Required. The IANA standard MIME type of the source data."""
|
611
|
-
|
612
|
-
|
613
|
-
BlobOrDict = Union[Blob, BlobDict]
|
614
|
-
|
615
|
-
|
616
623
|
class Part(_common.BaseModel):
|
617
624
|
"""A datatype containing media content.
|
618
625
|
|
@@ -628,6 +635,9 @@ class Part(_common.BaseModel):
|
|
628
635
|
default=None,
|
629
636
|
description="""Indicates if the part is thought from the model.""",
|
630
637
|
)
|
638
|
+
inline_data: Optional[Blob] = Field(
|
639
|
+
default=None, description="""Optional. Inlined bytes data."""
|
640
|
+
)
|
631
641
|
code_execution_result: Optional[CodeExecutionResult] = Field(
|
632
642
|
default=None,
|
633
643
|
description="""Optional. Result of executing the [ExecutableCode].""",
|
@@ -647,9 +657,6 @@ class Part(_common.BaseModel):
|
|
647
657
|
default=None,
|
648
658
|
description="""Optional. The result output of a [FunctionCall] that contains a string representing the [FunctionDeclaration.name] and a structured JSON object containing any output from the function call. It is used as context to the model.""",
|
649
659
|
)
|
650
|
-
inline_data: Optional[Blob] = Field(
|
651
|
-
default=None, description="""Optional. Inlined bytes data."""
|
652
|
-
)
|
653
660
|
text: Optional[str] = Field(
|
654
661
|
default=None, description="""Optional. Text part (can be code)."""
|
655
662
|
)
|
@@ -725,6 +732,9 @@ class PartDict(TypedDict, total=False):
|
|
725
732
|
thought: Optional[bool]
|
726
733
|
"""Indicates if the part is thought from the model."""
|
727
734
|
|
735
|
+
inline_data: Optional[BlobDict]
|
736
|
+
"""Optional. Inlined bytes data."""
|
737
|
+
|
728
738
|
code_execution_result: Optional[CodeExecutionResultDict]
|
729
739
|
"""Optional. Result of executing the [ExecutableCode]."""
|
730
740
|
|
@@ -740,9 +750,6 @@ class PartDict(TypedDict, total=False):
|
|
740
750
|
function_response: Optional[FunctionResponseDict]
|
741
751
|
"""Optional. The result output of a [FunctionCall] that contains a string representing the [FunctionDeclaration.name] and a structured JSON object containing any output from the function call. It is used as context to the model."""
|
742
752
|
|
743
|
-
inline_data: Optional[BlobDict]
|
744
|
-
"""Optional. Inlined bytes data."""
|
745
|
-
|
746
753
|
text: Optional[str]
|
747
754
|
"""Optional. Text part (can be code)."""
|
748
755
|
|
@@ -2991,12 +2998,23 @@ class GenerateContentConfig(_common.BaseModel):
|
|
2991
2998
|
)
|
2992
2999
|
response_mime_type: Optional[str] = Field(
|
2993
3000
|
default=None,
|
2994
|
-
description="""Output response
|
3001
|
+
description="""Output response mimetype of the generated candidate text.
|
3002
|
+
Supported mimetype:
|
3003
|
+
- `text/plain`: (default) Text output.
|
3004
|
+
- `application/json`: JSON response in the candidates.
|
3005
|
+
The model needs to be prompted to output the appropriate response type,
|
3006
|
+
otherwise the behavior is undefined.
|
3007
|
+
This is a preview feature.
|
2995
3008
|
""",
|
2996
3009
|
)
|
2997
3010
|
response_schema: Optional[SchemaUnion] = Field(
|
2998
3011
|
default=None,
|
2999
|
-
description="""Schema
|
3012
|
+
description="""The `Schema` object allows the definition of input and output data types.
|
3013
|
+
These types can be objects, but also primitives and arrays.
|
3014
|
+
Represents a select subset of an [OpenAPI 3.0 schema
|
3015
|
+
object](https://spec.openapis.org/oas/v3.0.3#schema).
|
3016
|
+
If set, a compatible response_mime_type must also be set.
|
3017
|
+
Compatible mimetypes: `application/json`: Schema for JSON response.
|
3000
3018
|
""",
|
3001
3019
|
)
|
3002
3020
|
routing_config: Optional[GenerationConfigRoutingConfig] = Field(
|
@@ -3163,11 +3181,22 @@ class GenerateContentConfigDict(TypedDict, total=False):
|
|
3163
3181
|
"""
|
3164
3182
|
|
3165
3183
|
response_mime_type: Optional[str]
|
3166
|
-
"""Output response
|
3184
|
+
"""Output response mimetype of the generated candidate text.
|
3185
|
+
Supported mimetype:
|
3186
|
+
- `text/plain`: (default) Text output.
|
3187
|
+
- `application/json`: JSON response in the candidates.
|
3188
|
+
The model needs to be prompted to output the appropriate response type,
|
3189
|
+
otherwise the behavior is undefined.
|
3190
|
+
This is a preview feature.
|
3167
3191
|
"""
|
3168
3192
|
|
3169
3193
|
response_schema: Optional[SchemaUnionDict]
|
3170
|
-
"""Schema
|
3194
|
+
"""The `Schema` object allows the definition of input and output data types.
|
3195
|
+
These types can be objects, but also primitives and arrays.
|
3196
|
+
Represents a select subset of an [OpenAPI 3.0 schema
|
3197
|
+
object](https://spec.openapis.org/oas/v3.0.3#schema).
|
3198
|
+
If set, a compatible response_mime_type must also be set.
|
3199
|
+
Compatible mimetypes: `application/json`: Schema for JSON response.
|
3171
3200
|
"""
|
3172
3201
|
|
3173
3202
|
routing_config: Optional[GenerationConfigRoutingConfigDict]
|
@@ -5449,7 +5478,7 @@ EditImageResponseOrDict = Union[EditImageResponse, EditImageResponseDict]
|
|
5449
5478
|
|
5450
5479
|
|
5451
5480
|
class _UpscaleImageAPIConfig(_common.BaseModel):
|
5452
|
-
"""API config for UpscaleImage
|
5481
|
+
"""Internal API config for UpscaleImage.
|
5453
5482
|
|
5454
5483
|
These fields require default values sent to the API which are not intended
|
5455
5484
|
to be modifiable or exposed to users in the SDK method.
|
@@ -5477,7 +5506,7 @@ class _UpscaleImageAPIConfig(_common.BaseModel):
|
|
5477
5506
|
|
5478
5507
|
|
5479
5508
|
class _UpscaleImageAPIConfigDict(TypedDict, total=False):
|
5480
|
-
"""API config for UpscaleImage
|
5509
|
+
"""Internal API config for UpscaleImage.
|
5481
5510
|
|
5482
5511
|
These fields require default values sent to the API which are not intended
|
5483
5512
|
to be modifiable or exposed to users in the SDK method.
|
@@ -5662,6 +5691,45 @@ class TunedModelInfoDict(TypedDict, total=False):
|
|
5662
5691
|
TunedModelInfoOrDict = Union[TunedModelInfo, TunedModelInfoDict]
|
5663
5692
|
|
5664
5693
|
|
5694
|
+
class Checkpoint(_common.BaseModel):
|
5695
|
+
"""Describes the machine learning model version checkpoint."""
|
5696
|
+
|
5697
|
+
checkpoint_id: Optional[str] = Field(
|
5698
|
+
default=None,
|
5699
|
+
description="""The ID of the checkpoint.
|
5700
|
+
""",
|
5701
|
+
)
|
5702
|
+
epoch: Optional[int] = Field(
|
5703
|
+
default=None,
|
5704
|
+
description="""The epoch of the checkpoint.
|
5705
|
+
""",
|
5706
|
+
)
|
5707
|
+
step: Optional[int] = Field(
|
5708
|
+
default=None,
|
5709
|
+
description="""The step of the checkpoint.
|
5710
|
+
""",
|
5711
|
+
)
|
5712
|
+
|
5713
|
+
|
5714
|
+
class CheckpointDict(TypedDict, total=False):
|
5715
|
+
"""Describes the machine learning model version checkpoint."""
|
5716
|
+
|
5717
|
+
checkpoint_id: Optional[str]
|
5718
|
+
"""The ID of the checkpoint.
|
5719
|
+
"""
|
5720
|
+
|
5721
|
+
epoch: Optional[int]
|
5722
|
+
"""The epoch of the checkpoint.
|
5723
|
+
"""
|
5724
|
+
|
5725
|
+
step: Optional[int]
|
5726
|
+
"""The step of the checkpoint.
|
5727
|
+
"""
|
5728
|
+
|
5729
|
+
|
5730
|
+
CheckpointOrDict = Union[Checkpoint, CheckpointDict]
|
5731
|
+
|
5732
|
+
|
5665
5733
|
class Model(_common.BaseModel):
|
5666
5734
|
"""A trained machine learning model."""
|
5667
5735
|
|
@@ -5706,6 +5774,14 @@ class Model(_common.BaseModel):
|
|
5706
5774
|
default=None,
|
5707
5775
|
description="""List of actions that are supported by the model.""",
|
5708
5776
|
)
|
5777
|
+
default_checkpoint_id: Optional[str] = Field(
|
5778
|
+
default=None,
|
5779
|
+
description="""The default checkpoint id of a model version.
|
5780
|
+
""",
|
5781
|
+
)
|
5782
|
+
checkpoints: Optional[list[Checkpoint]] = Field(
|
5783
|
+
default=None, description="""The checkpoints of the model."""
|
5784
|
+
)
|
5709
5785
|
|
5710
5786
|
|
5711
5787
|
class ModelDict(TypedDict, total=False):
|
@@ -5745,6 +5821,13 @@ class ModelDict(TypedDict, total=False):
|
|
5745
5821
|
supported_actions: Optional[list[str]]
|
5746
5822
|
"""List of actions that are supported by the model."""
|
5747
5823
|
|
5824
|
+
default_checkpoint_id: Optional[str]
|
5825
|
+
"""The default checkpoint id of a model version.
|
5826
|
+
"""
|
5827
|
+
|
5828
|
+
checkpoints: Optional[list[CheckpointDict]]
|
5829
|
+
"""The checkpoints of the model."""
|
5830
|
+
|
5748
5831
|
|
5749
5832
|
ModelOrDict = Union[Model, ModelDict]
|
5750
5833
|
|
@@ -5826,6 +5909,7 @@ class UpdateModelConfig(_common.BaseModel):
|
|
5826
5909
|
)
|
5827
5910
|
display_name: Optional[str] = Field(default=None, description="""""")
|
5828
5911
|
description: Optional[str] = Field(default=None, description="""""")
|
5912
|
+
default_checkpoint_id: Optional[str] = Field(default=None, description="""""")
|
5829
5913
|
|
5830
5914
|
|
5831
5915
|
class UpdateModelConfigDict(TypedDict, total=False):
|
@@ -5840,6 +5924,9 @@ class UpdateModelConfigDict(TypedDict, total=False):
|
|
5840
5924
|
description: Optional[str]
|
5841
5925
|
""""""
|
5842
5926
|
|
5927
|
+
default_checkpoint_id: Optional[str]
|
5928
|
+
""""""
|
5929
|
+
|
5843
5930
|
|
5844
5931
|
UpdateModelConfigOrDict = Union[UpdateModelConfig, UpdateModelConfigDict]
|
5845
5932
|
|
@@ -6619,6 +6706,58 @@ _GetTuningJobParametersOrDict = Union[
|
|
6619
6706
|
]
|
6620
6707
|
|
6621
6708
|
|
6709
|
+
class TunedModelCheckpoint(_common.BaseModel):
|
6710
|
+
"""TunedModelCheckpoint for the Tuned Model of a Tuning Job."""
|
6711
|
+
|
6712
|
+
checkpoint_id: Optional[str] = Field(
|
6713
|
+
default=None,
|
6714
|
+
description="""The ID of the checkpoint.
|
6715
|
+
""",
|
6716
|
+
)
|
6717
|
+
epoch: Optional[int] = Field(
|
6718
|
+
default=None,
|
6719
|
+
description="""The epoch of the checkpoint.
|
6720
|
+
""",
|
6721
|
+
)
|
6722
|
+
step: Optional[int] = Field(
|
6723
|
+
default=None,
|
6724
|
+
description="""The step of the checkpoint.
|
6725
|
+
""",
|
6726
|
+
)
|
6727
|
+
endpoint: Optional[str] = Field(
|
6728
|
+
default=None,
|
6729
|
+
description="""The Endpoint resource name that the checkpoint is deployed to.
|
6730
|
+
Format: `projects/{project}/locations/{location}/endpoints/{endpoint}`.
|
6731
|
+
""",
|
6732
|
+
)
|
6733
|
+
|
6734
|
+
|
6735
|
+
class TunedModelCheckpointDict(TypedDict, total=False):
|
6736
|
+
"""TunedModelCheckpoint for the Tuned Model of a Tuning Job."""
|
6737
|
+
|
6738
|
+
checkpoint_id: Optional[str]
|
6739
|
+
"""The ID of the checkpoint.
|
6740
|
+
"""
|
6741
|
+
|
6742
|
+
epoch: Optional[int]
|
6743
|
+
"""The epoch of the checkpoint.
|
6744
|
+
"""
|
6745
|
+
|
6746
|
+
step: Optional[int]
|
6747
|
+
"""The step of the checkpoint.
|
6748
|
+
"""
|
6749
|
+
|
6750
|
+
endpoint: Optional[str]
|
6751
|
+
"""The Endpoint resource name that the checkpoint is deployed to.
|
6752
|
+
Format: `projects/{project}/locations/{location}/endpoints/{endpoint}`.
|
6753
|
+
"""
|
6754
|
+
|
6755
|
+
|
6756
|
+
TunedModelCheckpointOrDict = Union[
|
6757
|
+
TunedModelCheckpoint, TunedModelCheckpointDict
|
6758
|
+
]
|
6759
|
+
|
6760
|
+
|
6622
6761
|
class TunedModel(_common.BaseModel):
|
6623
6762
|
|
6624
6763
|
model: Optional[str] = Field(
|
@@ -6629,6 +6768,12 @@ class TunedModel(_common.BaseModel):
|
|
6629
6768
|
default=None,
|
6630
6769
|
description="""Output only. A resource name of an Endpoint. Format: `projects/{project}/locations/{location}/endpoints/{endpoint}`.""",
|
6631
6770
|
)
|
6771
|
+
checkpoints: Optional[list[TunedModelCheckpoint]] = Field(
|
6772
|
+
default=None,
|
6773
|
+
description="""The checkpoints associated with this TunedModel.
|
6774
|
+
This field is only populated for tuning jobs that enable intermediate
|
6775
|
+
checkpoints.""",
|
6776
|
+
)
|
6632
6777
|
|
6633
6778
|
|
6634
6779
|
class TunedModelDict(TypedDict, total=False):
|
@@ -6639,6 +6784,11 @@ class TunedModelDict(TypedDict, total=False):
|
|
6639
6784
|
endpoint: Optional[str]
|
6640
6785
|
"""Output only. A resource name of an Endpoint. Format: `projects/{project}/locations/{location}/endpoints/{endpoint}`."""
|
6641
6786
|
|
6787
|
+
checkpoints: Optional[list[TunedModelCheckpointDict]]
|
6788
|
+
"""The checkpoints associated with this TunedModel.
|
6789
|
+
This field is only populated for tuning jobs that enable intermediate
|
6790
|
+
checkpoints."""
|
6791
|
+
|
6642
6792
|
|
6643
6793
|
TunedModelOrDict = Union[TunedModel, TunedModelDict]
|
6644
6794
|
|
@@ -6736,6 +6886,10 @@ class SupervisedTuningSpec(_common.BaseModel):
|
|
6736
6886
|
default=None,
|
6737
6887
|
description="""Optional. Cloud Storage path to file containing validation dataset for tuning. The dataset must be formatted as a JSONL file.""",
|
6738
6888
|
)
|
6889
|
+
export_last_checkpoint_only: Optional[bool] = Field(
|
6890
|
+
default=None,
|
6891
|
+
description="""Optional. If set to true, disable intermediate checkpoints for SFT and only the last checkpoint will be exported.""",
|
6892
|
+
)
|
6739
6893
|
|
6740
6894
|
|
6741
6895
|
class SupervisedTuningSpecDict(TypedDict, total=False):
|
@@ -6750,6 +6904,9 @@ class SupervisedTuningSpecDict(TypedDict, total=False):
|
|
6750
6904
|
validation_dataset_uri: Optional[str]
|
6751
6905
|
"""Optional. Cloud Storage path to file containing validation dataset for tuning. The dataset must be formatted as a JSONL file."""
|
6752
6906
|
|
6907
|
+
export_last_checkpoint_only: Optional[bool]
|
6908
|
+
"""Optional. If set to true, disable intermediate checkpoints for SFT and only the last checkpoint will be exported."""
|
6909
|
+
|
6753
6910
|
|
6754
6911
|
SupervisedTuningSpecOrDict = Union[
|
6755
6912
|
SupervisedTuningSpec, SupervisedTuningSpecDict
|
@@ -7661,6 +7818,10 @@ class CreateTuningJobConfig(_common.BaseModel):
|
|
7661
7818
|
default=None,
|
7662
7819
|
description="""Multiplier for adjusting the default learning rate.""",
|
7663
7820
|
)
|
7821
|
+
export_last_checkpoint_only: Optional[bool] = Field(
|
7822
|
+
default=None,
|
7823
|
+
description="""If set to true, disable intermediate checkpoints for SFT and only the last checkpoint will be exported. Otherwise, enable intermediate checkpoints for SFT.""",
|
7824
|
+
)
|
7664
7825
|
adapter_size: Optional[AdapterSize] = Field(
|
7665
7826
|
default=None, description="""Adapter size for tuning."""
|
7666
7827
|
)
|
@@ -7695,6 +7856,9 @@ class CreateTuningJobConfigDict(TypedDict, total=False):
|
|
7695
7856
|
learning_rate_multiplier: Optional[float]
|
7696
7857
|
"""Multiplier for adjusting the default learning rate."""
|
7697
7858
|
|
7859
|
+
export_last_checkpoint_only: Optional[bool]
|
7860
|
+
"""If set to true, disable intermediate checkpoints for SFT and only the last checkpoint will be exported. Otherwise, enable intermediate checkpoints for SFT."""
|
7861
|
+
|
7698
7862
|
adapter_size: Optional[AdapterSize]
|
7699
7863
|
"""Adapter size for tuning."""
|
7700
7864
|
|
@@ -10792,6 +10956,87 @@ LiveClientRealtimeInputOrDict = Union[
|
|
10792
10956
|
LiveClientRealtimeInput, LiveClientRealtimeInputDict
|
10793
10957
|
]
|
10794
10958
|
|
10959
|
+
if _is_pillow_image_imported:
|
10960
|
+
BlobImageUnion = Union[Blob, PIL_Image]
|
10961
|
+
else:
|
10962
|
+
BlobImageUnion = Blob # type: ignore[misc]
|
10963
|
+
|
10964
|
+
|
10965
|
+
BlobImageUnionDict = Union[BlobImageUnion, BlobDict]
|
10966
|
+
|
10967
|
+
|
10968
|
+
class LiveSendRealtimeInputParameters(_common.BaseModel):
|
10969
|
+
"""Parameters for sending realtime input to the live API."""
|
10970
|
+
|
10971
|
+
media: Optional[BlobImageUnion] = Field(
|
10972
|
+
default=None, description="""Realtime input to send to the session."""
|
10973
|
+
)
|
10974
|
+
audio: Optional[Blob] = Field(
|
10975
|
+
default=None, description="""The realtime audio input stream."""
|
10976
|
+
)
|
10977
|
+
audio_stream_end: Optional[bool] = Field(
|
10978
|
+
default=None,
|
10979
|
+
description="""
|
10980
|
+
Indicates that the audio stream has ended, e.g. because the microphone was
|
10981
|
+
turned off.
|
10982
|
+
|
10983
|
+
This should only be sent when automatic activity detection is enabled
|
10984
|
+
(which is the default).
|
10985
|
+
|
10986
|
+
The client can reopen the stream by sending an audio message.
|
10987
|
+
""",
|
10988
|
+
)
|
10989
|
+
video: Optional[BlobImageUnion] = Field(
|
10990
|
+
default=None, description="""The realtime video input stream."""
|
10991
|
+
)
|
10992
|
+
text: Optional[str] = Field(
|
10993
|
+
default=None, description="""The realtime text input stream."""
|
10994
|
+
)
|
10995
|
+
activity_start: Optional[ActivityStart] = Field(
|
10996
|
+
default=None, description="""Marks the start of user activity."""
|
10997
|
+
)
|
10998
|
+
activity_end: Optional[ActivityEnd] = Field(
|
10999
|
+
default=None, description="""Marks the end of user activity."""
|
11000
|
+
)
|
11001
|
+
|
11002
|
+
|
11003
|
+
class LiveSendRealtimeInputParametersDict(TypedDict, total=False):
|
11004
|
+
"""Parameters for sending realtime input to the live API."""
|
11005
|
+
|
11006
|
+
media: Optional[BlobImageUnionDict]
|
11007
|
+
"""Realtime input to send to the session."""
|
11008
|
+
|
11009
|
+
audio: Optional[BlobDict]
|
11010
|
+
"""The realtime audio input stream."""
|
11011
|
+
|
11012
|
+
audio_stream_end: Optional[bool]
|
11013
|
+
"""
|
11014
|
+
Indicates that the audio stream has ended, e.g. because the microphone was
|
11015
|
+
turned off.
|
11016
|
+
|
11017
|
+
This should only be sent when automatic activity detection is enabled
|
11018
|
+
(which is the default).
|
11019
|
+
|
11020
|
+
The client can reopen the stream by sending an audio message.
|
11021
|
+
"""
|
11022
|
+
|
11023
|
+
video: Optional[BlobImageUnionDict]
|
11024
|
+
"""The realtime video input stream."""
|
11025
|
+
|
11026
|
+
text: Optional[str]
|
11027
|
+
"""The realtime text input stream."""
|
11028
|
+
|
11029
|
+
activity_start: Optional[ActivityStartDict]
|
11030
|
+
"""Marks the start of user activity."""
|
11031
|
+
|
11032
|
+
activity_end: Optional[ActivityEndDict]
|
11033
|
+
"""Marks the end of user activity."""
|
11034
|
+
|
11035
|
+
|
11036
|
+
LiveSendRealtimeInputParametersOrDict = Union[
|
11037
|
+
LiveSendRealtimeInputParameters, LiveSendRealtimeInputParametersDict
|
11038
|
+
]
|
11039
|
+
|
10795
11040
|
|
10796
11041
|
class LiveClientToolResponse(_common.BaseModel):
|
10797
11042
|
"""Client generated response to a `ToolCall` received from the server.
|
@@ -11090,84 +11335,3 @@ class LiveConnectParametersDict(TypedDict, total=False):
|
|
11090
11335
|
LiveConnectParametersOrDict = Union[
|
11091
11336
|
LiveConnectParameters, LiveConnectParametersDict
|
11092
11337
|
]
|
11093
|
-
|
11094
|
-
if _is_pillow_image_imported:
|
11095
|
-
BlobImageUnion = Union[Blob, PIL_Image]
|
11096
|
-
else:
|
11097
|
-
BlobImageUnion = Blob # type: ignore[misc]
|
11098
|
-
|
11099
|
-
|
11100
|
-
BlobImageUnionDict = Union[BlobImageUnion, BlobDict]
|
11101
|
-
|
11102
|
-
|
11103
|
-
class LiveSendRealtimeInputParameters(_common.BaseModel):
|
11104
|
-
"""Parameters for sending realtime input to the live API."""
|
11105
|
-
|
11106
|
-
media: Optional[BlobImageUnion] = Field(
|
11107
|
-
default=None, description="""Realtime input to send to the session."""
|
11108
|
-
)
|
11109
|
-
audio: Optional[Blob] = Field(
|
11110
|
-
default=None, description="""The realtime audio input stream."""
|
11111
|
-
)
|
11112
|
-
audio_stream_end: Optional[bool] = Field(
|
11113
|
-
default=None,
|
11114
|
-
description="""
|
11115
|
-
Indicates that the audio stream has ended, e.g. because the microphone was
|
11116
|
-
turned off.
|
11117
|
-
|
11118
|
-
This should only be sent when automatic activity detection is enabled
|
11119
|
-
(which is the default).
|
11120
|
-
|
11121
|
-
The client can reopen the stream by sending an audio message.
|
11122
|
-
""",
|
11123
|
-
)
|
11124
|
-
video: Optional[BlobImageUnion] = Field(
|
11125
|
-
default=None, description="""The realtime video input stream."""
|
11126
|
-
)
|
11127
|
-
text: Optional[str] = Field(
|
11128
|
-
default=None, description="""The realtime text input stream."""
|
11129
|
-
)
|
11130
|
-
activity_start: Optional[ActivityStart] = Field(
|
11131
|
-
default=None, description="""Marks the start of user activity."""
|
11132
|
-
)
|
11133
|
-
activity_end: Optional[ActivityEnd] = Field(
|
11134
|
-
default=None, description="""Marks the end of user activity."""
|
11135
|
-
)
|
11136
|
-
|
11137
|
-
|
11138
|
-
class LiveSendRealtimeInputParametersDict(TypedDict, total=False):
|
11139
|
-
"""Parameters for sending realtime input to the live API."""
|
11140
|
-
|
11141
|
-
media: Optional[BlobImageUnionDict]
|
11142
|
-
"""Realtime input to send to the session."""
|
11143
|
-
|
11144
|
-
audio: Optional[BlobDict]
|
11145
|
-
"""The realtime audio input stream."""
|
11146
|
-
|
11147
|
-
audio_stream_end: Optional[bool]
|
11148
|
-
"""
|
11149
|
-
Indicates that the audio stream has ended, e.g. because the microphone was
|
11150
|
-
turned off.
|
11151
|
-
|
11152
|
-
This should only be sent when automatic activity detection is enabled
|
11153
|
-
(which is the default).
|
11154
|
-
|
11155
|
-
The client can reopen the stream by sending an audio message.
|
11156
|
-
"""
|
11157
|
-
|
11158
|
-
video: Optional[BlobImageUnionDict]
|
11159
|
-
"""The realtime video input stream."""
|
11160
|
-
|
11161
|
-
text: Optional[str]
|
11162
|
-
"""The realtime text input stream."""
|
11163
|
-
|
11164
|
-
activity_start: Optional[ActivityStartDict]
|
11165
|
-
"""Marks the start of user activity."""
|
11166
|
-
|
11167
|
-
activity_end: Optional[ActivityEndDict]
|
11168
|
-
"""Marks the end of user activity."""
|
11169
|
-
|
11170
|
-
|
11171
|
-
LiveSendRealtimeInputParametersOrDict = Union[
|
11172
|
-
LiveSendRealtimeInputParameters, LiveSendRealtimeInputParametersDict
|
11173
|
-
]
|
google/genai/version.py
CHANGED