google-genai 1.22.0__py3-none-any.whl → 1.24.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 +111 -32
- google/genai/_live_converters.py +14 -6
- google/genai/_tokens_converters.py +6 -0
- google/genai/batches.py +84 -12
- google/genai/caches.py +6 -0
- google/genai/live.py +4 -1
- google/genai/models.py +6 -0
- google/genai/tunings.py +36 -0
- google/genai/types.py +311 -36
- google/genai/version.py +1 -1
- {google_genai-1.22.0.dist-info → google_genai-1.24.0.dist-info}/METADATA +120 -6
- {google_genai-1.22.0.dist-info → google_genai-1.24.0.dist-info}/RECORD +15 -15
- {google_genai-1.22.0.dist-info → google_genai-1.24.0.dist-info}/WHEEL +0 -0
- {google_genai-1.22.0.dist-info → google_genai-1.24.0.dist-info}/licenses/LICENSE +0 -0
- {google_genai-1.22.0.dist-info → google_genai-1.24.0.dist-info}/top_level.txt +0 -0
google/genai/types.py
CHANGED
@@ -138,6 +138,18 @@ class HarmCategory(_common.CaseInSensitiveEnum):
|
|
138
138
|
"""The harm category is sexually explicit content."""
|
139
139
|
HARM_CATEGORY_CIVIC_INTEGRITY = 'HARM_CATEGORY_CIVIC_INTEGRITY'
|
140
140
|
"""Deprecated: Election filter is not longer supported. The harm category is civic integrity."""
|
141
|
+
HARM_CATEGORY_IMAGE_HATE = 'HARM_CATEGORY_IMAGE_HATE'
|
142
|
+
"""The harm category is image hate."""
|
143
|
+
HARM_CATEGORY_IMAGE_DANGEROUS_CONTENT = (
|
144
|
+
'HARM_CATEGORY_IMAGE_DANGEROUS_CONTENT'
|
145
|
+
)
|
146
|
+
"""The harm category is image dangerous content."""
|
147
|
+
HARM_CATEGORY_IMAGE_HARASSMENT = 'HARM_CATEGORY_IMAGE_HARASSMENT'
|
148
|
+
"""The harm category is image harassment."""
|
149
|
+
HARM_CATEGORY_IMAGE_SEXUALLY_EXPLICIT = (
|
150
|
+
'HARM_CATEGORY_IMAGE_SEXUALLY_EXPLICIT'
|
151
|
+
)
|
152
|
+
"""The harm category is image sexually explicit content."""
|
141
153
|
|
142
154
|
|
143
155
|
class HarmBlockMethod(_common.CaseInSensitiveEnum):
|
@@ -199,6 +211,37 @@ class AuthType(_common.CaseInSensitiveEnum):
|
|
199
211
|
"""OpenID Connect (OIDC) Auth."""
|
200
212
|
|
201
213
|
|
214
|
+
class ApiSpec(_common.CaseInSensitiveEnum):
|
215
|
+
"""The API spec that the external API implements."""
|
216
|
+
|
217
|
+
API_SPEC_UNSPECIFIED = 'API_SPEC_UNSPECIFIED'
|
218
|
+
"""Unspecified API spec. This value should not be used."""
|
219
|
+
SIMPLE_SEARCH = 'SIMPLE_SEARCH'
|
220
|
+
"""Simple search API spec."""
|
221
|
+
ELASTIC_SEARCH = 'ELASTIC_SEARCH'
|
222
|
+
"""Elastic search API spec."""
|
223
|
+
|
224
|
+
|
225
|
+
class Environment(_common.CaseInSensitiveEnum):
|
226
|
+
"""Required. The environment being operated."""
|
227
|
+
|
228
|
+
ENVIRONMENT_UNSPECIFIED = 'ENVIRONMENT_UNSPECIFIED'
|
229
|
+
"""Defaults to browser."""
|
230
|
+
ENVIRONMENT_BROWSER = 'ENVIRONMENT_BROWSER'
|
231
|
+
"""Operates in a web browser."""
|
232
|
+
|
233
|
+
|
234
|
+
class UrlRetrievalStatus(_common.CaseInSensitiveEnum):
|
235
|
+
"""Status of the url retrieval."""
|
236
|
+
|
237
|
+
URL_RETRIEVAL_STATUS_UNSPECIFIED = 'URL_RETRIEVAL_STATUS_UNSPECIFIED'
|
238
|
+
"""Default value. This value is unused"""
|
239
|
+
URL_RETRIEVAL_STATUS_SUCCESS = 'URL_RETRIEVAL_STATUS_SUCCESS'
|
240
|
+
"""Url retrieval is successful."""
|
241
|
+
URL_RETRIEVAL_STATUS_ERROR = 'URL_RETRIEVAL_STATUS_ERROR'
|
242
|
+
"""Url retrieval is failed due to error."""
|
243
|
+
|
244
|
+
|
202
245
|
class FinishReason(_common.CaseInSensitiveEnum):
|
203
246
|
"""Output only. The reason why the model stopped generating tokens.
|
204
247
|
|
@@ -276,6 +319,8 @@ class BlockedReason(_common.CaseInSensitiveEnum):
|
|
276
319
|
"""Candidates blocked due to the terms which are included from the terminology blocklist."""
|
277
320
|
PROHIBITED_CONTENT = 'PROHIBITED_CONTENT'
|
278
321
|
"""Candidates blocked due to prohibited content."""
|
322
|
+
IMAGE_SAFETY = 'IMAGE_SAFETY'
|
323
|
+
"""Candidates blocked due to unsafe image generation content."""
|
279
324
|
|
280
325
|
|
281
326
|
class TrafficType(_common.CaseInSensitiveEnum):
|
@@ -411,17 +456,6 @@ class FunctionCallingConfigMode(_common.CaseInSensitiveEnum):
|
|
411
456
|
"""Model will not predict any function calls. Model behavior is same as when not passing any function declarations."""
|
412
457
|
|
413
458
|
|
414
|
-
class UrlRetrievalStatus(_common.CaseInSensitiveEnum):
|
415
|
-
"""Status of the url retrieval."""
|
416
|
-
|
417
|
-
URL_RETRIEVAL_STATUS_UNSPECIFIED = 'URL_RETRIEVAL_STATUS_UNSPECIFIED'
|
418
|
-
"""Default value. This value is unused"""
|
419
|
-
URL_RETRIEVAL_STATUS_SUCCESS = 'URL_RETRIEVAL_STATUS_SUCCESS'
|
420
|
-
"""Url retrieval is successful."""
|
421
|
-
URL_RETRIEVAL_STATUS_ERROR = 'URL_RETRIEVAL_STATUS_ERROR'
|
422
|
-
"""Url retrieval is failed due to error."""
|
423
|
-
|
424
|
-
|
425
459
|
class SafetyFilterLevel(_common.CaseInSensitiveEnum):
|
426
460
|
"""Enum that controls the safety filter level for objectionable content."""
|
427
461
|
|
@@ -743,7 +777,8 @@ FileDataOrDict = Union[FileData, FileDataDict]
|
|
743
777
|
class CodeExecutionResult(_common.BaseModel):
|
744
778
|
"""Result of executing the [ExecutableCode].
|
745
779
|
|
746
|
-
|
780
|
+
Only generated when using the [CodeExecution] tool, and always follows a
|
781
|
+
`part` containing the [ExecutableCode].
|
747
782
|
"""
|
748
783
|
|
749
784
|
outcome: Optional[Outcome] = Field(
|
@@ -758,7 +793,8 @@ class CodeExecutionResult(_common.BaseModel):
|
|
758
793
|
class CodeExecutionResultDict(TypedDict, total=False):
|
759
794
|
"""Result of executing the [ExecutableCode].
|
760
795
|
|
761
|
-
|
796
|
+
Only generated when using the [CodeExecution] tool, and always follows a
|
797
|
+
`part` containing the [ExecutableCode].
|
762
798
|
"""
|
763
799
|
|
764
800
|
outcome: Optional[Outcome]
|
@@ -774,8 +810,9 @@ CodeExecutionResultOrDict = Union[CodeExecutionResult, CodeExecutionResultDict]
|
|
774
810
|
class ExecutableCode(_common.BaseModel):
|
775
811
|
"""Code generated by the model that is meant to be executed, and the result returned to the model.
|
776
812
|
|
777
|
-
Generated when using the [
|
778
|
-
|
813
|
+
Generated when using the [CodeExecution] tool, in which the code will be
|
814
|
+
automatically executed, and a corresponding [CodeExecutionResult] will also be
|
815
|
+
generated.
|
779
816
|
"""
|
780
817
|
|
781
818
|
code: Optional[str] = Field(
|
@@ -790,8 +827,9 @@ class ExecutableCode(_common.BaseModel):
|
|
790
827
|
class ExecutableCodeDict(TypedDict, total=False):
|
791
828
|
"""Code generated by the model that is meant to be executed, and the result returned to the model.
|
792
829
|
|
793
|
-
Generated when using the [
|
794
|
-
|
830
|
+
Generated when using the [CodeExecution] tool, in which the code will be
|
831
|
+
automatically executed, and a corresponding [CodeExecutionResult] will also be
|
832
|
+
generated.
|
795
833
|
"""
|
796
834
|
|
797
835
|
code: Optional[str]
|
@@ -2473,6 +2511,168 @@ class UrlContextDict(TypedDict, total=False):
|
|
2473
2511
|
UrlContextOrDict = Union[UrlContext, UrlContextDict]
|
2474
2512
|
|
2475
2513
|
|
2514
|
+
class ApiAuthApiKeyConfig(_common.BaseModel):
|
2515
|
+
"""The API secret."""
|
2516
|
+
|
2517
|
+
api_key_secret_version: Optional[str] = Field(
|
2518
|
+
default=None,
|
2519
|
+
description="""Required. The SecretManager secret version resource name storing API key. e.g. projects/{project}/secrets/{secret}/versions/{version}""",
|
2520
|
+
)
|
2521
|
+
api_key_string: Optional[str] = Field(
|
2522
|
+
default=None,
|
2523
|
+
description="""The API key string. Either this or `api_key_secret_version` must be set.""",
|
2524
|
+
)
|
2525
|
+
|
2526
|
+
|
2527
|
+
class ApiAuthApiKeyConfigDict(TypedDict, total=False):
|
2528
|
+
"""The API secret."""
|
2529
|
+
|
2530
|
+
api_key_secret_version: Optional[str]
|
2531
|
+
"""Required. The SecretManager secret version resource name storing API key. e.g. projects/{project}/secrets/{secret}/versions/{version}"""
|
2532
|
+
|
2533
|
+
api_key_string: Optional[str]
|
2534
|
+
"""The API key string. Either this or `api_key_secret_version` must be set."""
|
2535
|
+
|
2536
|
+
|
2537
|
+
ApiAuthApiKeyConfigOrDict = Union[ApiAuthApiKeyConfig, ApiAuthApiKeyConfigDict]
|
2538
|
+
|
2539
|
+
|
2540
|
+
class ApiAuth(_common.BaseModel):
|
2541
|
+
"""The generic reusable api auth config.
|
2542
|
+
|
2543
|
+
Deprecated. Please use AuthConfig (google/cloud/aiplatform/master/auth.proto)
|
2544
|
+
instead.
|
2545
|
+
"""
|
2546
|
+
|
2547
|
+
api_key_config: Optional[ApiAuthApiKeyConfig] = Field(
|
2548
|
+
default=None, description="""The API secret."""
|
2549
|
+
)
|
2550
|
+
|
2551
|
+
|
2552
|
+
class ApiAuthDict(TypedDict, total=False):
|
2553
|
+
"""The generic reusable api auth config.
|
2554
|
+
|
2555
|
+
Deprecated. Please use AuthConfig (google/cloud/aiplatform/master/auth.proto)
|
2556
|
+
instead.
|
2557
|
+
"""
|
2558
|
+
|
2559
|
+
api_key_config: Optional[ApiAuthApiKeyConfigDict]
|
2560
|
+
"""The API secret."""
|
2561
|
+
|
2562
|
+
|
2563
|
+
ApiAuthOrDict = Union[ApiAuth, ApiAuthDict]
|
2564
|
+
|
2565
|
+
|
2566
|
+
class ExternalApiElasticSearchParams(_common.BaseModel):
|
2567
|
+
"""The search parameters to use for the ELASTIC_SEARCH spec."""
|
2568
|
+
|
2569
|
+
index: Optional[str] = Field(
|
2570
|
+
default=None, description="""The ElasticSearch index to use."""
|
2571
|
+
)
|
2572
|
+
num_hits: Optional[int] = Field(
|
2573
|
+
default=None,
|
2574
|
+
description="""Optional. Number of hits (chunks) to request. When specified, it is passed to Elasticsearch as the `num_hits` param.""",
|
2575
|
+
)
|
2576
|
+
search_template: Optional[str] = Field(
|
2577
|
+
default=None, description="""The ElasticSearch search template to use."""
|
2578
|
+
)
|
2579
|
+
|
2580
|
+
|
2581
|
+
class ExternalApiElasticSearchParamsDict(TypedDict, total=False):
|
2582
|
+
"""The search parameters to use for the ELASTIC_SEARCH spec."""
|
2583
|
+
|
2584
|
+
index: Optional[str]
|
2585
|
+
"""The ElasticSearch index to use."""
|
2586
|
+
|
2587
|
+
num_hits: Optional[int]
|
2588
|
+
"""Optional. Number of hits (chunks) to request. When specified, it is passed to Elasticsearch as the `num_hits` param."""
|
2589
|
+
|
2590
|
+
search_template: Optional[str]
|
2591
|
+
"""The ElasticSearch search template to use."""
|
2592
|
+
|
2593
|
+
|
2594
|
+
ExternalApiElasticSearchParamsOrDict = Union[
|
2595
|
+
ExternalApiElasticSearchParams, ExternalApiElasticSearchParamsDict
|
2596
|
+
]
|
2597
|
+
|
2598
|
+
|
2599
|
+
class ExternalApiSimpleSearchParams(_common.BaseModel):
|
2600
|
+
"""The search parameters to use for SIMPLE_SEARCH spec."""
|
2601
|
+
|
2602
|
+
pass
|
2603
|
+
|
2604
|
+
|
2605
|
+
class ExternalApiSimpleSearchParamsDict(TypedDict, total=False):
|
2606
|
+
"""The search parameters to use for SIMPLE_SEARCH spec."""
|
2607
|
+
|
2608
|
+
pass
|
2609
|
+
|
2610
|
+
|
2611
|
+
ExternalApiSimpleSearchParamsOrDict = Union[
|
2612
|
+
ExternalApiSimpleSearchParams, ExternalApiSimpleSearchParamsDict
|
2613
|
+
]
|
2614
|
+
|
2615
|
+
|
2616
|
+
class ExternalApi(_common.BaseModel):
|
2617
|
+
"""Retrieve from data source powered by external API for grounding.
|
2618
|
+
|
2619
|
+
The external API is not owned by Google, but need to follow the pre-defined
|
2620
|
+
API spec.
|
2621
|
+
"""
|
2622
|
+
|
2623
|
+
api_auth: Optional[ApiAuth] = Field(
|
2624
|
+
default=None,
|
2625
|
+
description="""The authentication config to access the API. Deprecated. Please use auth_config instead.""",
|
2626
|
+
)
|
2627
|
+
api_spec: Optional[ApiSpec] = Field(
|
2628
|
+
default=None,
|
2629
|
+
description="""The API spec that the external API implements.""",
|
2630
|
+
)
|
2631
|
+
auth_config: Optional[AuthConfig] = Field(
|
2632
|
+
default=None,
|
2633
|
+
description="""The authentication config to access the API.""",
|
2634
|
+
)
|
2635
|
+
elastic_search_params: Optional[ExternalApiElasticSearchParams] = Field(
|
2636
|
+
default=None, description="""Parameters for the elastic search API."""
|
2637
|
+
)
|
2638
|
+
endpoint: Optional[str] = Field(
|
2639
|
+
default=None,
|
2640
|
+
description="""The endpoint of the external API. The system will call the API at this endpoint to retrieve the data for grounding. Example: https://acme.com:443/search""",
|
2641
|
+
)
|
2642
|
+
simple_search_params: Optional[ExternalApiSimpleSearchParams] = Field(
|
2643
|
+
default=None, description="""Parameters for the simple search API."""
|
2644
|
+
)
|
2645
|
+
|
2646
|
+
|
2647
|
+
class ExternalApiDict(TypedDict, total=False):
|
2648
|
+
"""Retrieve from data source powered by external API for grounding.
|
2649
|
+
|
2650
|
+
The external API is not owned by Google, but need to follow the pre-defined
|
2651
|
+
API spec.
|
2652
|
+
"""
|
2653
|
+
|
2654
|
+
api_auth: Optional[ApiAuthDict]
|
2655
|
+
"""The authentication config to access the API. Deprecated. Please use auth_config instead."""
|
2656
|
+
|
2657
|
+
api_spec: Optional[ApiSpec]
|
2658
|
+
"""The API spec that the external API implements."""
|
2659
|
+
|
2660
|
+
auth_config: Optional[AuthConfigDict]
|
2661
|
+
"""The authentication config to access the API."""
|
2662
|
+
|
2663
|
+
elastic_search_params: Optional[ExternalApiElasticSearchParamsDict]
|
2664
|
+
"""Parameters for the elastic search API."""
|
2665
|
+
|
2666
|
+
endpoint: Optional[str]
|
2667
|
+
"""The endpoint of the external API. The system will call the API at this endpoint to retrieve the data for grounding. Example: https://acme.com:443/search"""
|
2668
|
+
|
2669
|
+
simple_search_params: Optional[ExternalApiSimpleSearchParamsDict]
|
2670
|
+
"""Parameters for the simple search API."""
|
2671
|
+
|
2672
|
+
|
2673
|
+
ExternalApiOrDict = Union[ExternalApi, ExternalApiDict]
|
2674
|
+
|
2675
|
+
|
2476
2676
|
class VertexAISearchDataStoreSpec(_common.BaseModel):
|
2477
2677
|
"""Define data stores within engine to filter on in a search call and configurations for those data stores.
|
2478
2678
|
|
@@ -2815,6 +3015,10 @@ class Retrieval(_common.BaseModel):
|
|
2815
3015
|
default=None,
|
2816
3016
|
description="""Optional. Deprecated. This option is no longer supported.""",
|
2817
3017
|
)
|
3018
|
+
external_api: Optional[ExternalApi] = Field(
|
3019
|
+
default=None,
|
3020
|
+
description="""Use data source powered by external API for grounding.""",
|
3021
|
+
)
|
2818
3022
|
vertex_ai_search: Optional[VertexAISearch] = Field(
|
2819
3023
|
default=None,
|
2820
3024
|
description="""Set to use data source powered by Vertex AI Search.""",
|
@@ -2831,6 +3035,9 @@ class RetrievalDict(TypedDict, total=False):
|
|
2831
3035
|
disable_attribution: Optional[bool]
|
2832
3036
|
"""Optional. Deprecated. This option is no longer supported."""
|
2833
3037
|
|
3038
|
+
external_api: Optional[ExternalApiDict]
|
3039
|
+
"""Use data source powered by external API for grounding."""
|
3040
|
+
|
2834
3041
|
vertex_ai_search: Optional[VertexAISearchDict]
|
2835
3042
|
"""Set to use data source powered by Vertex AI Search."""
|
2836
3043
|
|
@@ -2864,6 +3071,24 @@ class ToolCodeExecutionDict(TypedDict, total=False):
|
|
2864
3071
|
ToolCodeExecutionOrDict = Union[ToolCodeExecution, ToolCodeExecutionDict]
|
2865
3072
|
|
2866
3073
|
|
3074
|
+
class ToolComputerUse(_common.BaseModel):
|
3075
|
+
"""Tool to support computer use."""
|
3076
|
+
|
3077
|
+
environment: Optional[Environment] = Field(
|
3078
|
+
default=None, description="""Required. The environment being operated."""
|
3079
|
+
)
|
3080
|
+
|
3081
|
+
|
3082
|
+
class ToolComputerUseDict(TypedDict, total=False):
|
3083
|
+
"""Tool to support computer use."""
|
3084
|
+
|
3085
|
+
environment: Optional[Environment]
|
3086
|
+
"""Required. The environment being operated."""
|
3087
|
+
|
3088
|
+
|
3089
|
+
ToolComputerUseOrDict = Union[ToolComputerUse, ToolComputerUseDict]
|
3090
|
+
|
3091
|
+
|
2867
3092
|
class Tool(_common.BaseModel):
|
2868
3093
|
"""Tool details of a tool that the model may use to generate a response."""
|
2869
3094
|
|
@@ -2902,6 +3127,10 @@ class Tool(_common.BaseModel):
|
|
2902
3127
|
default=None,
|
2903
3128
|
description="""Optional. CodeExecution tool type. Enables the model to execute code as part of generation.""",
|
2904
3129
|
)
|
3130
|
+
computer_use: Optional[ToolComputerUse] = Field(
|
3131
|
+
default=None,
|
3132
|
+
description="""Optional. Tool to support the model interacting directly with the computer. If enabled, it automatically populates computer-use specific Function Declarations.""",
|
3133
|
+
)
|
2905
3134
|
|
2906
3135
|
|
2907
3136
|
class ToolDict(TypedDict, total=False):
|
@@ -2934,6 +3163,9 @@ class ToolDict(TypedDict, total=False):
|
|
2934
3163
|
code_execution: Optional[ToolCodeExecutionDict]
|
2935
3164
|
"""Optional. CodeExecution tool type. Enables the model to execute code as part of generation."""
|
2936
3165
|
|
3166
|
+
computer_use: Optional[ToolComputerUseDict]
|
3167
|
+
"""Optional. Tool to support the model interacting directly with the computer. If enabled, it automatically populates computer-use specific Function Declarations."""
|
3168
|
+
|
2937
3169
|
|
2938
3170
|
ToolOrDict = Union[Tool, ToolDict]
|
2939
3171
|
if _is_mcp_imported:
|
@@ -4341,7 +4573,7 @@ class GroundingSupport(_common.BaseModel):
|
|
4341
4573
|
|
4342
4574
|
confidence_scores: Optional[list[float]] = Field(
|
4343
4575
|
default=None,
|
4344
|
-
description="""Confidence score of the support references. Ranges from 0 to 1. 1 is the most confident.
|
4576
|
+
description="""Confidence score of the support references. Ranges from 0 to 1. 1 is the most confident. For Gemini 2.0 and before, this list must have the same size as the grounding_chunk_indices. For Gemini 2.5 and after, this list will be empty and should be ignored.""",
|
4345
4577
|
)
|
4346
4578
|
grounding_chunk_indices: Optional[list[int]] = Field(
|
4347
4579
|
default=None,
|
@@ -4357,7 +4589,7 @@ class GroundingSupportDict(TypedDict, total=False):
|
|
4357
4589
|
"""Grounding support."""
|
4358
4590
|
|
4359
4591
|
confidence_scores: Optional[list[float]]
|
4360
|
-
"""Confidence score of the support references. Ranges from 0 to 1. 1 is the most confident.
|
4592
|
+
"""Confidence score of the support references. Ranges from 0 to 1. 1 is the most confident. For Gemini 2.0 and before, this list must have the same size as the grounding_chunk_indices. For Gemini 2.5 and after, this list will be empty and should be ignored."""
|
4361
4593
|
|
4362
4594
|
grounding_chunk_indices: Optional[list[int]]
|
4363
4595
|
"""A list of indices (into 'grounding_chunk') specifying the citations associated with the claim. For instance [1,3,4] means that grounding_chunk[1], grounding_chunk[3], grounding_chunk[4] are the retrieved content attributed to the claim."""
|
@@ -4554,6 +4786,10 @@ class SafetyRating(_common.BaseModel):
|
|
4554
4786
|
category: Optional[HarmCategory] = Field(
|
4555
4787
|
default=None, description="""Output only. Harm category."""
|
4556
4788
|
)
|
4789
|
+
overwritten_threshold: Optional[HarmBlockThreshold] = Field(
|
4790
|
+
default=None,
|
4791
|
+
description="""Output only. The overwritten threshold for the safety category of Gemini 2.0 image out. If minors are detected in the output image, the threshold of each safety category will be overwritten if user sets a lower threshold.""",
|
4792
|
+
)
|
4557
4793
|
probability: Optional[HarmProbability] = Field(
|
4558
4794
|
default=None,
|
4559
4795
|
description="""Output only. Harm probability levels in the content.""",
|
@@ -4579,6 +4815,9 @@ class SafetyRatingDict(TypedDict, total=False):
|
|
4579
4815
|
category: Optional[HarmCategory]
|
4580
4816
|
"""Output only. Harm category."""
|
4581
4817
|
|
4818
|
+
overwritten_threshold: Optional[HarmBlockThreshold]
|
4819
|
+
"""Output only. The overwritten threshold for the safety category of Gemini 2.0 image out. If minors are detected in the output image, the threshold of each safety category will be overwritten if user sets a lower threshold."""
|
4820
|
+
|
4582
4821
|
probability: Optional[HarmProbability]
|
4583
4822
|
"""Output only. Harm probability levels in the content."""
|
4584
4823
|
|
@@ -6866,6 +7105,10 @@ class GenerationConfig(_common.BaseModel):
|
|
6866
7105
|
default=None,
|
6867
7106
|
description="""Optional. Number of candidates to generate.""",
|
6868
7107
|
)
|
7108
|
+
enable_affective_dialog: Optional[bool] = Field(
|
7109
|
+
default=None,
|
7110
|
+
description="""Optional. If enabled, the model will detect emotions and adapt its responses accordingly.""",
|
7111
|
+
)
|
6869
7112
|
frequency_penalty: Optional[float] = Field(
|
6870
7113
|
default=None, description="""Optional. Frequency penalties."""
|
6871
7114
|
)
|
@@ -6883,6 +7126,10 @@ class GenerationConfig(_common.BaseModel):
|
|
6883
7126
|
presence_penalty: Optional[float] = Field(
|
6884
7127
|
default=None, description="""Optional. Positive penalties."""
|
6885
7128
|
)
|
7129
|
+
response_json_schema: Optional[Any] = Field(
|
7130
|
+
default=None,
|
7131
|
+
description="""Optional. Output schema of the generated response. This is an alternative to `response_schema` that accepts [JSON Schema](https://json-schema.org/). If set, `response_schema` must be omitted, but `response_mime_type` is required. While the full JSON Schema may be sent, not all features are supported. Specifically, only the following properties are supported: - `$id` - `$defs` - `$ref` - `$anchor` - `type` - `format` - `title` - `description` - `enum` (for strings and numbers) - `items` - `prefixItems` - `minItems` - `maxItems` - `minimum` - `maximum` - `anyOf` - `oneOf` (interpreted the same as `anyOf`) - `properties` - `additionalProperties` - `required` The non-standard `propertyOrdering` property may also be set. Cyclic references are unrolled to a limited degree and, as such, may only be used within non-required properties. (Nullable properties are not sufficient.) If `$ref` is set on a sub-schema, no other properties, except for than those starting as a `$`, may be set.""",
|
7132
|
+
)
|
6886
7133
|
response_logprobs: Optional[bool] = Field(
|
6887
7134
|
default=None,
|
6888
7135
|
description="""Optional. If true, export the logprobs results in response.""",
|
@@ -6898,10 +7145,6 @@ class GenerationConfig(_common.BaseModel):
|
|
6898
7145
|
default=None,
|
6899
7146
|
description="""Optional. The `Schema` object allows the definition of input and output data types. These types can be objects, but also primitives and arrays. Represents a select subset of an [OpenAPI 3.0 schema object](https://spec.openapis.org/oas/v3.0.3#schema). If set, a compatible response_mime_type must also be set. Compatible mimetypes: `application/json`: Schema for JSON response.""",
|
6900
7147
|
)
|
6901
|
-
response_json_schema: Optional[Any] = Field(
|
6902
|
-
default=None,
|
6903
|
-
description="""Optional. Output schema of the generated response. This is an alternative to `response_schema` that accepts [JSON Schema](https://json-schema.org/). If set, `response_schema` must be omitted, but `response_mime_type` is required. While the full JSON Schema may be sent, not all features are supported. Specifically, only the following properties are supported: - `$id` - `$defs` - `$ref` - `$anchor` - `type` - `format` - `title` - `description` - `enum` (for strings and numbers) - `items` - `prefixItems` - `minItems` - `maxItems` - `minimum` - `maximum` - `anyOf` - `oneOf` (interpreted the same as `anyOf`) - `properties` - `additionalProperties` - `required` The non-standard `propertyOrdering` property may also be set. Cyclic references are unrolled to a limited degree and, as such, may only be used within non-required properties. (Nullable properties are not sufficient.) If `$ref` is set on a sub-schema, no other properties, except for than those starting as a `$`, may be set.""",
|
6904
|
-
)
|
6905
7148
|
routing_config: Optional[GenerationConfigRoutingConfig] = Field(
|
6906
7149
|
default=None, description="""Optional. Routing configuration."""
|
6907
7150
|
)
|
@@ -6942,6 +7185,9 @@ class GenerationConfigDict(TypedDict, total=False):
|
|
6942
7185
|
candidate_count: Optional[int]
|
6943
7186
|
"""Optional. Number of candidates to generate."""
|
6944
7187
|
|
7188
|
+
enable_affective_dialog: Optional[bool]
|
7189
|
+
"""Optional. If enabled, the model will detect emotions and adapt its responses accordingly."""
|
7190
|
+
|
6945
7191
|
frequency_penalty: Optional[float]
|
6946
7192
|
"""Optional. Frequency penalties."""
|
6947
7193
|
|
@@ -6957,6 +7203,9 @@ class GenerationConfigDict(TypedDict, total=False):
|
|
6957
7203
|
presence_penalty: Optional[float]
|
6958
7204
|
"""Optional. Positive penalties."""
|
6959
7205
|
|
7206
|
+
response_json_schema: Optional[Any]
|
7207
|
+
"""Optional. Output schema of the generated response. This is an alternative to `response_schema` that accepts [JSON Schema](https://json-schema.org/). If set, `response_schema` must be omitted, but `response_mime_type` is required. While the full JSON Schema may be sent, not all features are supported. Specifically, only the following properties are supported: - `$id` - `$defs` - `$ref` - `$anchor` - `type` - `format` - `title` - `description` - `enum` (for strings and numbers) - `items` - `prefixItems` - `minItems` - `maxItems` - `minimum` - `maximum` - `anyOf` - `oneOf` (interpreted the same as `anyOf`) - `properties` - `additionalProperties` - `required` The non-standard `propertyOrdering` property may also be set. Cyclic references are unrolled to a limited degree and, as such, may only be used within non-required properties. (Nullable properties are not sufficient.) If `$ref` is set on a sub-schema, no other properties, except for than those starting as a `$`, may be set."""
|
7208
|
+
|
6960
7209
|
response_logprobs: Optional[bool]
|
6961
7210
|
"""Optional. If true, export the logprobs results in response."""
|
6962
7211
|
|
@@ -6969,9 +7218,6 @@ class GenerationConfigDict(TypedDict, total=False):
|
|
6969
7218
|
response_schema: Optional[SchemaDict]
|
6970
7219
|
"""Optional. The `Schema` object allows the definition of input and output data types. These types can be objects, but also primitives and arrays. Represents a select subset of an [OpenAPI 3.0 schema object](https://spec.openapis.org/oas/v3.0.3#schema). If set, a compatible response_mime_type must also be set. Compatible mimetypes: `application/json`: Schema for JSON response."""
|
6971
7220
|
|
6972
|
-
response_json_schema: Optional[Any]
|
6973
|
-
"""Optional. Output schema of the generated response. This is an alternative to `response_schema` that accepts [JSON Schema](https://json-schema.org/). If set, `response_schema` must be omitted, but `response_mime_type` is required. While the full JSON Schema may be sent, not all features are supported. Specifically, only the following properties are supported: - `$id` - `$defs` - `$ref` - `$anchor` - `type` - `format` - `title` - `description` - `enum` (for strings and numbers) - `items` - `prefixItems` - `minItems` - `maxItems` - `minimum` - `maximum` - `anyOf` - `oneOf` (interpreted the same as `anyOf`) - `properties` - `additionalProperties` - `required` The non-standard `propertyOrdering` property may also be set. Cyclic references are unrolled to a limited degree and, as such, may only be used within non-required properties. (Nullable properties are not sufficient.) If `$ref` is set on a sub-schema, no other properties, except for than those starting as a `$`, may be set."""
|
6974
|
-
|
6975
7221
|
routing_config: Optional[GenerationConfigRoutingConfigDict]
|
6976
7222
|
"""Optional. Routing configuration."""
|
6977
7223
|
|
@@ -7780,7 +8026,7 @@ class SupervisedHyperParameters(_common.BaseModel):
|
|
7780
8026
|
)
|
7781
8027
|
learning_rate_multiplier: Optional[float] = Field(
|
7782
8028
|
default=None,
|
7783
|
-
description="""Optional. Multiplier for adjusting the default learning rate.""",
|
8029
|
+
description="""Optional. Multiplier for adjusting the default learning rate. Mutually exclusive with `learning_rate`.""",
|
7784
8030
|
)
|
7785
8031
|
|
7786
8032
|
|
@@ -7794,7 +8040,7 @@ class SupervisedHyperParametersDict(TypedDict, total=False):
|
|
7794
8040
|
"""Optional. Number of complete passes the model makes over the entire training dataset during training."""
|
7795
8041
|
|
7796
8042
|
learning_rate_multiplier: Optional[float]
|
7797
|
-
"""Optional. Multiplier for adjusting the default learning rate."""
|
8043
|
+
"""Optional. Multiplier for adjusting the default learning rate. Mutually exclusive with `learning_rate`."""
|
7798
8044
|
|
7799
8045
|
|
7800
8046
|
SupervisedHyperParametersOrDict = Union[
|
@@ -7814,11 +8060,11 @@ class SupervisedTuningSpec(_common.BaseModel):
|
|
7814
8060
|
)
|
7815
8061
|
training_dataset_uri: Optional[str] = Field(
|
7816
8062
|
default=None,
|
7817
|
-
description="""Required.
|
8063
|
+
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.""",
|
7818
8064
|
)
|
7819
8065
|
validation_dataset_uri: Optional[str] = Field(
|
7820
8066
|
default=None,
|
7821
|
-
description="""Optional.
|
8067
|
+
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.""",
|
7822
8068
|
)
|
7823
8069
|
|
7824
8070
|
|
@@ -7832,10 +8078,10 @@ class SupervisedTuningSpecDict(TypedDict, total=False):
|
|
7832
8078
|
"""Optional. Hyperparameters for SFT."""
|
7833
8079
|
|
7834
8080
|
training_dataset_uri: Optional[str]
|
7835
|
-
"""Required.
|
8081
|
+
"""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."""
|
7836
8082
|
|
7837
8083
|
validation_dataset_uri: Optional[str]
|
7838
|
-
"""Optional.
|
8084
|
+
"""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."""
|
7839
8085
|
|
7840
8086
|
|
7841
8087
|
SupervisedTuningSpecOrDict = Union[
|
@@ -8504,6 +8750,12 @@ class TuningJob(_common.BaseModel):
|
|
8504
8750
|
default=None,
|
8505
8751
|
description="""Output only. The resource name of the PipelineJob associated with the TuningJob. Format: `projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}`.""",
|
8506
8752
|
)
|
8753
|
+
satisfies_pzi: Optional[bool] = Field(
|
8754
|
+
default=None, description="""Output only. Reserved for future use."""
|
8755
|
+
)
|
8756
|
+
satisfies_pzs: Optional[bool] = Field(
|
8757
|
+
default=None, description="""Output only. Reserved for future use."""
|
8758
|
+
)
|
8507
8759
|
service_account: Optional[str] = Field(
|
8508
8760
|
default=None,
|
8509
8761
|
description="""The service account that the tuningJob workload runs as. If not specified, the Vertex AI Secure Fine-Tuned Service Agent in the project will be used. See https://cloud.google.com/iam/docs/service-agents#vertex-ai-secure-fine-tuning-service-agent Users starting the pipeline must have the `iam.serviceAccounts.actAs` permission on this service account.""",
|
@@ -8581,6 +8833,12 @@ class TuningJobDict(TypedDict, total=False):
|
|
8581
8833
|
pipeline_job: Optional[str]
|
8582
8834
|
"""Output only. The resource name of the PipelineJob associated with the TuningJob. Format: `projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}`."""
|
8583
8835
|
|
8836
|
+
satisfies_pzi: Optional[bool]
|
8837
|
+
"""Output only. Reserved for future use."""
|
8838
|
+
|
8839
|
+
satisfies_pzs: Optional[bool]
|
8840
|
+
"""Output only. Reserved for future use."""
|
8841
|
+
|
8584
8842
|
service_account: Optional[str]
|
8585
8843
|
"""The service account that the tuningJob workload runs as. If not specified, the Vertex AI Secure Fine-Tuned Service Agent in the project will be used. See https://cloud.google.com/iam/docs/service-agents#vertex-ai-secure-fine-tuning-service-agent Users starting the pipeline must have the `iam.serviceAccounts.actAs` permission on this service account."""
|
8586
8844
|
|
@@ -8699,6 +8957,10 @@ class TuningDataset(_common.BaseModel):
|
|
8699
8957
|
default=None,
|
8700
8958
|
description="""GCS URI of the file containing training dataset in JSONL format.""",
|
8701
8959
|
)
|
8960
|
+
vertex_dataset_resource: Optional[str] = Field(
|
8961
|
+
default=None,
|
8962
|
+
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'.""",
|
8963
|
+
)
|
8702
8964
|
examples: Optional[list[TuningExample]] = Field(
|
8703
8965
|
default=None,
|
8704
8966
|
description="""Inline examples with simple input/output text.""",
|
@@ -8711,6 +8973,9 @@ class TuningDatasetDict(TypedDict, total=False):
|
|
8711
8973
|
gcs_uri: Optional[str]
|
8712
8974
|
"""GCS URI of the file containing training dataset in JSONL format."""
|
8713
8975
|
|
8976
|
+
vertex_dataset_resource: Optional[str]
|
8977
|
+
"""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'."""
|
8978
|
+
|
8714
8979
|
examples: Optional[list[TuningExampleDict]]
|
8715
8980
|
"""Inline examples with simple input/output text."""
|
8716
8981
|
|
@@ -8724,6 +8989,10 @@ class TuningValidationDataset(_common.BaseModel):
|
|
8724
8989
|
default=None,
|
8725
8990
|
description="""GCS URI of the file containing validation dataset in JSONL format.""",
|
8726
8991
|
)
|
8992
|
+
vertex_dataset_resource: Optional[str] = Field(
|
8993
|
+
default=None,
|
8994
|
+
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'.""",
|
8995
|
+
)
|
8727
8996
|
|
8728
8997
|
|
8729
8998
|
class TuningValidationDatasetDict(TypedDict, total=False):
|
@@ -8731,6 +9000,9 @@ class TuningValidationDatasetDict(TypedDict, total=False):
|
|
8731
9000
|
gcs_uri: Optional[str]
|
8732
9001
|
"""GCS URI of the file containing validation dataset in JSONL format."""
|
8733
9002
|
|
9003
|
+
vertex_dataset_resource: Optional[str]
|
9004
|
+
"""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'."""
|
9005
|
+
|
8734
9006
|
|
8735
9007
|
TuningValidationDatasetOrDict = Union[
|
8736
9008
|
TuningValidationDataset, TuningValidationDatasetDict
|
@@ -11125,13 +11397,16 @@ SubjectReferenceImageOrDict = Union[
|
|
11125
11397
|
class LiveServerSetupComplete(_common.BaseModel):
|
11126
11398
|
"""Sent in response to a `LiveGenerateContentSetup` message from the client."""
|
11127
11399
|
|
11128
|
-
|
11400
|
+
session_id: Optional[str] = Field(
|
11401
|
+
default=None, description="""The session id of the live session."""
|
11402
|
+
)
|
11129
11403
|
|
11130
11404
|
|
11131
11405
|
class LiveServerSetupCompleteDict(TypedDict, total=False):
|
11132
11406
|
"""Sent in response to a `LiveGenerateContentSetup` message from the client."""
|
11133
11407
|
|
11134
|
-
|
11408
|
+
session_id: Optional[str]
|
11409
|
+
"""The session id of the live session."""
|
11135
11410
|
|
11136
11411
|
|
11137
11412
|
LiveServerSetupCompleteOrDict = Union[
|
@@ -12801,7 +13076,7 @@ class AudioChunk(_common.BaseModel):
|
|
12801
13076
|
"""Representation of an audio chunk."""
|
12802
13077
|
|
12803
13078
|
data: Optional[bytes] = Field(
|
12804
|
-
default=None, description="""Raw
|
13079
|
+
default=None, description="""Raw bytes of audio data."""
|
12805
13080
|
)
|
12806
13081
|
mime_type: Optional[str] = Field(
|
12807
13082
|
default=None, description="""MIME type of the audio chunk."""
|
@@ -12816,7 +13091,7 @@ class AudioChunkDict(TypedDict, total=False):
|
|
12816
13091
|
"""Representation of an audio chunk."""
|
12817
13092
|
|
12818
13093
|
data: Optional[bytes]
|
12819
|
-
"""Raw
|
13094
|
+
"""Raw bytes of audio data."""
|
12820
13095
|
|
12821
13096
|
mime_type: Optional[str]
|
12822
13097
|
"""MIME type of the audio chunk."""
|
google/genai/version.py
CHANGED