-
Notifications
You must be signed in to change notification settings - Fork 808
Expand file tree
/
Copy pathtypes.py
More file actions
20831 lines (15635 loc) · 742 KB
/
types.py
File metadata and controls
20831 lines (15635 loc) · 742 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# Copyright 2025 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Code generated by the Google Gen AI SDK generator DO NOT EDIT.
from abc import ABC, abstractmethod
import datetime
from enum import Enum, EnumMeta
import inspect
import io
import json
import logging
import sys
import types as builtin_types
import typing
from typing import Any, Callable, Dict, List, Literal, Optional, Sequence, Union, _UnionGenericAlias # type: ignore
import pydantic
from pydantic import ConfigDict, Field, PrivateAttr, model_validator
from typing_extensions import Self, TypedDict
from . import _common
from ._operations_converters import (
_GenerateVideosOperation_from_mldev,
_GenerateVideosOperation_from_vertex,
_ImportFileOperation_from_mldev,
_UploadToFileSearchStoreOperation_from_mldev,
)
if sys.version_info >= (3, 10):
# Supports both Union[t1, t2] and t1 | t2
VersionedUnionType = Union[builtin_types.UnionType, _UnionGenericAlias]
_UNION_TYPES = (typing.Union, builtin_types.UnionType)
else:
# Supports only Union[t1, t2]
VersionedUnionType = _UnionGenericAlias
_UNION_TYPES = (typing.Union,)
_is_pillow_image_imported = False
if typing.TYPE_CHECKING:
from ._api_client import BaseApiClient
import PIL.Image
PIL_Image = PIL.Image.Image
_is_pillow_image_imported = True
else:
PIL_Image: typing.Type = Any
try:
import PIL.Image
PIL_Image = PIL.Image.Image
_is_pillow_image_imported = True
except ImportError:
PIL_Image = None
_is_mcp_imported = False
if typing.TYPE_CHECKING:
from mcp import types as mcp_types
from mcp import ClientSession as McpClientSession
from mcp.types import CallToolResult as McpCallToolResult
_is_mcp_imported = True
else:
McpClientSession: typing.Type = Any
McpCallToolResult: typing.Type = Any
try:
from mcp import types as mcp_types
from mcp import ClientSession as McpClientSession
from mcp.types import CallToolResult as McpCallToolResult
_is_mcp_imported = True
except ImportError:
McpClientSession = None
McpCallToolResult = None
if typing.TYPE_CHECKING:
import yaml
_is_httpx_imported = False
if typing.TYPE_CHECKING:
import httpx
HttpxClient = httpx.Client
HttpxAsyncClient = httpx.AsyncClient
_is_httpx_imported = True
else:
HttpxClient: typing.Type = Any
HttpxAsyncClient: typing.Type = Any
try:
import httpx
HttpxClient = httpx.Client
HttpxAsyncClient = httpx.AsyncClient
_is_httpx_imported = True
except ImportError:
HttpxClient = None
HttpxAsyncClient = None
_is_aiohttp_imported = False
if typing.TYPE_CHECKING:
from aiohttp import ClientSession
_is_aiohttp_imported = True
else:
ClientSession: typing.Type = Any
try:
from aiohttp import ClientSession
_is_aiohttp_imported = True
except ImportError:
ClientSession = None
logger = logging.getLogger('google_genai.types')
_from_json_schema_warning_logged = False
_json_schema_warning_logged = False
_response_text_warning_logged = False
_response_text_non_text_warning_logged = False
_response_parts_warning_logged = False
_response_function_calls_warning_logged = False
_response_executable_code_warning_logged = False
_response_code_execution_warning_logged = False
_live_server_text_warning_logged = False
_live_server_data_warning_logged = False
T = typing.TypeVar('T', bound='GenerateContentResponse')
MetricSubclass = typing.TypeVar('MetricSubclass', bound='Metric')
class Language(_common.CaseInSensitiveEnum):
"""Programming language of the `code`."""
LANGUAGE_UNSPECIFIED = 'LANGUAGE_UNSPECIFIED'
"""Unspecified language. This value should not be used."""
PYTHON = 'PYTHON'
"""Python >= 3.10, with numpy and simpy available."""
class Outcome(_common.CaseInSensitiveEnum):
"""Outcome of the code execution."""
OUTCOME_UNSPECIFIED = 'OUTCOME_UNSPECIFIED'
"""Unspecified status. This value should not be used."""
OUTCOME_OK = 'OUTCOME_OK'
"""Code execution completed successfully."""
OUTCOME_FAILED = 'OUTCOME_FAILED'
"""Code execution finished but with a failure. `stderr` should contain the reason."""
OUTCOME_DEADLINE_EXCEEDED = 'OUTCOME_DEADLINE_EXCEEDED'
"""Code execution ran for too long, and was cancelled. There may or may not be a partial output present."""
class FunctionResponseScheduling(_common.CaseInSensitiveEnum):
"""Specifies how the response should be scheduled in the conversation."""
SCHEDULING_UNSPECIFIED = 'SCHEDULING_UNSPECIFIED'
"""This value is unused."""
SILENT = 'SILENT'
"""Only add the result to the conversation context, do not interrupt or trigger generation."""
WHEN_IDLE = 'WHEN_IDLE'
"""Add the result to the conversation context, and prompt to generate output without interrupting ongoing generation."""
INTERRUPT = 'INTERRUPT'
"""Add the result to the conversation context, interrupt ongoing generation and prompt to generate output."""
class Type(_common.CaseInSensitiveEnum):
"""Data type of the schema field."""
TYPE_UNSPECIFIED = 'TYPE_UNSPECIFIED'
"""Not specified, should not be used."""
STRING = 'STRING'
"""OpenAPI string type"""
NUMBER = 'NUMBER'
"""OpenAPI number type"""
INTEGER = 'INTEGER'
"""OpenAPI integer type"""
BOOLEAN = 'BOOLEAN'
"""OpenAPI boolean type"""
ARRAY = 'ARRAY'
"""OpenAPI array type"""
OBJECT = 'OBJECT'
"""OpenAPI object type"""
NULL = 'NULL'
"""Null type"""
class Environment(_common.CaseInSensitiveEnum):
"""The environment being operated."""
ENVIRONMENT_UNSPECIFIED = 'ENVIRONMENT_UNSPECIFIED'
"""Defaults to browser."""
ENVIRONMENT_BROWSER = 'ENVIRONMENT_BROWSER'
"""Operates in a web browser."""
class AuthType(_common.CaseInSensitiveEnum):
"""Type of auth scheme. This enum is not supported in Gemini API."""
AUTH_TYPE_UNSPECIFIED = 'AUTH_TYPE_UNSPECIFIED'
NO_AUTH = 'NO_AUTH'
"""No Auth."""
API_KEY_AUTH = 'API_KEY_AUTH'
"""API Key Auth."""
HTTP_BASIC_AUTH = 'HTTP_BASIC_AUTH'
"""HTTP Basic Auth."""
GOOGLE_SERVICE_ACCOUNT_AUTH = 'GOOGLE_SERVICE_ACCOUNT_AUTH'
"""Google Service Account Auth."""
OAUTH = 'OAUTH'
"""OAuth auth."""
OIDC_AUTH = 'OIDC_AUTH'
"""OpenID Connect (OIDC) Auth."""
class HttpElementLocation(_common.CaseInSensitiveEnum):
"""The location of the API key. This enum is not supported in Gemini API."""
HTTP_IN_UNSPECIFIED = 'HTTP_IN_UNSPECIFIED'
HTTP_IN_QUERY = 'HTTP_IN_QUERY'
"""Element is in the HTTP request query."""
HTTP_IN_HEADER = 'HTTP_IN_HEADER'
"""Element is in the HTTP request header."""
HTTP_IN_PATH = 'HTTP_IN_PATH'
"""Element is in the HTTP request path."""
HTTP_IN_BODY = 'HTTP_IN_BODY'
"""Element is in the HTTP request body."""
HTTP_IN_COOKIE = 'HTTP_IN_COOKIE'
"""Element is in the HTTP request cookie."""
class ApiSpec(_common.CaseInSensitiveEnum):
"""The API spec that the external API implements.
This enum is not supported in Gemini API.
"""
API_SPEC_UNSPECIFIED = 'API_SPEC_UNSPECIFIED'
"""Unspecified API spec. This value should not be used."""
SIMPLE_SEARCH = 'SIMPLE_SEARCH'
"""Simple search API spec."""
ELASTIC_SEARCH = 'ELASTIC_SEARCH'
"""Elastic search API spec."""
class PhishBlockThreshold(_common.CaseInSensitiveEnum):
"""Sites with confidence level chosen & above this value will be blocked from the search results.
This enum is not supported in Gemini API.
"""
PHISH_BLOCK_THRESHOLD_UNSPECIFIED = 'PHISH_BLOCK_THRESHOLD_UNSPECIFIED'
"""Defaults to unspecified."""
BLOCK_LOW_AND_ABOVE = 'BLOCK_LOW_AND_ABOVE'
"""Blocks Low and above confidence URL that is risky."""
BLOCK_MEDIUM_AND_ABOVE = 'BLOCK_MEDIUM_AND_ABOVE'
"""Blocks Medium and above confidence URL that is risky."""
BLOCK_HIGH_AND_ABOVE = 'BLOCK_HIGH_AND_ABOVE'
"""Blocks High and above confidence URL that is risky."""
BLOCK_HIGHER_AND_ABOVE = 'BLOCK_HIGHER_AND_ABOVE'
"""Blocks Higher and above confidence URL that is risky."""
BLOCK_VERY_HIGH_AND_ABOVE = 'BLOCK_VERY_HIGH_AND_ABOVE'
"""Blocks Very high and above confidence URL that is risky."""
BLOCK_ONLY_EXTREMELY_HIGH = 'BLOCK_ONLY_EXTREMELY_HIGH'
"""Blocks Extremely high confidence URL that is risky."""
class Behavior(_common.CaseInSensitiveEnum):
"""Specifies the function Behavior.
Currently only supported by the BidiGenerateContent method. This enum is not
supported in Vertex AI.
"""
UNSPECIFIED = 'UNSPECIFIED'
"""This value is unused."""
BLOCKING = 'BLOCKING'
"""If set, the system will wait to receive the function response before continuing the conversation."""
NON_BLOCKING = 'NON_BLOCKING'
"""If set, the system will not wait to receive the function response. Instead, it will attempt to handle function responses as they become available while maintaining the conversation between the user and the model."""
class DynamicRetrievalConfigMode(_common.CaseInSensitiveEnum):
"""The mode of the predictor to be used in dynamic retrieval."""
MODE_UNSPECIFIED = 'MODE_UNSPECIFIED'
"""Always trigger retrieval."""
MODE_DYNAMIC = 'MODE_DYNAMIC'
"""Run retrieval only when system decides it is necessary."""
class FunctionCallingConfigMode(_common.CaseInSensitiveEnum):
"""Function calling mode."""
MODE_UNSPECIFIED = 'MODE_UNSPECIFIED'
"""Unspecified function calling mode. This value should not be used."""
AUTO = 'AUTO'
"""Default model behavior, model decides to predict either function calls or natural language response."""
ANY = 'ANY'
"""Model is constrained to always predicting function calls only. If "allowed_function_names" are set, the predicted function calls will be limited to any one of "allowed_function_names", else the predicted function calls will be any one of the provided "function_declarations"."""
NONE = 'NONE'
"""Model will not predict any function calls. Model behavior is same as when not passing any function declarations."""
VALIDATED = 'VALIDATED'
"""Model is constrained to predict either function calls or natural language response. If "allowed_function_names" are set, the predicted function calls will be limited to any one of "allowed_function_names", else the predicted function calls will be any one of the provided "function_declarations"."""
class ThinkingLevel(_common.CaseInSensitiveEnum):
"""The number of thoughts tokens that the model should generate."""
THINKING_LEVEL_UNSPECIFIED = 'THINKING_LEVEL_UNSPECIFIED'
"""Unspecified thinking level."""
MINIMAL = 'MINIMAL'
"""MINIMAL thinking level."""
LOW = 'LOW'
"""Low thinking level."""
MEDIUM = 'MEDIUM'
"""Medium thinking level."""
HIGH = 'HIGH'
"""High thinking level."""
class PersonGeneration(_common.CaseInSensitiveEnum):
"""Enum that controls the generation of people."""
DONT_ALLOW = 'DONT_ALLOW'
"""Block generation of images of people."""
ALLOW_ADULT = 'ALLOW_ADULT'
"""Generate images of adults, but not children."""
ALLOW_ALL = 'ALLOW_ALL'
"""Generate images that include adults and children."""
class ProminentPeople(_common.CaseInSensitiveEnum):
"""Controls whether prominent people (celebrities) generation is allowed.
If used with personGeneration, personGeneration enum would take precedence.
For instance, if ALLOW_NONE is set, all person generation would be blocked. If
this field is unspecified, the default behavior is to allow prominent people.
This enum is not supported in Gemini API.
"""
PROMINENT_PEOPLE_UNSPECIFIED = 'PROMINENT_PEOPLE_UNSPECIFIED'
"""Unspecified value. The model will proceed with the default behavior, which is to allow generation of prominent people."""
ALLOW_PROMINENT_PEOPLE = 'ALLOW_PROMINENT_PEOPLE'
"""Allows the model to generate images of prominent people."""
BLOCK_PROMINENT_PEOPLE = 'BLOCK_PROMINENT_PEOPLE'
"""Prevents the model from generating images of prominent people."""
class HarmCategory(_common.CaseInSensitiveEnum):
"""The harm category to be blocked."""
HARM_CATEGORY_UNSPECIFIED = 'HARM_CATEGORY_UNSPECIFIED'
"""Default value. This value is unused."""
HARM_CATEGORY_HARASSMENT = 'HARM_CATEGORY_HARASSMENT'
"""Abusive, threatening, or content intended to bully, torment, or ridicule."""
HARM_CATEGORY_HATE_SPEECH = 'HARM_CATEGORY_HATE_SPEECH'
"""Content that promotes violence or incites hatred against individuals or groups based on certain attributes."""
HARM_CATEGORY_SEXUALLY_EXPLICIT = 'HARM_CATEGORY_SEXUALLY_EXPLICIT'
"""Content that contains sexually explicit material."""
HARM_CATEGORY_DANGEROUS_CONTENT = 'HARM_CATEGORY_DANGEROUS_CONTENT'
"""Content that promotes, facilitates, or enables dangerous activities."""
HARM_CATEGORY_CIVIC_INTEGRITY = 'HARM_CATEGORY_CIVIC_INTEGRITY'
"""Deprecated: Election filter is not longer supported. The harm category is civic integrity."""
HARM_CATEGORY_IMAGE_HATE = 'HARM_CATEGORY_IMAGE_HATE'
"""Images that contain hate speech. This enum value is not supported in Gemini API."""
HARM_CATEGORY_IMAGE_DANGEROUS_CONTENT = (
'HARM_CATEGORY_IMAGE_DANGEROUS_CONTENT'
)
"""Images that contain dangerous content. This enum value is not supported in Gemini API."""
HARM_CATEGORY_IMAGE_HARASSMENT = 'HARM_CATEGORY_IMAGE_HARASSMENT'
"""Images that contain harassment. This enum value is not supported in Gemini API."""
HARM_CATEGORY_IMAGE_SEXUALLY_EXPLICIT = (
'HARM_CATEGORY_IMAGE_SEXUALLY_EXPLICIT'
)
"""Images that contain sexually explicit content. This enum value is not supported in Gemini API."""
HARM_CATEGORY_JAILBREAK = 'HARM_CATEGORY_JAILBREAK'
"""Prompts designed to bypass safety filters. This enum value is not supported in Gemini API."""
class HarmBlockMethod(_common.CaseInSensitiveEnum):
"""The method for blocking content.
If not specified, the default behavior is to use the probability score. This
enum is not supported in Gemini API.
"""
HARM_BLOCK_METHOD_UNSPECIFIED = 'HARM_BLOCK_METHOD_UNSPECIFIED'
"""The harm block method is unspecified."""
SEVERITY = 'SEVERITY'
"""The harm block method uses both probability and severity scores."""
PROBABILITY = 'PROBABILITY'
"""The harm block method uses the probability score."""
class HarmBlockThreshold(_common.CaseInSensitiveEnum):
"""The threshold for blocking content.
If the harm probability exceeds this threshold, the content will be blocked.
"""
HARM_BLOCK_THRESHOLD_UNSPECIFIED = 'HARM_BLOCK_THRESHOLD_UNSPECIFIED'
"""The harm block threshold is unspecified."""
BLOCK_LOW_AND_ABOVE = 'BLOCK_LOW_AND_ABOVE'
"""Block content with a low harm probability or higher."""
BLOCK_MEDIUM_AND_ABOVE = 'BLOCK_MEDIUM_AND_ABOVE'
"""Block content with a medium harm probability or higher."""
BLOCK_ONLY_HIGH = 'BLOCK_ONLY_HIGH'
"""Block content with a high harm probability."""
BLOCK_NONE = 'BLOCK_NONE'
"""Do not block any content, regardless of its harm probability."""
OFF = 'OFF'
"""Turn off the safety filter entirely."""
class FinishReason(_common.CaseInSensitiveEnum):
"""Output only. The reason why the model stopped generating tokens.
If empty, the model has not stopped generating the tokens.
"""
FINISH_REASON_UNSPECIFIED = 'FINISH_REASON_UNSPECIFIED'
"""The finish reason is unspecified."""
STOP = 'STOP'
"""Token generation reached a natural stopping point or a configured stop sequence."""
MAX_TOKENS = 'MAX_TOKENS'
"""Token generation reached the configured maximum output tokens."""
SAFETY = 'SAFETY'
"""Token generation stopped because the content potentially contains safety violations. NOTE: When streaming, [content][] is empty if content filters blocks the output."""
RECITATION = 'RECITATION'
"""The token generation stopped because of potential recitation."""
LANGUAGE = 'LANGUAGE'
"""The token generation stopped because of using an unsupported language."""
OTHER = 'OTHER'
"""All other reasons that stopped the token generation."""
BLOCKLIST = 'BLOCKLIST'
"""Token generation stopped because the content contains forbidden terms."""
PROHIBITED_CONTENT = 'PROHIBITED_CONTENT'
"""Token generation stopped for potentially containing prohibited content."""
SPII = 'SPII'
"""Token generation stopped because the content potentially contains Sensitive Personally Identifiable Information (SPII)."""
MALFORMED_FUNCTION_CALL = 'MALFORMED_FUNCTION_CALL'
"""The function call generated by the model is invalid."""
IMAGE_SAFETY = 'IMAGE_SAFETY'
"""Token generation stopped because generated images have safety violations."""
UNEXPECTED_TOOL_CALL = 'UNEXPECTED_TOOL_CALL'
"""The tool call generated by the model is invalid."""
IMAGE_PROHIBITED_CONTENT = 'IMAGE_PROHIBITED_CONTENT'
"""Image generation stopped because the generated images have prohibited content."""
NO_IMAGE = 'NO_IMAGE'
"""The model was expected to generate an image, but none was generated."""
IMAGE_RECITATION = 'IMAGE_RECITATION'
"""Image generation stopped because the generated image may be a recitation from a source."""
IMAGE_OTHER = 'IMAGE_OTHER'
"""Image generation stopped for a reason not otherwise specified."""
class HarmProbability(_common.CaseInSensitiveEnum):
"""Output only. The probability of harm for this category."""
HARM_PROBABILITY_UNSPECIFIED = 'HARM_PROBABILITY_UNSPECIFIED'
"""The harm probability is unspecified."""
NEGLIGIBLE = 'NEGLIGIBLE'
"""The harm probability is negligible."""
LOW = 'LOW'
"""The harm probability is low."""
MEDIUM = 'MEDIUM'
"""The harm probability is medium."""
HIGH = 'HIGH'
"""The harm probability is high."""
class HarmSeverity(_common.CaseInSensitiveEnum):
"""Output only.
The severity of harm for this category. This enum is not supported in Gemini
API.
"""
HARM_SEVERITY_UNSPECIFIED = 'HARM_SEVERITY_UNSPECIFIED'
"""The harm severity is unspecified."""
HARM_SEVERITY_NEGLIGIBLE = 'HARM_SEVERITY_NEGLIGIBLE'
"""The harm severity is negligible."""
HARM_SEVERITY_LOW = 'HARM_SEVERITY_LOW'
"""The harm severity is low."""
HARM_SEVERITY_MEDIUM = 'HARM_SEVERITY_MEDIUM'
"""The harm severity is medium."""
HARM_SEVERITY_HIGH = 'HARM_SEVERITY_HIGH'
"""The harm severity is high."""
class UrlRetrievalStatus(_common.CaseInSensitiveEnum):
"""The status of the URL retrieval."""
URL_RETRIEVAL_STATUS_UNSPECIFIED = 'URL_RETRIEVAL_STATUS_UNSPECIFIED'
"""Default value. This value is unused."""
URL_RETRIEVAL_STATUS_SUCCESS = 'URL_RETRIEVAL_STATUS_SUCCESS'
"""The URL was retrieved successfully."""
URL_RETRIEVAL_STATUS_ERROR = 'URL_RETRIEVAL_STATUS_ERROR'
"""The URL retrieval failed."""
URL_RETRIEVAL_STATUS_PAYWALL = 'URL_RETRIEVAL_STATUS_PAYWALL'
"""Url retrieval is failed because the content is behind paywall. This enum value is not supported in Vertex AI."""
URL_RETRIEVAL_STATUS_UNSAFE = 'URL_RETRIEVAL_STATUS_UNSAFE'
"""Url retrieval is failed because the content is unsafe. This enum value is not supported in Vertex AI."""
class BlockedReason(_common.CaseInSensitiveEnum):
"""Output only. The reason why the prompt was blocked."""
BLOCKED_REASON_UNSPECIFIED = 'BLOCKED_REASON_UNSPECIFIED'
"""The blocked reason is unspecified."""
SAFETY = 'SAFETY'
"""The prompt was blocked for safety reasons."""
OTHER = 'OTHER'
"""The prompt was blocked for other reasons. For example, it may be due to the prompt's language, or because it contains other harmful content."""
BLOCKLIST = 'BLOCKLIST'
"""The prompt was blocked because it contains a term from the terminology blocklist."""
PROHIBITED_CONTENT = 'PROHIBITED_CONTENT'
"""The prompt was blocked because it contains prohibited content."""
IMAGE_SAFETY = 'IMAGE_SAFETY'
"""The prompt was blocked because it contains content that is unsafe for image generation."""
MODEL_ARMOR = 'MODEL_ARMOR'
"""The prompt was blocked by Model Armor. This enum value is not supported in Gemini API."""
JAILBREAK = 'JAILBREAK'
"""The prompt was blocked as a jailbreak attempt. This enum value is not supported in Gemini API."""
class TrafficType(_common.CaseInSensitiveEnum):
"""Output only.
The traffic type for this request. This enum is not supported in Gemini API.
"""
TRAFFIC_TYPE_UNSPECIFIED = 'TRAFFIC_TYPE_UNSPECIFIED'
"""Unspecified request traffic type."""
ON_DEMAND = 'ON_DEMAND'
"""The request was processed using Pay-As-You-Go quota."""
ON_DEMAND_PRIORITY = 'ON_DEMAND_PRIORITY'
"""Type for Priority Pay-As-You-Go traffic."""
ON_DEMAND_FLEX = 'ON_DEMAND_FLEX'
"""Type for Flex traffic."""
PROVISIONED_THROUGHPUT = 'PROVISIONED_THROUGHPUT'
"""Type for Provisioned Throughput traffic."""
class Modality(_common.CaseInSensitiveEnum):
"""Server content modalities."""
MODALITY_UNSPECIFIED = 'MODALITY_UNSPECIFIED'
"""The modality is unspecified."""
TEXT = 'TEXT'
"""Indicates the model should return text"""
IMAGE = 'IMAGE'
"""Indicates the model should return images."""
AUDIO = 'AUDIO'
"""Indicates the model should return audio."""
class ModelStage(_common.CaseInSensitiveEnum):
"""The stage of the underlying model.
This enum is not supported in Vertex AI.
"""
MODEL_STAGE_UNSPECIFIED = 'MODEL_STAGE_UNSPECIFIED'
"""Unspecified model stage."""
UNSTABLE_EXPERIMENTAL = 'UNSTABLE_EXPERIMENTAL'
"""The underlying model is subject to lots of tunings."""
EXPERIMENTAL = 'EXPERIMENTAL'
"""Models in this stage are for experimental purposes only."""
PREVIEW = 'PREVIEW'
"""Models in this stage are more mature than experimental models."""
STABLE = 'STABLE'
"""Models in this stage are considered stable and ready for production use."""
LEGACY = 'LEGACY'
"""If the model is on this stage, it means that this model is on the path to deprecation in near future. Only existing customers can use this model."""
DEPRECATED = 'DEPRECATED'
"""Models in this stage are deprecated. These models cannot be used."""
RETIRED = 'RETIRED'
"""Models in this stage are retired. These models cannot be used."""
class MediaResolution(_common.CaseInSensitiveEnum):
"""The media resolution to use."""
MEDIA_RESOLUTION_UNSPECIFIED = 'MEDIA_RESOLUTION_UNSPECIFIED'
"""Media resolution has not been set"""
MEDIA_RESOLUTION_LOW = 'MEDIA_RESOLUTION_LOW'
"""Media resolution set to low (64 tokens)."""
MEDIA_RESOLUTION_MEDIUM = 'MEDIA_RESOLUTION_MEDIUM'
"""Media resolution set to medium (256 tokens)."""
MEDIA_RESOLUTION_HIGH = 'MEDIA_RESOLUTION_HIGH'
"""Media resolution set to high (zoomed reframing with 256 tokens)."""
class TuningMode(_common.CaseInSensitiveEnum):
"""Tuning mode. This enum is not supported in Gemini API."""
TUNING_MODE_UNSPECIFIED = 'TUNING_MODE_UNSPECIFIED'
"""Tuning mode is unspecified."""
TUNING_MODE_FULL = 'TUNING_MODE_FULL'
"""Full fine-tuning mode."""
TUNING_MODE_PEFT_ADAPTER = 'TUNING_MODE_PEFT_ADAPTER'
"""PEFT adapter tuning mode."""
class AdapterSize(_common.CaseInSensitiveEnum):
"""Adapter size for tuning. This enum is not supported in Gemini API."""
ADAPTER_SIZE_UNSPECIFIED = 'ADAPTER_SIZE_UNSPECIFIED'
"""Adapter size is unspecified."""
ADAPTER_SIZE_ONE = 'ADAPTER_SIZE_ONE'
"""Adapter size 1."""
ADAPTER_SIZE_TWO = 'ADAPTER_SIZE_TWO'
"""Adapter size 2."""
ADAPTER_SIZE_FOUR = 'ADAPTER_SIZE_FOUR'
"""Adapter size 4."""
ADAPTER_SIZE_EIGHT = 'ADAPTER_SIZE_EIGHT'
"""Adapter size 8."""
ADAPTER_SIZE_SIXTEEN = 'ADAPTER_SIZE_SIXTEEN'
"""Adapter size 16."""
ADAPTER_SIZE_THIRTY_TWO = 'ADAPTER_SIZE_THIRTY_TWO'
"""Adapter size 32."""
class JobState(_common.CaseInSensitiveEnum):
"""Job state."""
JOB_STATE_UNSPECIFIED = 'JOB_STATE_UNSPECIFIED'
"""The job state is unspecified."""
JOB_STATE_QUEUED = 'JOB_STATE_QUEUED'
"""The job has been just created or resumed and processing has not yet begun."""
JOB_STATE_PENDING = 'JOB_STATE_PENDING'
"""The service is preparing to run the job."""
JOB_STATE_RUNNING = 'JOB_STATE_RUNNING'
"""The job is in progress."""
JOB_STATE_SUCCEEDED = 'JOB_STATE_SUCCEEDED'
"""The job completed successfully."""
JOB_STATE_FAILED = 'JOB_STATE_FAILED'
"""The job failed."""
JOB_STATE_CANCELLING = 'JOB_STATE_CANCELLING'
"""The job is being cancelled. From this state the job may only go to either `JOB_STATE_SUCCEEDED`, `JOB_STATE_FAILED` or `JOB_STATE_CANCELLED`."""
JOB_STATE_CANCELLED = 'JOB_STATE_CANCELLED'
"""The job has been cancelled."""
JOB_STATE_PAUSED = 'JOB_STATE_PAUSED'
"""The job has been stopped, and can be resumed."""
JOB_STATE_EXPIRED = 'JOB_STATE_EXPIRED'
"""The job has expired."""
JOB_STATE_UPDATING = 'JOB_STATE_UPDATING'
"""The job is being updated. Only jobs in the `JOB_STATE_RUNNING` state can be updated. After updating, the job goes back to the `JOB_STATE_RUNNING` state."""
JOB_STATE_PARTIALLY_SUCCEEDED = 'JOB_STATE_PARTIALLY_SUCCEEDED'
"""The job is partially succeeded, some results may be missing due to errors."""
class TuningJobState(_common.CaseInSensitiveEnum):
"""Output only.
The detail state of the tuning job (while the overall `JobState` is running).
This enum is not supported in Gemini API.
"""
TUNING_JOB_STATE_UNSPECIFIED = 'TUNING_JOB_STATE_UNSPECIFIED'
"""Default tuning job state."""
TUNING_JOB_STATE_WAITING_FOR_QUOTA = 'TUNING_JOB_STATE_WAITING_FOR_QUOTA'
"""Tuning job is waiting for job quota."""
TUNING_JOB_STATE_PROCESSING_DATASET = 'TUNING_JOB_STATE_PROCESSING_DATASET'
"""Tuning job is validating the dataset."""
TUNING_JOB_STATE_WAITING_FOR_CAPACITY = (
'TUNING_JOB_STATE_WAITING_FOR_CAPACITY'
)
"""Tuning job is waiting for hardware capacity."""
TUNING_JOB_STATE_TUNING = 'TUNING_JOB_STATE_TUNING'
"""Tuning job is running."""
TUNING_JOB_STATE_POST_PROCESSING = 'TUNING_JOB_STATE_POST_PROCESSING'
"""Tuning job is doing some post processing steps."""
class AggregationMetric(_common.CaseInSensitiveEnum):
"""Aggregation metric. This enum is not supported in Gemini API."""
AGGREGATION_METRIC_UNSPECIFIED = 'AGGREGATION_METRIC_UNSPECIFIED'
"""Unspecified aggregation metric."""
AVERAGE = 'AVERAGE'
"""Average aggregation metric. Not supported for Pairwise metric."""
MODE = 'MODE'
"""Mode aggregation metric."""
STANDARD_DEVIATION = 'STANDARD_DEVIATION'
"""Standard deviation aggregation metric. Not supported for pairwise metric."""
VARIANCE = 'VARIANCE'
"""Variance aggregation metric. Not supported for pairwise metric."""
MINIMUM = 'MINIMUM'
"""Minimum aggregation metric. Not supported for pairwise metric."""
MAXIMUM = 'MAXIMUM'
"""Maximum aggregation metric. Not supported for pairwise metric."""
MEDIAN = 'MEDIAN'
"""Median aggregation metric. Not supported for pairwise metric."""
PERCENTILE_P90 = 'PERCENTILE_P90'
"""90th percentile aggregation metric. Not supported for pairwise metric."""
PERCENTILE_P95 = 'PERCENTILE_P95'
"""95th percentile aggregation metric. Not supported for pairwise metric."""
PERCENTILE_P99 = 'PERCENTILE_P99'
"""99th percentile aggregation metric. Not supported for pairwise metric."""
class PairwiseChoice(_common.CaseInSensitiveEnum):
"""Output only.
Pairwise metric choice. This enum is not supported in Gemini API.
"""
PAIRWISE_CHOICE_UNSPECIFIED = 'PAIRWISE_CHOICE_UNSPECIFIED'
"""Unspecified prediction choice."""
BASELINE = 'BASELINE'
"""Baseline prediction wins"""
CANDIDATE = 'CANDIDATE'
"""Candidate prediction wins"""
TIE = 'TIE'
"""Winner cannot be determined"""
class TuningTask(_common.CaseInSensitiveEnum):
"""The tuning task.
Either I2V or T2V. This enum is not supported in Gemini API.
"""
TUNING_TASK_UNSPECIFIED = 'TUNING_TASK_UNSPECIFIED'
"""Default value. This value is unused."""
TUNING_TASK_I2V = 'TUNING_TASK_I2V'
"""Tuning task for image to video."""
TUNING_TASK_T2V = 'TUNING_TASK_T2V'
"""Tuning task for text to video."""
TUNING_TASK_R2V = 'TUNING_TASK_R2V'
"""Tuning task for reference to video."""
class DocumentState(_common.CaseInSensitiveEnum):
"""Output only.
Current state of the `Document`. This enum is not supported in Vertex AI.
"""
STATE_UNSPECIFIED = 'STATE_UNSPECIFIED'
"""The default value. This value is used if the state is omitted."""
STATE_PENDING = 'STATE_PENDING'
"""Some `Chunks` of the `Document` are being processed (embedding and vector storage)."""
STATE_ACTIVE = 'STATE_ACTIVE'
"""All `Chunks` of the `Document` is processed and available for querying."""
STATE_FAILED = 'STATE_FAILED'
"""Some `Chunks` of the `Document` failed processing."""
class RubricContentType(_common.CaseInSensitiveEnum):
"""Represents the rubric content type."""
RUBRIC_CONTENT_TYPE_UNSPECIFIED = 'RUBRIC_CONTENT_TYPE_UNSPECIFIED'
"""Rubric content type is unspecified."""
PROPERTY = 'PROPERTY'
"""Generate rubrics based on properties."""
NL_QUESTION_ANSWER = 'NL_QUESTION_ANSWER'
"""Generate rubrics in an NL question answer format."""
PYTHON_CODE_ASSERTION = 'PYTHON_CODE_ASSERTION'
"""Generate rubrics in a unit test format."""
class ComputationBasedMetricType(_common.CaseInSensitiveEnum):
"""Represents the type of the computation based metric."""
COMPUTATION_BASED_METRIC_TYPE_UNSPECIFIED = (
'COMPUTATION_BASED_METRIC_TYPE_UNSPECIFIED'
)
"""Computation based metric type is unspecified."""
EXACT_MATCH = 'EXACT_MATCH'
"""Exact match metric."""
BLEU = 'BLEU'
"""BLEU metric."""
ROUGE = 'ROUGE'
"""ROUGE metric."""
class PartMediaResolutionLevel(_common.CaseInSensitiveEnum):
"""The tokenization quality used for given media."""
MEDIA_RESOLUTION_UNSPECIFIED = 'MEDIA_RESOLUTION_UNSPECIFIED'
"""Media resolution has not been set."""
MEDIA_RESOLUTION_LOW = 'MEDIA_RESOLUTION_LOW'
"""Media resolution set to low."""
MEDIA_RESOLUTION_MEDIUM = 'MEDIA_RESOLUTION_MEDIUM'
"""Media resolution set to medium."""
MEDIA_RESOLUTION_HIGH = 'MEDIA_RESOLUTION_HIGH'
"""Media resolution set to high."""
MEDIA_RESOLUTION_ULTRA_HIGH = 'MEDIA_RESOLUTION_ULTRA_HIGH'
"""Media resolution set to ultra high."""
class ToolType(_common.CaseInSensitiveEnum):
"""The type of tool in the function call."""
TOOL_TYPE_UNSPECIFIED = 'TOOL_TYPE_UNSPECIFIED'
"""Unspecified tool type."""
GOOGLE_SEARCH_WEB = 'GOOGLE_SEARCH_WEB'
"""Google search tool, maps to Tool.google_search.search_types.web_search."""
GOOGLE_SEARCH_IMAGE = 'GOOGLE_SEARCH_IMAGE'
"""Image search tool, maps to Tool.google_search.search_types.image_search."""
URL_CONTEXT = 'URL_CONTEXT'
"""URL context tool, maps to Tool.url_context."""
GOOGLE_MAPS = 'GOOGLE_MAPS'
"""Google maps tool, maps to Tool.google_maps."""
FILE_SEARCH = 'FILE_SEARCH'
"""File search tool, maps to Tool.file_search."""
class ResourceScope(_common.CaseInSensitiveEnum):
"""Resource scope."""
COLLECTION = 'COLLECTION'
"""When setting base_url, this value configures resource scope to be the collection.
The resource name will not include api version, project, or location.
For example, if base_url is set to "https://aiplatform.googleapis.com",
then the resource name for a Model would be
"https://aiplatform.googleapis.com/publishers/google/models/gemini-3-pro-preview"""
class ServiceTier(_common.CaseInSensitiveEnum):
"""Pricing and performance service tier."""
SERVICE_TIER_UNSPECIFIED = 'SERVICE_TIER_UNSPECIFIED'
"""Default service tier, which is standard."""
SERVICE_TIER_FLEX = 'SERVICE_TIER_FLEX'
"""Flex service tier."""
SERVICE_TIER_STANDARD = 'SERVICE_TIER_STANDARD'
"""Standard service tier."""
SERVICE_TIER_PRIORITY = 'SERVICE_TIER_PRIORITY'
"""Priority service tier."""
class JSONSchemaType(Enum):
"""The type of the data supported by JSON Schema.
The values of the enums are lower case strings, while the values of the enums
for the Type class are upper case strings.
"""
NULL = 'null'
BOOLEAN = 'boolean'
OBJECT = 'object'
ARRAY = 'array'
NUMBER = 'number'
INTEGER = 'integer'
STRING = 'string'
class FeatureSelectionPreference(_common.CaseInSensitiveEnum):
"""Options for feature selection preference."""
FEATURE_SELECTION_PREFERENCE_UNSPECIFIED = (
'FEATURE_SELECTION_PREFERENCE_UNSPECIFIED'
)
PRIORITIZE_QUALITY = 'PRIORITIZE_QUALITY'
BALANCED = 'BALANCED'
PRIORITIZE_COST = 'PRIORITIZE_COST'
class EmbeddingApiType(_common.CaseInSensitiveEnum):
"""Enum representing the Vertex embedding API to use."""
PREDICT = 'PREDICT'
"""predict API endpoint (default)"""
EMBED_CONTENT = 'EMBED_CONTENT'
"""embedContent API Endpoint"""
class SafetyFilterLevel(_common.CaseInSensitiveEnum):
"""Enum that controls the safety filter level for objectionable content."""
BLOCK_LOW_AND_ABOVE = 'BLOCK_LOW_AND_ABOVE'
BLOCK_MEDIUM_AND_ABOVE = 'BLOCK_MEDIUM_AND_ABOVE'
BLOCK_ONLY_HIGH = 'BLOCK_ONLY_HIGH'
BLOCK_NONE = 'BLOCK_NONE'
class ImagePromptLanguage(_common.CaseInSensitiveEnum):
"""Enum that specifies the language of the text in the prompt."""
auto = 'auto'
"""Auto-detect the language."""
en = 'en'
"""English"""
ja = 'ja'
"""Japanese"""
ko = 'ko'
"""Korean"""
hi = 'hi'
"""Hindi"""
zh = 'zh'
"""Chinese"""
pt = 'pt'
"""Portuguese"""
es = 'es'
"""Spanish"""
class MaskReferenceMode(_common.CaseInSensitiveEnum):
"""Enum representing the mask mode of a mask reference image."""
MASK_MODE_DEFAULT = 'MASK_MODE_DEFAULT'
MASK_MODE_USER_PROVIDED = 'MASK_MODE_USER_PROVIDED'
MASK_MODE_BACKGROUND = 'MASK_MODE_BACKGROUND'
MASK_MODE_FOREGROUND = 'MASK_MODE_FOREGROUND'
MASK_MODE_SEMANTIC = 'MASK_MODE_SEMANTIC'
class ControlReferenceType(_common.CaseInSensitiveEnum):
"""Enum representing the control type of a control reference image."""
CONTROL_TYPE_DEFAULT = 'CONTROL_TYPE_DEFAULT'
CONTROL_TYPE_CANNY = 'CONTROL_TYPE_CANNY'
CONTROL_TYPE_SCRIBBLE = 'CONTROL_TYPE_SCRIBBLE'
CONTROL_TYPE_FACE_MESH = 'CONTROL_TYPE_FACE_MESH'
class SubjectReferenceType(_common.CaseInSensitiveEnum):
"""Enum representing the subject type of a subject reference image."""
SUBJECT_TYPE_DEFAULT = 'SUBJECT_TYPE_DEFAULT'
SUBJECT_TYPE_PERSON = 'SUBJECT_TYPE_PERSON'
SUBJECT_TYPE_ANIMAL = 'SUBJECT_TYPE_ANIMAL'
SUBJECT_TYPE_PRODUCT = 'SUBJECT_TYPE_PRODUCT'
class EditMode(_common.CaseInSensitiveEnum):
"""Enum representing the editing mode."""
EDIT_MODE_DEFAULT = 'EDIT_MODE_DEFAULT'
EDIT_MODE_INPAINT_REMOVAL = 'EDIT_MODE_INPAINT_REMOVAL'
EDIT_MODE_INPAINT_INSERTION = 'EDIT_MODE_INPAINT_INSERTION'
EDIT_MODE_OUTPAINT = 'EDIT_MODE_OUTPAINT'
EDIT_MODE_CONTROLLED_EDITING = 'EDIT_MODE_CONTROLLED_EDITING'
EDIT_MODE_STYLE = 'EDIT_MODE_STYLE'
EDIT_MODE_BGSWAP = 'EDIT_MODE_BGSWAP'
EDIT_MODE_PRODUCT_IMAGE = 'EDIT_MODE_PRODUCT_IMAGE'
class SegmentMode(_common.CaseInSensitiveEnum):
"""Enum that represents the segmentation mode."""
FOREGROUND = 'FOREGROUND'
BACKGROUND = 'BACKGROUND'
PROMPT = 'PROMPT'
SEMANTIC = 'SEMANTIC'
INTERACTIVE = 'INTERACTIVE'
class VideoGenerationReferenceType(_common.CaseInSensitiveEnum):
"""Enum for the reference type of a video generation reference image."""
ASSET = 'ASSET'
"""A reference image that provides assets to the generated video,
such as the scene, an object, a character, etc."""
STYLE = 'STYLE'
"""A reference image that provides aesthetics including colors,
lighting, texture, etc., to be used as the style of the generated video,
such as 'anime', 'photography', 'origami', etc."""
class VideoGenerationMaskMode(_common.CaseInSensitiveEnum):
"""Enum for the mask mode of a video generation mask."""
INSERT = 'INSERT'
"""The image mask contains a masked rectangular region which is
applied on the first frame of the input video. The object described in
the prompt is inserted into this region and will appear in subsequent
frames."""
REMOVE = 'REMOVE'
"""The image mask is used to determine an object in the
first video frame to track. This object is removed from the video."""
REMOVE_STATIC = 'REMOVE_STATIC'
"""The image mask is used to determine a region in the
video. Objects in this region will be removed."""
OUTPAINT = 'OUTPAINT'
"""The image mask contains a masked rectangular region where
the input video will go. The remaining area will be generated. Video
masks are not supported."""
class VideoCompressionQuality(_common.CaseInSensitiveEnum):
"""Enum that controls the compression quality of the generated videos."""
OPTIMIZED = 'OPTIMIZED'
"""Optimized video compression quality. This will produce videos