google-genai 1.48.0__py3-none-any.whl → 1.49.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/types.py CHANGED
@@ -19,12 +19,13 @@ from abc import ABC, abstractmethod
19
19
  import datetime
20
20
  from enum import Enum, EnumMeta
21
21
  import inspect
22
+ import io
22
23
  import json
23
24
  import logging
24
25
  import sys
25
26
  import types as builtin_types
26
27
  import typing
27
- from typing import Any, Callable, Literal, Optional, Sequence, Union, _UnionGenericAlias # type: ignore
28
+ from typing import Any, Callable, Dict, List, Literal, Optional, Sequence, Union, _UnionGenericAlias # type: ignore
28
29
  import pydantic
29
30
  from pydantic import ConfigDict, Field, PrivateAttr, model_validator
30
31
  from typing_extensions import Self, TypedDict
@@ -32,6 +33,8 @@ from . import _common
32
33
  from ._operations_converters import (
33
34
  _GenerateVideosOperation_from_mldev,
34
35
  _GenerateVideosOperation_from_vertex,
36
+ _ImportFileOperation_from_mldev,
37
+ _UploadToFileSearchStoreOperation_from_mldev,
35
38
  )
36
39
 
37
40
 
@@ -182,6 +185,20 @@ class Mode(_common.CaseInSensitiveEnum):
182
185
  """Run retrieval only when system decides it is necessary."""
183
186
 
184
187
 
188
+ class ApiSpec(_common.CaseInSensitiveEnum):
189
+ """The API spec that the external API implements.
190
+
191
+ This enum is not supported in Gemini API.
192
+ """
193
+
194
+ API_SPEC_UNSPECIFIED = 'API_SPEC_UNSPECIFIED'
195
+ """Unspecified API spec. This value should not be used."""
196
+ SIMPLE_SEARCH = 'SIMPLE_SEARCH'
197
+ """Simple search API spec."""
198
+ ELASTIC_SEARCH = 'ELASTIC_SEARCH'
199
+ """Elastic search API spec."""
200
+
201
+
185
202
  class AuthType(_common.CaseInSensitiveEnum):
186
203
  """Type of auth scheme. This enum is not supported in Gemini API."""
187
204
 
@@ -200,18 +217,20 @@ class AuthType(_common.CaseInSensitiveEnum):
200
217
  """OpenID Connect (OIDC) Auth."""
201
218
 
202
219
 
203
- class ApiSpec(_common.CaseInSensitiveEnum):
204
- """The API spec that the external API implements.
205
-
206
- This enum is not supported in Gemini API.
207
- """
220
+ class HttpElementLocation(_common.CaseInSensitiveEnum):
221
+ """The location of the API key. This enum is not supported in Gemini API."""
208
222
 
209
- API_SPEC_UNSPECIFIED = 'API_SPEC_UNSPECIFIED'
210
- """Unspecified API spec. This value should not be used."""
211
- SIMPLE_SEARCH = 'SIMPLE_SEARCH'
212
- """Simple search API spec."""
213
- ELASTIC_SEARCH = 'ELASTIC_SEARCH'
214
- """Elastic search API spec."""
223
+ HTTP_IN_UNSPECIFIED = 'HTTP_IN_UNSPECIFIED'
224
+ HTTP_IN_QUERY = 'HTTP_IN_QUERY'
225
+ """Element is in the HTTP request query."""
226
+ HTTP_IN_HEADER = 'HTTP_IN_HEADER'
227
+ """Element is in the HTTP request header."""
228
+ HTTP_IN_PATH = 'HTTP_IN_PATH'
229
+ """Element is in the HTTP request path."""
230
+ HTTP_IN_BODY = 'HTTP_IN_BODY'
231
+ """Element is in the HTTP request body."""
232
+ HTTP_IN_COOKIE = 'HTTP_IN_COOKIE'
233
+ """Element is in the HTTP request cookie."""
215
234
 
216
235
 
217
236
  class PhishBlockThreshold(_common.CaseInSensitiveEnum):
@@ -409,14 +428,13 @@ class BlockedReason(_common.CaseInSensitiveEnum):
409
428
  class TrafficType(_common.CaseInSensitiveEnum):
410
429
  """Output only.
411
430
 
412
- Traffic type. This shows whether a request consumes Pay-As-You-Go or
413
- Provisioned Throughput quota. This enum is not supported in Gemini API.
431
+ The traffic type for this request. This enum is not supported in Gemini API.
414
432
  """
415
433
 
416
434
  TRAFFIC_TYPE_UNSPECIFIED = 'TRAFFIC_TYPE_UNSPECIFIED'
417
435
  """Unspecified request traffic type."""
418
436
  ON_DEMAND = 'ON_DEMAND'
419
- """Type for Pay-As-You-Go traffic."""
437
+ """The request was processed using Pay-As-You-Go quota."""
420
438
  PROVISIONED_THROUGHPUT = 'PROVISIONED_THROUGHPUT'
421
439
  """Type for Provisioned Throughput traffic."""
422
440
 
@@ -518,6 +536,8 @@ class TuningTask(_common.CaseInSensitiveEnum):
518
536
  """Tuning task for image to video."""
519
537
  TUNING_TASK_T2V = 'TUNING_TASK_T2V'
520
538
  """Tuning task for text to video."""
539
+ TUNING_TASK_R2V = 'TUNING_TASK_R2V'
540
+ """Tuning task for reference to video."""
521
541
 
522
542
 
523
543
  class JSONSchemaType(Enum):
@@ -735,6 +755,15 @@ class TuningMethod(_common.CaseInSensitiveEnum):
735
755
  """Preference optimization tuning."""
736
756
 
737
757
 
758
+ class DocumentState(_common.CaseInSensitiveEnum):
759
+ """State for the lifecycle of a Document."""
760
+
761
+ STATE_UNSPECIFIED = 'STATE_UNSPECIFIED'
762
+ STATE_PENDING = 'STATE_PENDING'
763
+ STATE_ACTIVE = 'STATE_ACTIVE'
764
+ STATE_FAILED = 'STATE_FAILED'
765
+
766
+
738
767
  class FileState(_common.CaseInSensitiveEnum):
739
768
  """State for the lifecycle of a File."""
740
769
 
@@ -904,7 +933,7 @@ class FunctionCall(_common.BaseModel):
904
933
  )
905
934
  name: Optional[str] = Field(
906
935
  default=None,
907
- description="""Required. The name of the function to call. Matches [FunctionDeclaration.name].""",
936
+ description="""Optional. The name of the function to call. Matches [FunctionDeclaration.name].""",
908
937
  )
909
938
 
910
939
 
@@ -919,7 +948,7 @@ class FunctionCallDict(TypedDict, total=False):
919
948
  """Optional. The function parameters and values in JSON object format. See [FunctionDeclaration.parameters] for parameter details."""
920
949
 
921
950
  name: Optional[str]
922
- """Required. The name of the function to call. Matches [FunctionDeclaration.name]."""
951
+ """Optional. The name of the function to call. Matches [FunctionDeclaration.name]."""
923
952
 
924
953
 
925
954
  FunctionCallOrDict = Union[FunctionCall, FunctionCallDict]
@@ -1360,6 +1389,81 @@ class Part(_common.BaseModel):
1360
1389
  description="""Optional. Video metadata. The metadata should only be specified while the video data is presented in inline_data or file_data.""",
1361
1390
  )
1362
1391
 
1392
+ def __init__(
1393
+ self,
1394
+ value: Optional['PartUnionDict'] = None,
1395
+ /,
1396
+ *,
1397
+ video_metadata: Optional[VideoMetadata] = None,
1398
+ thought: Optional[bool] = None,
1399
+ inline_data: Optional[Blob] = None,
1400
+ file_data: Optional[FileData] = None,
1401
+ thought_signature: Optional[bytes] = None,
1402
+ function_call: Optional[FunctionCall] = None,
1403
+ code_execution_result: Optional[CodeExecutionResult] = None,
1404
+ executable_code: Optional[ExecutableCode] = None,
1405
+ function_response: Optional[FunctionResponse] = None,
1406
+ text: Optional[str] = None,
1407
+ # Pydantic allows CamelCase in addition to snake_case attribute
1408
+ # names. kwargs here catch these aliases.
1409
+ **kwargs: Any,
1410
+ ):
1411
+ part_dict = dict(
1412
+ video_metadata=video_metadata,
1413
+ thought=thought,
1414
+ inline_data=inline_data,
1415
+ file_data=file_data,
1416
+ thought_signature=thought_signature,
1417
+ function_call=function_call,
1418
+ code_execution_result=code_execution_result,
1419
+ executable_code=executable_code,
1420
+ function_response=function_response,
1421
+ text=text,
1422
+ )
1423
+ part_dict = {k: v for k, v in part_dict.items() if v is not None}
1424
+
1425
+ if part_dict and value is not None:
1426
+ raise ValueError(
1427
+ 'Positional and keyword arguments can not be combined when '
1428
+ 'initializing a Part.'
1429
+ )
1430
+
1431
+ if value is None:
1432
+ pass
1433
+ elif isinstance(value, str):
1434
+ part_dict['text'] = value
1435
+ elif isinstance(value, File):
1436
+ if not value.uri or not value.mime_type:
1437
+ raise ValueError('file uri and mime_type are required.')
1438
+ part_dict['file_data'] = FileData(
1439
+ file_uri=value.uri,
1440
+ mime_type=value.mime_type,
1441
+ display_name=value.display_name,
1442
+ )
1443
+ elif isinstance(value, dict):
1444
+ try:
1445
+ Part.model_validate(value)
1446
+ part_dict.update(value) # type: ignore[arg-type]
1447
+ except pydantic.ValidationError:
1448
+ part_dict['file_data'] = FileData.model_validate(value)
1449
+ elif isinstance(value, Part):
1450
+ part_dict.update(value.dict())
1451
+ elif 'image' in value.__class__.__name__.lower():
1452
+ # PIL.Image case.
1453
+
1454
+ suffix = value.format.lower() if value.format else 'jpeg'
1455
+ mimetype = f'image/{suffix}'
1456
+ bytes_io = io.BytesIO()
1457
+ value.save(bytes_io, suffix.upper())
1458
+
1459
+ part_dict['inline_data'] = Blob(
1460
+ data=bytes_io.getvalue(), mime_type=mimetype
1461
+ )
1462
+ else:
1463
+ raise ValueError(f'Unsupported content part type: {type(value)}')
1464
+
1465
+ super().__init__(**part_dict, **kwargs)
1466
+
1363
1467
  def as_image(self) -> Optional['Image']:
1364
1468
  """Returns the part as a PIL Image, or None if the part is not an image."""
1365
1469
  if not self.inline_data:
@@ -1905,8 +2009,39 @@ class Schema(_common.BaseModel):
1905
2009
  def json_schema(self) -> JSONSchema:
1906
2010
  """Converts the Schema object to a JSONSchema object, that is compatible with 2020-12 JSON Schema draft.
1907
2011
 
1908
- If a Schema field is not supported by JSONSchema, it will be ignored.
2012
+ Note: Conversion of fields that are not included in the JSONSchema class
2013
+ are ignored.
2014
+ Json Schema is now supported natively by both Vertex AI and Gemini API.
2015
+ Users
2016
+ are recommended to pass/receive Json Schema directly to/from the API. For
2017
+ example:
2018
+ 1. the counter part of GenerateContentConfig.response_schema is
2019
+ GenerateContentConfig.response_json_schema, which accepts [JSON
2020
+ Schema](https://json-schema.org/)
2021
+ 2. the counter part of FunctionDeclaration.parameters is
2022
+ FunctionDeclaration.parameters_json_schema, which accepts [JSON
2023
+ Schema](https://json-schema.org/)
2024
+ 3. the counter part of FunctionDeclaration.response is
2025
+ FunctionDeclaration.response_json_schema, which accepts [JSON
2026
+ Schema](https://json-schema.org/)
1909
2027
  """
2028
+
2029
+ info_message = """
2030
+ Note: Conversion of fields that are not included in the JSONSchema class are
2031
+ ignored.
2032
+ Json Schema is now supported natively by both Vertex AI and Gemini API. Users
2033
+ are recommended to pass/receive Json Schema directly to/from the API. For example:
2034
+ 1. the counter part of GenerateContentConfig.response_schema is
2035
+ GenerateContentConfig.response_json_schema, which accepts [JSON
2036
+ Schema](https://json-schema.org/)
2037
+ 2. the counter part of FunctionDeclaration.parameters is
2038
+ FunctionDeclaration.parameters_json_schema, which accepts [JSON
2039
+ Schema](https://json-schema.org/)
2040
+ 3. the counter part of FunctionDeclaration.response is
2041
+ FunctionDeclaration.response_json_schema, which accepts [JSON
2042
+ Schema](https://json-schema.org/)
2043
+ """
2044
+ logger.info(info_message)
1910
2045
  json_schema_field_names: set[str] = set(JSONSchema.model_fields.keys())
1911
2046
  schema_field_names: tuple[str] = (
1912
2047
  'items',
@@ -1977,27 +2112,57 @@ class Schema(_common.BaseModel):
1977
2112
  ) -> 'Schema':
1978
2113
  """Converts a JSONSchema object to a Schema object.
1979
2114
 
1980
- The JSONSchema is compatible with 2020-12 JSON Schema draft, specified by
1981
- OpenAPI 3.1.
1982
-
1983
- Args:
1984
- json_schema: JSONSchema object to be converted.
1985
- api_option: API option to be used. If set to 'VERTEX_AI', the JSONSchema
1986
- will be converted to a Schema object that is compatible with Vertex AI
1987
- API. If set to 'GEMINI_API', the JSONSchema will be converted to a
1988
- Schema object that is compatible with Gemini API. Default is
1989
- 'GEMINI_API'.
1990
- raise_error_on_unsupported_field: If set to True, an error will be
1991
- raised if the JSONSchema contains any unsupported fields. Default is
1992
- False.
1993
-
1994
- Returns:
1995
- Schema object that is compatible with the specified API option.
1996
- Raises:
1997
- ValueError: If the JSONSchema contains any unsupported fields and
1998
- raise_error_on_unsupported_field is set to True. Or if the JSONSchema
1999
- is not compatible with the specified API option.
2115
+ Note: Conversion of fields that are not included in the JSONSchema class
2116
+ are ignored.
2117
+ Json Schema is now supported natively by both Vertex AI and Gemini API.
2118
+ Users
2119
+ are recommended to pass/receive Json Schema directly to/from the API. For
2120
+ example:
2121
+ 1. the counter part of GenerateContentConfig.response_schema is
2122
+ GenerateContentConfig.response_json_schema, which accepts [JSON
2123
+ Schema](https://json-schema.org/)
2124
+ 2. the counter part of FunctionDeclaration.parameters is
2125
+ FunctionDeclaration.parameters_json_schema, which accepts [JSON
2126
+ Schema](https://json-schema.org/)
2127
+ 3. the counter part of FunctionDeclaration.response is
2128
+ FunctionDeclaration.response_json_schema, which accepts [JSON
2129
+ Schema](https://json-schema.org/)
2130
+ The JSONSchema is compatible with 2020-12 JSON Schema draft, specified by
2131
+ OpenAPI 3.1.
2132
+
2133
+ Args:
2134
+ json_schema: JSONSchema object to be converted.
2135
+ api_option: API option to be used. If set to 'VERTEX_AI', the
2136
+ JSONSchema will be converted to a Schema object that is compatible
2137
+ with Vertex AI API. If set to 'GEMINI_API', the JSONSchema will be
2138
+ converted to a Schema object that is compatible with Gemini API.
2139
+ Default is 'GEMINI_API'.
2140
+ raise_error_on_unsupported_field: If set to True, an error will be
2141
+ raised if the JSONSchema contains any unsupported fields. Default is
2142
+ False.
2143
+
2144
+ Returns:
2145
+ Schema object that is compatible with the specified API option.
2146
+ Raises:
2147
+ ValueError: If the JSONSchema contains any unsupported fields and
2148
+ raise_error_on_unsupported_field is set to True. Or if the JSONSchema
2149
+ is not compatible with the specified API option.
2000
2150
  """
