google-genai 1.23.0__py3-none-any.whl → 1.25.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 +43 -31
- google/genai/_common.py +6 -4
- google/genai/_live_converters.py +14 -6
- google/genai/_replay_api_client.py +15 -8
- google/genai/_tokens_converters.py +6 -0
- google/genai/_transformers.py +12 -6
- google/genai/batches.py +84 -12
- google/genai/caches.py +6 -0
- google/genai/errors.py +2 -2
- google/genai/live.py +14 -5
- google/genai/models.py +6 -0
- google/genai/tokens.py +8 -4
- google/genai/tunings.py +12 -0
- google/genai/types.py +312 -34
- google/genai/version.py +1 -1
- {google_genai-1.23.0.dist-info → google_genai-1.25.0.dist-info}/METADATA +96 -7
- google_genai-1.25.0.dist-info/RECORD +35 -0
- google_genai-1.23.0.dist-info/RECORD +0 -35
- {google_genai-1.23.0.dist-info → google_genai-1.25.0.dist-info}/WHEEL +0 -0
- {google_genai-1.23.0.dist-info → google_genai-1.25.0.dist-info}/licenses/LICENSE +0 -0
- {google_genai-1.23.0.dist-info → google_genai-1.25.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
|
|
@@ -446,10 +480,21 @@ class ImagePromptLanguage(_common.CaseInSensitiveEnum):
|
|
446
480
|
"""Enum that specifies the language of the text in the prompt."""
|
447
481
|
|
448
482
|
auto = 'auto'
|
483
|
+
"""Auto-detect the language."""
|
449
484
|
en = 'en'
|
485
|
+
"""English"""
|
450
486
|
ja = 'ja'
|
487
|
+
"""Japanese"""
|
451
488
|
ko = 'ko'
|
489
|
+
"""Korean"""
|
452
490
|
hi = 'hi'
|
491
|
+
"""Hindi"""
|
492
|
+
zh = 'zh'
|
493
|
+
"""Chinese"""
|
494
|
+
pt = 'pt'
|
495
|
+
"""Portuguese"""
|
496
|
+
es = 'es'
|
497
|
+
"""Spanish"""
|
453
498
|
|
454
499
|
|
455
500
|
class MaskReferenceMode(_common.CaseInSensitiveEnum):
|
@@ -743,7 +788,8 @@ FileDataOrDict = Union[FileData, FileDataDict]
|
|
743
788
|
class CodeExecutionResult(_common.BaseModel):
|
744
789
|
"""Result of executing the [ExecutableCode].
|
745
790
|
|
746
|
-
|
791
|
+
Only generated when using the [CodeExecution] tool, and always follows a
|
792
|
+
`part` containing the [ExecutableCode].
|
747
793
|
"""
|
748
794
|
|
749
795
|
outcome: Optional[Outcome] = Field(
|
@@ -758,7 +804,8 @@ class CodeExecutionResult(_common.BaseModel):
|
|
758
804
|
class CodeExecutionResultDict(TypedDict, total=False):
|
759
805
|
"""Result of executing the [ExecutableCode].
|
760
806
|
|
761
|
-
|
807
|
+
Only generated when using the [CodeExecution] tool, and always follows a
|
808
|
+
`part` containing the [ExecutableCode].
|
762
809
|
"""
|
763
810
|
|
764
811
|
outcome: Optional[Outcome]
|
@@ -774,8 +821,9 @@ CodeExecutionResultOrDict = Union[CodeExecutionResult, CodeExecutionResultDict]
|
|
774
821
|
class ExecutableCode(_common.BaseModel):
|
775
822
|
"""Code generated by the model that is meant to be executed, and the result returned to the model.
|
776
823
|
|
777
|
-
Generated when using the [
|
778
|
-
|
824
|
+
Generated when using the [CodeExecution] tool, in which the code will be
|
825
|
+
automatically executed, and a corresponding [CodeExecutionResult] will also be
|
826
|
+
generated.
|
779
827
|
"""
|
780
828
|
|
781
829
|
code: Optional[str] = Field(
|
@@ -790,8 +838,9 @@ class ExecutableCode(_common.BaseModel):
|
|
790
838
|
class ExecutableCodeDict(TypedDict, total=False):
|
791
839
|
"""Code generated by the model that is meant to be executed, and the result returned to the model.
|
792
840
|
|
793
|
-
Generated when using the [
|
794
|
-
|
841
|
+
Generated when using the [CodeExecution] tool, in which the code will be
|
842
|
+
automatically executed, and a corresponding [CodeExecutionResult] will also be
|
843
|
+
generated.
|
795
844
|
"""
|
796
845
|
|
797
846
|
code: Optional[str]
|
@@ -2473,6 +2522,168 @@ class UrlContextDict(TypedDict, total=False):
|
|
2473
2522
|
UrlContextOrDict = Union[UrlContext, UrlContextDict]
|
2474
2523
|
|
2475
2524
|
|
2525
|
+
class ApiAuthApiKeyConfig(_common.BaseModel):
|
2526
|
+
"""The API secret."""
|
2527
|
+
|
2528
|
+
api_key_secret_version: Optional[str] = Field(
|
2529
|
+
default=None,
|
2530
|
+
description="""Required. The SecretManager secret version resource name storing API key. e.g. projects/{project}/secrets/{secret}/versions/{version}""",
|
2531
|
+
)
|
2532
|
+
api_key_string: Optional[str] = Field(
|
2533
|
+
default=None,
|
2534
|
+
description="""The API key string. Either this or `api_key_secret_version` must be set.""",
|
2535
|
+
)
|
2536
|
+
|
2537
|
+
|
2538
|
+
class ApiAuthApiKeyConfigDict(TypedDict, total=False):
|
2539
|
+
"""The API secret."""
|
2540
|
+
|
2541
|
+
api_key_secret_version: Optional[str]
|
2542
|
+
"""Required. The SecretManager secret version resource name storing API key. e.g. projects/{project}/secrets/{secret}/versions/{version}"""
|
2543
|
+
|
2544
|
+
api_key_string: Optional[str]
|
2545
|
+
"""The API key string. Either this or `api_key_secret_version` must be set."""
|
2546
|
+
|
2547
|
+
|
2548
|
+
ApiAuthApiKeyConfigOrDict = Union[ApiAuthApiKeyConfig, ApiAuthApiKeyConfigDict]
|
2549
|
+
|
2550
|
+
|
2551
|
+
class ApiAuth(_common.BaseModel):
|
2552
|
+
"""The generic reusable api auth config.
|
2553
|
+
|
2554
|
+
Deprecated. Please use AuthConfig (google/cloud/aiplatform/master/auth.proto)
|
2555
|
+
instead.
|
2556
|
+
"""
|
2557
|
+
|
2558
|
+
api_key_config: Optional[ApiAuthApiKeyConfig] = Field(
|
2559
|
+
default=None, description="""The API secret."""
|
2560
|
+
)
|
2561
|
+
|
2562
|
+
|
2563
|
+
class ApiAuthDict(TypedDict, total=False):
|
2564
|
+
"""The generic reusable api auth config.
|
2565
|
+
|
2566
|
+
Deprecated. Please use AuthConfig (google/cloud/aiplatform/master/auth.proto)
|
2567
|
+
instead.
|
2568
|
+
"""
|
2569
|
+
|
2570
|
+
api_key_config: Optional[ApiAuthApiKeyConfigDict]
|
2571
|
+
"""The API secret."""
|
2572
|
+
|
2573
|
+
|
2574
|
+
ApiAuthOrDict = Union[ApiAuth, ApiAuthDict]
|
2575
|
+
|
2576
|
+
|
2577
|
+
class ExternalApiElasticSearchParams(_common.BaseModel):
|
2578
|
+
"""The search parameters to use for the ELASTIC_SEARCH spec."""
|
2579
|
+
|
2580
|
+
index: Optional[str] = Field(
|
2581
|
+
default=None, description="""The ElasticSearch index to use."""
|
2582
|
+
)
|
2583
|
+
num_hits: Optional[int] = Field(
|
2584
|
+
default=None,
|
2585
|
+
description="""Optional. Number of hits (chunks) to request. When specified, it is passed to Elasticsearch as the `num_hits` param.""",
|
2586
|
+
)
|
2587
|
+
search_template: Optional[str] = Field(
|
2588
|
+
default=None, description="""The ElasticSearch search template to use."""
|
2589
|
+
)
|
2590
|
+
|
2591
|
+
|
2592
|
+
class ExternalApiElasticSearchParamsDict(TypedDict, total=False):
|
2593
|
+
"""The search parameters to use for the ELASTIC_SEARCH spec."""
|
2594
|
+
|
2595
|
+
index: Optional[str]
|
2596
|
+
"""The ElasticSearch index to use."""
|
2597
|
+
|
2598
|
+
num_hits: Optional[int]
|
2599
|
+
"""Optional. Number of hits (chunks) to request. When specified, it is passed to Elasticsearch as the `num_hits` param."""
|
2600
|
+
|
2601
|
+
search_template: Optional[str]
|
2602
|
+
"""The ElasticSearch search template to use."""
|
2603
|
+
|
2604
|
+
|
2605
|
+
ExternalApiElasticSearchParamsOrDict = Union[
|
2606
|
+
ExternalApiElasticSearchParams, ExternalApiElasticSearchParamsDict
|
2607
|
+
]
|
2608
|
+
|
2609
|
+
|
2610
|
+
class ExternalApiSimpleSearchParams(_common.BaseModel):
|
2611
|
+
"""The search parameters to use for SIMPLE_SEARCH spec."""
|
2612
|
+
|
2613
|
+
pass
|
2614
|
+
|
2615
|
+
|
2616
|
+
class ExternalApiSimpleSearchParamsDict(TypedDict, total=False):
|
2617
|
+
"""The search parameters to use for SIMPLE_SEARCH spec."""
|
2618
|
+
|
2619
|
+
pass
|
2620
|
+
|
2621
|
+
|
2622
|
+
ExternalApiSimpleSearchParamsOrDict = Union[
|
2623
|
+
ExternalApiSimpleSearchParams, ExternalApiSimpleSearchParamsDict
|
2624
|
+
]
|
2625
|
+
|
2626
|
+
|
2627
|
+
class ExternalApi(_common.BaseModel):
|
2628
|
+
"""Retrieve from data source powered by external API for grounding.
|
2629
|
+
|
2630
|
+
The external API is not owned by Google, but need to follow the pre-defined
|
2631
|
+
API spec.
|
2632
|
+
"""
|
2633
|
+
|
2634
|
+
api_auth: Optional[ApiAuth] = Field(
|
2635
|
+
default=None,
|
2636
|
+
description="""The authentication config to access the API. Deprecated. Please use auth_config instead.""",
|
2637
|
+
)
|
2638
|
+
api_spec: Optional[ApiSpec] = Field(
|
2639
|
+
default=None,
|
2640
|
+
description="""The API spec that the external API implements.""",
|
2641
|
+
)
|
2642
|
+
auth_config: Optional[AuthConfig] = Field(
|
2643
|
+
default=None,
|
2644
|
+
description="""The authentication config to access the API.""",
|
2645
|
+
)
|
2646
|
+
elastic_search_params: Optional[ExternalApiElasticSearchParams] = Field(
|
2647
|
+
default=None, description="""Parameters for the elastic search API."""
|
2648
|
+
)
|
2649
|
+
endpoint: Optional[str] = Field(
|
2650
|
+
default=None,
|
2651
|
+
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""",
|
2652
|
+
)
|
2653
|
+
simple_search_params: Optional[ExternalApiSimpleSearchParams] = Field(
|
2654
|
+
default=None, description="""Parameters for the simple search API."""
|
2655
|
+
)
|
2656
|
+
|
2657
|
+
|
2658
|
+
class ExternalApiDict(TypedDict, total=False):
|
2659
|
+
"""Retrieve from data source powered by external API for grounding.
|
2660
|
+
|
2661
|
+
The external API is not owned by Google, but need to follow the pre-defined
|
2662
|
+
API spec.
|
2663
|
+
"""
|
2664
|
+
|
2665
|
+
api_auth: Optional[ApiAuthDict]
|
2666
|
+
"""The authentication config to access the API. Deprecated. Please use auth_config instead."""
|
2667
|
+
|
2668
|
+
api_spec: Optional[ApiSpec]
|
2669
|
+
"""The API spec that the external API implements."""
|
2670
|
+
|
2671
|
+
auth_config: Optional[AuthConfigDict]
|
2672
|
+
"""The authentication config to access the API."""
|
2673
|
+
|
2674
|
+
elastic_search_params: Optional[ExternalApiElasticSearchParamsDict]
|
2675
|
+
"""Parameters for the elastic search API."""
|
2676
|
+
|
2677
|
+
endpoint: Optional[str]
|
2678
|
+
"""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"""
|
2679
|
+
|
2680
|
+
simple_search_params: Optional[ExternalApiSimpleSearchParamsDict]
|
2681
|
+
"""Parameters for the simple search API."""
|
2682
|
+
|
2683
|
+
|
2684
|
+
ExternalApiOrDict = Union[ExternalApi, ExternalApiDict]
|
2685
|
+
|
2686
|
+
|
2476
2687
|
class VertexAISearchDataStoreSpec(_common.BaseModel):
|
2477
2688
|
"""Define data stores within engine to filter on in a search call and configurations for those data stores.
|
2478
2689
|
|
@@ -2815,6 +3026,10 @@ class Retrieval(_common.BaseModel):
|
|
2815
3026
|
default=None,
|
2816
3027
|
description="""Optional. Deprecated. This option is no longer supported.""",
|
2817
3028
|
)
|
3029
|
+
external_api: Optional[ExternalApi] = Field(
|
3030
|
+
default=None,
|
3031
|
+
description="""Use data source powered by external API for grounding.""",
|
3032
|
+
)
|
2818
3033
|
vertex_ai_search: Optional[VertexAISearch] = Field(
|
2819
3034
|
default=None,
|
2820
3035
|
description="""Set to use data source powered by Vertex AI Search.""",
|
@@ -2831,6 +3046,9 @@ class RetrievalDict(TypedDict, total=False):
|
|
2831
3046
|
disable_attribution: Optional[bool]
|
2832
3047
|
"""Optional. Deprecated. This option is no longer supported."""
|
2833
3048
|
|
3049
|
+
external_api: Optional[ExternalApiDict]
|
3050
|
+
"""Use data source powered by external API for grounding."""
|
3051
|
+
|
2834
3052
|
vertex_ai_search: Optional[VertexAISearchDict]
|
2835
3053
|
"""Set to use data source powered by Vertex AI Search."""
|
2836
3054
|
|
@@ -2864,6 +3082,24 @@ class ToolCodeExecutionDict(TypedDict, total=False):
|
|
2864
3082
|
ToolCodeExecutionOrDict = Union[ToolCodeExecution, ToolCodeExecutionDict]
|
2865
3083
|
|
2866
3084
|
|
3085
|
+
class ToolComputerUse(_common.BaseModel):
|
3086
|
+
"""Tool to support computer use."""
|
3087
|
+
|
3088
|
+
environment: Optional[Environment] = Field(
|
3089
|
+
default=None, description="""Required. The environment being operated."""
|
3090
|
+
)
|
3091
|
+
|
3092
|
+
|
3093
|
+
class ToolComputerUseDict(TypedDict, total=False):
|
3094
|
+
"""Tool to support computer use."""
|
3095
|
+
|
3096
|
+
environment: Optional[Environment]
|
3097
|
+
"""Required. The environment being operated."""
|
3098
|
+
|
3099
|
+
|
3100
|
+
ToolComputerUseOrDict = Union[ToolComputerUse, ToolComputerUseDict]
|
3101
|
+
|
3102
|
+
|
2867
3103
|
class Tool(_common.BaseModel):
|
2868
3104
|
"""Tool details of a tool that the model may use to generate a response."""
|
2869
3105
|
|
@@ -2902,6 +3138,10 @@ class Tool(_common.BaseModel):
|
|
2902
3138
|
default=None,
|
2903
3139
|
description="""Optional. CodeExecution tool type. Enables the model to execute code as part of generation.""",
|
2904
3140
|
)
|
3141
|
+
computer_use: Optional[ToolComputerUse] = Field(
|
3142
|
+
default=None,
|
3143
|
+
description="""Optional. Tool to support the model interacting directly with the computer. If enabled, it automatically populates computer-use specific Function Declarations.""",
|
3144
|
+
)
|
2905
3145
|
|
2906
3146
|
|
2907
3147
|
class ToolDict(TypedDict, total=False):
|
@@ -2934,6 +3174,9 @@ class ToolDict(TypedDict, total=False):
|
|
2934
3174
|
code_execution: Optional[ToolCodeExecutionDict]
|
2935
3175
|
"""Optional. CodeExecution tool type. Enables the model to execute code as part of generation."""
|
2936
3176
|
|
3177
|
+
computer_use: Optional[ToolComputerUseDict]
|
3178
|
+
"""Optional. Tool to support the model interacting directly with the computer. If enabled, it automatically populates computer-use specific Function Declarations."""
|
3179
|
+
|
2937
3180
|
|
2938
3181
|
ToolOrDict = Union[Tool, ToolDict]
|
2939
3182
|
if _is_mcp_imported:
|
@@ -4341,7 +4584,7 @@ class GroundingSupport(_common.BaseModel):
|
|
4341
4584
|
|
4342
4585
|
confidence_scores: Optional[list[float]] = Field(
|
4343
4586
|
default=None,
|
4344
|
-
description="""Confidence score of the support references. Ranges from 0 to 1. 1 is the most confident.
|
4587
|
+
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
4588
|
)
|
4346
4589
|
grounding_chunk_indices: Optional[list[int]] = Field(
|
4347
4590
|
default=None,
|
@@ -4357,7 +4600,7 @@ class GroundingSupportDict(TypedDict, total=False):
|
|
4357
4600
|
"""Grounding support."""
|
4358
4601
|
|
4359
4602
|
confidence_scores: Optional[list[float]]
|
4360
|
-
"""Confidence score of the support references. Ranges from 0 to 1. 1 is the most confident.
|
4603
|
+
"""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
4604
|
|
4362
4605
|
grounding_chunk_indices: Optional[list[int]]
|
4363
4606
|
"""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 +4797,10 @@ class SafetyRating(_common.BaseModel):
|
|
4554
4797
|
category: Optional[HarmCategory] = Field(
|
4555
4798
|
default=None, description="""Output only. Harm category."""
|
4556
4799
|
)
|
4800
|
+
overwritten_threshold: Optional[HarmBlockThreshold] = Field(
|
4801
|
+
default=None,
|
4802
|
+
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.""",
|
4803
|
+
)
|
4557
4804
|
probability: Optional[HarmProbability] = Field(
|
4558
4805
|
default=None,
|
4559
4806
|
description="""Output only. Harm probability levels in the content.""",
|
@@ -4579,6 +4826,9 @@ class SafetyRatingDict(TypedDict, total=False):
|
|
4579
4826
|
category: Optional[HarmCategory]
|
4580
4827
|
"""Output only. Harm category."""
|
4581
4828
|
|
4829
|
+
overwritten_threshold: Optional[HarmBlockThreshold]
|
4830
|
+
"""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."""
|
4831
|
+
|
4582
4832
|
probability: Optional[HarmProbability]
|
4583
4833
|
"""Output only. Harm probability levels in the content."""
|
4584
4834
|
|
@@ -5003,6 +5253,12 @@ class GenerateContentResponse(_common.BaseModel):
|
|
5003
5253
|
response_schema = _common.get_value_by_path(
|
5004
5254
|
kwargs, ['config', 'response_schema']
|
5005
5255
|
)
|
5256
|
+
# Handles response_json_schema. Backend will throw error if both
|
5257
|
+
# response_schema and response_json_schema are set.
|
5258
|
+
if response_schema is None:
|
5259
|
+
response_schema = _common.get_value_by_path(
|
5260
|
+
kwargs, ['config', 'response_json_schema']
|
5261
|
+
)
|
5006
5262
|
if (
|
5007
5263
|
inspect.isclass(response_schema)
|
5008
5264
|
and not (
|
@@ -6866,6 +7122,10 @@ class GenerationConfig(_common.BaseModel):
|
|
6866
7122
|
default=None,
|
6867
7123
|
description="""Optional. Number of candidates to generate.""",
|
6868
7124
|
)
|
7125
|
+
enable_affective_dialog: Optional[bool] = Field(
|
7126
|
+
default=None,
|
7127
|
+
description="""Optional. If enabled, the model will detect emotions and adapt its responses accordingly.""",
|
7128
|
+
)
|
6869
7129
|
frequency_penalty: Optional[float] = Field(
|
6870
7130
|
default=None, description="""Optional. Frequency penalties."""
|
6871
7131
|
)
|
@@ -6883,6 +7143,10 @@ class GenerationConfig(_common.BaseModel):
|
|
6883
7143
|
presence_penalty: Optional[float] = Field(
|
6884
7144
|
default=None, description="""Optional. Positive penalties."""
|
6885
7145
|
)
|
7146
|
+
response_json_schema: Optional[Any] = Field(
|
7147
|
+
default=None,
|
7148
|
+
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.""",
|
7149
|
+
)
|
6886
7150
|
response_logprobs: Optional[bool] = Field(
|
6887
7151
|
default=None,
|
6888
7152
|
description="""Optional. If true, export the logprobs results in response.""",
|
@@ -6898,10 +7162,6 @@ class GenerationConfig(_common.BaseModel):
|
|
6898
7162
|
default=None,
|
6899
7163
|
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
7164
|
)
|
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
7165
|
routing_config: Optional[GenerationConfigRoutingConfig] = Field(
|
6906
7166
|
default=None, description="""Optional. Routing configuration."""
|
6907
7167
|
)
|
@@ -6942,6 +7202,9 @@ class GenerationConfigDict(TypedDict, total=False):
|
|
6942
7202
|
candidate_count: Optional[int]
|
6943
7203
|
"""Optional. Number of candidates to generate."""
|
6944
7204
|
|
7205
|
+
enable_affective_dialog: Optional[bool]
|
7206
|
+
"""Optional. If enabled, the model will detect emotions and adapt its responses accordingly."""
|
7207
|
+
|
6945
7208
|
frequency_penalty: Optional[float]
|
6946
7209
|
"""Optional. Frequency penalties."""
|
6947
7210
|
|
@@ -6957,6 +7220,9 @@ class GenerationConfigDict(TypedDict, total=False):
|
|
6957
7220
|
presence_penalty: Optional[float]
|
6958
7221
|
"""Optional. Positive penalties."""
|
6959
7222
|
|
7223
|
+
response_json_schema: Optional[Any]
|
7224
|
+
"""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."""
|
7225
|
+
|
6960
7226
|
response_logprobs: Optional[bool]
|
6961
7227
|
"""Optional. If true, export the logprobs results in response."""
|
6962
7228
|
|
@@ -6969,9 +7235,6 @@ class GenerationConfigDict(TypedDict, total=False):
|
|
6969
7235
|
response_schema: Optional[SchemaDict]
|
6970
7236
|
"""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
7237
|
|
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
7238
|
routing_config: Optional[GenerationConfigRoutingConfigDict]
|
6976
7239
|
"""Optional. Routing configuration."""
|
6977
7240
|
|
@@ -7780,7 +8043,7 @@ class SupervisedHyperParameters(_common.BaseModel):
|
|
7780
8043
|
)
|
7781
8044
|
learning_rate_multiplier: Optional[float] = Field(
|
7782
8045
|
default=None,
|
7783
|
-
description="""Optional. Multiplier for adjusting the default learning rate.""",
|
8046
|
+
description="""Optional. Multiplier for adjusting the default learning rate. Mutually exclusive with `learning_rate`.""",
|
7784
8047
|
)
|
7785
8048
|
|
7786
8049
|
|
@@ -7794,7 +8057,7 @@ class SupervisedHyperParametersDict(TypedDict, total=False):
|
|
7794
8057
|
"""Optional. Number of complete passes the model makes over the entire training dataset during training."""
|
7795
8058
|
|
7796
8059
|
learning_rate_multiplier: Optional[float]
|
7797
|
-
"""Optional. Multiplier for adjusting the default learning rate."""
|
8060
|
+
"""Optional. Multiplier for adjusting the default learning rate. Mutually exclusive with `learning_rate`."""
|
7798
8061
|
|
7799
8062
|
|
7800
8063
|
SupervisedHyperParametersOrDict = Union[
|
@@ -7814,11 +8077,11 @@ class SupervisedTuningSpec(_common.BaseModel):
|
|
7814
8077
|
)
|
7815
8078
|
training_dataset_uri: Optional[str] = Field(
|
7816
8079
|
default=None,
|
7817
|
-
description="""Required.
|
8080
|
+
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
8081
|
)
|
7819
8082
|
validation_dataset_uri: Optional[str] = Field(
|
7820
8083
|
default=None,
|
7821
|
-
description="""Optional.
|
8084
|
+
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
8085
|
)
|
7823
8086
|
|
7824
8087
|
|
@@ -7832,10 +8095,10 @@ class SupervisedTuningSpecDict(TypedDict, total=False):
|
|
7832
8095
|
"""Optional. Hyperparameters for SFT."""
|
7833
8096
|
|
7834
8097
|
training_dataset_uri: Optional[str]
|
7835
|
-
"""Required.
|
8098
|
+
"""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
8099
|
|
7837
8100
|
validation_dataset_uri: Optional[str]
|
7838
|
-
"""Optional.
|
8101
|
+
"""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
8102
|
|
7840
8103
|
|
7841
8104
|
SupervisedTuningSpecOrDict = Union[
|
@@ -8504,6 +8767,12 @@ class TuningJob(_common.BaseModel):
|
|
8504
8767
|
default=None,
|
8505
8768
|
description="""Output only. The resource name of the PipelineJob associated with the TuningJob. Format: `projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}`.""",
|
8506
8769
|
)
|
8770
|
+
satisfies_pzi: Optional[bool] = Field(
|
8771
|
+
default=None, description="""Output only. Reserved for future use."""
|
8772
|
+
)
|
8773
|
+
satisfies_pzs: Optional[bool] = Field(
|
8774
|
+
default=None, description="""Output only. Reserved for future use."""
|
8775
|
+
)
|
8507
8776
|
service_account: Optional[str] = Field(
|
8508
8777
|
default=None,
|
8509
8778
|
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 +8850,12 @@ class TuningJobDict(TypedDict, total=False):
|
|
8581
8850
|
pipeline_job: Optional[str]
|
8582
8851
|
"""Output only. The resource name of the PipelineJob associated with the TuningJob. Format: `projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}`."""
|
8583
8852
|
|
8853
|
+
satisfies_pzi: Optional[bool]
|
8854
|
+
"""Output only. Reserved for future use."""
|
8855
|
+
|
8856
|
+
satisfies_pzs: Optional[bool]
|
8857
|
+
"""Output only. Reserved for future use."""
|
8858
|
+
|
8584
8859
|
service_account: Optional[str]
|
8585
8860
|
"""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
8861
|
|
@@ -11139,13 +11414,16 @@ SubjectReferenceImageOrDict = Union[
|
|
11139
11414
|
class LiveServerSetupComplete(_common.BaseModel):
|
11140
11415
|
"""Sent in response to a `LiveGenerateContentSetup` message from the client."""
|
11141
11416
|
|
11142
|
-
|
11417
|
+
session_id: Optional[str] = Field(
|
11418
|
+
default=None, description="""The session id of the live session."""
|
11419
|
+
)
|
11143
11420
|
|
11144
11421
|
|
11145
11422
|
class LiveServerSetupCompleteDict(TypedDict, total=False):
|
11146
11423
|
"""Sent in response to a `LiveGenerateContentSetup` message from the client."""
|
11147
11424
|
|
11148
|
-
|
11425
|
+
session_id: Optional[str]
|
11426
|
+
"""The session id of the live session."""
|
11149
11427
|
|
11150
11428
|
|
11151
11429
|
LiveServerSetupCompleteOrDict = Union[
|
google/genai/version.py
CHANGED