google-genai 1.40.0__py3-none-any.whl → 1.41.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/_extra_utils.py +72 -1
- google/genai/_live_converters.py +50 -0
- google/genai/_tokens_converters.py +25 -0
- google/genai/files.py +17 -97
- google/genai/tunings.py +6 -0
- google/genai/types.py +101 -2
- google/genai/version.py +1 -1
- {google_genai-1.40.0.dist-info → google_genai-1.41.0.dist-info}/METADATA +1 -1
- {google_genai-1.40.0.dist-info → google_genai-1.41.0.dist-info}/RECORD +12 -12
- {google_genai-1.40.0.dist-info → google_genai-1.41.0.dist-info}/WHEEL +0 -0
- {google_genai-1.40.0.dist-info → google_genai-1.41.0.dist-info}/licenses/LICENSE +0 -0
- {google_genai-1.40.0.dist-info → google_genai-1.41.0.dist-info}/top_level.txt +0 -0
google/genai/_extra_utils.py
CHANGED
@@ -16,11 +16,13 @@
|
|
16
16
|
"""Extra utils depending on types that are shared between sync and async modules."""
|
17
17
|
|
18
18
|
import inspect
|
19
|
+
import io
|
19
20
|
import logging
|
20
21
|
import sys
|
21
22
|
import typing
|
22
23
|
from typing import Any, Callable, Dict, Optional, Union, get_args, get_origin
|
23
|
-
|
24
|
+
import mimetypes
|
25
|
+
import os
|
24
26
|
import pydantic
|
25
27
|
|
26
28
|
from . import _common
|
@@ -541,3 +543,72 @@ def append_chunk_contents(
|
|
541
543
|
contents = t.t_contents(contents) # type: ignore[assignment]
|
542
544
|
if isinstance(contents, list) and chunk_content is not None:
|
543
545
|
contents.append(chunk_content) # type: ignore[arg-type]
|
546
|
+
|
547
|
+
|
548
|
+
def prepare_resumable_upload(
|
549
|
+
file: Union[str, os.PathLike[str], io.IOBase],
|
550
|
+
user_http_options: Optional[types.HttpOptionsOrDict] = None,
|
551
|
+
user_mime_type: Optional[str] = None,
|
552
|
+
) -> tuple[
|
553
|
+
types.HttpOptions,
|
554
|
+
int,
|
555
|
+
str,
|
556
|
+
]:
|
557
|
+
"""Prepares the HTTP options, file bytes size and mime type for a resumable upload.
|
558
|
+
|
559
|
+
This function inspects a file (from a path or an in-memory object) to
|
560
|
+
determine its size and MIME type. It then constructs the necessary HTTP
|
561
|
+
headers and options required to initiate a resumable upload session.
|
562
|
+
"""
|
563
|
+
size_bytes = None
|
564
|
+
mime_type = user_mime_type
|
565
|
+
if isinstance(file, io.IOBase):
|
566
|
+
if mime_type is None:
|
567
|
+
raise ValueError(
|
568
|
+
'Unknown mime type: Could not determine the mimetype for your'
|
569
|
+
' file\n please set the `mime_type` argument'
|
570
|
+
)
|
571
|
+
if hasattr(file, 'mode'):
|
572
|
+
if 'b' not in file.mode:
|
573
|
+
raise ValueError('The file must be opened in binary mode.')
|
574
|
+
offset = file.tell()
|
575
|
+
file.seek(0, os.SEEK_END)
|
576
|
+
size_bytes = file.tell() - offset
|
577
|
+
file.seek(offset, os.SEEK_SET)
|
578
|
+
else:
|
579
|
+
fs_path = os.fspath(file)
|
580
|
+
if not fs_path or not os.path.isfile(fs_path):
|
581
|
+
raise FileNotFoundError(f'{file} is not a valid file path.')
|
582
|
+
size_bytes = os.path.getsize(fs_path)
|
583
|
+
if mime_type is None:
|
584
|
+
mime_type, _ = mimetypes.guess_type(fs_path)
|
585
|
+
if mime_type is None:
|
586
|
+
raise ValueError(
|
587
|
+
'Unknown mime type: Could not determine the mimetype for your'
|
588
|
+
' file\n please set the `mime_type` argument'
|
589
|
+
)
|
590
|
+
http_options: types.HttpOptions
|
591
|
+
if user_http_options:
|
592
|
+
if isinstance(user_http_options, dict):
|
593
|
+
user_http_options = types.HttpOptions(**user_http_options)
|
594
|
+
http_options = user_http_options
|
595
|
+
http_options.api_version = ''
|
596
|
+
http_options.headers = {
|
597
|
+
'Content-Type': 'application/json',
|
598
|
+
'X-Goog-Upload-Protocol': 'resumable',
|
599
|
+
'X-Goog-Upload-Command': 'start',
|
600
|
+
'X-Goog-Upload-Header-Content-Length': f'{size_bytes}',
|
601
|
+
'X-Goog-Upload-Header-Content-Type': f'{mime_type}',
|
602
|
+
}
|
603
|
+
else:
|
604
|
+
http_options = types.HttpOptions(
|
605
|
+
api_version='',
|
606
|
+
headers={
|
607
|
+
'Content-Type': 'application/json',
|
608
|
+
'X-Goog-Upload-Protocol': 'resumable',
|
609
|
+
'X-Goog-Upload-Command': 'start',
|
610
|
+
'X-Goog-Upload-Header-Content-Length': f'{size_bytes}',
|
611
|
+
'X-Goog-Upload-Header-Content-Type': f'{mime_type}',
|
612
|
+
},
|
613
|
+
)
|
614
|
+
return http_options, size_bytes, mime_type
|
google/genai/_live_converters.py
CHANGED
@@ -1484,6 +1484,15 @@ def _LiveConnectConfig_to_mldev(
|
|
1484
1484
|
),
|
1485
1485
|
)
|
1486
1486
|
|
1487
|
+
if getv(from_object, ['thinking_config']) is not None:
|
1488
|
+
setv(
|
1489
|
+
parent_object,
|
1490
|
+
['setup', 'generationConfig', 'thinkingConfig'],
|
1491
|
+
_ThinkingConfig_to_mldev(
|
1492
|
+
getv(from_object, ['thinking_config']), to_object
|
1493
|
+
),
|
1494
|
+
)
|
1495
|
+
|
1487
1496
|
if getv(from_object, ['enable_affective_dialog']) is not None:
|
1488
1497
|
setv(
|
1489
1498
|
parent_object,
|
@@ -1640,6 +1649,15 @@ def _LiveConnectConfig_to_vertex(
|
|
1640
1649
|
),
|
1641
1650
|
)
|
1642
1651
|
|
1652
|
+
if getv(from_object, ['thinking_config']) is not None:
|
1653
|
+
setv(
|
1654
|
+
parent_object,
|
1655
|
+
['setup', 'generationConfig', 'thinkingConfig'],
|
1656
|
+
_ThinkingConfig_to_vertex(
|
1657
|
+
getv(from_object, ['thinking_config']), to_object
|
1658
|
+
),
|
1659
|
+
)
|
1660
|
+
|
1643
1661
|
if getv(from_object, ['enable_affective_dialog']) is not None:
|
1644
1662
|
setv(
|
1645
1663
|
parent_object,
|
@@ -3225,6 +3243,38 @@ def _SpeechConfig_to_vertex(
|
|
3225
3243
|
return to_object
|
3226
3244
|
|
3227
3245
|
|
3246
|
+
def _ThinkingConfig_to_mldev(
|
3247
|
+
from_object: Union[dict[str, Any], object],
|
3248
|
+
parent_object: Optional[dict[str, Any]] = None,
|
3249
|
+
) -> dict[str, Any]:
|
3250
|
+
to_object: dict[str, Any] = {}
|
3251
|
+
if getv(from_object, ['include_thoughts']) is not None:
|
3252
|
+
setv(
|
3253
|
+
to_object, ['includeThoughts'], getv(from_object, ['include_thoughts'])
|
3254
|
+
)
|
3255
|
+
|
3256
|
+
if getv(from_object, ['thinking_budget']) is not None:
|
3257
|
+
setv(to_object, ['thinkingBudget'], getv(from_object, ['thinking_budget']))
|
3258
|
+
|
3259
|
+
return to_object
|
3260
|
+
|
3261
|
+
|
3262
|
+
def _ThinkingConfig_to_vertex(
|
3263
|
+
from_object: Union[dict[str, Any], object],
|
3264
|
+
parent_object: Optional[dict[str, Any]] = None,
|
3265
|
+
) -> dict[str, Any]:
|
3266
|
+
to_object: dict[str, Any] = {}
|
3267
|
+
if getv(from_object, ['include_thoughts']) is not None:
|
3268
|
+
setv(
|
3269
|
+
to_object, ['includeThoughts'], getv(from_object, ['include_thoughts'])
|
3270
|
+
)
|
3271
|
+
|
3272
|
+
if getv(from_object, ['thinking_budget']) is not None:
|
3273
|
+
setv(to_object, ['thinkingBudget'], getv(from_object, ['thinking_budget']))
|
3274
|
+
|
3275
|
+
return to_object
|
3276
|
+
|
3277
|
+
|
3228
3278
|
def _Tool_to_mldev(
|
3229
3279
|
from_object: Union[dict[str, Any], object],
|
3230
3280
|
parent_object: Optional[dict[str, Any]] = None,
|
@@ -448,6 +448,15 @@ def _LiveConnectConfig_to_mldev(
|
|
448
448
|
),
|
449
449
|
)
|
450
450
|
|
451
|
+
if getv(from_object, ['thinking_config']) is not None:
|
452
|
+
setv(
|
453
|
+
parent_object,
|
454
|
+
['setup', 'generationConfig', 'thinkingConfig'],
|
455
|
+
_ThinkingConfig_to_mldev(
|
456
|
+
getv(from_object, ['thinking_config']), to_object
|
457
|
+
),
|
458
|
+
)
|
459
|
+
|
451
460
|
if getv(from_object, ['enable_affective_dialog']) is not None:
|
452
461
|
setv(
|
453
462
|
parent_object,
|
@@ -761,6 +770,22 @@ def _SpeechConfig_to_mldev(
|
|
761
770
|
return to_object
|
762
771
|
|
763
772
|
|
773
|
+
def _ThinkingConfig_to_mldev(
|
774
|
+
from_object: Union[dict[str, Any], object],
|
775
|
+
parent_object: Optional[dict[str, Any]] = None,
|
776
|
+
) -> dict[str, Any]:
|
777
|
+
to_object: dict[str, Any] = {}
|
778
|
+
if getv(from_object, ['include_thoughts']) is not None:
|
779
|
+
setv(
|
780
|
+
to_object, ['includeThoughts'], getv(from_object, ['include_thoughts'])
|
781
|
+
)
|
782
|
+
|
783
|
+
if getv(from_object, ['thinking_budget']) is not None:
|
784
|
+
setv(to_object, ['thinkingBudget'], getv(from_object, ['thinking_budget']))
|
785
|
+
|
786
|
+
return to_object
|
787
|
+
|
788
|
+
|
764
789
|
def _Tool_to_mldev(
|
765
790
|
from_object: Union[dict[str, Any], object],
|
766
791
|
parent_object: Optional[dict[str, Any]] = None,
|
google/genai/files.py
CHANGED
@@ -18,13 +18,13 @@
|
|
18
18
|
import io
|
19
19
|
import json
|
20
20
|
import logging
|
21
|
-
import mimetypes
|
22
21
|
import os
|
23
22
|
from typing import Any, Optional, Union
|
24
23
|
from urllib.parse import urlencode
|
25
24
|
|
26
25
|
from . import _api_module
|
27
26
|
from . import _common
|
27
|
+
from . import _extra_utils
|
28
28
|
from . import _transformers as t
|
29
29
|
from . import types
|
30
30
|
from ._common import get_value_by_path as getv
|
@@ -611,54 +611,13 @@ class Files(_api_module.BaseModule):
|
|
611
611
|
if file_obj.name is not None and not file_obj.name.startswith('files/'):
|
612
612
|
file_obj.name = f'files/{file_obj.name}'
|
613
613
|
|
614
|
-
|
615
|
-
|
616
|
-
|
617
|
-
|
618
|
-
|
619
|
-
|
620
|
-
|
621
|
-
if 'b' not in file.mode:
|
622
|
-
raise ValueError('The file must be opened in binary mode.')
|
623
|
-
offset = file.tell()
|
624
|
-
file.seek(0, os.SEEK_END)
|
625
|
-
file_obj.size_bytes = file.tell() - offset
|
626
|
-
file.seek(offset, os.SEEK_SET)
|
627
|
-
else:
|
628
|
-
fs_path = os.fspath(file)
|
629
|
-
if not fs_path or not os.path.isfile(fs_path):
|
630
|
-
raise FileNotFoundError(f'{file} is not a valid file path.')
|
631
|
-
file_obj.size_bytes = os.path.getsize(fs_path)
|
632
|
-
if file_obj.mime_type is None:
|
633
|
-
file_obj.mime_type, _ = mimetypes.guess_type(fs_path)
|
634
|
-
if file_obj.mime_type is None:
|
635
|
-
raise ValueError(
|
636
|
-
'Unknown mime type: Could not determine the mimetype for your'
|
637
|
-
' file\n please set the `mime_type` argument'
|
638
|
-
)
|
639
|
-
|
640
|
-
http_options: types.HttpOptions
|
641
|
-
if config_model and config_model.http_options:
|
642
|
-
http_options = config_model.http_options
|
643
|
-
http_options.api_version = ''
|
644
|
-
http_options.headers = {
|
645
|
-
'Content-Type': 'application/json',
|
646
|
-
'X-Goog-Upload-Protocol': 'resumable',
|
647
|
-
'X-Goog-Upload-Command': 'start',
|
648
|
-
'X-Goog-Upload-Header-Content-Length': f'{file_obj.size_bytes}',
|
649
|
-
'X-Goog-Upload-Header-Content-Type': f'{file_obj.mime_type}',
|
650
|
-
}
|
651
|
-
else:
|
652
|
-
http_options = types.HttpOptions(
|
653
|
-
api_version='',
|
654
|
-
headers={
|
655
|
-
'Content-Type': 'application/json',
|
656
|
-
'X-Goog-Upload-Protocol': 'resumable',
|
657
|
-
'X-Goog-Upload-Command': 'start',
|
658
|
-
'X-Goog-Upload-Header-Content-Length': f'{file_obj.size_bytes}',
|
659
|
-
'X-Goog-Upload-Header-Content-Type': f'{file_obj.mime_type}',
|
660
|
-
},
|
661
|
-
)
|
614
|
+
http_options, size_bytes, mime_type = _extra_utils.prepare_resumable_upload(
|
615
|
+
file,
|
616
|
+
user_http_options=config_model.http_options,
|
617
|
+
user_mime_type=config_model.mime_type,
|
618
|
+
)
|
619
|
+
file_obj.size_bytes = size_bytes
|
620
|
+
file_obj.mime_type = mime_type
|
662
621
|
response = self._create(
|
663
622
|
file=file_obj,
|
664
623
|
config=types.CreateFileConfig(
|
@@ -682,6 +641,7 @@ class Files(_api_module.BaseModule):
|
|
682
641
|
file, upload_url, file_obj.size_bytes, http_options=http_options
|
683
642
|
)
|
684
643
|
else:
|
644
|
+
fs_path = os.fspath(file)
|
685
645
|
return_file = self._api_client.upload_file(
|
686
646
|
fs_path, upload_url, file_obj.size_bytes, http_options=http_options
|
687
647
|
)
|
@@ -1096,54 +1056,13 @@ class AsyncFiles(_api_module.BaseModule):
|
|
1096
1056
|
if file_obj.name is not None and not file_obj.name.startswith('files/'):
|
1097
1057
|
file_obj.name = f'files/{file_obj.name}'
|
1098
1058
|
|
1099
|
-
|
1100
|
-
|
1101
|
-
|
1102
|
-
|
1103
|
-
|
1104
|
-
|
1105
|
-
|
1106
|
-
if 'b' not in file.mode:
|
1107
|
-
raise ValueError('The file must be opened in binary mode.')
|
1108
|
-
offset = file.tell()
|
1109
|
-
file.seek(0, os.SEEK_END)
|
1110
|
-
file_obj.size_bytes = file.tell() - offset
|
1111
|
-
file.seek(offset, os.SEEK_SET)
|
1112
|
-
else:
|
1113
|
-
fs_path = os.fspath(file)
|
1114
|
-
if not fs_path or not os.path.isfile(fs_path):
|
1115
|
-
raise FileNotFoundError(f'{file} is not a valid file path.')
|
1116
|
-
file_obj.size_bytes = os.path.getsize(fs_path)
|
1117
|
-
if file_obj.mime_type is None:
|
1118
|
-
file_obj.mime_type, _ = mimetypes.guess_type(fs_path)
|
1119
|
-
if file_obj.mime_type is None:
|
1120
|
-
raise ValueError(
|
1121
|
-
'Unknown mime type: Could not determine the mimetype for your'
|
1122
|
-
' file\n please set the `mime_type` argument'
|
1123
|
-
)
|
1124
|
-
|
1125
|
-
http_options: types.HttpOptions
|
1126
|
-
if config_model and config_model.http_options:
|
1127
|
-
http_options = config_model.http_options
|
1128
|
-
http_options.api_version = ''
|
1129
|
-
http_options.headers = {
|
1130
|
-
'Content-Type': 'application/json',
|
1131
|
-
'X-Goog-Upload-Protocol': 'resumable',
|
1132
|
-
'X-Goog-Upload-Command': 'start',
|
1133
|
-
'X-Goog-Upload-Header-Content-Length': f'{file_obj.size_bytes}',
|
1134
|
-
'X-Goog-Upload-Header-Content-Type': f'{file_obj.mime_type}',
|
1135
|
-
}
|
1136
|
-
else:
|
1137
|
-
http_options = types.HttpOptions(
|
1138
|
-
api_version='',
|
1139
|
-
headers={
|
1140
|
-
'Content-Type': 'application/json',
|
1141
|
-
'X-Goog-Upload-Protocol': 'resumable',
|
1142
|
-
'X-Goog-Upload-Command': 'start',
|
1143
|
-
'X-Goog-Upload-Header-Content-Length': f'{file_obj.size_bytes}',
|
1144
|
-
'X-Goog-Upload-Header-Content-Type': f'{file_obj.mime_type}',
|
1145
|
-
},
|
1146
|
-
)
|
1059
|
+
http_options, size_bytes, mime_type = _extra_utils.prepare_resumable_upload(
|
1060
|
+
file,
|
1061
|
+
user_http_options=config_model.http_options,
|
1062
|
+
user_mime_type=config_model.mime_type,
|
1063
|
+
)
|
1064
|
+
file_obj.size_bytes = size_bytes
|
1065
|
+
file_obj.mime_type = mime_type
|
1147
1066
|
response = await self._create(
|
1148
1067
|
file=file_obj,
|
1149
1068
|
config=types.CreateFileConfig(
|
@@ -1172,6 +1091,7 @@ class AsyncFiles(_api_module.BaseModule):
|
|
1172
1091
|
file, upload_url, file_obj.size_bytes, http_options=http_options
|
1173
1092
|
)
|
1174
1093
|
else:
|
1094
|
+
fs_path = os.fspath(file)
|
1175
1095
|
return_file = await self._api_client.async_upload_file(
|
1176
1096
|
fs_path, upload_url, file_obj.size_bytes, http_options=http_options
|
1177
1097
|
)
|
google/genai/tunings.py
CHANGED
@@ -753,6 +753,9 @@ def _TuningJob_from_mldev(
|
|
753
753
|
getv(from_object, ['tunedModelDisplayName']),
|
754
754
|
)
|
755
755
|
|
756
|
+
if getv(from_object, ['veoTuningSpec']) is not None:
|
757
|
+
setv(to_object, ['veo_tuning_spec'], getv(from_object, ['veoTuningSpec']))
|
758
|
+
|
756
759
|
return to_object
|
757
760
|
|
758
761
|
|
@@ -865,6 +868,9 @@ def _TuningJob_from_vertex(
|
|
865
868
|
getv(from_object, ['tunedModelDisplayName']),
|
866
869
|
)
|
867
870
|
|
871
|
+
if getv(from_object, ['veoTuningSpec']) is not None:
|
872
|
+
setv(to_object, ['veo_tuning_spec'], getv(from_object, ['veoTuningSpec']))
|
873
|
+
|
868
874
|
return to_object
|
869
875
|
|
870
876
|
|
google/genai/types.py
CHANGED
@@ -287,6 +287,8 @@ class FinishReason(_common.CaseInSensitiveEnum):
|
|
287
287
|
"""The tool call generated by the model is invalid."""
|
288
288
|
IMAGE_PROHIBITED_CONTENT = 'IMAGE_PROHIBITED_CONTENT'
|
289
289
|
"""Image generation stopped because the generated images have prohibited content."""
|
290
|
+
NO_IMAGE = 'NO_IMAGE'
|
291
|
+
"""The model was expected to generate an image, but none was generated."""
|
290
292
|
|
291
293
|
|
292
294
|
class HarmProbability(_common.CaseInSensitiveEnum):
|
@@ -436,6 +438,17 @@ class AdapterSize(_common.CaseInSensitiveEnum):
|
|
436
438
|
"""Adapter size 32."""
|
437
439
|
|
438
440
|
|
441
|
+
class TuningTask(_common.CaseInSensitiveEnum):
|
442
|
+
"""Optional. The tuning task. Either I2V or T2V."""
|
443
|
+
|
444
|
+
TUNING_TASK_UNSPECIFIED = 'TUNING_TASK_UNSPECIFIED'
|
445
|
+
"""Default value. This value is unused."""
|
446
|
+
TUNING_TASK_I2V = 'TUNING_TASK_I2V'
|
447
|
+
"""Tuning task for image to video."""
|
448
|
+
TUNING_TASK_T2V = 'TUNING_TASK_T2V'
|
449
|
+
"""Tuning task for text to video."""
|
450
|
+
|
451
|
+
|
439
452
|
class JSONSchemaType(Enum):
|
440
453
|
"""The type of the data supported by JSON Schema.
|
441
454
|
|
@@ -4309,8 +4322,10 @@ class GenerateContentConfig(_common.BaseModel):
|
|
4309
4322
|
@pydantic.field_validator('image_config', mode='before')
|
4310
4323
|
@classmethod
|
4311
4324
|
def _check_image_config_type(cls, value: Any) -> Any:
|
4312
|
-
if
|
4313
|
-
raise ValueError(
|
4325
|
+
if isinstance(value, GenerateImagesConfig):
|
4326
|
+
raise ValueError(
|
4327
|
+
'image_config must be an instance of ImageConfig or compatible dict.'
|
4328
|
+
)
|
4314
4329
|
return value
|
4315
4330
|
|
4316
4331
|
|
@@ -10173,6 +10188,71 @@ PartnerModelTuningSpecOrDict = Union[
|
|
10173
10188
|
]
|
10174
10189
|
|
10175
10190
|
|
10191
|
+
class VeoHyperParameters(_common.BaseModel):
|
10192
|
+
"""Hyperparameters for Veo."""
|
10193
|
+
|
10194
|
+
epoch_count: Optional[int] = Field(
|
10195
|
+
default=None,
|
10196
|
+
description="""Optional. Number of complete passes the model makes over the entire training dataset during training.""",
|
10197
|
+
)
|
10198
|
+
learning_rate_multiplier: Optional[float] = Field(
|
10199
|
+
default=None,
|
10200
|
+
description="""Optional. Multiplier for adjusting the default learning rate.""",
|
10201
|
+
)
|
10202
|
+
tuning_task: Optional[TuningTask] = Field(
|
10203
|
+
default=None,
|
10204
|
+
description="""Optional. The tuning task. Either I2V or T2V.""",
|
10205
|
+
)
|
10206
|
+
|
10207
|
+
|
10208
|
+
class VeoHyperParametersDict(TypedDict, total=False):
|
10209
|
+
"""Hyperparameters for Veo."""
|
10210
|
+
|
10211
|
+
epoch_count: Optional[int]
|
10212
|
+
"""Optional. Number of complete passes the model makes over the entire training dataset during training."""
|
10213
|
+
|
10214
|
+
learning_rate_multiplier: Optional[float]
|
10215
|
+
"""Optional. Multiplier for adjusting the default learning rate."""
|
10216
|
+
|
10217
|
+
tuning_task: Optional[TuningTask]
|
10218
|
+
"""Optional. The tuning task. Either I2V or T2V."""
|
10219
|
+
|
10220
|
+
|
10221
|
+
VeoHyperParametersOrDict = Union[VeoHyperParameters, VeoHyperParametersDict]
|
10222
|
+
|
10223
|
+
|
10224
|
+
class VeoTuningSpec(_common.BaseModel):
|
10225
|
+
"""Tuning Spec for Veo Model Tuning."""
|
10226
|
+
|
10227
|
+
hyper_parameters: Optional[VeoHyperParameters] = Field(
|
10228
|
+
default=None, description="""Optional. Hyperparameters for Veo."""
|
10229
|
+
)
|
10230
|
+
training_dataset_uri: Optional[str] = Field(
|
10231
|
+
default=None,
|
10232
|
+
description="""Required. Training dataset used for tuning. The dataset can be specified as either a Cloud Storage path to a JSONL file or as the resource name of a Vertex Multimodal Dataset.""",
|
10233
|
+
)
|
10234
|
+
validation_dataset_uri: Optional[str] = Field(
|
10235
|
+
default=None,
|
10236
|
+
description="""Optional. Validation dataset used for tuning. The dataset can be specified as either a Cloud Storage path to a JSONL file or as the resource name of a Vertex Multimodal Dataset.""",
|
10237
|
+
)
|
10238
|
+
|
10239
|
+
|
10240
|
+
class VeoTuningSpecDict(TypedDict, total=False):
|
10241
|
+
"""Tuning Spec for Veo Model Tuning."""
|
10242
|
+
|
10243
|
+
hyper_parameters: Optional[VeoHyperParametersDict]
|
10244
|
+
"""Optional. Hyperparameters for Veo."""
|
10245
|
+
|
10246
|
+
training_dataset_uri: Optional[str]
|
10247
|
+
"""Required. Training dataset used for tuning. The dataset can be specified as either a Cloud Storage path to a JSONL file or as the resource name of a Vertex Multimodal Dataset."""
|
10248
|
+
|
10249
|
+
validation_dataset_uri: Optional[str]
|
10250
|
+
"""Optional. Validation dataset used for tuning. The dataset can be specified as either a Cloud Storage path to a JSONL file or as the resource name of a Vertex Multimodal Dataset."""
|
10251
|
+
|
10252
|
+
|
10253
|
+
VeoTuningSpecOrDict = Union[VeoTuningSpec, VeoTuningSpecDict]
|
10254
|
+
|
10255
|
+
|
10176
10256
|
class TuningJob(_common.BaseModel):
|
10177
10257
|
"""A tuning job."""
|
10178
10258
|
|
@@ -10268,6 +10348,9 @@ class TuningJob(_common.BaseModel):
|
|
10268
10348
|
default=None,
|
10269
10349
|
description="""Optional. The display name of the TunedModel. The name can be up to 128 characters long and can consist of any UTF-8 characters.""",
|
10270
10350
|
)
|
10351
|
+
veo_tuning_spec: Optional[VeoTuningSpec] = Field(
|
10352
|
+
default=None, description="""Tuning Spec for Veo Tuning."""
|
10353
|
+
)
|
10271
10354
|
|
10272
10355
|
@property
|
10273
10356
|
def has_ended(self) -> bool:
|
@@ -10355,6 +10438,9 @@ class TuningJobDict(TypedDict, total=False):
|
|
10355
10438
|
tuned_model_display_name: Optional[str]
|
10356
10439
|
"""Optional. The display name of the TunedModel. The name can be up to 128 characters long and can consist of any UTF-8 characters."""
|
10357
10440
|
|
10441
|
+
veo_tuning_spec: Optional[VeoTuningSpecDict]
|
10442
|
+
"""Tuning Spec for Veo Tuning."""
|
10443
|
+
|
10358
10444
|
|
10359
10445
|
TuningJobOrDict = Union[TuningJob, TuningJobDict]
|
10360
10446
|
|
@@ -14633,6 +14719,13 @@ class LiveConnectConfig(_common.BaseModel):
|
|
14633
14719
|
description="""The speech generation configuration.
|
14634
14720
|
""",
|
14635
14721
|
)
|
14722
|
+
thinking_config: Optional[ThinkingConfig] = Field(
|
14723
|
+
default=None,
|
14724
|
+
description="""Config for thinking features.
|
14725
|
+
An error will be returned if this field is set for models that don't
|
14726
|
+
support thinking.
|
14727
|
+
""",
|
14728
|
+
)
|
14636
14729
|
enable_affective_dialog: Optional[bool] = Field(
|
14637
14730
|
default=None,
|
14638
14731
|
description="""If enabled, the model will detect emotions and adapt its responses accordingly.""",
|
@@ -14738,6 +14831,12 @@ class LiveConnectConfigDict(TypedDict, total=False):
|
|
14738
14831
|
"""The speech generation configuration.
|
14739
14832
|
"""
|
14740
14833
|
|
14834
|
+
thinking_config: Optional[ThinkingConfigDict]
|
14835
|
+
"""Config for thinking features.
|
14836
|
+
An error will be returned if this field is set for models that don't
|
14837
|
+
support thinking.
|
14838
|
+
"""
|
14839
|
+
|
14741
14840
|
enable_affective_dialog: Optional[bool]
|
14742
14841
|
"""If enabled, the model will detect emotions and adapt its responses accordingly."""
|
14743
14842
|
|
google/genai/version.py
CHANGED
@@ -6,21 +6,21 @@ google/genai/_automatic_function_calling_util.py,sha256=xXNkJR-pzSMkeSXMz3Jw-kMH
|
|
6
6
|
google/genai/_base_transformers.py,sha256=wljA6m4tLl4XLGlBC2DNOls5N9-X9tffBq0M7i8jgpw,1034
|
7
7
|
google/genai/_base_url.py,sha256=E5H4dew14Y16qfnB3XRnjSCi19cJVlkaMNoM_8ip-PM,1597
|
8
8
|
google/genai/_common.py,sha256=YU5842SoZOW0usJRnz58Wi8hqJ1f-Dd01flGTsqI8-U,20653
|
9
|
-
google/genai/_extra_utils.py,sha256=
|
10
|
-
google/genai/_live_converters.py,sha256=
|
9
|
+
google/genai/_extra_utils.py,sha256=YLw64xzAKD_fQJp327-GGZM3kQ0sVdhNXMeDaaNkVFE,23011
|
10
|
+
google/genai/_live_converters.py,sha256=OZV6-i-YR_HSKuBzu5EAjbqOv78efGo_1OVfRqoExxw,109492
|
11
11
|
google/genai/_local_tokenizer_loader.py,sha256=cGN1F0f7hNjRIGCGTLeox7IGAZf_YcvZjSp2rCyhUak,7465
|
12
12
|
google/genai/_mcp_utils.py,sha256=HuWJ8FUjquv40Mf_QjcL5r5yXWrS-JjINsjlOSbbyAc,3870
|
13
13
|
google/genai/_operations_converters.py,sha256=hPmrlU_yJWT4di2arA0VKaoQIB1MbCPglmAZ4D8M-Ds,8744
|
14
14
|
google/genai/_replay_api_client.py,sha256=MmpzqE5AxVeyvCahEnmukYGIZqN8lxS-suSgUszvLSw,22555
|
15
15
|
google/genai/_test_api_client.py,sha256=4ruFIy5_1qcbKqqIBu3HSQbpSOBrxiecBtDZaTGFR1s,4797
|
16
|
-
google/genai/_tokens_converters.py,sha256=
|
16
|
+
google/genai/_tokens_converters.py,sha256=7b1fe9fzigJfuwR17GF6YUHU8ef8H57xruTNQkCYfDE,25902
|
17
17
|
google/genai/_transformers.py,sha256=-1GIrDNS4fH6Qx2jNm-VhcmlTSjWxanna7N7Tp_ctQ8,40861
|
18
18
|
google/genai/batches.py,sha256=Xs4pZ6t8sjKGZ2N3ATOPFbobDgWxduSqc9-Zpo2Sdj8,102539
|
19
19
|
google/genai/caches.py,sha256=xq3kZBpUoc7Tv6In15gDOrKBnzfeIG3lCBY4zM8Y2sQ,67127
|
20
20
|
google/genai/chats.py,sha256=pIBw8d13llupLn4a7vP6vnpbzDcvCCrZZ-Q2r8Cvo7g,16652
|
21
21
|
google/genai/client.py,sha256=bwKV5gHKpxzmfFTtoudQ_hEz5QfUzKYMJHYT-AnQfNU,13066
|
22
22
|
google/genai/errors.py,sha256=zaPEs_GrtZuypvSPnOe32CTHO6nEVtshvc3Av2ug2Ac,5822
|
23
|
-
google/genai/files.py,sha256=
|
23
|
+
google/genai/files.py,sha256=1H6Kdxo4wAOW___7o3j9FJg_B5Dw2O0SJk5fEhC8wvk,36896
|
24
24
|
google/genai/live.py,sha256=PM5fXqhURdrdyM7AVCH_ogLe8_Zzhixzz2rXWm0FHxA,40590
|
25
25
|
google/genai/live_music.py,sha256=3GG9nsto8Vhkohcs-4CPMS4DFp1ZtMuLYzHfvEPYAeg,6971
|
26
26
|
google/genai/local_tokenizer.py,sha256=EKZ72cV2Zfutlo_efMOPnLRNZN4WQe57rD3G80cF340,14109
|
@@ -29,11 +29,11 @@ google/genai/operations.py,sha256=mgRuVCoqUf7z0RfB84W9x7S839VCttmIQZkXovHAMrE,17
|
|
29
29
|
google/genai/pagers.py,sha256=m0SfWWn1EJs2k1On3DZx371qb8g2BRm_188ExsicIRc,7098
|
30
30
|
google/genai/py.typed,sha256=RsMFoLwBkAvY05t6izop4UHZtqOPLiKp3GkIEizzmQY,40
|
31
31
|
google/genai/tokens.py,sha256=8RbZ0kgvyKT3SwbgIUOHr6TTZL24v4fqYarhlA8r1ac,12503
|
32
|
-
google/genai/tunings.py,sha256=
|
33
|
-
google/genai/types.py,sha256=
|
34
|
-
google/genai/version.py,sha256=
|
35
|
-
google_genai-1.
|
36
|
-
google_genai-1.
|
37
|
-
google_genai-1.
|
38
|
-
google_genai-1.
|
39
|
-
google_genai-1.
|
32
|
+
google/genai/tunings.py,sha256=958t2gwEu4XqLgYv7gK3pwKlqM5IrwYBDpQDujFPp50,63155
|
33
|
+
google/genai/types.py,sha256=tfpKdSkJd7wcDqbmbIZLFUkBhu4tTNecRODj_WHBzqc,555885
|
34
|
+
google/genai/version.py,sha256=f0C75ye5LDF8-vIJ_lGyMfMPwqvU5cpOMMxPDtXJ_hw,627
|
35
|
+
google_genai-1.41.0.dist-info/licenses/LICENSE,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
|
36
|
+
google_genai-1.41.0.dist-info/METADATA,sha256=DMCrhJAI1tN-JAhdwzOhD5ZQpO7pCgmXV7xZRuwqEHY,45381
|
37
|
+
google_genai-1.41.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
38
|
+
google_genai-1.41.0.dist-info/top_level.txt,sha256=_1QvSJIhFAGfxb79D6DhB7SUw2X6T4rwnz_LLrbcD3c,7
|
39
|
+
google_genai-1.41.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|