2151
+ info_message = """
2152
+ Note: Conversion of fields that are not included in the JSONSchema class are ignored.
2153
+ Json Schema is now supported natively by both Vertex AI and Gemini API. Users
2154
+ are recommended to pass/receive Json Schema directly to/from the API. For example:
2155
+ 1. the counter part of GenerateContentConfig.response_schema is
2156
+ GenerateContentConfig.response_json_schema, which accepts [JSON
2157
+ Schema](https://json-schema.org/)
2158
+ 2. the counter part of FunctionDeclaration.parameters is
2159
+ FunctionDeclaration.parameters_json_schema, which accepts [JSON
2160
+ Schema](https://json-schema.org/)
2161
+ 3. the counter part of FunctionDeclaration.response is
2162
+ FunctionDeclaration.response_json_schema, which accepts [JSON
2163
+ Schema](https://json-schema.org/)
2164
+ """
2165
+ logger.info(info_message)
2001
2166
  google_schema_field_names: set[str] = set(cls.model_fields.keys())
2002
2167
  schema_field_names: tuple[str, ...] = (
2003
2168
  'items',
@@ -2713,20 +2878,166 @@ GoogleSearchRetrievalOrDict = Union[
2713
2878
  ]
2714
2879
 
2715
2880
 
2881
+ class ComputerUse(_common.BaseModel):
2882
+ """Tool to support computer use."""
2883
+
2884
+ environment: Optional[Environment] = Field(
2885
+ default=None, description="""Required. The environment being operated."""
2886
+ )
2887
+ excluded_predefined_functions: Optional[list[str]] = Field(
2888
+ default=None,
2889
+ description="""By default, predefined functions are included in the final model call.
2890
+ Some of them can be explicitly excluded from being automatically included.
2891
+ This can serve two purposes:
2892
+ 1. Using a more restricted / different action space.
2893
+ 2. Improving the definitions / instructions of predefined functions.""",
2894
+ )
2895
+
2896
+
2897
+ class ComputerUseDict(TypedDict, total=False):
2898
+ """Tool to support computer use."""
2899
+
2900
+ environment: Optional[Environment]
2901
+ """Required. The environment being operated."""
2902
+
2903
+ excluded_predefined_functions: Optional[list[str]]
2904
+ """By default, predefined functions are included in the final model call.
2905
+ Some of them can be explicitly excluded from being automatically included.
2906
+ This can serve two purposes:
2907
+ 1. Using a more restricted / different action space.
2908
+ 2. Improving the definitions / instructions of predefined functions."""
2909
+
2910
+
2911
+ ComputerUseOrDict = Union[ComputerUse, ComputerUseDict]
2912
+
2913
+
2914
+ class FileSearch(_common.BaseModel):
2915
+ """Tool to retrieve knowledge from the File Search Stores."""
2916
+
2917
+ file_search_store_names: Optional[list[str]] = Field(
2918
+ default=None,
2919
+ description="""The names of the file_search_stores to retrieve from.
2920
+ Example: `fileSearchStores/my-file-search-store-123`""",
2921
+ )
2922
+ top_k: Optional[int] = Field(
2923
+ default=None,
2924
+ description="""The number of file search retrieval chunks to retrieve.""",
2925
+ )
2926
+ metadata_filter: Optional[str] = Field(
2927
+ default=None,
2928
+ description="""Metadata filter to apply to the file search retrieval documents. See https://google.aip.dev/160 for the syntax of the filter expression.""",
2929
+ )
2930
+
2931
+
2932
+ class FileSearchDict(TypedDict, total=False):
2933
+ """Tool to retrieve knowledge from the File Search Stores."""
2934
+
2935
+ file_search_store_names: Optional[list[str]]
2936
+ """The names of the file_search_stores to retrieve from.
2937
+ Example: `fileSearchStores/my-file-search-store-123`"""
2938
+
2939
+ top_k: Optional[int]
2940
+ """The number of file search retrieval chunks to retrieve."""
2941
+
2942
+ metadata_filter: Optional[str]
2943
+ """Metadata filter to apply to the file search retrieval documents. See https://google.aip.dev/160 for the syntax of the filter expression."""
2944
+
2945
+
2946
+ FileSearchOrDict = Union[FileSearch, FileSearchDict]
2947
+
2948
+
2949
+ class ApiAuthApiKeyConfig(_common.BaseModel):
2950
+ """The API secret. This data type is not supported in Gemini API."""
2951
+
2952
+ api_key_secret_version: Optional[str] = Field(
2953
+ default=None,
2954
+ description="""Required. The SecretManager secret version resource name storing API key. e.g. projects/{project}/secrets/{secret}/versions/{version}""",
2955
+ )
2956
+ api_key_string: Optional[str] = Field(
2957
+ default=None,
2958
+ description="""The API key string. Either this or `api_key_secret_version` must be set.""",
2959
+ )
2960
+
2961
+
2962
+ class ApiAuthApiKeyConfigDict(TypedDict, total=False):
2963
+ """The API secret. This data type is not supported in Gemini API."""
2964
+
2965
+ api_key_secret_version: Optional[str]
2966
+ """Required. The SecretManager secret version resource name storing API key. e.g. projects/{project}/secrets/{secret}/versions/{version}"""
2967
+
2968
+ api_key_string: Optional[str]
2969
+ """The API key string. Either this or `api_key_secret_version` must be set."""
2970
+
2971
+
2972
+ ApiAuthApiKeyConfigOrDict = Union[ApiAuthApiKeyConfig, ApiAuthApiKeyConfigDict]
2973
+
2974
+
2975
+ class ApiAuth(_common.BaseModel):
2976
+ """The generic reusable api auth config.
2977
+
2978
+ Deprecated. Please use AuthConfig (google/cloud/aiplatform/master/auth.proto)
2979
+ instead. This data type is not supported in Gemini API.
2980
+ """
2981
+
2982
+ api_key_config: Optional[ApiAuthApiKeyConfig] = Field(
2983
+ default=None, description="""The API secret."""
2984
+ )
2985
+
2986
+
2987
+ class ApiAuthDict(TypedDict, total=False):
2988
+ """The generic reusable api auth config.
2989
+
2990
+ Deprecated. Please use AuthConfig (google/cloud/aiplatform/master/auth.proto)
2991
+ instead. This data type is not supported in Gemini API.
2992
+ """
2993
+
2994
+ api_key_config: Optional[ApiAuthApiKeyConfigDict]
2995
+ """The API secret."""
2996
+
2997
+
2998
+ ApiAuthOrDict = Union[ApiAuth, ApiAuthDict]
2999
+
3000
+
2716
3001
  class ApiKeyConfig(_common.BaseModel):
2717
- """Config for authentication with API key."""
3002
+ """Config for authentication with API key.
3003
+
3004
+ This data type is not supported in Gemini API.
3005
+ """
2718
3006
 
3007
+ api_key_secret: Optional[str] = Field(
3008
+ default=None,
3009
+ description="""Optional. The name of the SecretManager secret version resource storing the API key. Format: `projects/{project}/secrets/{secrete}/versions/{version}` - If both `api_key_secret` and `api_key_string` are specified, this field takes precedence over `api_key_string`. - If specified, the `secretmanager.versions.access` permission should be granted to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) on the specified resource.""",
3010
+ )
2719
3011
  api_key_string: Optional[str] = Field(
2720
3012
  default=None,
2721
- description="""The API key to be used in the request directly.""",
3013
+ description="""Optional. The API key to be used in the request directly.""",
3014
+ )
3015
+ http_element_location: Optional[HttpElementLocation] = Field(
3016
+ default=None, description="""Optional. The location of the API key."""
3017
+ )
3018
+ name: Optional[str] = Field(
3019
+ default=None,
3020
+ description="""Optional. The parameter name of the API key. E.g. If the API request is "https://example.com/act?api_key=", "api_key" would be the parameter name.""",
2722
3021
  )
2723
3022
 
2724
3023
 
2725
3024
  class ApiKeyConfigDict(TypedDict, total=False):
2726
- """Config for authentication with API key."""
3025
+ """Config for authentication with API key.
3026
+
3027
+ This data type is not supported in Gemini API.
3028
+ """
3029
+
3030
+ api_key_secret: Optional[str]
3031
+ """Optional. The name of the SecretManager secret version resource storing the API key. Format: `projects/{project}/secrets/{secrete}/versions/{version}` - If both `api_key_secret` and `api_key_string` are specified, this field takes precedence over `api_key_string`. - If specified, the `secretmanager.versions.access` permission should be granted to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) on the specified resource."""
2727
3032
 
2728
3033
  api_key_string: Optional[str]
2729
- """The API key to be used in the request directly."""
3034
+ """Optional. The API key to be used in the request directly."""
3035
+
3036
+ http_element_location: Optional[HttpElementLocation]
3037
+ """Optional. The location of the API key."""
3038
+
3039
+ name: Optional[str]
3040
+ """Optional. The parameter name of the API key. E.g. If the API request is "https://example.com/act?api_key=", "api_key" would be the parameter name."""
2730
3041
 
2731
3042
 
2732
3043
  ApiKeyConfigOrDict = Union[ApiKeyConfig, ApiKeyConfigDict]
@@ -2850,7 +3161,10 @@ AuthConfigOidcConfigOrDict = Union[
2850
3161
 
2851
3162
 
2852
3163
  class AuthConfig(_common.BaseModel):
2853
- """Auth configuration to run the extension."""
3164
+ """Auth configuration to run the extension.
3165
+
3166
+ This data type is not supported in Gemini API.
3167
+ """
2854
3168
 
2855
3169
  api_key_config: Optional[ApiKeyConfig] = Field(
2856
3170
  default=None, description="""Config for API key auth."""
@@ -2875,7 +3189,10 @@ class AuthConfig(_common.BaseModel):
2875
3189
 
2876
3190
 
2877
3191
  class AuthConfigDict(TypedDict, total=False):
2878
- """Auth configuration to run the extension."""
3192
+ """Auth configuration to run the extension.
3193
+
3194
+ This data type is not supported in Gemini API.
3195
+ """
2879
3196
 
2880
3197
  api_key_config: Optional[ApiKeyConfigDict]
2881
3198
  """Config for API key auth."""
@@ -2901,172 +3218,61 @@ class AuthConfigDict(TypedDict, total=False):
2901
3218
  AuthConfigOrDict = Union[AuthConfig, AuthConfigDict]
2902
3219
 
2903
3220
 
2904
- class GoogleMaps(_common.BaseModel):
2905
- """Tool to support Google Maps in Model."""
3221
+ class ExternalApiElasticSearchParams(_common.BaseModel):
3222
+ """The search parameters to use for the ELASTIC_SEARCH spec.
2906
3223
 
2907
- auth_config: Optional[AuthConfig] = Field(
2908
- default=None,
2909
- description="""Optional. Auth config for the Google Maps tool.""",
3224
+ This data type is not supported in Gemini API.
3225
+ """
3226
+
3227
+ index: Optional[str] = Field(
3228
+ default=None, description="""The ElasticSearch index to use."""
2910
3229
  )
2911
- enable_widget: Optional[bool] = Field(
3230
+ num_hits: Optional[int] = Field(
2912
3231
  default=None,
2913
- description="""Optional. If true, include the widget context token in the response.""",
3232
+ description="""Optional. Number of hits (chunks) to request. When specified, it is passed to Elasticsearch as the `num_hits` param.""",
3233
+ )
3234
+ search_template: Optional[str] = Field(
3235
+ default=None, description="""The ElasticSearch search template to use."""
2914
3236
  )
2915
3237
 
2916
3238
 
2917
- class GoogleMapsDict(TypedDict, total=False):
2918
- """Tool to support Google Maps in Model."""
3239
+ class ExternalApiElasticSearchParamsDict(TypedDict, total=False):
3240
+ """The search parameters to use for the ELASTIC_SEARCH spec.
2919
3241
 
2920
- auth_config: Optional[AuthConfigDict]
2921
- """Optional. Auth config for the Google Maps tool."""
3242
+ This data type is not supported in Gemini API.
3243
+ """
2922
3244
 
2923
- enable_widget: Optional[bool]
2924
- """Optional. If true, include the widget context token in the response."""
3245
+ index: Optional[str]
3246
+ """The ElasticSearch index to use."""
2925
3247
 
3248
+ num_hits: Optional[int]
3249
+ """Optional. Number of hits (chunks) to request. When specified, it is passed to Elasticsearch as the `num_hits` param."""
2926
3250
 
2927
- GoogleMapsOrDict = Union[GoogleMaps, GoogleMapsDict]
3251
+ search_template: Optional[str]
3252
+ """The ElasticSearch search template to use."""
2928
3253
 
2929
3254
 
2930
- class ComputerUse(_common.BaseModel):
2931
- """Tool to support computer use."""
3255
+ ExternalApiElasticSearchParamsOrDict = Union[
3256
+ ExternalApiElasticSearchParams, ExternalApiElasticSearchParamsDict
3257
+ ]
2932
3258
 
2933
- environment: Optional[Environment] = Field(
2934
- default=None, description="""Required. The environment being operated."""
2935
- )
2936
- excluded_predefined_functions: Optional[list[str]] = Field(
2937
- default=None,
2938
- description="""By default, predefined functions are included in the final model call.
2939
- Some of them can be explicitly excluded from being automatically included.
2940
- This can serve two purposes:
2941
- 1. Using a more restricted / different action space.
2942
- 2. Improving the definitions / instructions of predefined functions.""",
2943
- )
2944
3259
 
3260
+ class ExternalApiSimpleSearchParams(_common.BaseModel):
3261
+ """The search parameters to use for SIMPLE_SEARCH spec.
2945
3262
 
2946
- class ComputerUseDict(TypedDict, total=False):
2947
- """Tool to support computer use."""
3263
+ This data type is not supported in Gemini API.
3264
+ """
2948
3265
 
2949
- environment: Optional[Environment]
2950
- """Required. The environment being operated."""
3266
+ pass
2951
3267
 
2952
- excluded_predefined_functions: Optional[list[str]]
2953
- """By default, predefined functions are included in the final model call.
2954
- Some of them can be explicitly excluded from being automatically included.
2955
- This can serve two purposes:
2956
- 1. Using a more restricted / different action space.
2957
- 2. Improving the definitions / instructions of predefined functions."""
2958
3268
 
3269
+ class ExternalApiSimpleSearchParamsDict(TypedDict, total=False):
3270
+ """The search parameters to use for SIMPLE_SEARCH spec.
2959
3271
 
2960
- ComputerUseOrDict = Union[ComputerUse, ComputerUseDict]
3272
+ This data type is not supported in Gemini API.
3273
+ """
2961
3274
 
2962
-
2963
- class ApiAuthApiKeyConfig(_common.BaseModel):
2964
- """The API secret. This data type is not supported in Gemini API."""
2965
-
2966
- api_key_secret_version: Optional[str] = Field(
2967
- default=None,
2968
- description="""Required. The SecretManager secret version resource name storing API key. e.g. projects/{project}/secrets/{secret}/versions/{version}""",
2969
- )
2970
- api_key_string: Optional[str] = Field(
2971
- default=None,
2972
- description="""The API key string. Either this or `api_key_secret_version` must be set.""",
2973
- )
2974
-
2975
-
2976
- class ApiAuthApiKeyConfigDict(TypedDict, total=False):
2977
- """The API secret. This data type is not supported in Gemini API."""
2978
-
2979
- api_key_secret_version: Optional[str]
2980
- """Required. The SecretManager secret version resource name storing API key. e.g. projects/{project}/secrets/{secret}/versions/{version}"""
2981
-
2982
- api_key_string: Optional[str]
2983
- """The API key string. Either this or `api_key_secret_version` must be set."""
2984
-
2985
-
2986
- ApiAuthApiKeyConfigOrDict = Union[ApiAuthApiKeyConfig, ApiAuthApiKeyConfigDict]
2987
-
2988
-
2989
- class ApiAuth(_common.BaseModel):
2990
- """The generic reusable api auth config.
2991
-
2992
- Deprecated. Please use AuthConfig (google/cloud/aiplatform/master/auth.proto)
2993
- instead. This data type is not supported in Gemini API.
2994
- """
2995
-
2996
- api_key_config: Optional[ApiAuthApiKeyConfig] = Field(
2997
- default=None, description="""The API secret."""
2998
- )
2999
-
3000
-
3001
- class ApiAuthDict(TypedDict, total=False):
3002
- """The generic reusable api auth config.
3003
-
3004
- Deprecated. Please use AuthConfig (google/cloud/aiplatform/master/auth.proto)
3005
- instead. This data type is not supported in Gemini API.
3006
- """
3007
-
3008
- api_key_config: Optional[ApiAuthApiKeyConfigDict]
3009
- """The API secret."""
3010
-
3011
-
3012
- ApiAuthOrDict = Union[ApiAuth, ApiAuthDict]
3013
-
3014
-
3015
- class ExternalApiElasticSearchParams(_common.BaseModel):
3016
- """The search parameters to use for the ELASTIC_SEARCH spec.
3017
-
3018
- This data type is not supported in Gemini API.
3019
- """
3020
-
3021
- index: Optional[str] = Field(
3022
- default=None, description="""The ElasticSearch index to use."""
3023
- )
3024
- num_hits: Optional[int] = Field(
3025
- default=None,
3026
- description="""Optional. Number of hits (chunks) to request. When specified, it is passed to Elasticsearch as the `num_hits` param.""",
3027
- )
3028
- search_template: Optional[str] = Field(
3029
- default=None, description="""The ElasticSearch search template to use."""
3030
- )
3031
-
3032
-
3033
- class ExternalApiElasticSearchParamsDict(TypedDict, total=False):
3034
- """The search parameters to use for the ELASTIC_SEARCH spec.
3035
-
3036
- This data type is not supported in Gemini API.
3037
- """
3038
-
3039
- index: Optional[str]
3040
- """The ElasticSearch index to use."""
3041
-
3042
- num_hits: Optional[int]
3043
- """Optional. Number of hits (chunks) to request. When specified, it is passed to Elasticsearch as the `num_hits` param."""
3044
-
3045
- search_template: Optional[str]
3046
- """The ElasticSearch search template to use."""
3047
-
3048
-
3049
- ExternalApiElasticSearchParamsOrDict = Union[
3050
- ExternalApiElasticSearchParams, ExternalApiElasticSearchParamsDict
3051
- ]
3052
-
3053
-
3054
- class ExternalApiSimpleSearchParams(_common.BaseModel):
3055
- """The search parameters to use for SIMPLE_SEARCH spec.
3056
-
3057
- This data type is not supported in Gemini API.
3058
- """
3059
-
3060
- pass
3061
-
3062
-
3063
- class ExternalApiSimpleSearchParamsDict(TypedDict, total=False):
3064
- """The search parameters to use for SIMPLE_SEARCH spec.
3065
-
3066
- This data type is not supported in Gemini API.
3067
- """
3068
-
3069
- pass
3275
+ pass
3070
3276
 
3071
3277
 
3072
3278
  ExternalApiSimpleSearchParamsOrDict = Union[
@@ -3598,6 +3804,32 @@ class EnterpriseWebSearchDict(TypedDict, total=False):
3598
3804
  EnterpriseWebSearchOrDict = Union[EnterpriseWebSearch, EnterpriseWebSearchDict]
3599
3805
 
3600
3806
 
3807
+ class GoogleMaps(_common.BaseModel):
3808
+ """Tool to retrieve public maps data for grounding, powered by Google."""
3809
+
3810
+ auth_config: Optional[AuthConfig] = Field(
3811
+ default=None,
3812
+ description="""The authentication config to access the API. Only API key is supported. This field is not supported in Gemini API.""",
3813
+ )
3814
+ enable_widget: Optional[bool] = Field(
3815
+ default=None,
3816
+ description="""Optional. If true, include the widget context token in the response.""",
3817
+ )
3818
+
3819
+
3820
+ class GoogleMapsDict(TypedDict, total=False):
3821
+ """Tool to retrieve public maps data for grounding, powered by Google."""
3822
+
3823
+ auth_config: Optional[AuthConfigDict]
3824
+ """The authentication config to access the API. Only API key is supported. This field is not supported in Gemini API."""
3825
+
3826
+ enable_widget: Optional[bool]
3827
+ """Optional. If true, include the widget context token in the response."""
3828
+
3829
+
3830
+ GoogleMapsOrDict = Union[GoogleMaps, GoogleMapsDict]
3831
+
3832
+
3601
3833
  class Interval(_common.BaseModel):
3602
3834
  """Represents a time interval, encoded as a Timestamp start (inclusive) and a Timestamp end (exclusive).
3603
3835
 
@@ -3701,12 +3933,7 @@ class Tool(_common.BaseModel):
3701
3933
  )
3702
3934
  google_search_retrieval: Optional[GoogleSearchRetrieval] = Field(
3703
3935
  default=None,
3704
- description="""Optional. GoogleSearchRetrieval tool type. Specialized retrieval tool that is powered by Google search.""",
3705
- )
3706
- google_maps: Optional[GoogleMaps] = Field(
3707
- default=None,
3708
- description="""Optional. Google Maps tool type. Specialized retrieval tool
3709
- that is powered by Google Maps.""",
3936
+ description="""Optional. Specialized retrieval tool that is powered by Google Search.""",
3710
3937
  )
3711
3938
  computer_use: Optional[ComputerUse] = Field(
3712
3939
  default=None,
@@ -3714,6 +3941,10 @@ class Tool(_common.BaseModel):
3714
3941
  computer. If enabled, it automatically populates computer-use specific
3715
3942
  Function Declarations.""",
3716
3943
  )
3944
+ file_search: Optional[FileSearch] = Field(
3945
+ default=None,
3946
+ description="""Optional. Tool to retrieve knowledge from the File Search Stores.""",
3947
+ )
3717
3948
  code_execution: Optional[ToolCodeExecution] = Field(
3718
3949
  default=None,
3719
3950
  description="""Optional. CodeExecution tool type. Enables the model to execute code as part of generation.""",
@@ -3722,6 +3953,10 @@ class Tool(_common.BaseModel):
3722
3953
  default=None,
3723
3954
  description="""Optional. Tool to support searching public web data, powered by Vertex AI Search and Sec4 compliance. This field is not supported in Gemini API.""",
3724
3955
  )
3956
+ google_maps: Optional[GoogleMaps] = Field(
3957
+ default=None,
3958
+ description="""Optional. GoogleMaps tool type. Tool to support Google Maps in Model.""",
3959
+ )
3725
3960
  google_search: Optional[GoogleSearch] = Field(
3726
3961
  default=None,
3727
3962
  description="""Optional. GoogleSearch tool type. Tool to support Google Search in Model. Powered by Google.""",
@@ -3742,23 +3977,25 @@ class ToolDict(TypedDict, total=False):
3742
3977
  """Optional. Retrieval tool type. System will always execute the provided retrieval tool(s) to get external knowledge to answer the prompt. Retrieval results are presented to the model for generation. This field is not supported in Gemini API."""
3743
3978
 
3744
3979
  google_search_retrieval: Optional[GoogleSearchRetrievalDict]
3745
- """Optional. GoogleSearchRetrieval tool type. Specialized retrieval tool that is powered by Google search."""
3746
-
3747
- google_maps: Optional[GoogleMapsDict]
3748
- """Optional. Google Maps tool type. Specialized retrieval tool
3749
- that is powered by Google Maps."""
3980
+ """Optional. Specialized retrieval tool that is powered by Google Search."""
3750
3981
 
3751
3982
  computer_use: Optional[ComputerUseDict]
3752
3983
  """Optional. Tool to support the model interacting directly with the
3753
3984
  computer. If enabled, it automatically populates computer-use specific
3754
3985
  Function Declarations."""
3755
3986
 
3987
+ file_search: Optional[FileSearchDict]
3988
+ """Optional. Tool to retrieve knowledge from the File Search Stores."""
3989
+
3756
3990
  code_execution: Optional[ToolCodeExecutionDict]
3757
3991
  """Optional. CodeExecution tool type. Enables the model to execute code as part of generation."""
3758
3992
 
3759
3993
  enterprise_web_search: Optional[EnterpriseWebSearchDict]
3760
3994
  """Optional. Tool to support searching public web data, powered by Vertex AI Search and Sec4 compliance. This field is not supported in Gemini API."""
3761
3995
 
3996
+ google_maps: Optional[GoogleMapsDict]
3997
+ """Optional. GoogleMaps tool type. Tool to support Google Maps in Model."""
3998
+
3762
3999
  google_search: Optional[GoogleSearchDict]
3763
4000
  """Optional. GoogleSearch tool type. Tool to support Google Search in Model. Powered by Google."""
3764
4001
 
@@ -4001,6 +4238,12 @@ class ImageConfig(_common.BaseModel):
4001
4238
  description="""Aspect ratio of the generated images. Supported values are
4002
4239
  "1:1", "2:3", "3:2", "3:4", "4:3", "9:16", "16:9", and "21:9".""",
4003
4240
  )
4241
+ image_size: Optional[str] = Field(
4242
+ default=None,
4243
+ description="""Optional. Specifies the size of generated images. Supported
4244
+ values are `1K`, `2K`, `4K`. If not specified, the model will use default
4245
+ value `1K`.""",
4246
+ )
4004
4247
 
4005
4248
 
4006
4249
  class ImageConfigDict(TypedDict, total=False):
@@ -4010,6 +4253,11 @@ class ImageConfigDict(TypedDict, total=False):
4010
4253
  """Aspect ratio of the generated images. Supported values are
4011
4254
  "1:1", "2:3", "3:2", "3:4", "4:3", "9:16", "16:9", and "21:9"."""
4012
4255
 
4256
+ image_size: Optional[str]
4257
+ """Optional. Specifies the size of generated images. Supported
4258
+ values are `1K`, `2K`, `4K`. If not specified, the model will use default
4259
+ value `1K`."""
4260
+
4013
4261
 
4014
4262
  ImageConfigOrDict = Union[ImageConfig, ImageConfigDict]
4015
4263
 
@@ -5115,13 +5363,13 @@ class GroundingChunkMaps(_common.BaseModel):
5115
5363
  description="""This Place's resource name, in `places/{place_id}` format. Can be used to look up the Place.""",
5116
5364
  )
5117
5365
  text: Optional[str] = Field(
5118
- default=None, description="""Text of the chunk."""
5366
+ default=None, description="""Text of the place answer."""
5119
5367
  )
5120
5368
  title: Optional[str] = Field(
5121
- default=None, description="""Title of the chunk."""
5369
+ default=None, description="""Title of the place."""
5122
5370
  )
5123
5371
  uri: Optional[str] = Field(
5124
- default=None, description="""URI reference of the chunk."""
5372
+ default=None, description="""URI reference of the place."""
5125
5373
  )
5126
5374
 
5127
5375
 
@@ -5135,13 +5383,13 @@ class GroundingChunkMapsDict(TypedDict, total=False):
5135
5383
  """This Place's resource name, in `places/{place_id}` format. Can be used to look up the Place."""
5136
5384
 
5137
5385
  text: Optional[str]
5138
- """Text of the chunk."""
5386
+ """Text of the place answer."""
5139
5387
 
5140
5388
  title: Optional[str]
5141
- """Title of the chunk."""
5389
+ """Title of the place."""
5142
5390
 
5143
5391
  uri: Optional[str]
5144
- """URI reference of the chunk."""
5392
+ """URI reference of the place."""
5145
5393
 
5146
5394
 
5147
5395
  GroundingChunkMapsOrDict = Union[GroundingChunkMaps, GroundingChunkMapsDict]
@@ -5896,94 +6144,97 @@ ModalityTokenCountOrDict = Union[ModalityTokenCount, ModalityTokenCountDict]
5896
6144
 
5897
6145
 
5898
6146
  class GenerateContentResponseUsageMetadata(_common.BaseModel):
5899
- """Usage metadata about response(s).
6147
+ """Usage metadata about the content generation request and response.
5900
6148
 
5901
- This data type is not supported in Gemini API.
6149
+ This message provides a detailed breakdown of token usage and other relevant
6150
+ metrics. This data type is not supported in Gemini API.
5902
6151
  """
5903
6152
 
5904
6153
  cache_tokens_details: Optional[list[ModalityTokenCount]] = Field(
5905
6154
  default=None,
5906
- description="""Output only. List of modalities of the cached content in the request input.""",
6155
+ description="""Output only. A detailed breakdown of the token count for each modality in the cached content.""",
5907
6156
  )
5908
6157
  cached_content_token_count: Optional[int] = Field(
5909
6158
  default=None,
5910
- description="""Output only. Number of tokens in the cached part in the input (the cached content).""",
6159
+ description="""Output only. The number of tokens in the cached content that was used for this request.""",
5911
6160
  )
5912
6161
  candidates_token_count: Optional[int] = Field(
5913
- default=None, description="""Number of tokens in the response(s)."""
6162
+ default=None,
6163
+ description="""The total number of tokens in the generated candidates.""",
5914
6164
  )
5915
6165
  candidates_tokens_details: Optional[list[ModalityTokenCount]] = Field(
5916
6166
  default=None,
5917
- description="""Output only. List of modalities that were returned in the response.""",
6167
+ description="""Output only. A detailed breakdown of the token count for each modality in the generated candidates.""",
5918
6168
  )
5919
6169
  prompt_token_count: Optional[int] = Field(
5920
6170
  default=None,
5921
- description="""Number of tokens in the request. When `cached_content` is set, this is still the total effective prompt size meaning this includes the number of tokens in the cached content.""",
6171
+ description="""The total number of tokens in the prompt. This includes any text, images, or other media provided in the request. When `cached_content` is set, this also includes the number of tokens in the cached content.""",
5922
6172
  )
5923
6173
  prompt_tokens_details: Optional[list[ModalityTokenCount]] = Field(
5924
6174
  default=None,
5925
- description="""Output only. List of modalities that were processed in the request input.""",
6175
+ description="""Output only. A detailed breakdown of the token count for each modality in the prompt.""",
5926
6176
  )
5927
6177
  thoughts_token_count: Optional[int] = Field(
5928
6178
  default=None,
5929
- description="""Output only. Number of tokens present in thoughts output.""",
6179
+ description="""Output only. The number of tokens that were part of the model's generated "thoughts" output, if applicable.""",
5930
6180
  )
5931
6181
  tool_use_prompt_token_count: Optional[int] = Field(
5932
6182
  default=None,
5933
- description="""Output only. Number of tokens present in tool-use prompt(s).""",
6183
+ description="""Output only. The number of tokens in the results from tool executions, which are provided back to the model as input, if applicable.""",
5934
6184
  )
5935
6185
  tool_use_prompt_tokens_details: Optional[list[ModalityTokenCount]] = Field(
5936
6186
  default=None,
5937
- description="""Output only. List of modalities that were processed for tool-use request inputs.""",
6187
+ description="""Output only. A detailed breakdown by modality of the token counts from the results of tool executions, which are provided back to the model as input.""",
5938
6188
  )
5939
6189
  total_token_count: Optional[int] = Field(
5940
6190
  default=None,
5941
- description="""Total token count for prompt, response candidates, and tool-use prompts (if present).""",
6191
+ description="""The total number of tokens for the entire request. This is the sum of `prompt_token_count`, `candidates_token_count`, `tool_use_prompt_token_count`, and `thoughts_token_count`.""",
5942
6192
  )
5943
6193
  traffic_type: Optional[TrafficType] = Field(
5944
6194
  default=None,
5945
- description="""Output only. Traffic type. This shows whether a request consumes Pay-As-You-Go or Provisioned Throughput quota.""",
6195
+ description="""Output only. The traffic type for this request.""",
5946
6196
  )
5947
6197
 
5948
6198
 
5949
6199
  class GenerateContentResponseUsageMetadataDict(TypedDict, total=False):
5950
- """Usage metadata about response(s).
6200
+ """Usage metadata about the content generation request and response.
5951
6201
 
5952
- This data type is not supported in Gemini API.
6202
+ This message provides a detailed breakdown of token usage and other relevant
6203
+ metrics. This data type is not supported in Gemini API.
5953
6204
  """
5954
6205
 
5955
6206
  cache_tokens_details: Optional[list[ModalityTokenCountDict]]
5956
- """Output only. List of modalities of the cached content in the request input."""
6207
+ """Output only. A detailed breakdown of the token count for each modality in the cached content."""
5957
6208
 
5958
6209
  cached_content_token_count: Optional[int]
5959
- """Output only. Number of tokens in the cached part in the input (the cached content)."""
6210
+ """Output only. The number of tokens in the cached content that was used for this request."""
5960
6211
 
5961
6212
  candidates_token_count: Optional[int]
5962
- """Number of tokens in the response(s)."""
6213
+ """The total number of tokens in the generated candidates."""
5963
6214
 
5964
6215
  candidates_tokens_details: Optional[list[ModalityTokenCountDict]]
5965
- """Output only. List of modalities that were returned in the response."""
6216
+ """Output only. A detailed breakdown of the token count for each modality in the generated candidates."""
5966
6217
 
5967
6218
  prompt_token_count: Optional[int]
5968
- """Number of tokens in the request. When `cached_content` is set, this is still the total effective prompt size meaning this includes the number of tokens in the cached content."""
6219
+ """The total number of tokens in the prompt. This includes any text, images, or other media provided in the request. When `cached_content` is set, this also includes the number of tokens in the cached content."""
5969
6220
 
5970
6221
  prompt_tokens_details: Optional[list[ModalityTokenCountDict]]
5971
- """Output only. List of modalities that were processed in the request input."""
6222
+ """Output only. A detailed breakdown of the token count for each modality in the prompt."""
5972
6223
 
5973
6224
  thoughts_token_count: Optional[int]
5974
- """Output only. Number of tokens present in thoughts output."""
6225
+ """Output only. The number of tokens that were part of the model's generated "thoughts" output, if applicable."""
5975
6226
 
5976
6227
  tool_use_prompt_token_count: Optional[int]
5977
- """Output only. Number of tokens present in tool-use prompt(s)."""
6228
+ """Output only. The number of tokens in the results from tool executions, which are provided back to the model as input, if applicable."""
5978
6229
 
5979
6230
  tool_use_prompt_tokens_details: Optional[list[ModalityTokenCountDict]]
5980
- """Output only. List of modalities that were processed for tool-use request inputs."""
6231
+ """Output only. A detailed breakdown by modality of the token counts from the results of tool executions, which are provided back to the model as input."""
5981
6232
 
5982
6233
  total_token_count: Optional[int]
5983
- """Total token count for prompt, response candidates, and tool-use prompts (if present)."""
6234
+ """The total number of tokens for the entire request. This is the sum of `prompt_token_count`, `candidates_token_count`, `tool_use_prompt_token_count`, and `thoughts_token_count`."""
5984
6235
 
5985
6236
  traffic_type: Optional[TrafficType]
5986
- """Output only. Traffic type. This shows whether a request consumes Pay-As-You-Go or Provisioned Throughput quota."""
6237
+ """Output only. The traffic type for this request."""
5987
6238
 
5988
6239
 
5989
6240
  GenerateContentResponseUsageMetadataOrDict = Union[
@@ -8501,32 +8752,26 @@ VoiceConfigOrDict = Union[VoiceConfig, VoiceConfigDict]
8501
8752
 
8502
8753
 
8503
8754
  class SpeakerVoiceConfig(_common.BaseModel):
8504
- """The configuration for a single speaker in a multi speaker setup.
8505
-
8506
- This data type is not supported in Vertex AI.
8507
- """
8755
+ """Configuration for a single speaker in a multi speaker setup."""
8508
8756
 
8509
8757
  speaker: Optional[str] = Field(
8510
8758
  default=None,
8511
- description="""Required. The name of the speaker to use. Should be the same as in the prompt.""",
8759
+ description="""Required. The name of the speaker. This should be the same as the speaker name used in the prompt.""",
8512
8760
  )
8513
8761
  voice_config: Optional[VoiceConfig] = Field(
8514
8762
  default=None,
8515
- description="""Required. The configuration for the voice to use.""",
8763
+ description="""Required. The configuration for the voice of this speaker.""",
8516
8764
  )
8517
8765
 
8518
8766
 
8519
8767
  class SpeakerVoiceConfigDict(TypedDict, total=False):
8520
- """The configuration for a single speaker in a multi speaker setup.
8521
-
8522
- This data type is not supported in Vertex AI.
8523
- """
8768
+ """Configuration for a single speaker in a multi speaker setup."""
8524
8769
 
8525
8770
  speaker: Optional[str]
8526
- """Required. The name of the speaker to use. Should be the same as in the prompt."""
8771
+ """Required. The name of the speaker. This should be the same as the speaker name used in the prompt."""
8527
8772
 
8528
8773
  voice_config: Optional[VoiceConfigDict]
8529
- """Required. The configuration for the voice to use."""
8774
+ """Required. The configuration for the voice of this speaker."""
8530
8775
 
8531
8776
 
8532
8777
  SpeakerVoiceConfigOrDict = Union[SpeakerVoiceConfig, SpeakerVoiceConfigDict]
@@ -8564,6 +8809,12 @@ class GenerationConfig(_common.BaseModel):
8564
8809
  model_selection_config: Optional[ModelSelectionConfig] = Field(
8565
8810
  default=None, description="""Optional. Config for model selection."""
8566
8811
  )
8812
+ response_json_schema: Optional[Any] = Field(
8813
+ default=None,
8814
+ description="""Output schema of the generated response. This is an alternative to
8815
+ `response_schema` that accepts [JSON Schema](https://json-schema.org/).
8816
+ """,
8817
+ )
8567
8818
  audio_timestamp: Optional[bool] = Field(
8568
8819
  default=None,
8569
8820
  description="""Optional. If enabled, audio timestamp will be included in the request to the model. This field is not supported in Gemini API.""",
@@ -8593,10 +8844,6 @@ class GenerationConfig(_common.BaseModel):
8593
8844
  presence_penalty: Optional[float] = Field(
8594
8845
  default=None, description="""Optional. Positive penalties."""
8595
8846
  )
8596
- response_json_schema: Optional[Any] = Field(
8597
- default=None,
8598
- 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.""",
8599
- )
8600
8847
  response_logprobs: Optional[bool] = Field(
8601
8848
  default=None,
8602
8849
  description="""Optional. If true, export the logprobs results in response.""",
@@ -8651,6 +8898,11 @@ class GenerationConfigDict(TypedDict, total=False):
8651
8898
  model_selection_config: Optional[ModelSelectionConfigDict]
8652
8899
  """Optional. Config for model selection."""
8653
8900
 
8901
+ response_json_schema: Optional[Any]
8902
+ """Output schema of the generated response. This is an alternative to
8903
+ `response_schema` that accepts [JSON Schema](https://json-schema.org/).
8904
+ """
8905
+
8654
8906
  audio_timestamp: Optional[bool]
8655
8907
  """Optional. If enabled, audio timestamp will be included in the request to the model. This field is not supported in Gemini API."""
8656
8908
 
@@ -8675,9 +8927,6 @@ class GenerationConfigDict(TypedDict, total=False):
8675
8927
  presence_penalty: Optional[float]
8676
8928
  """Optional. Positive penalties."""
8677
8929
 
8678
- response_json_schema: Optional[Any]
8679
- """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."""
8680
-
8681
8930
  response_logprobs: Optional[bool]
8682
8931
  """Optional. If true, export the logprobs results in response."""
8683
8932
 
@@ -9766,6 +10015,10 @@ PreferenceOptimizationHyperParametersOrDict = Union[
9766
10015
  class PreferenceOptimizationSpec(_common.BaseModel):
9767
10016
  """Preference optimization tuning spec for tuning."""
9768
10017
 
10018
+ export_last_checkpoint_only: Optional[bool] = Field(
10019
+ default=None,
10020
+ description="""Optional. If set to true, disable intermediate checkpoints for Preference Optimization and only the last checkpoint will be exported. Otherwise, enable intermediate checkpoints for Preference Optimization. Default is false.""",
10021
+ )
9769
10022
  hyper_parameters: Optional[PreferenceOptimizationHyperParameters] = Field(
9770
10023
  default=None,
9771
10024
  description="""Optional. Hyperparameters for Preference Optimization.""",
@@ -9783,6 +10036,9 @@ class PreferenceOptimizationSpec(_common.BaseModel):
9783
10036
  class PreferenceOptimizationSpecDict(TypedDict, total=False):
9784
10037
  """Preference optimization tuning spec for tuning."""
9785
10038
 
10039
+ export_last_checkpoint_only: Optional[bool]
10040
+ """Optional. If set to true, disable intermediate checkpoints for Preference Optimization and only the last checkpoint will be exported. Otherwise, enable intermediate checkpoints for Preference Optimization. Default is false."""
10041
+
9786
10042
  hyper_parameters: Optional[PreferenceOptimizationHyperParametersDict]
9787
10043
  """Optional. Hyperparameters for Preference Optimization."""
9788
10044
 
@@ -9875,6 +10131,10 @@ class AutoraterConfig(_common.BaseModel):
9875
10131
  Tuned model endpoint format:
9876
10132
  `projects/{project}/locations/{location}/endpoints/{endpoint}`""",
9877
10133
  )
10134
+ generation_config: Optional[GenerationConfig] = Field(
10135
+ default=None,
10136
+ description="""Configuration options for model generation and outputs.""",
10137
+ )
9878
10138
 
9879
10139
 
9880
10140
  class AutoraterConfigDict(TypedDict, total=False):
@@ -9903,6 +10163,9 @@ class AutoraterConfigDict(TypedDict, total=False):
9903
10163
  Tuned model endpoint format:
9904
10164
  `projects/{project}/locations/{location}/endpoints/{endpoint}`"""
9905
10165
 
10166
+ generation_config: Optional[GenerationConfigDict]
10167
+ """Configuration options for model generation and outputs."""
10168
+
9906
10169
 
9907
10170
  AutoraterConfigOrDict = Union[AutoraterConfig, AutoraterConfigDict]
9908
10171
 
@@ -9950,12 +10213,11 @@ class Metric(_common.BaseModel):
9950
10213
  """An optional string indicating the version of the metric."""
9951
10214
 
9952
10215
  @model_validator(mode='after') # type: ignore[arg-type]
9953
- @classmethod
9954
- def validate_name(cls, model: 'Metric') -> 'Metric':
9955
- if not model.name:
10216
+ def validate_name(self) -> 'Metric':
10217
+ if not self.name:
9956
10218
  raise ValueError('Metric name cannot be empty.')
9957
- model.name = model.name.lower()
9958
- return model
10219
+ self.name = self.name.lower()
10220
+ return self
9959
10221
 
9960
10222
  def to_yaml_file(self, file_path: str, version: Optional[str] = None) -> None:
9961
10223
  """Dumps the metric object to a YAML file.
@@ -11027,7 +11289,7 @@ class TuningJob(_common.BaseModel):
11027
11289
  )
11028
11290
  tuned_model_display_name: Optional[str] = Field(
11029
11291
  default=None,
11030
- description="""Optional. The display name of the TunedModel. The name can be up to 128 characters long and can consist of any UTF-8 characters.""",
11292
+ description="""Optional. The display name of the TunedModel. The name can be up to 128 characters long and can consist of any UTF-8 characters. For continuous tuning, tuned_model_display_name will by default use the same display name as the pre-tuned model. If a new display name is provided, the tuning job will create a new model instead of a new version.""",
11031
11293
  )
11032
11294
  veo_tuning_spec: Optional[VeoTuningSpec] = Field(
11033
11295
  default=None, description="""Tuning Spec for Veo Tuning."""
@@ -11120,7 +11382,7 @@ class TuningJobDict(TypedDict, total=False):
11120
11382
  """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."""
11121
11383
 
11122
11384
  tuned_model_display_name: Optional[str]
11123
- """Optional. The display name of the TunedModel. The name can be up to 128 characters long and can consist of any UTF-8 characters."""
11385
+ """Optional. The display name of the TunedModel. The name can be up to 128 characters long and can consist of any UTF-8 characters. For continuous tuning, tuned_model_display_name will by default use the same display name as the pre-tuned model. If a new display name is provided, the tuning job will create a new model instead of a new version."""
11124
11386
 
11125
11387
  veo_tuning_spec: Optional[VeoTuningSpecDict]
11126
11388
  """Tuning Spec for Veo Tuning."""
@@ -11825,239 +12087,1137 @@ class _GetCachedContentParameters(_common.BaseModel):
11825
12087
  )
11826
12088
 
11827
12089
 
11828
- class _GetCachedContentParametersDict(TypedDict, total=False):
11829
- """Parameters for caches.get method."""
12090
+ class _GetCachedContentParametersDict(TypedDict, total=False):
12091
+ """Parameters for caches.get method."""
12092
+
12093
+ name: Optional[str]
12094
+ """The server-generated resource name of the cached content.
12095
+ """
12096
+
12097
+ config: Optional[GetCachedContentConfigDict]
12098
+ """Optional parameters for the request.
12099
+ """
12100
+
12101
+
12102
+ _GetCachedContentParametersOrDict = Union[
12103
+ _GetCachedContentParameters, _GetCachedContentParametersDict
12104
+ ]
12105
+
12106
+
12107
+ class DeleteCachedContentConfig(_common.BaseModel):
12108
+ """Optional parameters for caches.delete method."""
12109
+
12110
+ http_options: Optional[HttpOptions] = Field(
12111
+ default=None, description="""Used to override HTTP request options."""
12112
+ )
12113
+
12114
+
12115
+ class DeleteCachedContentConfigDict(TypedDict, total=False):
12116
+ """Optional parameters for caches.delete method."""
12117
+
12118
+ http_options: Optional[HttpOptionsDict]
12119
+ """Used to override HTTP request options."""
12120
+
12121
+
12122
+ DeleteCachedContentConfigOrDict = Union[
12123
+ DeleteCachedContentConfig, DeleteCachedContentConfigDict
12124
+ ]
12125
+
12126
+
12127
+ class _DeleteCachedContentParameters(_common.BaseModel):
12128
+ """Parameters for caches.delete method."""
12129
+
12130
+ name: Optional[str] = Field(
12131
+ default=None,
12132
+ description="""The server-generated resource name of the cached content.
12133
+ """,
12134
+ )
12135
+ config: Optional[DeleteCachedContentConfig] = Field(
12136
+ default=None,
12137
+ description="""Optional parameters for the request.
12138
+ """,
12139
+ )
12140
+
12141
+
12142
+ class _DeleteCachedContentParametersDict(TypedDict, total=False):
12143
+ """Parameters for caches.delete method."""
12144
+
12145
+ name: Optional[str]
12146
+ """The server-generated resource name of the cached content.
12147
+ """
12148
+
12149
+ config: Optional[DeleteCachedContentConfigDict]
12150
+ """Optional parameters for the request.
12151
+ """
12152
+
12153
+
12154
+ _DeleteCachedContentParametersOrDict = Union[
12155
+ _DeleteCachedContentParameters, _DeleteCachedContentParametersDict
12156
+ ]
12157
+
12158
+
12159
+ class DeleteCachedContentResponse(_common.BaseModel):
12160
+ """Empty response for caches.delete method."""
12161
+
12162
+ sdk_http_response: Optional[HttpResponse] = Field(
12163
+ default=None, description="""Used to retain the full HTTP response."""
12164
+ )
12165
+
12166
+
12167
+ class DeleteCachedContentResponseDict(TypedDict, total=False):
12168
+ """Empty response for caches.delete method."""
12169
+
12170
+ sdk_http_response: Optional[HttpResponseDict]
12171
+ """Used to retain the full HTTP response."""
12172
+
12173
+
12174
+ DeleteCachedContentResponseOrDict = Union[
12175
+ DeleteCachedContentResponse, DeleteCachedContentResponseDict
12176
+ ]
12177
+
12178
+
12179
+ class UpdateCachedContentConfig(_common.BaseModel):
12180
+ """Optional parameters for caches.update method."""
12181
+
12182
+ http_options: Optional[HttpOptions] = Field(
12183
+ default=None, description="""Used to override HTTP request options."""
12184
+ )
12185
+ ttl: Optional[str] = Field(
12186
+ default=None,
12187
+ description="""The TTL for this resource. The expiration time is computed: now + TTL. It is a duration string, with up to nine fractional digits, terminated by 's'. Example: "3.5s".""",
12188
+ )
12189
+ expire_time: Optional[datetime.datetime] = Field(
12190
+ default=None,
12191
+ description="""Timestamp of when this resource is considered expired. Uses RFC 3339 format, Example: 2014-10-02T15:01:23Z.""",
12192
+ )
12193
+
12194
+
12195
+ class UpdateCachedContentConfigDict(TypedDict, total=False):
12196
+ """Optional parameters for caches.update method."""
12197
+
12198
+ http_options: Optional[HttpOptionsDict]
12199
+ """Used to override HTTP request options."""
12200
+
12201
+ ttl: Optional[str]
12202
+ """The TTL for this resource. The expiration time is computed: now + TTL. It is a duration string, with up to nine fractional digits, terminated by 's'. Example: "3.5s"."""
12203
+
12204
+ expire_time: Optional[datetime.datetime]
12205
+ """Timestamp of when this resource is considered expired. Uses RFC 3339 format, Example: 2014-10-02T15:01:23Z."""
12206
+
12207
+
12208
+ UpdateCachedContentConfigOrDict = Union[
12209
+ UpdateCachedContentConfig, UpdateCachedContentConfigDict
12210
+ ]
12211
+
12212
+
12213
+ class _UpdateCachedContentParameters(_common.BaseModel):
12214
+
12215
+ name: Optional[str] = Field(
12216
+ default=None,
12217
+ description="""The server-generated resource name of the cached content.
12218
+ """,
12219
+ )
12220
+ config: Optional[UpdateCachedContentConfig] = Field(
12221
+ default=None,
12222
+ description="""Configuration that contains optional parameters.
12223
+ """,
12224
+ )
12225
+
12226
+
12227
+ class _UpdateCachedContentParametersDict(TypedDict, total=False):
12228
+
12229
+ name: Optional[str]
12230
+ """The server-generated resource name of the cached content.
12231
+ """
12232
+
12233
+ config: Optional[UpdateCachedContentConfigDict]
12234
+ """Configuration that contains optional parameters.
12235
+ """
12236
+
12237
+
12238
+ _UpdateCachedContentParametersOrDict = Union[
12239
+ _UpdateCachedContentParameters, _UpdateCachedContentParametersDict
12240
+ ]
12241
+
12242
+
12243
+ class ListCachedContentsConfig(_common.BaseModel):
12244
+ """Config for caches.list method."""
12245
+
12246
+ http_options: Optional[HttpOptions] = Field(
12247
+ default=None, description="""Used to override HTTP request options."""
12248
+ )
12249
+ page_size: Optional[int] = Field(default=None, description="""""")
12250
+ page_token: Optional[str] = Field(default=None, description="""""")
12251
+
12252
+
12253
+ class ListCachedContentsConfigDict(TypedDict, total=False):
12254
+ """Config for caches.list method."""
12255
+
12256
+ http_options: Optional[HttpOptionsDict]
12257
+ """Used to override HTTP request options."""
12258
+
12259
+ page_size: Optional[int]
12260
+ """"""
12261
+
12262
+ page_token: Optional[str]
12263
+ """"""
12264
+
12265
+
12266
+ ListCachedContentsConfigOrDict = Union[
12267
+ ListCachedContentsConfig, ListCachedContentsConfigDict
12268
+ ]
12269
+
12270
+
12271
+ class _ListCachedContentsParameters(_common.BaseModel):
12272
+ """Parameters for caches.list method."""
12273
+
12274
+ config: Optional[ListCachedContentsConfig] = Field(
12275
+ default=None,
12276
+ description="""Configuration that contains optional parameters.
12277
+ """,
12278
+ )
12279
+
12280
+
12281
+ class _ListCachedContentsParametersDict(TypedDict, total=False):
12282
+ """Parameters for caches.list method."""
12283
+
12284
+ config: Optional[ListCachedContentsConfigDict]
12285
+ """Configuration that contains optional parameters.
12286
+ """
12287
+
12288
+
12289
+ _ListCachedContentsParametersOrDict = Union[
12290
+ _ListCachedContentsParameters, _ListCachedContentsParametersDict
12291
+ ]
12292
+
12293
+
12294
+ class ListCachedContentsResponse(_common.BaseModel):
12295
+
12296
+ sdk_http_response: Optional[HttpResponse] = Field(
12297
+ default=None, description="""Used to retain the full HTTP response."""
12298
+ )
12299
+ next_page_token: Optional[str] = Field(default=None, description="""""")
12300
+ cached_contents: Optional[list[CachedContent]] = Field(
12301
+ default=None,
12302
+ description="""List of cached contents.
12303
+ """,
12304
+ )
12305
+
12306
+
12307
+ class ListCachedContentsResponseDict(TypedDict, total=False):
12308
+
12309
+ sdk_http_response: Optional[HttpResponseDict]
12310
+ """Used to retain the full HTTP response."""
12311
+
12312
+ next_page_token: Optional[str]
12313
+ """"""
12314
+
12315
+ cached_contents: Optional[list[CachedContentDict]]
12316
+ """List of cached contents.
12317
+ """
12318
+
12319
+
12320
+ ListCachedContentsResponseOrDict = Union[
12321
+ ListCachedContentsResponse, ListCachedContentsResponseDict
12322
+ ]
12323
+
12324
+
12325
+ class GetDocumentConfig(_common.BaseModel):
12326
+ """Optional Config."""
12327
+
12328
+ http_options: Optional[HttpOptions] = Field(
12329
+ default=None, description="""Used to override HTTP request options."""
12330
+ )
12331
+
12332
+
12333
+ class GetDocumentConfigDict(TypedDict, total=False):
12334
+ """Optional Config."""
12335
+
12336
+ http_options: Optional[HttpOptionsDict]
12337
+ """Used to override HTTP request options."""
12338
+
12339
+
12340
+ GetDocumentConfigOrDict = Union[GetDocumentConfig, GetDocumentConfigDict]
12341
+
12342
+
12343
+ class _GetDocumentParameters(_common.BaseModel):
12344
+ """Parameters for documents.get."""
12345
+
12346
+ name: Optional[str] = Field(
12347
+ default=None,
12348
+ description="""The resource name of the Document.
12349
+ Example: fileSearchStores/file-search-store-foo/documents/documents-bar""",
12350
+ )
12351
+ config: Optional[GetDocumentConfig] = Field(
12352
+ default=None, description="""Optional parameters for the request."""
12353
+ )
12354
+
12355
+
12356
+ class _GetDocumentParametersDict(TypedDict, total=False):
12357
+ """Parameters for documents.get."""
12358
+
12359
+ name: Optional[str]
12360
+ """The resource name of the Document.
12361
+ Example: fileSearchStores/file-search-store-foo/documents/documents-bar"""
12362
+
12363
+ config: Optional[GetDocumentConfigDict]
12364
+ """Optional parameters for the request."""
12365
+
12366
+
12367
+ _GetDocumentParametersOrDict = Union[
12368
+ _GetDocumentParameters, _GetDocumentParametersDict
12369
+ ]
12370
+
12371
+
12372
+ class StringList(_common.BaseModel):
12373
+ """User provided string values assigned to a single metadata key.
12374
+
12375
+ This data type is not supported in Vertex AI.
12376
+ """
12377
+
12378
+ values: Optional[list[str]] = Field(
12379
+ default=None,
12380
+ description="""The string values of the metadata to store.""",
12381
+ )
12382
+
12383
+
12384
+ class StringListDict(TypedDict, total=False):
12385
+ """User provided string values assigned to a single metadata key.
12386
+
12387
+ This data type is not supported in Vertex AI.
12388
+ """
12389
+
12390
+ values: Optional[list[str]]
12391
+ """The string values of the metadata to store."""
12392
+
12393
+
12394
+ StringListOrDict = Union[StringList, StringListDict]
12395
+
12396
+
12397
+ class CustomMetadata(_common.BaseModel):
12398
+ """User provided metadata stored as key-value pairs.
12399
+
12400
+ This data type is not supported in Vertex AI.
12401
+ """
12402
+
12403
+ key: Optional[str] = Field(
12404
+ default=None,
12405
+ description="""Required. The key of the metadata to store.""",
12406
+ )
12407
+ numeric_value: Optional[float] = Field(
12408
+ default=None,
12409
+ description="""The numeric value of the metadata to store.""",
12410
+ )
12411
+ string_list_value: Optional[StringList] = Field(
12412
+ default=None,
12413
+ description="""The StringList value of the metadata to store.""",
12414
+ )
12415
+ string_value: Optional[str] = Field(
12416
+ default=None, description="""The string value of the metadata to store."""
12417
+ )
12418
+
12419
+
12420
+ class CustomMetadataDict(TypedDict, total=False):
12421
+ """User provided metadata stored as key-value pairs.
12422
+
12423
+ This data type is not supported in Vertex AI.
12424
+ """
12425
+
12426
+ key: Optional[str]
12427
+ """Required. The key of the metadata to store."""
12428
+
12429
+ numeric_value: Optional[float]
12430
+ """The numeric value of the metadata to store."""
12431
+
12432
+ string_list_value: Optional[StringListDict]
12433
+ """The StringList value of the metadata to store."""
12434
+
12435
+ string_value: Optional[str]
12436
+ """The string value of the metadata to store."""
12437
+
12438
+
12439
+ CustomMetadataOrDict = Union[CustomMetadata, CustomMetadataDict]
12440
+
12441
+
12442
+ class Document(_common.BaseModel):
12443
+ """A Document is a collection of Chunks."""
12444
+
12445
+ name: Optional[str] = Field(
12446
+ default=None,
12447
+ description="""The resource name of the Document.
12448
+ Example: fileSearchStores/file-search-store-foo/documents/documents-bar""",
12449
+ )
12450
+ display_name: Optional[str] = Field(
12451
+ default=None,
12452
+ description="""The human-readable display name for the Document.""",
12453
+ )
12454
+ state: Optional[DocumentState] = Field(
12455
+ default=None, description="""The current state of the Document."""
12456
+ )
12457
+ size_bytes: Optional[int] = Field(
12458
+ default=None, description="""The size of the Document in bytes."""
12459
+ )
12460
+ mime_type: Optional[str] = Field(
12461
+ default=None, description="""The MIME type of the Document."""
12462
+ )
12463
+ create_time: Optional[datetime.datetime] = Field(
12464
+ default=None,
12465
+ description="""Output only. The Timestamp of when the `Document` was created.""",
12466
+ )
12467
+ custom_metadata: Optional[list[CustomMetadata]] = Field(
12468
+ default=None,
12469
+ description="""Optional. User provided custom metadata stored as key-value pairs used for querying. A `Document` can have a maximum of 20 `CustomMetadata`.""",
12470
+ )
12471
+ update_time: Optional[datetime.datetime] = Field(
12472
+ default=None,
12473
+ description="""Output only. The Timestamp of when the `Document` was last updated.""",
12474
+ )
12475
+
12476
+
12477
+ class DocumentDict(TypedDict, total=False):
12478
+ """A Document is a collection of Chunks."""
12479
+
12480
+ name: Optional[str]
12481
+ """The resource name of the Document.
12482
+ Example: fileSearchStores/file-search-store-foo/documents/documents-bar"""
12483
+
12484
+ display_name: Optional[str]
12485
+ """The human-readable display name for the Document."""
12486
+
12487
+ state: Optional[DocumentState]
12488
+ """The current state of the Document."""
12489
+
12490
+ size_bytes: Optional[int]
12491
+ """The size of the Document in bytes."""
12492
+
12493
+ mime_type: Optional[str]
12494
+ """The MIME type of the Document."""
12495
+
12496
+ create_time: Optional[datetime.datetime]
12497
+ """Output only. The Timestamp of when the `Document` was created."""
12498
+
12499
+ custom_metadata: Optional[list[CustomMetadataDict]]
12500
+ """Optional. User provided custom metadata stored as key-value pairs used for querying. A `Document` can have a maximum of 20 `CustomMetadata`."""
12501
+
12502
+ update_time: Optional[datetime.datetime]
12503
+ """Output only. The Timestamp of when the `Document` was last updated."""
12504
+
12505
+
12506
+ DocumentOrDict = Union[Document, DocumentDict]
12507
+
12508
+
12509
+ class DeleteDocumentConfig(_common.BaseModel):
12510
+ """Config for optional parameters."""
12511
+
12512
+ http_options: Optional[HttpOptions] = Field(
12513
+ default=None, description="""Used to override HTTP request options."""
12514
+ )
12515
+ force: Optional[bool] = Field(
12516
+ default=None,
12517
+ description="""If set to true, any `Chunk`s and objects related to this `Document` will
12518
+ also be deleted.
12519
+ """,
12520
+ )
12521
+
12522
+
12523
+ class DeleteDocumentConfigDict(TypedDict, total=False):
12524
+ """Config for optional parameters."""
12525
+
12526
+ http_options: Optional[HttpOptionsDict]
12527
+ """Used to override HTTP request options."""
12528
+
12529
+ force: Optional[bool]
12530
+ """If set to true, any `Chunk`s and objects related to this `Document` will
12531
+ also be deleted.
12532
+ """
12533
+
12534
+
12535
+ DeleteDocumentConfigOrDict = Union[
12536
+ DeleteDocumentConfig, DeleteDocumentConfigDict
12537
+ ]
12538
+
12539
+
12540
+ class _DeleteDocumentParameters(_common.BaseModel):
12541
+ """Config for documents.delete parameters."""
12542
+
12543
+ name: Optional[str] = Field(
12544
+ default=None,
12545
+ description="""The resource name of the Document.
12546
+ Example: fileSearchStores/file-search-store-foo/documents/documents-bar""",
12547
+ )
12548
+ config: Optional[DeleteDocumentConfig] = Field(
12549
+ default=None, description="""Optional parameters for the request."""
12550
+ )
12551
+
12552
+
12553
+ class _DeleteDocumentParametersDict(TypedDict, total=False):
12554
+ """Config for documents.delete parameters."""
12555
+
12556
+ name: Optional[str]
12557
+ """The resource name of the Document.
12558
+ Example: fileSearchStores/file-search-store-foo/documents/documents-bar"""
12559
+
12560
+ config: Optional[DeleteDocumentConfigDict]
12561
+ """Optional parameters for the request."""
12562
+
12563
+
12564
+ _DeleteDocumentParametersOrDict = Union[
12565
+ _DeleteDocumentParameters, _DeleteDocumentParametersDict
12566
+ ]
12567
+
12568
+
12569
+ class ListDocumentsConfig(_common.BaseModel):
12570
+ """Config for optional parameters."""
12571
+
12572
+ http_options: Optional[HttpOptions] = Field(
12573
+ default=None, description="""Used to override HTTP request options."""
12574
+ )
12575
+ page_size: Optional[int] = Field(default=None, description="""""")
12576
+ page_token: Optional[str] = Field(default=None, description="""""")
12577
+
12578
+
12579
+ class ListDocumentsConfigDict(TypedDict, total=False):
12580
+ """Config for optional parameters."""
12581
+
12582
+ http_options: Optional[HttpOptionsDict]
12583
+ """Used to override HTTP request options."""
12584
+
12585
+ page_size: Optional[int]
12586
+ """"""
12587
+
12588
+ page_token: Optional[str]
12589
+ """"""
12590
+
12591
+
12592
+ ListDocumentsConfigOrDict = Union[ListDocumentsConfig, ListDocumentsConfigDict]
12593
+
12594
+
12595
+ class _ListDocumentsParameters(_common.BaseModel):
12596
+ """Config for documents.list parameters."""
12597
+
12598
+ parent: Optional[str] = Field(
12599
+ default=None,
12600
+ description="""The resource name of the FileSearchStores. Example: `fileSearchStore/file-search-store-foo`""",
12601
+ )
12602
+ config: Optional[ListDocumentsConfig] = Field(
12603
+ default=None, description=""""""
12604
+ )
12605
+
12606
+
12607
+ class _ListDocumentsParametersDict(TypedDict, total=False):
12608
+ """Config for documents.list parameters."""
12609
+
12610
+ parent: Optional[str]
12611
+ """The resource name of the FileSearchStores. Example: `fileSearchStore/file-search-store-foo`"""
12612
+
12613
+ config: Optional[ListDocumentsConfigDict]
12614
+ """"""
12615
+
12616
+
12617
+ _ListDocumentsParametersOrDict = Union[
12618
+ _ListDocumentsParameters, _ListDocumentsParametersDict
12619
+ ]
12620
+
12621
+
12622
+ class ListDocumentsResponse(_common.BaseModel):
12623
+ """Config for documents.list return value."""
12624
+
12625
+ sdk_http_response: Optional[HttpResponse] = Field(
12626
+ default=None, description="""Used to retain the full HTTP response."""
12627
+ )
12628
+ next_page_token: Optional[str] = Field(
12629
+ default=None,
12630
+ description="""A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no more pages.""",
12631
+ )
12632
+ documents: Optional[list[Document]] = Field(
12633
+ default=None, description="""The returned `Document`s."""
12634
+ )
12635
+
12636
+
12637
+ class ListDocumentsResponseDict(TypedDict, total=False):
12638
+ """Config for documents.list return value."""
12639
+
12640
+ sdk_http_response: Optional[HttpResponseDict]
12641
+ """Used to retain the full HTTP response."""
12642
+
12643
+ next_page_token: Optional[str]
12644
+ """A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no more pages."""
12645
+
12646
+ documents: Optional[list[DocumentDict]]
12647
+ """The returned `Document`s."""
12648
+
12649
+
12650
+ ListDocumentsResponseOrDict = Union[
12651
+ ListDocumentsResponse, ListDocumentsResponseDict
12652
+ ]
12653
+
12654
+
12655
+ class CreateFileSearchStoreConfig(_common.BaseModel):
12656
+ """Optional parameters for creating a file search store."""
12657
+
12658
+ http_options: Optional[HttpOptions] = Field(
12659
+ default=None, description="""Used to override HTTP request options."""
12660
+ )
12661
+ display_name: Optional[str] = Field(
12662
+ default=None,
12663
+ description="""The human-readable display name for the file search store.
12664
+ """,
12665
+ )
12666
+
12667
+
12668
+ class CreateFileSearchStoreConfigDict(TypedDict, total=False):
12669
+ """Optional parameters for creating a file search store."""
12670
+
12671
+ http_options: Optional[HttpOptionsDict]
12672
+ """Used to override HTTP request options."""
12673
+
12674
+ display_name: Optional[str]
12675
+ """The human-readable display name for the file search store.
12676
+ """
12677
+
12678
+
12679
+ CreateFileSearchStoreConfigOrDict = Union[
12680
+ CreateFileSearchStoreConfig, CreateFileSearchStoreConfigDict
12681
+ ]
12682
+
12683
+
12684
+ class _CreateFileSearchStoreParameters(_common.BaseModel):
12685
+ """Config for file_search_stores.create parameters."""
12686
+
12687
+ config: Optional[CreateFileSearchStoreConfig] = Field(
12688
+ default=None,
12689
+ description="""Optional parameters for creating a file search store.
12690
+ """,
12691
+ )
12692
+
12693
+
12694
+ class _CreateFileSearchStoreParametersDict(TypedDict, total=False):
12695
+ """Config for file_search_stores.create parameters."""
12696
+
12697
+ config: Optional[CreateFileSearchStoreConfigDict]
12698
+ """Optional parameters for creating a file search store.
12699
+ """
12700
+
12701
+
12702
+ _CreateFileSearchStoreParametersOrDict = Union[
12703
+ _CreateFileSearchStoreParameters, _CreateFileSearchStoreParametersDict
12704
+ ]
12705
+
12706
+
12707
+ class FileSearchStore(_common.BaseModel):
12708
+ """A collection of Documents."""
12709
+
12710
+ name: Optional[str] = Field(
12711
+ default=None,
12712
+ description="""The resource name of the FileSearchStore. Example: `fileSearchStores/my-file-search-store-123`""",
12713
+ )
12714
+ display_name: Optional[str] = Field(
12715
+ default=None,
12716
+ description="""The human-readable display name for the FileSearchStore.""",
12717
+ )
12718
+ create_time: Optional[datetime.datetime] = Field(
12719
+ default=None,
12720
+ description="""The Timestamp of when the FileSearchStore was created.""",
12721
+ )
12722
+ update_time: Optional[datetime.datetime] = Field(
12723
+ default=None,
12724
+ description="""The Timestamp of when the FileSearchStore was last updated.""",
12725
+ )
12726
+ active_documents_count: Optional[int] = Field(
12727
+ default=None,
12728
+ description="""The number of documents in the FileSearchStore that are active and ready for retrieval.""",
12729
+ )
12730
+ pending_documents_count: Optional[int] = Field(
12731
+ default=None,
12732
+ description="""The number of documents in the FileSearchStore that are being processed.""",
12733
+ )
12734
+ failed_documents_count: Optional[int] = Field(
12735
+ default=None,
12736
+ description="""The number of documents in the FileSearchStore that have failed processing.""",
12737
+ )
12738
+ size_bytes: Optional[int] = Field(
12739
+ default=None,
12740
+ description="""The size of raw bytes ingested into the FileSearchStore. This is the
12741
+ total size of all the documents in the FileSearchStore.""",
12742
+ )
12743
+
12744
+
12745
+ class FileSearchStoreDict(TypedDict, total=False):
12746
+ """A collection of Documents."""
12747
+
12748
+ name: Optional[str]
12749
+ """The resource name of the FileSearchStore. Example: `fileSearchStores/my-file-search-store-123`"""
12750
+
12751
+ display_name: Optional[str]
12752
+ """The human-readable display name for the FileSearchStore."""
12753
+
12754
+ create_time: Optional[datetime.datetime]
12755
+ """The Timestamp of when the FileSearchStore was created."""
12756
+
12757
+ update_time: Optional[datetime.datetime]
12758
+ """The Timestamp of when the FileSearchStore was last updated."""
12759
+
12760
+ active_documents_count: Optional[int]
12761
+ """The number of documents in the FileSearchStore that are active and ready for retrieval."""
12762
+
12763
+ pending_documents_count: Optional[int]
12764
+ """The number of documents in the FileSearchStore that are being processed."""
12765
+
12766
+ failed_documents_count: Optional[int]
12767
+ """The number of documents in the FileSearchStore that have failed processing."""
12768
+
12769
+ size_bytes: Optional[int]
12770
+ """The size of raw bytes ingested into the FileSearchStore. This is the
12771
+ total size of all the documents in the FileSearchStore."""
12772
+
12773
+
12774
+ FileSearchStoreOrDict = Union[FileSearchStore, FileSearchStoreDict]
12775
+
12776
+
12777
+ class GetFileSearchStoreConfig(_common.BaseModel):
12778
+ """Optional parameters for getting a FileSearchStore."""
12779
+
12780
+ http_options: Optional[HttpOptions] = Field(
12781
+ default=None, description="""Used to override HTTP request options."""
12782
+ )
12783
+
12784
+
12785
+ class GetFileSearchStoreConfigDict(TypedDict, total=False):
12786
+ """Optional parameters for getting a FileSearchStore."""
12787
+
12788
+ http_options: Optional[HttpOptionsDict]
12789
+ """Used to override HTTP request options."""
12790
+
12791
+
12792
+ GetFileSearchStoreConfigOrDict = Union[
12793
+ GetFileSearchStoreConfig, GetFileSearchStoreConfigDict
12794
+ ]
12795
+
12796
+
12797
+ class _GetFileSearchStoreParameters(_common.BaseModel):
12798
+ """Config for file_search_stores.get parameters."""
12799
+
12800
+ name: Optional[str] = Field(
12801
+ default=None,
12802
+ description="""The resource name of the FileSearchStore. Example: `fileSearchStores/my-file-search-store-123`""",
12803
+ )
12804
+ config: Optional[GetFileSearchStoreConfig] = Field(
12805
+ default=None, description="""Optional parameters for the request."""
12806
+ )
12807
+
12808
+
12809
+ class _GetFileSearchStoreParametersDict(TypedDict, total=False):
12810
+ """Config for file_search_stores.get parameters."""
12811
+
12812
+ name: Optional[str]
12813
+ """The resource name of the FileSearchStore. Example: `fileSearchStores/my-file-search-store-123`"""
12814
+
12815
+ config: Optional[GetFileSearchStoreConfigDict]
12816
+ """Optional parameters for the request."""
12817
+
12818
+
12819
+ _GetFileSearchStoreParametersOrDict = Union[
12820
+ _GetFileSearchStoreParameters, _GetFileSearchStoreParametersDict
12821
+ ]
12822
+
12823
+
12824
+ class DeleteFileSearchStoreConfig(_common.BaseModel):
12825
+ """Optional parameters for deleting a FileSearchStore."""
12826
+
12827
+ http_options: Optional[HttpOptions] = Field(
12828
+ default=None, description="""Used to override HTTP request options."""
12829
+ )
12830
+ force: Optional[bool] = Field(
12831
+ default=None,
12832
+ description="""If set to true, any Documents and objects related to this FileSearchStore will also be deleted.
12833
+ If false (the default), a FAILED_PRECONDITION error will be returned if
12834
+ the FileSearchStore contains any Documents.
12835
+ """,
12836
+ )
12837
+
12838
+
12839
+ class DeleteFileSearchStoreConfigDict(TypedDict, total=False):
12840
+ """Optional parameters for deleting a FileSearchStore."""
12841
+
12842
+ http_options: Optional[HttpOptionsDict]
12843
+ """Used to override HTTP request options."""
12844
+
12845
+ force: Optional[bool]
12846
+ """If set to true, any Documents and objects related to this FileSearchStore will also be deleted.
12847
+ If false (the default), a FAILED_PRECONDITION error will be returned if
12848
+ the FileSearchStore contains any Documents.
12849
+ """
12850
+
12851
+
12852
+ DeleteFileSearchStoreConfigOrDict = Union[
12853
+ DeleteFileSearchStoreConfig, DeleteFileSearchStoreConfigDict
12854
+ ]
12855
+
12856
+
12857
+ class _DeleteFileSearchStoreParameters(_common.BaseModel):
12858
+ """Config for file_search_stores.delete parameters."""
12859
+
12860
+ name: Optional[str] = Field(
12861
+ default=None,
12862
+ description="""The resource name of the FileSearchStore. Example: `fileSearchStores/my-file-search-store-123`""",
12863
+ )
12864
+ config: Optional[DeleteFileSearchStoreConfig] = Field(
12865
+ default=None, description="""Optional parameters for the request."""
12866
+ )
12867
+
12868
+
12869
+ class _DeleteFileSearchStoreParametersDict(TypedDict, total=False):
12870
+ """Config for file_search_stores.delete parameters."""
12871
+
12872
+ name: Optional[str]
12873
+ """The resource name of the FileSearchStore. Example: `fileSearchStores/my-file-search-store-123`"""
12874
+
12875
+ config: Optional[DeleteFileSearchStoreConfigDict]
12876
+ """Optional parameters for the request."""
12877
+
12878
+
12879
+ _DeleteFileSearchStoreParametersOrDict = Union[
12880
+ _DeleteFileSearchStoreParameters, _DeleteFileSearchStoreParametersDict
12881
+ ]
12882
+
12883
+
12884
+ class ListFileSearchStoresConfig(_common.BaseModel):
12885
+ """Optional parameters for listing FileSearchStore."""
12886
+
12887
+ http_options: Optional[HttpOptions] = Field(
12888
+ default=None, description="""Used to override HTTP request options."""
12889
+ )
12890
+ page_size: Optional[int] = Field(default=None, description="""""")
12891
+ page_token: Optional[str] = Field(default=None, description="""""")
12892
+
12893
+
12894
+ class ListFileSearchStoresConfigDict(TypedDict, total=False):
12895
+ """Optional parameters for listing FileSearchStore."""
12896
+
12897
+ http_options: Optional[HttpOptionsDict]
12898
+ """Used to override HTTP request options."""
12899
+
12900
+ page_size: Optional[int]
12901
+ """"""
12902
+
12903
+ page_token: Optional[str]
12904
+ """"""
12905
+
12906
+
12907
+ ListFileSearchStoresConfigOrDict = Union[
12908
+ ListFileSearchStoresConfig, ListFileSearchStoresConfigDict
12909
+ ]
12910
+
12911
+
12912
+ class _ListFileSearchStoresParameters(_common.BaseModel):
12913
+ """Config for file_search_stores.list parameters."""
11830
12914
 
11831
- name: Optional[str]
11832
- """The server-generated resource name of the cached content.
11833
- """
12915
+ config: Optional[ListFileSearchStoresConfig] = Field(
12916
+ default=None, description="""Optional parameters for the list request."""
12917
+ )
11834
12918
 
11835
- config: Optional[GetCachedContentConfigDict]
11836
- """Optional parameters for the request.
11837
- """
11838
12919
 
12920
+ class _ListFileSearchStoresParametersDict(TypedDict, total=False):
12921
+ """Config for file_search_stores.list parameters."""
11839
12922
 
11840
- _GetCachedContentParametersOrDict = Union[
11841
- _GetCachedContentParameters, _GetCachedContentParametersDict
12923
+ config: Optional[ListFileSearchStoresConfigDict]
12924
+ """Optional parameters for the list request."""
12925
+
12926
+
12927
+ _ListFileSearchStoresParametersOrDict = Union[
12928
+ _ListFileSearchStoresParameters, _ListFileSearchStoresParametersDict
11842
12929
  ]
11843
12930
 
11844
12931
 
11845
- class DeleteCachedContentConfig(_common.BaseModel):
11846
- """Optional parameters for caches.delete method."""
12932
+ class ListFileSearchStoresResponse(_common.BaseModel):
12933
+ """Config for file_search_stores.list return value."""
11847
12934
 
11848
- http_options: Optional[HttpOptions] = Field(
11849
- default=None, description="""Used to override HTTP request options."""
12935
+ sdk_http_response: Optional[HttpResponse] = Field(
12936
+ default=None, description="""Used to retain the full HTTP response."""
12937
+ )
12938
+ next_page_token: Optional[str] = Field(default=None, description="""""")
12939
+ file_search_stores: Optional[list[FileSearchStore]] = Field(
12940
+ default=None, description="""The returned file search stores."""
11850
12941
  )
11851
12942
 
11852
12943
 
11853
- class DeleteCachedContentConfigDict(TypedDict, total=False):
11854
- """Optional parameters for caches.delete method."""
12944
+ class ListFileSearchStoresResponseDict(TypedDict, total=False):
12945
+ """Config for file_search_stores.list return value."""
11855
12946
 
11856
- http_options: Optional[HttpOptionsDict]
11857
- """Used to override HTTP request options."""
12947
+ sdk_http_response: Optional[HttpResponseDict]
12948
+ """Used to retain the full HTTP response."""
12949
+
12950
+ next_page_token: Optional[str]
12951
+ """"""
11858
12952
 
12953
+ file_search_stores: Optional[list[FileSearchStoreDict]]
12954
+ """The returned file search stores."""
11859
12955
 
11860
- DeleteCachedContentConfigOrDict = Union[
11861
- DeleteCachedContentConfig, DeleteCachedContentConfigDict
12956
+
12957
+ ListFileSearchStoresResponseOrDict = Union[
12958
+ ListFileSearchStoresResponse, ListFileSearchStoresResponseDict
11862
12959
  ]
11863
12960
 
11864
12961
 
11865
- class _DeleteCachedContentParameters(_common.BaseModel):
11866
- """Parameters for caches.delete method."""
12962
+ class WhiteSpaceConfig(_common.BaseModel):
12963
+ """Configuration for a white space chunking algorithm."""
11867
12964
 
11868
- name: Optional[str] = Field(
11869
- default=None,
11870
- description="""The server-generated resource name of the cached content.
11871
- """,
12965
+ max_tokens_per_chunk: Optional[int] = Field(
12966
+ default=None, description="""Maximum number of tokens per chunk."""
11872
12967
  )
11873
- config: Optional[DeleteCachedContentConfig] = Field(
12968
+ max_overlap_tokens: Optional[int] = Field(
11874
12969
  default=None,
11875
- description="""Optional parameters for the request.
11876
- """,
12970
+ description="""Maximum number of overlapping tokens between two adjacent chunks.""",
11877
12971
  )
11878
12972
 
11879
12973
 
11880
- class _DeleteCachedContentParametersDict(TypedDict, total=False):
11881
- """Parameters for caches.delete method."""
12974
+ class WhiteSpaceConfigDict(TypedDict, total=False):
12975
+ """Configuration for a white space chunking algorithm."""
11882
12976
 
11883
- name: Optional[str]
11884
- """The server-generated resource name of the cached content.
11885
- """
12977
+ max_tokens_per_chunk: Optional[int]
12978
+ """Maximum number of tokens per chunk."""
11886
12979
 
11887
- config: Optional[DeleteCachedContentConfigDict]
11888
- """Optional parameters for the request.
11889
- """
12980
+ max_overlap_tokens: Optional[int]
12981
+ """Maximum number of overlapping tokens between two adjacent chunks."""
11890
12982
 
11891
12983
 
11892
- _DeleteCachedContentParametersOrDict = Union[
11893
- _DeleteCachedContentParameters, _DeleteCachedContentParametersDict
11894
- ]
12984
+ WhiteSpaceConfigOrDict = Union[WhiteSpaceConfig, WhiteSpaceConfigDict]
11895
12985
 
11896
12986
 
11897
- class DeleteCachedContentResponse(_common.BaseModel):
11898
- """Empty response for caches.delete method."""
12987
+ class ChunkingConfig(_common.BaseModel):
12988
+ """Config for telling the service how to chunk the file."""
11899
12989
 
11900
- sdk_http_response: Optional[HttpResponse] = Field(
11901
- default=None, description="""Used to retain the full HTTP response."""
12990
+ white_space_config: Optional[WhiteSpaceConfig] = Field(
12991
+ default=None, description="""White space chunking configuration."""
11902
12992
  )
11903
12993
 
11904
12994
 
11905
- class DeleteCachedContentResponseDict(TypedDict, total=False):
11906
- """Empty response for caches.delete method."""
12995
+ class ChunkingConfigDict(TypedDict, total=False):
12996
+ """Config for telling the service how to chunk the file."""
11907
12997
 
11908
- sdk_http_response: Optional[HttpResponseDict]
11909
- """Used to retain the full HTTP response."""
12998
+ white_space_config: Optional[WhiteSpaceConfigDict]
12999
+ """White space chunking configuration."""
11910
13000
 
11911
13001
 
11912
- DeleteCachedContentResponseOrDict = Union[
11913
- DeleteCachedContentResponse, DeleteCachedContentResponseDict
11914
- ]
13002
+ ChunkingConfigOrDict = Union[ChunkingConfig, ChunkingConfigDict]
11915
13003
 
11916
13004
 
11917
- class UpdateCachedContentConfig(_common.BaseModel):
11918
- """Optional parameters for caches.update method."""
13005
+ class UploadToFileSearchStoreConfig(_common.BaseModel):
13006
+ """Optional parameters for uploading a file to a FileSearchStore."""
11919
13007
 
11920
13008
  http_options: Optional[HttpOptions] = Field(
11921
13009
  default=None, description="""Used to override HTTP request options."""
11922
13010
  )
11923
- ttl: Optional[str] = Field(
13011
+ should_return_http_response: Optional[bool] = Field(
11924
13012
  default=None,
11925
- description="""The TTL for this resource. The expiration time is computed: now + TTL. It is a duration string, with up to nine fractional digits, terminated by 's'. Example: "3.5s".""",
13013
+ description=""" If true, the raw HTTP response will be returned in the 'sdk_http_response' field.""",
11926
13014
  )
11927
- expire_time: Optional[datetime.datetime] = Field(
13015
+ mime_type: Optional[str] = Field(
11928
13016
  default=None,
11929
- description="""Timestamp of when this resource is considered expired. Uses RFC 3339 format, Example: 2014-10-02T15:01:23Z.""",
13017
+ description="""MIME type of the file to be uploaded. If not provided, it will be inferred from the file extension.""",
13018
+ )
13019
+ display_name: Optional[str] = Field(
13020
+ default=None, description="""Display name of the created document."""
13021
+ )
13022
+ custom_metadata: Optional[list[CustomMetadata]] = Field(
13023
+ default=None,
13024
+ description="""User provided custom metadata stored as key-value pairs used for querying.""",
13025
+ )
13026
+ chunking_config: Optional[ChunkingConfig] = Field(
13027
+ default=None,
13028
+ description="""Config for telling the service how to chunk the file.""",
11930
13029
  )
11931
13030
 
11932
13031
 
11933
- class UpdateCachedContentConfigDict(TypedDict, total=False):
11934
- """Optional parameters for caches.update method."""
13032
+ class UploadToFileSearchStoreConfigDict(TypedDict, total=False):
13033
+ """Optional parameters for uploading a file to a FileSearchStore."""
11935
13034
 
11936
13035
  http_options: Optional[HttpOptionsDict]
11937
13036
  """Used to override HTTP request options."""
11938
13037
 
11939
- ttl: Optional[str]
11940
- """The TTL for this resource. The expiration time is computed: now + TTL. It is a duration string, with up to nine fractional digits, terminated by 's'. Example: "3.5s"."""
13038
+ should_return_http_response: Optional[bool]
13039
+ """ If true, the raw HTTP response will be returned in the 'sdk_http_response' field."""
11941
13040
 
11942
- expire_time: Optional[datetime.datetime]
11943
- """Timestamp of when this resource is considered expired. Uses RFC 3339 format, Example: 2014-10-02T15:01:23Z."""
13041
+ mime_type: Optional[str]
13042
+ """MIME type of the file to be uploaded. If not provided, it will be inferred from the file extension."""
11944
13043
 
13044
+ display_name: Optional[str]
13045
+ """Display name of the created document."""
11945
13046
 
11946
- UpdateCachedContentConfigOrDict = Union[
11947
- UpdateCachedContentConfig, UpdateCachedContentConfigDict
13047
+ custom_metadata: Optional[list[CustomMetadataDict]]
13048
+ """User provided custom metadata stored as key-value pairs used for querying."""
13049
+
13050
+ chunking_config: Optional[ChunkingConfigDict]
13051
+ """Config for telling the service how to chunk the file."""
13052
+
13053
+
13054
+ UploadToFileSearchStoreConfigOrDict = Union[
13055
+ UploadToFileSearchStoreConfig, UploadToFileSearchStoreConfigDict
11948
13056
  ]
11949
13057
 
11950
13058
 
11951
- class _UpdateCachedContentParameters(_common.BaseModel):
13059
+ class _UploadToFileSearchStoreParameters(_common.BaseModel):
13060
+ """Generates the parameters for the private _upload_to_file_search_store method."""
11952
13061
 
11953
- name: Optional[str] = Field(
13062
+ file_search_store_name: Optional[str] = Field(
11954
13063
  default=None,
11955
- description="""The server-generated resource name of the cached content.
11956
- """,
13064
+ description="""The resource name of the FileSearchStore. Example: `fileSearchStores/my-file-search-store-123`""",
11957
13065
  )
11958
- config: Optional[UpdateCachedContentConfig] = Field(
13066
+ config: Optional[UploadToFileSearchStoreConfig] = Field(
11959
13067
  default=None,
11960
- description="""Configuration that contains optional parameters.
11961
- """,
13068
+ description="""Used to override the default configuration.""",
11962
13069
  )
11963
13070
 
11964
13071
 
11965
- class _UpdateCachedContentParametersDict(TypedDict, total=False):
13072
+ class _UploadToFileSearchStoreParametersDict(TypedDict, total=False):
13073
+ """Generates the parameters for the private _upload_to_file_search_store method."""
11966
13074
 
11967
- name: Optional[str]
11968
- """The server-generated resource name of the cached content.
11969
- """
13075
+ file_search_store_name: Optional[str]
13076
+ """The resource name of the FileSearchStore. Example: `fileSearchStores/my-file-search-store-123`"""
11970
13077
 
11971
- config: Optional[UpdateCachedContentConfigDict]
11972
- """Configuration that contains optional parameters.
11973
- """
13078
+ config: Optional[UploadToFileSearchStoreConfigDict]
13079
+ """Used to override the default configuration."""
11974
13080
 
11975
13081
 
11976
- _UpdateCachedContentParametersOrDict = Union[
11977
- _UpdateCachedContentParameters, _UpdateCachedContentParametersDict
13082
+ _UploadToFileSearchStoreParametersOrDict = Union[
13083
+ _UploadToFileSearchStoreParameters, _UploadToFileSearchStoreParametersDict
11978
13084
  ]
11979
13085
 
11980
13086
 
11981
- class ListCachedContentsConfig(_common.BaseModel):
11982
- """Config for caches.list method."""
13087
+ class UploadToFileSearchStoreResumableResponse(_common.BaseModel):
13088
+ """Response for the resumable upload method."""
13089
+
13090
+ sdk_http_response: Optional[HttpResponse] = Field(
13091
+ default=None, description="""Used to retain the full HTTP response."""
13092
+ )
13093
+
13094
+
13095
+ class UploadToFileSearchStoreResumableResponseDict(TypedDict, total=False):
13096
+ """Response for the resumable upload method."""
13097
+
13098
+ sdk_http_response: Optional[HttpResponseDict]
13099
+ """Used to retain the full HTTP response."""
13100
+
13101
+
13102
+ UploadToFileSearchStoreResumableResponseOrDict = Union[
13103
+ UploadToFileSearchStoreResumableResponse,
13104
+ UploadToFileSearchStoreResumableResponseDict,
13105
+ ]
13106
+
13107
+
13108
+ class ImportFileConfig(_common.BaseModel):
13109
+ """Optional parameters for importing a file."""
11983
13110
 
11984
13111
  http_options: Optional[HttpOptions] = Field(
11985
13112
  default=None, description="""Used to override HTTP request options."""
11986
13113
  )
11987
- page_size: Optional[int] = Field(default=None, description="""""")
11988
- page_token: Optional[str] = Field(default=None, description="""""")
13114
+ custom_metadata: Optional[list[CustomMetadata]] = Field(
13115
+ default=None,
13116
+ description="""User provided custom metadata stored as key-value pairs used for querying.""",
13117
+ )
13118
+ chunking_config: Optional[ChunkingConfig] = Field(
13119
+ default=None,
13120
+ description="""Config for telling the service how to chunk the file.""",
13121
+ )
11989
13122
 
11990
13123
 
11991
- class ListCachedContentsConfigDict(TypedDict, total=False):
11992
- """Config for caches.list method."""
13124
+ class ImportFileConfigDict(TypedDict, total=False):
13125
+ """Optional parameters for importing a file."""
11993
13126
 
11994
13127
  http_options: Optional[HttpOptionsDict]
11995
13128
  """Used to override HTTP request options."""
11996
13129
 
11997
- page_size: Optional[int]
11998
- """"""
13130
+ custom_metadata: Optional[list[CustomMetadataDict]]
13131
+ """User provided custom metadata stored as key-value pairs used for querying."""
11999
13132
 
12000
- page_token: Optional[str]
12001
- """"""
13133
+ chunking_config: Optional[ChunkingConfigDict]
13134
+ """Config for telling the service how to chunk the file."""
12002
13135
 
12003
13136
 
12004
- ListCachedContentsConfigOrDict = Union[
12005
- ListCachedContentsConfig, ListCachedContentsConfigDict
12006
- ]
13137
+ ImportFileConfigOrDict = Union[ImportFileConfig, ImportFileConfigDict]
12007
13138
 
12008
13139
 
12009
- class _ListCachedContentsParameters(_common.BaseModel):
12010
- """Parameters for caches.list method."""
13140
+ class _ImportFileParameters(_common.BaseModel):
13141
+ """Config for file_search_stores.import_file parameters."""
12011
13142
 
12012
- config: Optional[ListCachedContentsConfig] = Field(
13143
+ file_search_store_name: Optional[str] = Field(
12013
13144
  default=None,
12014
- description="""Configuration that contains optional parameters.
12015
- """,
13145
+ description="""The resource name of the FileSearchStore. Example: `fileSearchStores/my-file-search-store-123`""",
13146
+ )
13147
+ file_name: Optional[str] = Field(
13148
+ default=None,
13149
+ description="""The name of the File API File to import. Example: `files/abc-123`""",
13150
+ )
13151
+ config: Optional[ImportFileConfig] = Field(
13152
+ default=None, description="""Optional parameters for the request."""
12016
13153
  )
12017
13154
 
12018
13155
 
12019
- class _ListCachedContentsParametersDict(TypedDict, total=False):
12020
- """Parameters for caches.list method."""
13156
+ class _ImportFileParametersDict(TypedDict, total=False):
13157
+ """Config for file_search_stores.import_file parameters."""
12021
13158
 
12022
- config: Optional[ListCachedContentsConfigDict]
12023
- """Configuration that contains optional parameters.
12024
- """
13159
+ file_search_store_name: Optional[str]
13160
+ """The resource name of the FileSearchStore. Example: `fileSearchStores/my-file-search-store-123`"""
12025
13161
 
13162
+ file_name: Optional[str]
13163
+ """The name of the File API File to import. Example: `files/abc-123`"""
12026
13164
 
12027
- _ListCachedContentsParametersOrDict = Union[
12028
- _ListCachedContentsParameters, _ListCachedContentsParametersDict
13165
+ config: Optional[ImportFileConfigDict]
13166
+ """Optional parameters for the request."""
13167
+
13168
+
13169
+ _ImportFileParametersOrDict = Union[
13170
+ _ImportFileParameters, _ImportFileParametersDict
12029
13171
  ]
12030
13172
 
12031
13173
 
12032
- class ListCachedContentsResponse(_common.BaseModel):
13174
+ class ImportFileResponse(_common.BaseModel):
13175
+ """Response for ImportFile to import a File API file with a file search store."""
12033
13176
 
12034
13177
  sdk_http_response: Optional[HttpResponse] = Field(
12035
13178
  default=None, description="""Used to retain the full HTTP response."""
12036
13179
  )
12037
- next_page_token: Optional[str] = Field(default=None, description="""""")
12038
- cached_contents: Optional[list[CachedContent]] = Field(
13180
+ parent: Optional[str] = Field(
12039
13181
  default=None,
12040
- description="""List of cached contents.
12041
- """,
13182
+ description="""The name of the FileSearchStore containing Documents.""",
13183
+ )
13184
+ document_name: Optional[str] = Field(
13185
+ default=None, description="""The identifier for the Document imported."""
12042
13186
  )
12043
13187
 
12044
13188
 
12045
- class ListCachedContentsResponseDict(TypedDict, total=False):
13189
+ class ImportFileResponseDict(TypedDict, total=False):
13190
+ """Response for ImportFile to import a File API file with a file search store."""
12046
13191
 
12047
13192
  sdk_http_response: Optional[HttpResponseDict]
12048
13193
  """Used to retain the full HTTP response."""
12049
13194
 
12050
- next_page_token: Optional[str]
12051
- """"""
13195
+ parent: Optional[str]
13196
+ """The name of the FileSearchStore containing Documents."""
12052
13197
 
12053
- cached_contents: Optional[list[CachedContentDict]]
12054
- """List of cached contents.
12055
- """
13198
+ document_name: Optional[str]
13199
+ """The identifier for the Document imported."""
12056
13200
 
12057
13201
 
12058
- ListCachedContentsResponseOrDict = Union[
12059
- ListCachedContentsResponse, ListCachedContentsResponseDict
12060
- ]
13202
+ ImportFileResponseOrDict = Union[ImportFileResponse, ImportFileResponseDict]
13203
+
13204
+
13205
+ class ImportFileOperation(_common.BaseModel, Operation):
13206
+ """Long-running operation for importing a file to a FileSearchStore."""
13207
+
13208
+ response: Optional[ImportFileResponse] = Field(
13209
+ default=None,
13210
+ description="""The result of the ImportFile operation, available when the operation is done.""",
13211
+ )
13212
+
13213
+ @classmethod
13214
+ def from_api_response(
13215
+ cls, api_response: Any, is_vertex_ai: bool = False
13216
+ ) -> Self:
13217
+ """Instantiates a ImportFileOperation from an API response."""
13218
+
13219
+ response_dict = _ImportFileOperation_from_mldev(api_response)
13220
+ return cls._from_response(response=response_dict, kwargs={})
12061
13221
 
12062
13222
 
12063
13223
  class ListFilesConfig(_common.BaseModel):
@@ -12745,6 +13905,52 @@ _CreateBatchJobParametersOrDict = Union[
12745
13905
  ]
12746
13906
 
12747
13907
 
13908
+ class CompletionStats(_common.BaseModel):
13909
+ """Success and error statistics of processing multiple entities (for example, DataItems or structured data rows) in batch.
13910
+
13911
+ This data type is not supported in Gemini API.
13912
+ """
13913
+
13914
+ failed_count: Optional[int] = Field(
13915
+ default=None,
13916
+ description="""Output only. The number of entities for which any error was encountered.""",
13917
+ )
13918
+ incomplete_count: Optional[int] = Field(
13919
+ default=None,
13920
+ description="""Output only. In cases when enough errors are encountered a job, pipeline, or operation may be failed as a whole. Below is the number of entities for which the processing had not been finished (either in successful or failed state). Set to -1 if the number is unknown (for example, the operation failed before the total entity number could be collected).""",
13921
+ )
13922
+ successful_count: Optional[int] = Field(
13923
+ default=None,
13924
+ description="""Output only. The number of entities that had been processed successfully.""",
13925
+ )
13926
+ successful_forecast_point_count: Optional[int] = Field(
13927
+ default=None,
13928
+ description="""Output only. The number of the successful forecast points that are generated by the forecasting model. This is ONLY used by the forecasting batch prediction.""",
13929
+ )
13930
+
13931
+
13932
+ class CompletionStatsDict(TypedDict, total=False):
13933
+ """Success and error statistics of processing multiple entities (for example, DataItems or structured data rows) in batch.
13934
+
13935
+ This data type is not supported in Gemini API.
13936
+ """
13937
+
13938
+ failed_count: Optional[int]
13939
+ """Output only. The number of entities for which any error was encountered."""
13940
+
13941
+ incomplete_count: Optional[int]
13942
+ """Output only. In cases when enough errors are encountered a job, pipeline, or operation may be failed as a whole. Below is the number of entities for which the processing had not been finished (either in successful or failed state). Set to -1 if the number is unknown (for example, the operation failed before the total entity number could be collected)."""
13943
+
13944
+ successful_count: Optional[int]
13945
+ """Output only. The number of entities that had been processed successfully."""
13946
+
13947
+ successful_forecast_point_count: Optional[int]
13948
+ """Output only. The number of the successful forecast points that are generated by the forecasting model. This is ONLY used by the forecasting batch prediction."""
13949
+
13950
+
13951
+ CompletionStatsOrDict = Union[CompletionStats, CompletionStatsDict]
13952
+
13953
+
12748
13954
  class BatchJob(_common.BaseModel):
12749
13955
  """Config for batches.create return value."""
12750
13956
 
@@ -12778,7 +13984,7 @@ class BatchJob(_common.BaseModel):
12778
13984
  )
12779
13985
  end_time: Optional[datetime.datetime] = Field(
12780
13986
  default=None,
12781
- description="""The time when the BatchJob was completed.
13987
+ description="""The time when the BatchJob was completed. This field is for Vertex AI only.
12782
13988
  """,
12783
13989
  )
12784
13990
  update_time: Optional[datetime.datetime] = Field(
@@ -12793,7 +13999,7 @@ class BatchJob(_common.BaseModel):
12793
13999
  )
12794
14000
  src: Optional[BatchJobSource] = Field(
12795
14001
  default=None,
12796
- description="""Configuration for the input data.
14002
+ description="""Configuration for the input data. This field is for Vertex AI only.
12797
14003
  """,
12798
14004
  )
12799
14005
  dest: Optional[BatchJobDestination] = Field(
@@ -12801,6 +14007,11 @@ class BatchJob(_common.BaseModel):
12801
14007
  description="""Configuration for the output data.
12802
14008
  """,
12803
14009
  )
14010
+ completion_stats: Optional[CompletionStats] = Field(
14011
+ default=None,
14012
+ description="""Statistics on completed and failed prediction instances. This field is for Vertex AI only.
14013
+ """,
14014
+ )
12804
14015
 
12805
14016
  @property
12806
14017
  def done(self) -> bool:
@@ -12855,7 +14066,7 @@ class BatchJobDict(TypedDict, total=False):
12855
14066
  """Output only. Time when the Job for the first time entered the `JOB_STATE_RUNNING` state."""
12856
14067
 
12857
14068
  end_time: Optional[datetime.datetime]
12858
- """The time when the BatchJob was completed.
14069
+ """The time when the BatchJob was completed. This field is for Vertex AI only.
12859
14070
  """
12860
14071
 
12861
14072
  update_time: Optional[datetime.datetime]
@@ -12867,13 +14078,17 @@ class BatchJobDict(TypedDict, total=False):
12867
14078
  """
12868
14079
 
12869
14080
  src: Optional[BatchJobSourceDict]
12870
- """Configuration for the input data.
14081
+ """Configuration for the input data. This field is for Vertex AI only.
12871
14082
  """
12872
14083
 
12873
14084
  dest: Optional[BatchJobDestinationDict]
12874
14085
  """Configuration for the output data.
12875
14086
  """
12876
14087
 
14088
+ completion_stats: Optional[CompletionStatsDict]
14089
+ """Statistics on completed and failed prediction instances. This field is for Vertex AI only.
14090
+ """
14091
+
12877
14092
 
12878
14093
  BatchJobOrDict = Union[BatchJob, BatchJobDict]
12879
14094
 
@@ -16551,3 +17766,54 @@ class RougeSpecDict(TypedDict, total=False):
16551
17766
 
16552
17767
 
16553
17768
  RougeSpecOrDict = Union[RougeSpec, RougeSpecDict]
17769
+
17770
+
17771
+ class UploadToFileSearchStoreResponse(_common.BaseModel):
17772
+ """The response when long-running operation for uploading a file to a FileSearchStore complete."""
17773
+
17774
+ sdk_http_response: Optional[HttpResponse] = Field(
17775
+ default=None, description="""Used to retain the full HTTP response."""
17776
+ )
17777
+ parent: Optional[str] = Field(
17778
+ default=None,
17779
+ description="""The name of the FileSearchStore containing Documents.""",
17780
+ )
17781
+ document_name: Optional[str] = Field(
17782
+ default=None, description="""The identifier for the Document imported."""
17783
+ )
17784
+
17785
+
17786
+ class UploadToFileSearchStoreResponseDict(TypedDict, total=False):
17787
+ """The response when long-running operation for uploading a file to a FileSearchStore complete."""
17788
+
17789
+ sdk_http_response: Optional[HttpResponseDict]
17790
+ """Used to retain the full HTTP response."""
17791
+
17792
+ parent: Optional[str]
17793
+ """The name of the FileSearchStore containing Documents."""
17794
+
17795
+ document_name: Optional[str]
17796
+ """The identifier for the Document imported."""
17797
+
17798
+
17799
+ UploadToFileSearchStoreResponseOrDict = Union[
17800
+ UploadToFileSearchStoreResponse, UploadToFileSearchStoreResponseDict
17801
+ ]
17802
+
17803
+
17804
+ class UploadToFileSearchStoreOperation(_common.BaseModel, Operation):
17805
+ """Long-running operation for uploading a file to a FileSearchStore."""
17806
+
17807
+ response: Optional[UploadToFileSearchStoreResponse] = Field(
17808
+ default=None,
17809
+ description="""The result of the UploadToFileSearchStore operation, available when the operation is done.""",
17810
+ )
17811
+
17812
+ @classmethod
17813
+ def from_api_response(
17814
+ cls, api_response: Any, is_vertex_ai: bool = False
17815
+ ) -> Self:
17816
+ """Instantiates a UploadToFileSearchStoreOperation from an API response."""
17817
+
17818
+ response_dict = _UploadToFileSearchStoreOperation_from_mldev(api_response)
17819
+ return cls._from_response(response=response_dict, kwargs={})