google-genai 1.48.0__py3-none-any.whl → 1.50.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- google/genai/_api_client.py +36 -7
- google/genai/_live_converters.py +23 -17
- google/genai/_local_tokenizer_loader.py +0 -9
- google/genai/_operations_converters.py +96 -0
- google/genai/_replay_api_client.py +24 -39
- google/genai/_tokens_converters.py +10 -7
- google/genai/_transformers.py +2 -0
- google/genai/batches.py +15 -7
- google/genai/caches.py +16 -10
- google/genai/client.py +11 -0
- google/genai/documents.py +552 -0
- google/genai/errors.py +46 -2
- google/genai/file_search_stores.py +1312 -0
- google/genai/models.py +51 -20
- google/genai/operations.py +4 -0
- google/genai/pagers.py +7 -1
- google/genai/tunings.py +313 -2
- google/genai/types.py +1723 -388
- google/genai/version.py +1 -1
- {google_genai-1.48.0.dist-info → google_genai-1.50.0.dist-info}/METADATA +1 -1
- google_genai-1.50.0.dist-info/RECORD +41 -0
- google_genai-1.48.0.dist-info/RECORD +0 -39
- {google_genai-1.48.0.dist-info → google_genai-1.50.0.dist-info}/WHEEL +0 -0
- {google_genai-1.48.0.dist-info → google_genai-1.50.0.dist-info}/licenses/LICENSE +0 -0
- {google_genai-1.48.0.dist-info → google_genai-1.50.0.dist-info}/top_level.txt +0 -0
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
|
|
|
@@ -111,6 +114,8 @@ else:
|
|
|
111
114
|
HttpxAsyncClient = None
|
|
112
115
|
|
|
113
116
|
logger = logging.getLogger('google_genai.types')
|
|
117
|
+
_from_json_schema_warning_logged = False
|
|
118
|
+
_json_schema_warning_logged = False
|
|
114
119
|
|
|
115
120
|
T = typing.TypeVar('T', bound='GenerateContentResponse')
|
|
116
121
|
|
|
@@ -182,6 +187,20 @@ class Mode(_common.CaseInSensitiveEnum):
|
|
|
182
187
|
"""Run retrieval only when system decides it is necessary."""
|
|
183
188
|
|
|
184
189
|
|
|
190
|
+
class ApiSpec(_common.CaseInSensitiveEnum):
|
|
191
|
+
"""The API spec that the external API implements.
|
|
192
|
+
|
|
193
|
+
This enum is not supported in Gemini API.
|
|
194
|
+
"""
|
|
195
|
+
|
|
196
|
+
API_SPEC_UNSPECIFIED = 'API_SPEC_UNSPECIFIED'
|
|
197
|
+
"""Unspecified API spec. This value should not be used."""
|
|
198
|
+
SIMPLE_SEARCH = 'SIMPLE_SEARCH'
|
|
199
|
+
"""Simple search API spec."""
|
|
200
|
+
ELASTIC_SEARCH = 'ELASTIC_SEARCH'
|
|
201
|
+
"""Elastic search API spec."""
|
|
202
|
+
|
|
203
|
+
|
|
185
204
|
class AuthType(_common.CaseInSensitiveEnum):
|
|
186
205
|
"""Type of auth scheme. This enum is not supported in Gemini API."""
|
|
187
206
|
|
|
@@ -200,18 +219,20 @@ class AuthType(_common.CaseInSensitiveEnum):
|
|
|
200
219
|
"""OpenID Connect (OIDC) Auth."""
|
|
201
220
|
|
|
202
221
|
|
|
203
|
-
class
|
|
204
|
-
"""The API
|
|
205
|
-
|
|
206
|
-
This enum is not supported in Gemini API.
|
|
207
|
-
"""
|
|
222
|
+
class HttpElementLocation(_common.CaseInSensitiveEnum):
|
|
223
|
+
"""The location of the API key. This enum is not supported in Gemini API."""
|
|
208
224
|
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
225
|
+
HTTP_IN_UNSPECIFIED = 'HTTP_IN_UNSPECIFIED'
|
|
226
|
+
HTTP_IN_QUERY = 'HTTP_IN_QUERY'
|
|
227
|
+
"""Element is in the HTTP request query."""
|
|
228
|
+
HTTP_IN_HEADER = 'HTTP_IN_HEADER'
|
|
229
|
+
"""Element is in the HTTP request header."""
|
|
230
|
+
HTTP_IN_PATH = 'HTTP_IN_PATH'
|
|
231
|
+
"""Element is in the HTTP request path."""
|
|
232
|
+
HTTP_IN_BODY = 'HTTP_IN_BODY'
|
|
233
|
+
"""Element is in the HTTP request body."""
|
|
234
|
+
HTTP_IN_COOKIE = 'HTTP_IN_COOKIE'
|
|
235
|
+
"""Element is in the HTTP request cookie."""
|
|
215
236
|
|
|
216
237
|
|
|
217
238
|
class PhishBlockThreshold(_common.CaseInSensitiveEnum):
|
|
@@ -409,14 +430,13 @@ class BlockedReason(_common.CaseInSensitiveEnum):
|
|
|
409
430
|
class TrafficType(_common.CaseInSensitiveEnum):
|
|
410
431
|
"""Output only.
|
|
411
432
|
|
|
412
|
-
|
|
413
|
-
Provisioned Throughput quota. This enum is not supported in Gemini API.
|
|
433
|
+
The traffic type for this request. This enum is not supported in Gemini API.
|
|
414
434
|
"""
|
|
415
435
|
|
|
416
436
|
TRAFFIC_TYPE_UNSPECIFIED = 'TRAFFIC_TYPE_UNSPECIFIED'
|
|
417
437
|
"""Unspecified request traffic type."""
|
|
418
438
|
ON_DEMAND = 'ON_DEMAND'
|
|
419
|
-
"""
|
|
439
|
+
"""The request was processed using Pay-As-You-Go quota."""
|
|
420
440
|
PROVISIONED_THROUGHPUT = 'PROVISIONED_THROUGHPUT'
|
|
421
441
|
"""Type for Provisioned Throughput traffic."""
|
|
422
442
|
|
|
@@ -518,6 +538,8 @@ class TuningTask(_common.CaseInSensitiveEnum):
|
|
|
518
538
|
"""Tuning task for image to video."""
|
|
519
539
|
TUNING_TASK_T2V = 'TUNING_TASK_T2V'
|
|
520
540
|
"""Tuning task for text to video."""
|
|
541
|
+
TUNING_TASK_R2V = 'TUNING_TASK_R2V'
|
|
542
|
+
"""Tuning task for reference to video."""
|
|
521
543
|
|
|
522
544
|
|
|
523
545
|
class JSONSchemaType(Enum):
|
|
@@ -735,6 +757,15 @@ class TuningMethod(_common.CaseInSensitiveEnum):
|
|
|
735
757
|
"""Preference optimization tuning."""
|
|
736
758
|
|
|
737
759
|
|
|
760
|
+
class DocumentState(_common.CaseInSensitiveEnum):
|
|
761
|
+
"""State for the lifecycle of a Document."""
|
|
762
|
+
|
|
763
|
+
STATE_UNSPECIFIED = 'STATE_UNSPECIFIED'
|
|
764
|
+
STATE_PENDING = 'STATE_PENDING'
|
|
765
|
+
STATE_ACTIVE = 'STATE_ACTIVE'
|
|
766
|
+
STATE_FAILED = 'STATE_FAILED'
|
|
767
|
+
|
|
768
|
+
|
|
738
769
|
class FileState(_common.CaseInSensitiveEnum):
|
|
739
770
|
"""State for the lifecycle of a File."""
|
|
740
771
|
|
|
@@ -904,7 +935,7 @@ class FunctionCall(_common.BaseModel):
|
|
|
904
935
|
)
|
|
905
936
|
name: Optional[str] = Field(
|
|
906
937
|
default=None,
|
|
907
|
-
description="""
|
|
938
|
+
description="""Optional. The name of the function to call. Matches [FunctionDeclaration.name].""",
|
|
908
939
|
)
|
|
909
940
|
|
|
910
941
|
|
|
@@ -919,7 +950,7 @@ class FunctionCallDict(TypedDict, total=False):
|
|
|
919
950
|
"""Optional. The function parameters and values in JSON object format. See [FunctionDeclaration.parameters] for parameter details."""
|
|
920
951
|
|
|
921
952
|
name: Optional[str]
|
|
922
|
-
"""
|
|
953
|
+
"""Optional. The name of the function to call. Matches [FunctionDeclaration.name]."""
|
|
923
954
|
|
|
924
955
|
|
|
925
956
|
FunctionCallOrDict = Union[FunctionCall, FunctionCallDict]
|
|
@@ -1360,6 +1391,81 @@ class Part(_common.BaseModel):
|
|
|
1360
1391
|
description="""Optional. Video metadata. The metadata should only be specified while the video data is presented in inline_data or file_data.""",
|
|
1361
1392
|
)
|
|
1362
1393
|
|
|
1394
|
+
def __init__(
|
|
1395
|
+
self,
|
|
1396
|
+
value: Optional['PartUnionDict'] = None,
|
|
1397
|
+
/,
|
|
1398
|
+
*,
|
|
1399
|
+
video_metadata: Optional[VideoMetadata] = None,
|
|
1400
|
+
thought: Optional[bool] = None,
|
|
1401
|
+
inline_data: Optional[Blob] = None,
|
|
1402
|
+
file_data: Optional[FileData] = None,
|
|
1403
|
+
thought_signature: Optional[bytes] = None,
|
|
1404
|
+
function_call: Optional[FunctionCall] = None,
|
|
1405
|
+
code_execution_result: Optional[CodeExecutionResult] = None,
|
|
1406
|
+
executable_code: Optional[ExecutableCode] = None,
|
|
1407
|
+
function_response: Optional[FunctionResponse] = None,
|
|
1408
|
+
text: Optional[str] = None,
|
|
1409
|
+
# Pydantic allows CamelCase in addition to snake_case attribute
|
|
1410
|
+
# names. kwargs here catch these aliases.
|
|
1411
|
+
**kwargs: Any,
|
|
1412
|
+
):
|
|
1413
|
+
part_dict = dict(
|
|
1414
|
+
video_metadata=video_metadata,
|
|
1415
|
+
thought=thought,
|
|
1416
|
+
inline_data=inline_data,
|
|
1417
|
+
file_data=file_data,
|
|
1418
|
+
thought_signature=thought_signature,
|
|
1419
|
+
function_call=function_call,
|
|
1420
|
+
code_execution_result=code_execution_result,
|
|
1421
|
+
executable_code=executable_code,
|
|
1422
|
+
function_response=function_response,
|
|
1423
|
+
text=text,
|
|
1424
|
+
)
|
|
1425
|
+
part_dict = {k: v for k, v in part_dict.items() if v is not None}
|
|
1426
|
+
|
|
1427
|
+
if part_dict and value is not None:
|
|
1428
|
+
raise ValueError(
|
|
1429
|
+
'Positional and keyword arguments can not be combined when '
|
|
1430
|
+
'initializing a Part.'
|
|
1431
|
+
)
|
|
1432
|
+
|
|
1433
|
+
if value is None:
|
|
1434
|
+
pass
|
|
1435
|
+
elif isinstance(value, str):
|
|
1436
|
+
part_dict['text'] = value
|
|
1437
|
+
elif isinstance(value, File):
|
|
1438
|
+
if not value.uri or not value.mime_type:
|
|
1439
|
+
raise ValueError('file uri and mime_type are required.')
|
|
1440
|
+
part_dict['file_data'] = FileData(
|
|
1441
|
+
file_uri=value.uri,
|
|
1442
|
+
mime_type=value.mime_type,
|
|
1443
|
+
display_name=value.display_name,
|
|
1444
|
+
)
|
|
1445
|
+
elif isinstance(value, dict):
|
|
1446
|
+
try:
|
|
1447
|
+
Part.model_validate(value)
|
|
1448
|
+
part_dict.update(value) # type: ignore[arg-type]
|
|
1449
|
+
except pydantic.ValidationError:
|
|
1450
|
+
part_dict['file_data'] = FileData.model_validate(value)
|
|
1451
|
+
elif isinstance(value, Part):
|
|
1452
|
+
part_dict.update(value.dict())
|
|
1453
|
+
elif 'image' in value.__class__.__name__.lower():
|
|
1454
|
+
# PIL.Image case.
|
|
1455
|
+
|
|
1456
|
+
suffix = value.format.lower() if value.format else 'jpeg'
|
|
1457
|
+
mimetype = f'image/{suffix}'
|
|
1458
|
+
bytes_io = io.BytesIO()
|
|
1459
|
+
value.save(bytes_io, suffix.upper())
|
|
1460
|
+
|
|
1461
|
+
part_dict['inline_data'] = Blob(
|
|
1462
|
+
data=bytes_io.getvalue(), mime_type=mimetype
|
|
1463
|
+
)
|
|
1464
|
+
else:
|
|
1465
|
+
raise ValueError(f'Unsupported content part type: {type(value)}')
|
|
1466
|
+
|
|
1467
|
+
super().__init__(**part_dict, **kwargs)
|
|
1468
|
+
|
|
1363
1469
|
def as_image(self) -> Optional['Image']:
|
|
1364
1470
|
"""Returns the part as a PIL Image, or None if the part is not an image."""
|
|
1365
1471
|
if not self.inline_data:
|
|
@@ -1905,8 +2011,43 @@ class Schema(_common.BaseModel):
|
|
|
1905
2011
|
def json_schema(self) -> JSONSchema:
|
|
1906
2012
|
"""Converts the Schema object to a JSONSchema object, that is compatible with 2020-12 JSON Schema draft.
|
|
1907
2013
|
|
|
1908
|
-
|
|
2014
|
+
Note: Conversion of fields that are not included in the JSONSchema class
|
|
2015
|
+
are ignored.
|
|
2016
|
+
Json Schema is now supported natively by both Vertex AI and Gemini API.
|
|
2017
|
+
Users
|
|
2018
|
+
are recommended to pass/receive Json Schema directly to/from the API. For
|
|
2019
|
+
example:
|
|
2020
|
+
1. the counter part of GenerateContentConfig.response_schema is
|
|
2021
|
+
GenerateContentConfig.response_json_schema, which accepts [JSON
|
|
2022
|
+
Schema](https://json-schema.org/)
|
|
2023
|
+
2. the counter part of FunctionDeclaration.parameters is
|
|
2024
|
+
FunctionDeclaration.parameters_json_schema, which accepts [JSON
|
|
2025
|
+
Schema](https://json-schema.org/)
|
|
2026
|
+
3. the counter part of FunctionDeclaration.response is
|
|
2027
|
+
FunctionDeclaration.response_json_schema, which accepts [JSON
|
|
2028
|
+
Schema](https://json-schema.org/)
|
|
1909
2029
|
"""
|
|
2030
|
+
|
|
2031
|
+
global _json_schema_warning_logged
|
|
2032
|
+
if not _json_schema_warning_logged:
|
|
2033
|
+
info_message = """
|
|
2034
|
+
Note: Conversion of fields that are not included in the JSONSchema class are
|
|
2035
|
+
ignored.
|
|
2036
|
+
Json Schema is now supported natively by both Vertex AI and Gemini API. Users
|
|
2037
|
+
are recommended to pass/receive Json Schema directly to/from the API. For example:
|
|
2038
|
+
1. the counter part of GenerateContentConfig.response_schema is
|
|
2039
|
+
GenerateContentConfig.response_json_schema, which accepts [JSON
|
|
2040
|
+
Schema](https://json-schema.org/)
|
|
2041
|
+
2. the counter part of FunctionDeclaration.parameters is
|
|
2042
|
+
FunctionDeclaration.parameters_json_schema, which accepts [JSON
|
|
2043
|
+
Schema](https://json-schema.org/)
|
|
2044
|
+
3. the counter part of FunctionDeclaration.response is
|
|
2045
|
+
FunctionDeclaration.response_json_schema, which accepts [JSON
|
|
2046
|
+
Schema](https://json-schema.org/)
|
|
2047
|
+
"""
|
|
2048
|
+
logger.info(info_message)
|
|
2049
|
+
_json_schema_warning_logged = True
|
|
2050
|
+
|
|
1910
2051
|
json_schema_field_names: set[str] = set(JSONSchema.model_fields.keys())
|
|
1911
2052
|
schema_field_names: tuple[str] = (
|
|
1912
2053
|
'items',
|
|
@@ -1977,27 +2118,61 @@ class Schema(_common.BaseModel):
|
|
|
1977
2118
|
) -> 'Schema':
|
|
1978
2119
|
"""Converts a JSONSchema object to a Schema object.
|
|
1979
2120
|
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2121
|
+
Note: Conversion of fields that are not included in the JSONSchema class
|
|
2122
|
+
are ignored.
|
|
2123
|
+
Json Schema is now supported natively by both Vertex AI and Gemini API.
|
|
2124
|
+
Users
|
|
2125
|
+
are recommended to pass/receive Json Schema directly to/from the API. For
|
|
2126
|
+
example:
|
|
2127
|
+
1. the counter part of GenerateContentConfig.response_schema is
|
|
2128
|
+
GenerateContentConfig.response_json_schema, which accepts [JSON
|
|
2129
|
+
Schema](https://json-schema.org/)
|
|
2130
|
+
2. the counter part of FunctionDeclaration.parameters is
|
|
2131
|
+
FunctionDeclaration.parameters_json_schema, which accepts [JSON
|
|
2132
|
+
Schema](https://json-schema.org/)
|
|
2133
|
+
3. the counter part of FunctionDeclaration.response is
|
|
2134
|
+
FunctionDeclaration.response_json_schema, which accepts [JSON
|
|
2135
|
+
Schema](https://json-schema.org/)
|
|
2136
|
+
The JSONSchema is compatible with 2020-12 JSON Schema draft, specified by
|
|
2137
|
+
OpenAPI 3.1.
|
|
2138
|
+
|
|
2139
|
+
Args:
|
|
2140
|
+
json_schema: JSONSchema object to be converted.
|
|
2141
|
+
api_option: API option to be used. If set to 'VERTEX_AI', the
|
|
2142
|
+
JSONSchema will be converted to a Schema object that is compatible
|
|
2143
|
+
with Vertex AI API. If set to 'GEMINI_API', the JSONSchema will be
|
|
2144
|
+
converted to a Schema object that is compatible with Gemini API.
|
|
2145
|
+
Default is 'GEMINI_API'.
|
|
2146
|
+
raise_error_on_unsupported_field: If set to True, an error will be
|
|
2147
|
+
raised if the JSONSchema contains any unsupported fields. Default is
|
|
2148
|
+
False.
|
|
2149
|
+
|
|
2150
|
+
Returns:
|
|
2151
|
+
Schema object that is compatible with the specified API option.
|
|
2152
|
+
Raises:
|
|
2153
|
+
ValueError: If the JSONSchema contains any unsupported fields and
|
|
2154
|
+
raise_error_on_unsupported_field is set to True. Or if the JSONSchema
|
|
2155
|
+
is not compatible with the specified API option.
|
|
2000
2156
|
"""
|
|
2157
|
+
global _from_json_schema_warning_logged
|
|
2158
|
+
if not _from_json_schema_warning_logged:
|
|
2159
|
+
info_message = """
|
|
2160
|
+
Note: Conversion of fields that are not included in the JSONSchema class are ignored.
|
|
2161
|
+
Json Schema is now supported natively by both Vertex AI and Gemini API. Users
|
|
2162
|
+
are recommended to pass/receive Json Schema directly to/from the API. For example:
|
|
2163
|
+
1. the counter part of GenerateContentConfig.response_schema is
|
|
2164
|
+
GenerateContentConfig.response_json_schema, which accepts [JSON
|
|
2165
|
+
Schema](https://json-schema.org/)
|
|
2166
|
+
2. the counter part of FunctionDeclaration.parameters is
|
|
2167
|
+
FunctionDeclaration.parameters_json_schema, which accepts [JSON
|
|
2168
|
+
Schema](https://json-schema.org/)
|
|
2169
|
+
3. the counter part of FunctionDeclaration.response is
|
|
2170
|
+
FunctionDeclaration.response_json_schema, which accepts [JSON
|
|
2171
|
+
Schema](https://json-schema.org/)
|
|
2172
|
+
"""
|
|
2173
|
+
logger.info(info_message)
|
|
2174
|
+
_from_json_schema_warning_logged = True
|
|
2175
|
+
|
|
2001
2176
|
google_schema_field_names: set[str] = set(cls.model_fields.keys())
|
|
2002
2177
|
schema_field_names: tuple[str, ...] = (
|
|
2003
2178
|
'items',
|
|
@@ -2713,20 +2888,166 @@ GoogleSearchRetrievalOrDict = Union[
|
|
|
2713
2888
|
]
|
|
2714
2889
|
|
|
2715
2890
|
|
|
2891
|
+
class ComputerUse(_common.BaseModel):
|
|
2892
|
+
"""Tool to support computer use."""
|
|
2893
|
+
|
|
2894
|
+
environment: Optional[Environment] = Field(
|
|
2895
|
+
default=None, description="""Required. The environment being operated."""
|
|
2896
|
+
)
|
|
2897
|
+
excluded_predefined_functions: Optional[list[str]] = Field(
|
|
2898
|
+
default=None,
|
|
2899
|
+
description="""By default, predefined functions are included in the final model call.
|
|
2900
|
+
Some of them can be explicitly excluded from being automatically included.
|
|
2901
|
+
This can serve two purposes:
|
|
2902
|
+
1. Using a more restricted / different action space.
|
|
2903
|
+
2. Improving the definitions / instructions of predefined functions.""",
|
|
2904
|
+
)
|
|
2905
|
+
|
|
2906
|
+
|
|
2907
|
+
class ComputerUseDict(TypedDict, total=False):
|
|
2908
|
+
"""Tool to support computer use."""
|
|
2909
|
+
|
|
2910
|
+
environment: Optional[Environment]
|
|
2911
|
+
"""Required. The environment being operated."""
|
|
2912
|
+
|
|
2913
|
+
excluded_predefined_functions: Optional[list[str]]
|
|
2914
|
+
"""By default, predefined functions are included in the final model call.
|
|
2915
|
+
Some of them can be explicitly excluded from being automatically included.
|
|
2916
|
+
This can serve two purposes:
|
|
2917
|
+
1. Using a more restricted / different action space.
|
|
2918
|
+
2. Improving the definitions / instructions of predefined functions."""
|
|
2919
|
+
|
|
2920
|
+
|
|
2921
|
+
ComputerUseOrDict = Union[ComputerUse, ComputerUseDict]
|
|
2922
|
+
|
|
2923
|
+
|
|
2924
|
+
class FileSearch(_common.BaseModel):
|
|
2925
|
+
"""Tool to retrieve knowledge from the File Search Stores."""
|
|
2926
|
+
|
|
2927
|
+
file_search_store_names: Optional[list[str]] = Field(
|
|
2928
|
+
default=None,
|
|
2929
|
+
description="""The names of the file_search_stores to retrieve from.
|
|
2930
|
+
Example: `fileSearchStores/my-file-search-store-123`""",
|
|
2931
|
+
)
|
|
2932
|
+
top_k: Optional[int] = Field(
|
|
2933
|
+
default=None,
|
|
2934
|
+
description="""The number of file search retrieval chunks to retrieve.""",
|
|
2935
|
+
)
|
|
2936
|
+
metadata_filter: Optional[str] = Field(
|
|
2937
|
+
default=None,
|
|
2938
|
+
description="""Metadata filter to apply to the file search retrieval documents. See https://google.aip.dev/160 for the syntax of the filter expression.""",
|
|
2939
|
+
)
|
|
2940
|
+
|
|
2941
|
+
|
|
2942
|
+
class FileSearchDict(TypedDict, total=False):
|
|
2943
|
+
"""Tool to retrieve knowledge from the File Search Stores."""
|
|
2944
|
+
|
|
2945
|
+
file_search_store_names: Optional[list[str]]
|
|
2946
|
+
"""The names of the file_search_stores to retrieve from.
|
|
2947
|
+
Example: `fileSearchStores/my-file-search-store-123`"""
|
|
2948
|
+
|
|
2949
|
+
top_k: Optional[int]
|
|
2950
|
+
"""The number of file search retrieval chunks to retrieve."""
|
|
2951
|
+
|
|
2952
|
+
metadata_filter: Optional[str]
|
|
2953
|
+
"""Metadata filter to apply to the file search retrieval documents. See https://google.aip.dev/160 for the syntax of the filter expression."""
|
|
2954
|
+
|
|
2955
|
+
|
|
2956
|
+
FileSearchOrDict = Union[FileSearch, FileSearchDict]
|
|
2957
|
+
|
|
2958
|
+
|
|
2959
|
+
class ApiAuthApiKeyConfig(_common.BaseModel):
|
|
2960
|
+
"""The API secret. This data type is not supported in Gemini API."""
|
|
2961
|
+
|
|
2962
|
+
api_key_secret_version: Optional[str] = Field(
|
|
2963
|
+
default=None,
|
|
2964
|
+
description="""Required. The SecretManager secret version resource name storing API key. e.g. projects/{project}/secrets/{secret}/versions/{version}""",
|
|
2965
|
+
)
|
|
2966
|
+
api_key_string: Optional[str] = Field(
|
|
2967
|
+
default=None,
|
|
2968
|
+
description="""The API key string. Either this or `api_key_secret_version` must be set.""",
|
|
2969
|
+
)
|
|
2970
|
+
|
|
2971
|
+
|
|
2972
|
+
class ApiAuthApiKeyConfigDict(TypedDict, total=False):
|
|
2973
|
+
"""The API secret. This data type is not supported in Gemini API."""
|
|
2974
|
+
|
|
2975
|
+
api_key_secret_version: Optional[str]
|
|
2976
|
+
"""Required. The SecretManager secret version resource name storing API key. e.g. projects/{project}/secrets/{secret}/versions/{version}"""
|
|
2977
|
+
|
|
2978
|
+
api_key_string: Optional[str]
|
|
2979
|
+
"""The API key string. Either this or `api_key_secret_version` must be set."""
|
|
2980
|
+
|
|
2981
|
+
|
|
2982
|
+
ApiAuthApiKeyConfigOrDict = Union[ApiAuthApiKeyConfig, ApiAuthApiKeyConfigDict]
|
|
2983
|
+
|
|
2984
|
+
|
|
2985
|
+
class ApiAuth(_common.BaseModel):
|
|
2986
|
+
"""The generic reusable api auth config.
|
|
2987
|
+
|
|
2988
|
+
Deprecated. Please use AuthConfig (google/cloud/aiplatform/master/auth.proto)
|
|
2989
|
+
instead. This data type is not supported in Gemini API.
|
|
2990
|
+
"""
|
|
2991
|
+
|
|
2992
|
+
api_key_config: Optional[ApiAuthApiKeyConfig] = Field(
|
|
2993
|
+
default=None, description="""The API secret."""
|
|
2994
|
+
)
|
|
2995
|
+
|
|
2996
|
+
|
|
2997
|
+
class ApiAuthDict(TypedDict, total=False):
|
|
2998
|
+
"""The generic reusable api auth config.
|
|
2999
|
+
|
|
3000
|
+
Deprecated. Please use AuthConfig (google/cloud/aiplatform/master/auth.proto)
|
|
3001
|
+
instead. This data type is not supported in Gemini API.
|
|
3002
|
+
"""
|
|
3003
|
+
|
|
3004
|
+
api_key_config: Optional[ApiAuthApiKeyConfigDict]
|
|
3005
|
+
"""The API secret."""
|
|
3006
|
+
|
|
3007
|
+
|
|
3008
|
+
ApiAuthOrDict = Union[ApiAuth, ApiAuthDict]
|
|
3009
|
+
|
|
3010
|
+
|
|
2716
3011
|
class ApiKeyConfig(_common.BaseModel):
|
|
2717
|
-
"""Config for authentication with API key.
|
|
3012
|
+
"""Config for authentication with API key.
|
|
2718
3013
|
|
|
3014
|
+
This data type is not supported in Gemini API.
|
|
3015
|
+
"""
|
|
3016
|
+
|
|
3017
|
+
api_key_secret: Optional[str] = Field(
|
|
3018
|
+
default=None,
|
|
3019
|
+
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.""",
|
|
3020
|
+
)
|
|
2719
3021
|
api_key_string: Optional[str] = Field(
|
|
2720
3022
|
default=None,
|
|
2721
|
-
description="""The API key to be used in the request directly.""",
|
|
3023
|
+
description="""Optional. The API key to be used in the request directly.""",
|
|
3024
|
+
)
|
|
3025
|
+
http_element_location: Optional[HttpElementLocation] = Field(
|
|
3026
|
+
default=None, description="""Optional. The location of the API key."""
|
|
3027
|
+
)
|
|
3028
|
+
name: Optional[str] = Field(
|
|
3029
|
+
default=None,
|
|
3030
|
+
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
3031
|
)
|
|
2723
3032
|
|
|
2724
3033
|
|
|
2725
3034
|
class ApiKeyConfigDict(TypedDict, total=False):
|
|
2726
|
-
"""Config for authentication with API key.
|
|
3035
|
+
"""Config for authentication with API key.
|
|
3036
|
+
|
|
3037
|
+
This data type is not supported in Gemini API.
|
|
3038
|
+
"""
|
|
3039
|
+
|
|
3040
|
+
api_key_secret: Optional[str]
|
|
3041
|
+
"""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
3042
|
|
|
2728
3043
|
api_key_string: Optional[str]
|
|
2729
|
-
"""The API key to be used in the request directly."""
|
|
3044
|
+
"""Optional. The API key to be used in the request directly."""
|
|
3045
|
+
|
|
3046
|
+
http_element_location: Optional[HttpElementLocation]
|
|
3047
|
+
"""Optional. The location of the API key."""
|
|
3048
|
+
|
|
3049
|
+
name: Optional[str]
|
|
3050
|
+
"""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
3051
|
|
|
2731
3052
|
|
|
2732
3053
|
ApiKeyConfigOrDict = Union[ApiKeyConfig, ApiKeyConfigDict]
|
|
@@ -2850,7 +3171,10 @@ AuthConfigOidcConfigOrDict = Union[
|
|
|
2850
3171
|
|
|
2851
3172
|
|
|
2852
3173
|
class AuthConfig(_common.BaseModel):
|
|
2853
|
-
"""Auth configuration to run the extension.
|
|
3174
|
+
"""Auth configuration to run the extension.
|
|
3175
|
+
|
|
3176
|
+
This data type is not supported in Gemini API.
|
|
3177
|
+
"""
|
|
2854
3178
|
|
|
2855
3179
|
api_key_config: Optional[ApiKeyConfig] = Field(
|
|
2856
3180
|
default=None, description="""Config for API key auth."""
|
|
@@ -2875,7 +3199,10 @@ class AuthConfig(_common.BaseModel):
|
|
|
2875
3199
|
|
|
2876
3200
|
|
|
2877
3201
|
class AuthConfigDict(TypedDict, total=False):
|
|
2878
|
-
"""Auth configuration to run the extension.
|
|
3202
|
+
"""Auth configuration to run the extension.
|
|
3203
|
+
|
|
3204
|
+
This data type is not supported in Gemini API.
|
|
3205
|
+
"""
|
|
2879
3206
|
|
|
2880
3207
|
api_key_config: Optional[ApiKeyConfigDict]
|
|
2881
3208
|
"""Config for API key auth."""
|
|
@@ -2901,172 +3228,61 @@ class AuthConfigDict(TypedDict, total=False):
|
|
|
2901
3228
|
AuthConfigOrDict = Union[AuthConfig, AuthConfigDict]
|
|
2902
3229
|
|
|
2903
3230
|
|
|
2904
|
-
class
|
|
2905
|
-
"""
|
|
3231
|
+
class ExternalApiElasticSearchParams(_common.BaseModel):
|
|
3232
|
+
"""The search parameters to use for the ELASTIC_SEARCH spec.
|
|
2906
3233
|
|
|
2907
|
-
|
|
2908
|
-
|
|
2909
|
-
|
|
3234
|
+
This data type is not supported in Gemini API.
|
|
3235
|
+
"""
|
|
3236
|
+
|
|
3237
|
+
index: Optional[str] = Field(
|
|
3238
|
+
default=None, description="""The ElasticSearch index to use."""
|
|
2910
3239
|
)
|
|
2911
|
-
|
|
3240
|
+
num_hits: Optional[int] = Field(
|
|
2912
3241
|
default=None,
|
|
2913
|
-
description="""Optional.
|
|
3242
|
+
description="""Optional. Number of hits (chunks) to request. When specified, it is passed to Elasticsearch as the `num_hits` param.""",
|
|
3243
|
+
)
|
|
3244
|
+
search_template: Optional[str] = Field(
|
|
3245
|
+
default=None, description="""The ElasticSearch search template to use."""
|
|
2914
3246
|
)
|
|
2915
3247
|
|
|
2916
3248
|
|
|
2917
|
-
class
|
|
2918
|
-
"""
|
|
3249
|
+
class ExternalApiElasticSearchParamsDict(TypedDict, total=False):
|
|
3250
|
+
"""The search parameters to use for the ELASTIC_SEARCH spec.
|
|
2919
3251
|
|
|
2920
|
-
|
|
2921
|
-
"""
|
|
3252
|
+
This data type is not supported in Gemini API.
|
|
3253
|
+
"""
|
|
2922
3254
|
|
|
2923
|
-
|
|
2924
|
-
"""
|
|
3255
|
+
index: Optional[str]
|
|
3256
|
+
"""The ElasticSearch index to use."""
|
|
2925
3257
|
|
|
3258
|
+
num_hits: Optional[int]
|
|
3259
|
+
"""Optional. Number of hits (chunks) to request. When specified, it is passed to Elasticsearch as the `num_hits` param."""
|
|
2926
3260
|
|
|
2927
|
-
|
|
3261
|
+
search_template: Optional[str]
|
|
3262
|
+
"""The ElasticSearch search template to use."""
|
|
2928
3263
|
|
|
2929
3264
|
|
|
2930
|
-
|
|
2931
|
-
|
|
3265
|
+
ExternalApiElasticSearchParamsOrDict = Union[
|
|
3266
|
+
ExternalApiElasticSearchParams, ExternalApiElasticSearchParamsDict
|
|
3267
|
+
]
|
|
2932
3268
|
|
|
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
3269
|
|
|
3270
|
+
class ExternalApiSimpleSearchParams(_common.BaseModel):
|
|
3271
|
+
"""The search parameters to use for SIMPLE_SEARCH spec.
|
|
2945
3272
|
|
|
2946
|
-
|
|
2947
|
-
"""
|
|
3273
|
+
This data type is not supported in Gemini API.
|
|
3274
|
+
"""
|
|
2948
3275
|
|
|
2949
|
-
|
|
2950
|
-
"""Required. The environment being operated."""
|
|
3276
|
+
pass
|
|
2951
3277
|
|
|
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
3278
|
|
|
3279
|
+
class ExternalApiSimpleSearchParamsDict(TypedDict, total=False):
|
|
3280
|
+
"""The search parameters to use for SIMPLE_SEARCH spec.
|
|
2959
3281
|
|
|
2960
|
-
|
|
3282
|
+
This data type is not supported in Gemini API.
|
|
3283
|
+
"""
|
|
2961
3284
|
|
|
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
|
|
3285
|
+
pass
|
|
3070
3286
|
|
|
3071
3287
|
|
|
3072
3288
|
ExternalApiSimpleSearchParamsOrDict = Union[
|
|
@@ -3598,6 +3814,32 @@ class EnterpriseWebSearchDict(TypedDict, total=False):
|
|
|
3598
3814
|
EnterpriseWebSearchOrDict = Union[EnterpriseWebSearch, EnterpriseWebSearchDict]
|
|
3599
3815
|
|
|
3600
3816
|
|
|
3817
|
+
class GoogleMaps(_common.BaseModel):
|
|
3818
|
+
"""Tool to retrieve public maps data for grounding, powered by Google."""
|
|
3819
|
+
|
|
3820
|
+
auth_config: Optional[AuthConfig] = Field(
|
|
3821
|
+
default=None,
|
|
3822
|
+
description="""The authentication config to access the API. Only API key is supported. This field is not supported in Gemini API.""",
|
|
3823
|
+
)
|
|
3824
|
+
enable_widget: Optional[bool] = Field(
|
|
3825
|
+
default=None,
|
|
3826
|
+
description="""Optional. If true, include the widget context token in the response.""",
|
|
3827
|
+
)
|
|
3828
|
+
|
|
3829
|
+
|
|
3830
|
+
class GoogleMapsDict(TypedDict, total=False):
|
|
3831
|
+
"""Tool to retrieve public maps data for grounding, powered by Google."""
|
|
3832
|
+
|
|
3833
|
+
auth_config: Optional[AuthConfigDict]
|
|
3834
|
+
"""The authentication config to access the API. Only API key is supported. This field is not supported in Gemini API."""
|
|
3835
|
+
|
|
3836
|
+
enable_widget: Optional[bool]
|
|
3837
|
+
"""Optional. If true, include the widget context token in the response."""
|
|
3838
|
+
|
|
3839
|
+
|
|
3840
|
+
GoogleMapsOrDict = Union[GoogleMaps, GoogleMapsDict]
|
|
3841
|
+
|
|
3842
|
+
|
|
3601
3843
|
class Interval(_common.BaseModel):
|
|
3602
3844
|
"""Represents a time interval, encoded as a Timestamp start (inclusive) and a Timestamp end (exclusive).
|
|
3603
3845
|
|
|
@@ -3701,12 +3943,7 @@ class Tool(_common.BaseModel):
|
|
|
3701
3943
|
)
|
|
3702
3944
|
google_search_retrieval: Optional[GoogleSearchRetrieval] = Field(
|
|
3703
3945
|
default=None,
|
|
3704
|
-
description="""Optional.
|
|
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.""",
|
|
3946
|
+
description="""Optional. Specialized retrieval tool that is powered by Google Search.""",
|
|
3710
3947
|
)
|
|
3711
3948
|
computer_use: Optional[ComputerUse] = Field(
|
|
3712
3949
|
default=None,
|
|
@@ -3714,6 +3951,10 @@ class Tool(_common.BaseModel):
|
|
|
3714
3951
|
computer. If enabled, it automatically populates computer-use specific
|
|
3715
3952
|
Function Declarations.""",
|
|
3716
3953
|
)
|
|
3954
|
+
file_search: Optional[FileSearch] = Field(
|
|
3955
|
+
default=None,
|
|
3956
|
+
description="""Optional. Tool to retrieve knowledge from the File Search Stores.""",
|
|
3957
|
+
)
|
|
3717
3958
|
code_execution: Optional[ToolCodeExecution] = Field(
|
|
3718
3959
|
default=None,
|
|
3719
3960
|
description="""Optional. CodeExecution tool type. Enables the model to execute code as part of generation.""",
|
|
@@ -3722,6 +3963,10 @@ class Tool(_common.BaseModel):
|
|
|
3722
3963
|
default=None,
|
|
3723
3964
|
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
3965
|
)
|
|
3966
|
+
google_maps: Optional[GoogleMaps] = Field(
|
|
3967
|
+
default=None,
|
|
3968
|
+
description="""Optional. GoogleMaps tool type. Tool to support Google Maps in Model.""",
|
|
3969
|
+
)
|
|
3725
3970
|
google_search: Optional[GoogleSearch] = Field(
|
|
3726
3971
|
default=None,
|
|
3727
3972
|
description="""Optional. GoogleSearch tool type. Tool to support Google Search in Model. Powered by Google.""",
|
|
@@ -3742,23 +3987,25 @@ class ToolDict(TypedDict, total=False):
|
|
|
3742
3987
|
"""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
3988
|
|
|
3744
3989
|
google_search_retrieval: Optional[GoogleSearchRetrievalDict]
|
|
3745
|
-
"""Optional.
|
|
3746
|
-
|
|
3747
|
-
google_maps: Optional[GoogleMapsDict]
|
|
3748
|
-
"""Optional. Google Maps tool type. Specialized retrieval tool
|
|
3749
|
-
that is powered by Google Maps."""
|
|
3990
|
+
"""Optional. Specialized retrieval tool that is powered by Google Search."""
|
|
3750
3991
|
|
|
3751
3992
|
computer_use: Optional[ComputerUseDict]
|
|
3752
3993
|
"""Optional. Tool to support the model interacting directly with the
|
|
3753
3994
|
computer. If enabled, it automatically populates computer-use specific
|
|
3754
3995
|
Function Declarations."""
|
|
3755
3996
|
|
|
3997
|
+
file_search: Optional[FileSearchDict]
|
|
3998
|
+
"""Optional. Tool to retrieve knowledge from the File Search Stores."""
|
|
3999
|
+
|
|
3756
4000
|
code_execution: Optional[ToolCodeExecutionDict]
|
|
3757
4001
|
"""Optional. CodeExecution tool type. Enables the model to execute code as part of generation."""
|
|
3758
4002
|
|
|
3759
4003
|
enterprise_web_search: Optional[EnterpriseWebSearchDict]
|
|
3760
4004
|
"""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
4005
|
|
|
4006
|
+
google_maps: Optional[GoogleMapsDict]
|
|
4007
|
+
"""Optional. GoogleMaps tool type. Tool to support Google Maps in Model."""
|
|
4008
|
+
|
|
3762
4009
|
google_search: Optional[GoogleSearchDict]
|
|
3763
4010
|
"""Optional. GoogleSearch tool type. Tool to support Google Search in Model. Powered by Google."""
|
|
3764
4011
|
|
|
@@ -4001,6 +4248,12 @@ class ImageConfig(_common.BaseModel):
|
|
|
4001
4248
|
description="""Aspect ratio of the generated images. Supported values are
|
|
4002
4249
|
"1:1", "2:3", "3:2", "3:4", "4:3", "9:16", "16:9", and "21:9".""",
|
|
4003
4250
|
)
|
|
4251
|
+
image_size: Optional[str] = Field(
|
|
4252
|
+
default=None,
|
|
4253
|
+
description="""Optional. Specifies the size of generated images. Supported
|
|
4254
|
+
values are `1K`, `2K`, `4K`. If not specified, the model will use default
|
|
4255
|
+
value `1K`.""",
|
|
4256
|
+
)
|
|
4004
4257
|
|
|
4005
4258
|
|
|
4006
4259
|
class ImageConfigDict(TypedDict, total=False):
|
|
@@ -4010,6 +4263,11 @@ class ImageConfigDict(TypedDict, total=False):
|
|
|
4010
4263
|
"""Aspect ratio of the generated images. Supported values are
|
|
4011
4264
|
"1:1", "2:3", "3:2", "3:4", "4:3", "9:16", "16:9", and "21:9"."""
|
|
4012
4265
|
|
|
4266
|
+
image_size: Optional[str]
|
|
4267
|
+
"""Optional. Specifies the size of generated images. Supported
|
|
4268
|
+
values are `1K`, `2K`, `4K`. If not specified, the model will use default
|
|
4269
|
+
value `1K`."""
|
|
4270
|
+
|
|
4013
4271
|
|
|
4014
4272
|
ImageConfigOrDict = Union[ImageConfig, ImageConfigDict]
|
|
4015
4273
|
|
|
@@ -5115,13 +5373,13 @@ class GroundingChunkMaps(_common.BaseModel):
|
|
|
5115
5373
|
description="""This Place's resource name, in `places/{place_id}` format. Can be used to look up the Place.""",
|
|
5116
5374
|
)
|
|
5117
5375
|
text: Optional[str] = Field(
|
|
5118
|
-
default=None, description="""Text of the
|
|
5376
|
+
default=None, description="""Text of the place answer."""
|
|
5119
5377
|
)
|
|
5120
5378
|
title: Optional[str] = Field(
|
|
5121
|
-
default=None, description="""Title of the
|
|
5379
|
+
default=None, description="""Title of the place."""
|
|
5122
5380
|
)
|
|
5123
5381
|
uri: Optional[str] = Field(
|
|
5124
|
-
default=None, description="""URI reference of the
|
|
5382
|
+
default=None, description="""URI reference of the place."""
|
|
5125
5383
|
)
|
|
5126
5384
|
|
|
5127
5385
|
|
|
@@ -5135,13 +5393,13 @@ class GroundingChunkMapsDict(TypedDict, total=False):
|
|
|
5135
5393
|
"""This Place's resource name, in `places/{place_id}` format. Can be used to look up the Place."""
|
|
5136
5394
|
|
|
5137
5395
|
text: Optional[str]
|
|
5138
|
-
"""Text of the
|
|
5396
|
+
"""Text of the place answer."""
|
|
5139
5397
|
|
|
5140
5398
|
title: Optional[str]
|
|
5141
|
-
"""Title of the
|
|
5399
|
+
"""Title of the place."""
|
|
5142
5400
|
|
|
5143
5401
|
uri: Optional[str]
|
|
5144
|
-
"""URI reference of the
|
|
5402
|
+
"""URI reference of the place."""
|
|
5145
5403
|
|
|
5146
5404
|
|
|
5147
5405
|
GroundingChunkMapsOrDict = Union[GroundingChunkMaps, GroundingChunkMapsDict]
|
|
@@ -5896,94 +6154,97 @@ ModalityTokenCountOrDict = Union[ModalityTokenCount, ModalityTokenCountDict]
|
|
|
5896
6154
|
|
|
5897
6155
|
|
|
5898
6156
|
class GenerateContentResponseUsageMetadata(_common.BaseModel):
|
|
5899
|
-
"""Usage metadata about response
|
|
6157
|
+
"""Usage metadata about the content generation request and response.
|
|
5900
6158
|
|
|
5901
|
-
This
|
|
6159
|
+
This message provides a detailed breakdown of token usage and other relevant
|
|
6160
|
+
metrics. This data type is not supported in Gemini API.
|
|
5902
6161
|
"""
|
|
5903
6162
|
|
|
5904
6163
|
cache_tokens_details: Optional[list[ModalityTokenCount]] = Field(
|
|
5905
6164
|
default=None,
|
|
5906
|
-
description="""Output only.
|
|
6165
|
+
description="""Output only. A detailed breakdown of the token count for each modality in the cached content.""",
|
|
5907
6166
|
)
|
|
5908
6167
|
cached_content_token_count: Optional[int] = Field(
|
|
5909
6168
|
default=None,
|
|
5910
|
-
description="""Output only.
|
|
6169
|
+
description="""Output only. The number of tokens in the cached content that was used for this request.""",
|
|
5911
6170
|
)
|
|
5912
6171
|
candidates_token_count: Optional[int] = Field(
|
|
5913
|
-
default=None,
|
|
6172
|
+
default=None,
|
|
6173
|
+
description="""The total number of tokens in the generated candidates.""",
|
|
5914
6174
|
)
|
|
5915
6175
|
candidates_tokens_details: Optional[list[ModalityTokenCount]] = Field(
|
|
5916
6176
|
default=None,
|
|
5917
|
-
description="""Output only.
|
|
6177
|
+
description="""Output only. A detailed breakdown of the token count for each modality in the generated candidates.""",
|
|
5918
6178
|
)
|
|
5919
6179
|
prompt_token_count: Optional[int] = Field(
|
|
5920
6180
|
default=None,
|
|
5921
|
-
description="""
|
|
6181
|
+
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
6182
|
)
|
|
5923
6183
|
prompt_tokens_details: Optional[list[ModalityTokenCount]] = Field(
|
|
5924
6184
|
default=None,
|
|
5925
|
-
description="""Output only.
|
|
6185
|
+
description="""Output only. A detailed breakdown of the token count for each modality in the prompt.""",
|
|
5926
6186
|
)
|
|
5927
6187
|
thoughts_token_count: Optional[int] = Field(
|
|
5928
6188
|
default=None,
|
|
5929
|
-
description="""Output only.
|
|
6189
|
+
description="""Output only. The number of tokens that were part of the model's generated "thoughts" output, if applicable.""",
|
|
5930
6190
|
)
|
|
5931
6191
|
tool_use_prompt_token_count: Optional[int] = Field(
|
|
5932
6192
|
default=None,
|
|
5933
|
-
description="""Output only.
|
|
6193
|
+
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
6194
|
)
|
|
5935
6195
|
tool_use_prompt_tokens_details: Optional[list[ModalityTokenCount]] = Field(
|
|
5936
6196
|
default=None,
|
|
5937
|
-
description="""Output only.
|
|
6197
|
+
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
6198
|
)
|
|
5939
6199
|
total_token_count: Optional[int] = Field(
|
|
5940
6200
|
default=None,
|
|
5941
|
-
description="""
|
|
6201
|
+
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
6202
|
)
|
|
5943
6203
|
traffic_type: Optional[TrafficType] = Field(
|
|
5944
6204
|
default=None,
|
|
5945
|
-
description="""Output only.
|
|
6205
|
+
description="""Output only. The traffic type for this request.""",
|
|
5946
6206
|
)
|
|
5947
6207
|
|
|
5948
6208
|
|
|
5949
6209
|
class GenerateContentResponseUsageMetadataDict(TypedDict, total=False):
|
|
5950
|
-
"""Usage metadata about response
|
|
6210
|
+
"""Usage metadata about the content generation request and response.
|
|
5951
6211
|
|
|
5952
|
-
This
|
|
6212
|
+
This message provides a detailed breakdown of token usage and other relevant
|
|
6213
|
+
metrics. This data type is not supported in Gemini API.
|
|
5953
6214
|
"""
|
|
5954
6215
|
|
|
5955
6216
|
cache_tokens_details: Optional[list[ModalityTokenCountDict]]
|
|
5956
|
-
"""Output only.
|
|
6217
|
+
"""Output only. A detailed breakdown of the token count for each modality in the cached content."""
|
|
5957
6218
|
|
|
5958
6219
|
cached_content_token_count: Optional[int]
|
|
5959
|
-
"""Output only.
|
|
6220
|
+
"""Output only. The number of tokens in the cached content that was used for this request."""
|
|
5960
6221
|
|
|
5961
6222
|
candidates_token_count: Optional[int]
|
|
5962
|
-
"""
|
|
6223
|
+
"""The total number of tokens in the generated candidates."""
|
|
5963
6224
|
|
|
5964
6225
|
candidates_tokens_details: Optional[list[ModalityTokenCountDict]]
|
|
5965
|
-
"""Output only.
|
|
6226
|
+
"""Output only. A detailed breakdown of the token count for each modality in the generated candidates."""
|
|
5966
6227
|
|
|
5967
6228
|
prompt_token_count: Optional[int]
|
|
5968
|
-
"""
|
|
6229
|
+
"""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
6230
|
|
|
5970
6231
|
prompt_tokens_details: Optional[list[ModalityTokenCountDict]]
|
|
5971
|
-
"""Output only.
|
|
6232
|
+
"""Output only. A detailed breakdown of the token count for each modality in the prompt."""
|
|
5972
6233
|
|
|
5973
6234
|
thoughts_token_count: Optional[int]
|
|
5974
|
-
"""Output only.
|
|
6235
|
+
"""Output only. The number of tokens that were part of the model's generated "thoughts" output, if applicable."""
|
|
5975
6236
|
|
|
5976
6237
|
tool_use_prompt_token_count: Optional[int]
|
|
5977
|
-
"""Output only.
|
|
6238
|
+
"""Output only. The number of tokens in the results from tool executions, which are provided back to the model as input, if applicable."""
|
|
5978
6239
|
|
|
5979
6240
|
tool_use_prompt_tokens_details: Optional[list[ModalityTokenCountDict]]
|
|
5980
|
-
"""Output only.
|
|
6241
|
+
"""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
6242
|
|
|
5982
6243
|
total_token_count: Optional[int]
|
|
5983
|
-
"""
|
|
6244
|
+
"""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
6245
|
|
|
5985
6246
|
traffic_type: Optional[TrafficType]
|
|
5986
|
-
"""Output only.
|
|
6247
|
+
"""Output only. The traffic type for this request."""
|
|
5987
6248
|
|
|
5988
6249
|
|
|
5989
6250
|
GenerateContentResponseUsageMetadataOrDict = Union[
|
|
@@ -6060,7 +6321,7 @@ class GenerateContentResponse(_common.BaseModel):
|
|
|
6060
6321
|
non_text_parts = []
|
|
6061
6322
|
for part in self.candidates[0].content.parts:
|
|
6062
6323
|
for field_name, field_value in part.model_dump(
|
|
6063
|
-
exclude={'text', 'thought'}
|
|
6324
|
+
exclude={'text', 'thought', 'thought_signature'}
|
|
6064
6325
|
).items():
|
|
6065
6326
|
if field_value is not None:
|
|
6066
6327
|
non_text_parts.append(field_name)
|
|
@@ -8228,6 +8489,38 @@ class Model(_common.BaseModel):
|
|
|
8228
8489
|
checkpoints: Optional[list[Checkpoint]] = Field(
|
|
8229
8490
|
default=None, description="""The checkpoints of the model."""
|
|
8230
8491
|
)
|
|
8492
|
+
temperature: Optional[float] = Field(
|
|
8493
|
+
default=None,
|
|
8494
|
+
description="""Temperature value used for sampling set when the dataset was saved.
|
|
8495
|
+
This value is used to tune the degree of randomness.""",
|
|
8496
|
+
)
|
|
8497
|
+
max_temperature: Optional[float] = Field(
|
|
8498
|
+
default=None,
|
|
8499
|
+
description="""The maximum temperature value used for sampling set when the
|
|
8500
|
+
dataset was saved. This value is used to tune the degree of randomness.""",
|
|
8501
|
+
)
|
|
8502
|
+
top_p: Optional[float] = Field(
|
|
8503
|
+
default=None,
|
|
8504
|
+
description="""Optional. Specifies the nucleus sampling threshold. The model
|
|
8505
|
+
considers only the smallest set of tokens whose cumulative probability is
|
|
8506
|
+
at least `top_p`. This helps generate more diverse and less repetitive
|
|
8507
|
+
responses. For example, a `top_p` of 0.9 means the model considers tokens
|
|
8508
|
+
until the cumulative probability of the tokens to select from reaches 0.9.
|
|
8509
|
+
It's recommended to adjust either temperature or `top_p`, but not both.""",
|
|
8510
|
+
)
|
|
8511
|
+
top_k: Optional[int] = Field(
|
|
8512
|
+
default=None,
|
|
8513
|
+
description="""Optional. Specifies the top-k sampling threshold. The model
|
|
8514
|
+
considers only the top k most probable tokens for the next token. This can
|
|
8515
|
+
be useful for generating more coherent and less random text. For example,
|
|
8516
|
+
a `top_k` of 40 means the model will choose the next word from the 40 most
|
|
8517
|
+
likely words.""",
|
|
8518
|
+
)
|
|
8519
|
+
thinking: Optional[bool] = Field(
|
|
8520
|
+
default=None,
|
|
8521
|
+
description="""Whether the model supports thinking features. If true, thoughts are
|
|
8522
|
+
returned only if the model supports thought and thoughts are available.""",
|
|
8523
|
+
)
|
|
8231
8524
|
|
|
8232
8525
|
|
|
8233
8526
|
class ModelDict(TypedDict, total=False):
|
|
@@ -8274,6 +8567,33 @@ class ModelDict(TypedDict, total=False):
|
|
|
8274
8567
|
checkpoints: Optional[list[CheckpointDict]]
|
|
8275
8568
|
"""The checkpoints of the model."""
|
|
8276
8569
|
|
|
8570
|
+
temperature: Optional[float]
|
|
8571
|
+
"""Temperature value used for sampling set when the dataset was saved.
|
|
8572
|
+
This value is used to tune the degree of randomness."""
|
|
8573
|
+
|
|
8574
|
+
max_temperature: Optional[float]
|
|
8575
|
+
"""The maximum temperature value used for sampling set when the
|
|
8576
|
+
dataset was saved. This value is used to tune the degree of randomness."""
|
|
8577
|
+
|
|
8578
|
+
top_p: Optional[float]
|
|
8579
|
+
"""Optional. Specifies the nucleus sampling threshold. The model
|
|
8580
|
+
considers only the smallest set of tokens whose cumulative probability is
|
|
8581
|
+
at least `top_p`. This helps generate more diverse and less repetitive
|
|
8582
|
+
responses. For example, a `top_p` of 0.9 means the model considers tokens
|
|
8583
|
+
until the cumulative probability of the tokens to select from reaches 0.9.
|
|
8584
|
+
It's recommended to adjust either temperature or `top_p`, but not both."""
|
|
8585
|
+
|
|
8586
|
+
top_k: Optional[int]
|
|
8587
|
+
"""Optional. Specifies the top-k sampling threshold. The model
|
|
8588
|
+
considers only the top k most probable tokens for the next token. This can
|
|
8589
|
+
be useful for generating more coherent and less random text. For example,
|
|
8590
|
+
a `top_k` of 40 means the model will choose the next word from the 40 most
|
|
8591
|
+
likely words."""
|
|
8592
|
+
|
|
8593
|
+
thinking: Optional[bool]
|
|
8594
|
+
"""Whether the model supports thinking features. If true, thoughts are
|
|
8595
|
+
returned only if the model supports thought and thoughts are available."""
|
|
8596
|
+
|
|
8277
8597
|
|
|
8278
8598
|
ModelOrDict = Union[Model, ModelDict]
|
|
8279
8599
|
|
|
@@ -8501,32 +8821,26 @@ VoiceConfigOrDict = Union[VoiceConfig, VoiceConfigDict]
|
|
|
8501
8821
|
|
|
8502
8822
|
|
|
8503
8823
|
class SpeakerVoiceConfig(_common.BaseModel):
|
|
8504
|
-
"""
|
|
8505
|
-
|
|
8506
|
-
This data type is not supported in Vertex AI.
|
|
8507
|
-
"""
|
|
8824
|
+
"""Configuration for a single speaker in a multi speaker setup."""
|
|
8508
8825
|
|
|
8509
8826
|
speaker: Optional[str] = Field(
|
|
8510
8827
|
default=None,
|
|
8511
|
-
description="""Required. The name of the speaker
|
|
8828
|
+
description="""Required. The name of the speaker. This should be the same as the speaker name used in the prompt.""",
|
|
8512
8829
|
)
|
|
8513
8830
|
voice_config: Optional[VoiceConfig] = Field(
|
|
8514
8831
|
default=None,
|
|
8515
|
-
description="""Required. The configuration for the voice
|
|
8832
|
+
description="""Required. The configuration for the voice of this speaker.""",
|
|
8516
8833
|
)
|
|
8517
8834
|
|
|
8518
8835
|
|
|
8519
8836
|
class SpeakerVoiceConfigDict(TypedDict, total=False):
|
|
8520
|
-
"""
|
|
8521
|
-
|
|
8522
|
-
This data type is not supported in Vertex AI.
|
|
8523
|
-
"""
|
|
8837
|
+
"""Configuration for a single speaker in a multi speaker setup."""
|
|
8524
8838
|
|
|
8525
8839
|
speaker: Optional[str]
|
|
8526
|
-
"""Required. The name of the speaker
|
|
8840
|
+
"""Required. The name of the speaker. This should be the same as the speaker name used in the prompt."""
|
|
8527
8841
|
|
|
8528
8842
|
voice_config: Optional[VoiceConfigDict]
|
|
8529
|
-
"""Required. The configuration for the voice
|
|
8843
|
+
"""Required. The configuration for the voice of this speaker."""
|
|
8530
8844
|
|
|
8531
8845
|
|
|
8532
8846
|
SpeakerVoiceConfigOrDict = Union[SpeakerVoiceConfig, SpeakerVoiceConfigDict]
|
|
@@ -8564,6 +8878,12 @@ class GenerationConfig(_common.BaseModel):
|
|
|
8564
8878
|
model_selection_config: Optional[ModelSelectionConfig] = Field(
|
|
8565
8879
|
default=None, description="""Optional. Config for model selection."""
|
|
8566
8880
|
)
|
|
8881
|
+
response_json_schema: Optional[Any] = Field(
|
|
8882
|
+
default=None,
|
|
8883
|
+
description="""Output schema of the generated response. This is an alternative to
|
|
8884
|
+
`response_schema` that accepts [JSON Schema](https://json-schema.org/).
|
|
8885
|
+
""",
|
|
8886
|
+
)
|
|
8567
8887
|
audio_timestamp: Optional[bool] = Field(
|
|
8568
8888
|
default=None,
|
|
8569
8889
|
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 +8913,6 @@ class GenerationConfig(_common.BaseModel):
|
|
|
8593
8913
|
presence_penalty: Optional[float] = Field(
|
|
8594
8914
|
default=None, description="""Optional. Positive penalties."""
|
|
8595
8915
|
)
|
|
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
8916
|
response_logprobs: Optional[bool] = Field(
|
|
8601
8917
|
default=None,
|
|
8602
8918
|
description="""Optional. If true, export the logprobs results in response.""",
|
|
@@ -8651,6 +8967,11 @@ class GenerationConfigDict(TypedDict, total=False):
|
|
|
8651
8967
|
model_selection_config: Optional[ModelSelectionConfigDict]
|
|
8652
8968
|
"""Optional. Config for model selection."""
|
|
8653
8969
|
|
|
8970
|
+
response_json_schema: Optional[Any]
|
|
8971
|
+
"""Output schema of the generated response. This is an alternative to
|
|
8972
|
+
`response_schema` that accepts [JSON Schema](https://json-schema.org/).
|
|
8973
|
+
"""
|
|
8974
|
+
|
|
8654
8975
|
audio_timestamp: Optional[bool]
|
|
8655
8976
|
"""Optional. If enabled, audio timestamp will be included in the request to the model. This field is not supported in Gemini API."""
|
|
8656
8977
|
|
|
@@ -8675,9 +8996,6 @@ class GenerationConfigDict(TypedDict, total=False):
|
|
|
8675
8996
|
presence_penalty: Optional[float]
|
|
8676
8997
|
"""Optional. Positive penalties."""
|
|
8677
8998
|
|
|
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
8999
|
response_logprobs: Optional[bool]
|
|
8682
9000
|
"""Optional. If true, export the logprobs results in response."""
|
|
8683
9001
|
|
|
@@ -9766,6 +10084,10 @@ PreferenceOptimizationHyperParametersOrDict = Union[
|
|
|
9766
10084
|
class PreferenceOptimizationSpec(_common.BaseModel):
|
|
9767
10085
|
"""Preference optimization tuning spec for tuning."""
|
|
9768
10086
|
|
|
10087
|
+
export_last_checkpoint_only: Optional[bool] = Field(
|
|
10088
|
+
default=None,
|
|
10089
|
+
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.""",
|
|
10090
|
+
)
|
|
9769
10091
|
hyper_parameters: Optional[PreferenceOptimizationHyperParameters] = Field(
|
|
9770
10092
|
default=None,
|
|
9771
10093
|
description="""Optional. Hyperparameters for Preference Optimization.""",
|
|
@@ -9783,6 +10105,9 @@ class PreferenceOptimizationSpec(_common.BaseModel):
|
|
|
9783
10105
|
class PreferenceOptimizationSpecDict(TypedDict, total=False):
|
|
9784
10106
|
"""Preference optimization tuning spec for tuning."""
|
|
9785
10107
|
|
|
10108
|
+
export_last_checkpoint_only: Optional[bool]
|
|
10109
|
+
"""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."""
|
|
10110
|
+
|
|
9786
10111
|
hyper_parameters: Optional[PreferenceOptimizationHyperParametersDict]
|
|
9787
10112
|
"""Optional. Hyperparameters for Preference Optimization."""
|
|
9788
10113
|
|
|
@@ -9870,11 +10195,15 @@ class AutoraterConfig(_common.BaseModel):
|
|
|
9870
10195
|
endpoint to use.
|
|
9871
10196
|
|
|
9872
10197
|
Publisher model format:
|
|
9873
|
-
`projects/{project}/locations/{location}/publishers
|
|
10198
|
+
`projects/{project}/locations/{location}/publishers/{publisher}/models/{model}`
|
|
9874
10199
|
|
|
9875
10200
|
Tuned model endpoint format:
|
|
9876
10201
|
`projects/{project}/locations/{location}/endpoints/{endpoint}`""",
|
|
9877
10202
|
)
|
|
10203
|
+
generation_config: Optional[GenerationConfig] = Field(
|
|
10204
|
+
default=None,
|
|
10205
|
+
description="""Configuration options for model generation and outputs.""",
|
|
10206
|
+
)
|
|
9878
10207
|
|
|
9879
10208
|
|
|
9880
10209
|
class AutoraterConfigDict(TypedDict, total=False):
|
|
@@ -9898,11 +10227,14 @@ class AutoraterConfigDict(TypedDict, total=False):
|
|
|
9898
10227
|
endpoint to use.
|
|
9899
10228
|
|
|
9900
10229
|
Publisher model format:
|
|
9901
|
-
`projects/{project}/locations/{location}/publishers
|
|
10230
|
+
`projects/{project}/locations/{location}/publishers/{publisher}/models/{model}`
|
|
9902
10231
|
|
|
9903
10232
|
Tuned model endpoint format:
|
|
9904
10233
|
`projects/{project}/locations/{location}/endpoints/{endpoint}`"""
|
|
9905
10234
|
|
|
10235
|
+
generation_config: Optional[GenerationConfigDict]
|
|
10236
|
+
"""Configuration options for model generation and outputs."""
|
|
10237
|
+
|
|
9906
10238
|
|
|
9907
10239
|
AutoraterConfigOrDict = Union[AutoraterConfig, AutoraterConfigDict]
|
|
9908
10240
|
|
|
@@ -9950,12 +10282,11 @@ class Metric(_common.BaseModel):
|
|
|
9950
10282
|
"""An optional string indicating the version of the metric."""
|
|
9951
10283
|
|
|
9952
10284
|
@model_validator(mode='after') # type: ignore[arg-type]
|
|
9953
|
-
|
|
9954
|
-
|
|
9955
|
-
if not model.name:
|
|
10285
|
+
def validate_name(self) -> 'Metric':
|
|
10286
|
+
if not self.name:
|
|
9956
10287
|
raise ValueError('Metric name cannot be empty.')
|
|
9957
|
-
|
|
9958
|
-
return
|
|
10288
|
+
self.name = self.name.lower()
|
|
10289
|
+
return self
|
|
9959
10290
|
|
|
9960
10291
|
def to_yaml_file(self, file_path: str, version: Optional[str] = None) -> None:
|
|
9961
10292
|
"""Dumps the metric object to a YAML file.
|
|
@@ -10999,7 +11330,7 @@ class TuningJob(_common.BaseModel):
|
|
|
10999
11330
|
description="""Tuning Spec for open sourced and third party Partner models.""",
|
|
11000
11331
|
)
|
|
11001
11332
|
evaluation_config: Optional[EvaluationConfig] = Field(
|
|
11002
|
-
default=None, description=""""""
|
|
11333
|
+
default=None, description="""Evaluation config for the tuning job."""
|
|
11003
11334
|
)
|
|
11004
11335
|
custom_base_model: Optional[str] = Field(
|
|
11005
11336
|
default=None,
|
|
@@ -11027,7 +11358,7 @@ class TuningJob(_common.BaseModel):
|
|
|
11027
11358
|
)
|
|
11028
11359
|
tuned_model_display_name: Optional[str] = Field(
|
|
11029
11360
|
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.""",
|
|
11361
|
+
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
11362
|
)
|
|
11032
11363
|
veo_tuning_spec: Optional[VeoTuningSpec] = Field(
|
|
11033
11364
|
default=None, description="""Tuning Spec for Veo Tuning."""
|
|
@@ -11099,7 +11430,7 @@ class TuningJobDict(TypedDict, total=False):
|
|
|
11099
11430
|
"""Tuning Spec for open sourced and third party Partner models."""
|
|
11100
11431
|
|
|
11101
11432
|
evaluation_config: Optional[EvaluationConfigDict]
|
|
11102
|
-
""""""
|
|
11433
|
+
"""Evaluation config for the tuning job."""
|
|
11103
11434
|
|
|
11104
11435
|
custom_base_model: Optional[str]
|
|
11105
11436
|
"""Optional. The user-provided path to custom model weights. Set this field to tune a custom model. The path must be a Cloud Storage directory that contains the model weights in .safetensors format along with associated model metadata files. If this field is set, the base_model field must still be set to indicate which base model the custom model is derived from. This feature is only available for open source models."""
|
|
@@ -11120,7 +11451,7 @@ class TuningJobDict(TypedDict, total=False):
|
|
|
11120
11451
|
"""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
11452
|
|
|
11122
11453
|
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."""
|
|
11454
|
+
"""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
11455
|
|
|
11125
11456
|
veo_tuning_spec: Optional[VeoTuningSpecDict]
|
|
11126
11457
|
"""Tuning Spec for Veo Tuning."""
|
|
@@ -11825,239 +12156,1137 @@ class _GetCachedContentParameters(_common.BaseModel):
|
|
|
11825
12156
|
)
|
|
11826
12157
|
|
|
11827
12158
|
|
|
11828
|
-
class _GetCachedContentParametersDict(TypedDict, total=False):
|
|
11829
|
-
"""Parameters for caches.get method."""
|
|
12159
|
+
class _GetCachedContentParametersDict(TypedDict, total=False):
|
|
12160
|
+
"""Parameters for caches.get method."""
|
|
12161
|
+
|
|
12162
|
+
name: Optional[str]
|
|
12163
|
+
"""The server-generated resource name of the cached content.
|
|
12164
|
+
"""
|
|
12165
|
+
|
|
12166
|
+
config: Optional[GetCachedContentConfigDict]
|
|
12167
|
+
"""Optional parameters for the request.
|
|
12168
|
+
"""
|
|
12169
|
+
|
|
12170
|
+
|
|
12171
|
+
_GetCachedContentParametersOrDict = Union[
|
|
12172
|
+
_GetCachedContentParameters, _GetCachedContentParametersDict
|
|
12173
|
+
]
|
|
12174
|
+
|
|
12175
|
+
|
|
12176
|
+
class DeleteCachedContentConfig(_common.BaseModel):
|
|
12177
|
+
"""Optional parameters for caches.delete method."""
|
|
12178
|
+
|
|
12179
|
+
http_options: Optional[HttpOptions] = Field(
|
|
12180
|
+
default=None, description="""Used to override HTTP request options."""
|
|
12181
|
+
)
|
|
12182
|
+
|
|
12183
|
+
|
|
12184
|
+
class DeleteCachedContentConfigDict(TypedDict, total=False):
|
|
12185
|
+
"""Optional parameters for caches.delete method."""
|
|
12186
|
+
|
|
12187
|
+
http_options: Optional[HttpOptionsDict]
|
|
12188
|
+
"""Used to override HTTP request options."""
|
|
12189
|
+
|
|
12190
|
+
|
|
12191
|
+
DeleteCachedContentConfigOrDict = Union[
|
|
12192
|
+
DeleteCachedContentConfig, DeleteCachedContentConfigDict
|
|
12193
|
+
]
|
|
12194
|
+
|
|
12195
|
+
|
|
12196
|
+
class _DeleteCachedContentParameters(_common.BaseModel):
|
|
12197
|
+
"""Parameters for caches.delete method."""
|
|
12198
|
+
|
|
12199
|
+
name: Optional[str] = Field(
|
|
12200
|
+
default=None,
|
|
12201
|
+
description="""The server-generated resource name of the cached content.
|
|
12202
|
+
""",
|
|
12203
|
+
)
|
|
12204
|
+
config: Optional[DeleteCachedContentConfig] = Field(
|
|
12205
|
+
default=None,
|
|
12206
|
+
description="""Optional parameters for the request.
|
|
12207
|
+
""",
|
|
12208
|
+
)
|
|
12209
|
+
|
|
12210
|
+
|
|
12211
|
+
class _DeleteCachedContentParametersDict(TypedDict, total=False):
|
|
12212
|
+
"""Parameters for caches.delete method."""
|
|
12213
|
+
|
|
12214
|
+
name: Optional[str]
|
|
12215
|
+
"""The server-generated resource name of the cached content.
|
|
12216
|
+
"""
|
|
12217
|
+
|
|
12218
|
+
config: Optional[DeleteCachedContentConfigDict]
|
|
12219
|
+
"""Optional parameters for the request.
|
|
12220
|
+
"""
|
|
12221
|
+
|
|
12222
|
+
|
|
12223
|
+
_DeleteCachedContentParametersOrDict = Union[
|
|
12224
|
+
_DeleteCachedContentParameters, _DeleteCachedContentParametersDict
|
|
12225
|
+
]
|
|
12226
|
+
|
|
12227
|
+
|
|
12228
|
+
class DeleteCachedContentResponse(_common.BaseModel):
|
|
12229
|
+
"""Empty response for caches.delete method."""
|
|
12230
|
+
|
|
12231
|
+
sdk_http_response: Optional[HttpResponse] = Field(
|
|
12232
|
+
default=None, description="""Used to retain the full HTTP response."""
|
|
12233
|
+
)
|
|
12234
|
+
|
|
12235
|
+
|
|
12236
|
+
class DeleteCachedContentResponseDict(TypedDict, total=False):
|
|
12237
|
+
"""Empty response for caches.delete method."""
|
|
12238
|
+
|
|
12239
|
+
sdk_http_response: Optional[HttpResponseDict]
|
|
12240
|
+
"""Used to retain the full HTTP response."""
|
|
12241
|
+
|
|
12242
|
+
|
|
12243
|
+
DeleteCachedContentResponseOrDict = Union[
|
|
12244
|
+
DeleteCachedContentResponse, DeleteCachedContentResponseDict
|
|
12245
|
+
]
|
|
12246
|
+
|
|
12247
|
+
|
|
12248
|
+
class UpdateCachedContentConfig(_common.BaseModel):
|
|
12249
|
+
"""Optional parameters for caches.update method."""
|
|
12250
|
+
|
|
12251
|
+
http_options: Optional[HttpOptions] = Field(
|
|
12252
|
+
default=None, description="""Used to override HTTP request options."""
|
|
12253
|
+
)
|
|
12254
|
+
ttl: Optional[str] = Field(
|
|
12255
|
+
default=None,
|
|
12256
|
+
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".""",
|
|
12257
|
+
)
|
|
12258
|
+
expire_time: Optional[datetime.datetime] = Field(
|
|
12259
|
+
default=None,
|
|
12260
|
+
description="""Timestamp of when this resource is considered expired. Uses RFC 3339 format, Example: 2014-10-02T15:01:23Z.""",
|
|
12261
|
+
)
|
|
12262
|
+
|
|
12263
|
+
|
|
12264
|
+
class UpdateCachedContentConfigDict(TypedDict, total=False):
|
|
12265
|
+
"""Optional parameters for caches.update method."""
|
|
12266
|
+
|
|
12267
|
+
http_options: Optional[HttpOptionsDict]
|
|
12268
|
+
"""Used to override HTTP request options."""
|
|
12269
|
+
|
|
12270
|
+
ttl: Optional[str]
|
|
12271
|
+
"""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"."""
|
|
12272
|
+
|
|
12273
|
+
expire_time: Optional[datetime.datetime]
|
|
12274
|
+
"""Timestamp of when this resource is considered expired. Uses RFC 3339 format, Example: 2014-10-02T15:01:23Z."""
|
|
12275
|
+
|
|
12276
|
+
|
|
12277
|
+
UpdateCachedContentConfigOrDict = Union[
|
|
12278
|
+
UpdateCachedContentConfig, UpdateCachedContentConfigDict
|
|
12279
|
+
]
|
|
12280
|
+
|
|
12281
|
+
|
|
12282
|
+
class _UpdateCachedContentParameters(_common.BaseModel):
|
|
12283
|
+
|
|
12284
|
+
name: Optional[str] = Field(
|
|
12285
|
+
default=None,
|
|
12286
|
+
description="""The server-generated resource name of the cached content.
|
|
12287
|
+
""",
|
|
12288
|
+
)
|
|
12289
|
+
config: Optional[UpdateCachedContentConfig] = Field(
|
|
12290
|
+
default=None,
|
|
12291
|
+
description="""Configuration that contains optional parameters.
|
|
12292
|
+
""",
|
|
12293
|
+
)
|
|
12294
|
+
|
|
12295
|
+
|
|
12296
|
+
class _UpdateCachedContentParametersDict(TypedDict, total=False):
|
|
12297
|
+
|
|
12298
|
+
name: Optional[str]
|
|
12299
|
+
"""The server-generated resource name of the cached content.
|
|
12300
|
+
"""
|
|
12301
|
+
|
|
12302
|
+
config: Optional[UpdateCachedContentConfigDict]
|
|
12303
|
+
"""Configuration that contains optional parameters.
|
|
12304
|
+
"""
|
|
12305
|
+
|
|
12306
|
+
|
|
12307
|
+
_UpdateCachedContentParametersOrDict = Union[
|
|
12308
|
+
_UpdateCachedContentParameters, _UpdateCachedContentParametersDict
|
|
12309
|
+
]
|
|
12310
|
+
|
|
12311
|
+
|
|
12312
|
+
class ListCachedContentsConfig(_common.BaseModel):
|
|
12313
|
+
"""Config for caches.list method."""
|
|
12314
|
+
|
|
12315
|
+
http_options: Optional[HttpOptions] = Field(
|
|
12316
|
+
default=None, description="""Used to override HTTP request options."""
|
|
12317
|
+
)
|
|
12318
|
+
page_size: Optional[int] = Field(default=None, description="""""")
|
|
12319
|
+
page_token: Optional[str] = Field(default=None, description="""""")
|
|
12320
|
+
|
|
12321
|
+
|
|
12322
|
+
class ListCachedContentsConfigDict(TypedDict, total=False):
|
|
12323
|
+
"""Config for caches.list method."""
|
|
12324
|
+
|
|
12325
|
+
http_options: Optional[HttpOptionsDict]
|
|
12326
|
+
"""Used to override HTTP request options."""
|
|
12327
|
+
|
|
12328
|
+
page_size: Optional[int]
|
|
12329
|
+
""""""
|
|
12330
|
+
|
|
12331
|
+
page_token: Optional[str]
|
|
12332
|
+
""""""
|
|
12333
|
+
|
|
12334
|
+
|
|
12335
|
+
ListCachedContentsConfigOrDict = Union[
|
|
12336
|
+
ListCachedContentsConfig, ListCachedContentsConfigDict
|
|
12337
|
+
]
|
|
12338
|
+
|
|
12339
|
+
|
|
12340
|
+
class _ListCachedContentsParameters(_common.BaseModel):
|
|
12341
|
+
"""Parameters for caches.list method."""
|
|
12342
|
+
|
|
12343
|
+
config: Optional[ListCachedContentsConfig] = Field(
|
|
12344
|
+
default=None,
|
|
12345
|
+
description="""Configuration that contains optional parameters.
|
|
12346
|
+
""",
|
|
12347
|
+
)
|
|
12348
|
+
|
|
12349
|
+
|
|
12350
|
+
class _ListCachedContentsParametersDict(TypedDict, total=False):
|
|
12351
|
+
"""Parameters for caches.list method."""
|
|
12352
|
+
|
|
12353
|
+
config: Optional[ListCachedContentsConfigDict]
|
|
12354
|
+
"""Configuration that contains optional parameters.
|
|
12355
|
+
"""
|
|
12356
|
+
|
|
12357
|
+
|
|
12358
|
+
_ListCachedContentsParametersOrDict = Union[
|
|
12359
|
+
_ListCachedContentsParameters, _ListCachedContentsParametersDict
|
|
12360
|
+
]
|
|
12361
|
+
|
|
12362
|
+
|
|
12363
|
+
class ListCachedContentsResponse(_common.BaseModel):
|
|
12364
|
+
|
|
12365
|
+
sdk_http_response: Optional[HttpResponse] = Field(
|
|
12366
|
+
default=None, description="""Used to retain the full HTTP response."""
|
|
12367
|
+
)
|
|
12368
|
+
next_page_token: Optional[str] = Field(default=None, description="""""")
|
|
12369
|
+
cached_contents: Optional[list[CachedContent]] = Field(
|
|
12370
|
+
default=None,
|
|
12371
|
+
description="""List of cached contents.
|
|
12372
|
+
""",
|
|
12373
|
+
)
|
|
12374
|
+
|
|
12375
|
+
|
|
12376
|
+
class ListCachedContentsResponseDict(TypedDict, total=False):
|
|
12377
|
+
|
|
12378
|
+
sdk_http_response: Optional[HttpResponseDict]
|
|
12379
|
+
"""Used to retain the full HTTP response."""
|
|
12380
|
+
|
|
12381
|
+
next_page_token: Optional[str]
|
|
12382
|
+
""""""
|
|
12383
|
+
|
|
12384
|
+
cached_contents: Optional[list[CachedContentDict]]
|
|
12385
|
+
"""List of cached contents.
|
|
12386
|
+
"""
|
|
12387
|
+
|
|
12388
|
+
|
|
12389
|
+
ListCachedContentsResponseOrDict = Union[
|
|
12390
|
+
ListCachedContentsResponse, ListCachedContentsResponseDict
|
|
12391
|
+
]
|
|
12392
|
+
|
|
12393
|
+
|
|
12394
|
+
class GetDocumentConfig(_common.BaseModel):
|
|
12395
|
+
"""Optional Config."""
|
|
12396
|
+
|
|
12397
|
+
http_options: Optional[HttpOptions] = Field(
|
|
12398
|
+
default=None, description="""Used to override HTTP request options."""
|
|
12399
|
+
)
|
|
12400
|
+
|
|
12401
|
+
|
|
12402
|
+
class GetDocumentConfigDict(TypedDict, total=False):
|
|
12403
|
+
"""Optional Config."""
|
|
12404
|
+
|
|
12405
|
+
http_options: Optional[HttpOptionsDict]
|
|
12406
|
+
"""Used to override HTTP request options."""
|
|
12407
|
+
|
|
12408
|
+
|
|
12409
|
+
GetDocumentConfigOrDict = Union[GetDocumentConfig, GetDocumentConfigDict]
|
|
12410
|
+
|
|
12411
|
+
|
|
12412
|
+
class _GetDocumentParameters(_common.BaseModel):
|
|
12413
|
+
"""Parameters for documents.get."""
|
|
12414
|
+
|
|
12415
|
+
name: Optional[str] = Field(
|
|
12416
|
+
default=None,
|
|
12417
|
+
description="""The resource name of the Document.
|
|
12418
|
+
Example: fileSearchStores/file-search-store-foo/documents/documents-bar""",
|
|
12419
|
+
)
|
|
12420
|
+
config: Optional[GetDocumentConfig] = Field(
|
|
12421
|
+
default=None, description="""Optional parameters for the request."""
|
|
12422
|
+
)
|
|
12423
|
+
|
|
12424
|
+
|
|
12425
|
+
class _GetDocumentParametersDict(TypedDict, total=False):
|
|
12426
|
+
"""Parameters for documents.get."""
|
|
12427
|
+
|
|
12428
|
+
name: Optional[str]
|
|
12429
|
+
"""The resource name of the Document.
|
|
12430
|
+
Example: fileSearchStores/file-search-store-foo/documents/documents-bar"""
|
|
12431
|
+
|
|
12432
|
+
config: Optional[GetDocumentConfigDict]
|
|
12433
|
+
"""Optional parameters for the request."""
|
|
12434
|
+
|
|
12435
|
+
|
|
12436
|
+
_GetDocumentParametersOrDict = Union[
|
|
12437
|
+
_GetDocumentParameters, _GetDocumentParametersDict
|
|
12438
|
+
]
|
|
12439
|
+
|
|
12440
|
+
|
|
12441
|
+
class StringList(_common.BaseModel):
|
|
12442
|
+
"""User provided string values assigned to a single metadata key.
|
|
12443
|
+
|
|
12444
|
+
This data type is not supported in Vertex AI.
|
|
12445
|
+
"""
|
|
12446
|
+
|
|
12447
|
+
values: Optional[list[str]] = Field(
|
|
12448
|
+
default=None,
|
|
12449
|
+
description="""The string values of the metadata to store.""",
|
|
12450
|
+
)
|
|
12451
|
+
|
|
12452
|
+
|
|
12453
|
+
class StringListDict(TypedDict, total=False):
|
|
12454
|
+
"""User provided string values assigned to a single metadata key.
|
|
12455
|
+
|
|
12456
|
+
This data type is not supported in Vertex AI.
|
|
12457
|
+
"""
|
|
12458
|
+
|
|
12459
|
+
values: Optional[list[str]]
|
|
12460
|
+
"""The string values of the metadata to store."""
|
|
12461
|
+
|
|
12462
|
+
|
|
12463
|
+
StringListOrDict = Union[StringList, StringListDict]
|
|
12464
|
+
|
|
12465
|
+
|
|
12466
|
+
class CustomMetadata(_common.BaseModel):
|
|
12467
|
+
"""User provided metadata stored as key-value pairs.
|
|
12468
|
+
|
|
12469
|
+
This data type is not supported in Vertex AI.
|
|
12470
|
+
"""
|
|
12471
|
+
|
|
12472
|
+
key: Optional[str] = Field(
|
|
12473
|
+
default=None,
|
|
12474
|
+
description="""Required. The key of the metadata to store.""",
|
|
12475
|
+
)
|
|
12476
|
+
numeric_value: Optional[float] = Field(
|
|
12477
|
+
default=None,
|
|
12478
|
+
description="""The numeric value of the metadata to store.""",
|
|
12479
|
+
)
|
|
12480
|
+
string_list_value: Optional[StringList] = Field(
|
|
12481
|
+
default=None,
|
|
12482
|
+
description="""The StringList value of the metadata to store.""",
|
|
12483
|
+
)
|
|
12484
|
+
string_value: Optional[str] = Field(
|
|
12485
|
+
default=None, description="""The string value of the metadata to store."""
|
|
12486
|
+
)
|
|
12487
|
+
|
|
12488
|
+
|
|
12489
|
+
class CustomMetadataDict(TypedDict, total=False):
|
|
12490
|
+
"""User provided metadata stored as key-value pairs.
|
|
12491
|
+
|
|
12492
|
+
This data type is not supported in Vertex AI.
|
|
12493
|
+
"""
|
|
12494
|
+
|
|
12495
|
+
key: Optional[str]
|
|
12496
|
+
"""Required. The key of the metadata to store."""
|
|
12497
|
+
|
|
12498
|
+
numeric_value: Optional[float]
|
|
12499
|
+
"""The numeric value of the metadata to store."""
|
|
12500
|
+
|
|
12501
|
+
string_list_value: Optional[StringListDict]
|
|
12502
|
+
"""The StringList value of the metadata to store."""
|
|
12503
|
+
|
|
12504
|
+
string_value: Optional[str]
|
|
12505
|
+
"""The string value of the metadata to store."""
|
|
12506
|
+
|
|
12507
|
+
|
|
12508
|
+
CustomMetadataOrDict = Union[CustomMetadata, CustomMetadataDict]
|
|
12509
|
+
|
|
12510
|
+
|
|
12511
|
+
class Document(_common.BaseModel):
|
|
12512
|
+
"""A Document is a collection of Chunks."""
|
|
12513
|
+
|
|
12514
|
+
name: Optional[str] = Field(
|
|
12515
|
+
default=None,
|
|
12516
|
+
description="""The resource name of the Document.
|
|
12517
|
+
Example: fileSearchStores/file-search-store-foo/documents/documents-bar""",
|
|
12518
|
+
)
|
|
12519
|
+
display_name: Optional[str] = Field(
|
|
12520
|
+
default=None,
|
|
12521
|
+
description="""The human-readable display name for the Document.""",
|
|
12522
|
+
)
|
|
12523
|
+
state: Optional[DocumentState] = Field(
|
|
12524
|
+
default=None, description="""The current state of the Document."""
|
|
12525
|
+
)
|
|
12526
|
+
size_bytes: Optional[int] = Field(
|
|
12527
|
+
default=None, description="""The size of the Document in bytes."""
|
|
12528
|
+
)
|
|
12529
|
+
mime_type: Optional[str] = Field(
|
|
12530
|
+
default=None, description="""The MIME type of the Document."""
|
|
12531
|
+
)
|
|
12532
|
+
create_time: Optional[datetime.datetime] = Field(
|
|
12533
|
+
default=None,
|
|
12534
|
+
description="""Output only. The Timestamp of when the `Document` was created.""",
|
|
12535
|
+
)
|
|
12536
|
+
custom_metadata: Optional[list[CustomMetadata]] = Field(
|
|
12537
|
+
default=None,
|
|
12538
|
+
description="""Optional. User provided custom metadata stored as key-value pairs used for querying. A `Document` can have a maximum of 20 `CustomMetadata`.""",
|
|
12539
|
+
)
|
|
12540
|
+
update_time: Optional[datetime.datetime] = Field(
|
|
12541
|
+
default=None,
|
|
12542
|
+
description="""Output only. The Timestamp of when the `Document` was last updated.""",
|
|
12543
|
+
)
|
|
12544
|
+
|
|
12545
|
+
|
|
12546
|
+
class DocumentDict(TypedDict, total=False):
|
|
12547
|
+
"""A Document is a collection of Chunks."""
|
|
12548
|
+
|
|
12549
|
+
name: Optional[str]
|
|
12550
|
+
"""The resource name of the Document.
|
|
12551
|
+
Example: fileSearchStores/file-search-store-foo/documents/documents-bar"""
|
|
12552
|
+
|
|
12553
|
+
display_name: Optional[str]
|
|
12554
|
+
"""The human-readable display name for the Document."""
|
|
12555
|
+
|
|
12556
|
+
state: Optional[DocumentState]
|
|
12557
|
+
"""The current state of the Document."""
|
|
12558
|
+
|
|
12559
|
+
size_bytes: Optional[int]
|
|
12560
|
+
"""The size of the Document in bytes."""
|
|
12561
|
+
|
|
12562
|
+
mime_type: Optional[str]
|
|
12563
|
+
"""The MIME type of the Document."""
|
|
12564
|
+
|
|
12565
|
+
create_time: Optional[datetime.datetime]
|
|
12566
|
+
"""Output only. The Timestamp of when the `Document` was created."""
|
|
12567
|
+
|
|
12568
|
+
custom_metadata: Optional[list[CustomMetadataDict]]
|
|
12569
|
+
"""Optional. User provided custom metadata stored as key-value pairs used for querying. A `Document` can have a maximum of 20 `CustomMetadata`."""
|
|
12570
|
+
|
|
12571
|
+
update_time: Optional[datetime.datetime]
|
|
12572
|
+
"""Output only. The Timestamp of when the `Document` was last updated."""
|
|
12573
|
+
|
|
12574
|
+
|
|
12575
|
+
DocumentOrDict = Union[Document, DocumentDict]
|
|
12576
|
+
|
|
12577
|
+
|
|
12578
|
+
class DeleteDocumentConfig(_common.BaseModel):
|
|
12579
|
+
"""Config for optional parameters."""
|
|
12580
|
+
|
|
12581
|
+
http_options: Optional[HttpOptions] = Field(
|
|
12582
|
+
default=None, description="""Used to override HTTP request options."""
|
|
12583
|
+
)
|
|
12584
|
+
force: Optional[bool] = Field(
|
|
12585
|
+
default=None,
|
|
12586
|
+
description="""If set to true, any `Chunk`s and objects related to this `Document` will
|
|
12587
|
+
also be deleted.
|
|
12588
|
+
""",
|
|
12589
|
+
)
|
|
12590
|
+
|
|
12591
|
+
|
|
12592
|
+
class DeleteDocumentConfigDict(TypedDict, total=False):
|
|
12593
|
+
"""Config for optional parameters."""
|
|
12594
|
+
|
|
12595
|
+
http_options: Optional[HttpOptionsDict]
|
|
12596
|
+
"""Used to override HTTP request options."""
|
|
12597
|
+
|
|
12598
|
+
force: Optional[bool]
|
|
12599
|
+
"""If set to true, any `Chunk`s and objects related to this `Document` will
|
|
12600
|
+
also be deleted.
|
|
12601
|
+
"""
|
|
12602
|
+
|
|
12603
|
+
|
|
12604
|
+
DeleteDocumentConfigOrDict = Union[
|
|
12605
|
+
DeleteDocumentConfig, DeleteDocumentConfigDict
|
|
12606
|
+
]
|
|
12607
|
+
|
|
12608
|
+
|
|
12609
|
+
class _DeleteDocumentParameters(_common.BaseModel):
|
|
12610
|
+
"""Config for documents.delete parameters."""
|
|
12611
|
+
|
|
12612
|
+
name: Optional[str] = Field(
|
|
12613
|
+
default=None,
|
|
12614
|
+
description="""The resource name of the Document.
|
|
12615
|
+
Example: fileSearchStores/file-search-store-foo/documents/documents-bar""",
|
|
12616
|
+
)
|
|
12617
|
+
config: Optional[DeleteDocumentConfig] = Field(
|
|
12618
|
+
default=None, description="""Optional parameters for the request."""
|
|
12619
|
+
)
|
|
12620
|
+
|
|
12621
|
+
|
|
12622
|
+
class _DeleteDocumentParametersDict(TypedDict, total=False):
|
|
12623
|
+
"""Config for documents.delete parameters."""
|
|
12624
|
+
|
|
12625
|
+
name: Optional[str]
|
|
12626
|
+
"""The resource name of the Document.
|
|
12627
|
+
Example: fileSearchStores/file-search-store-foo/documents/documents-bar"""
|
|
12628
|
+
|
|
12629
|
+
config: Optional[DeleteDocumentConfigDict]
|
|
12630
|
+
"""Optional parameters for the request."""
|
|
12631
|
+
|
|
12632
|
+
|
|
12633
|
+
_DeleteDocumentParametersOrDict = Union[
|
|
12634
|
+
_DeleteDocumentParameters, _DeleteDocumentParametersDict
|
|
12635
|
+
]
|
|
12636
|
+
|
|
12637
|
+
|
|
12638
|
+
class ListDocumentsConfig(_common.BaseModel):
|
|
12639
|
+
"""Config for optional parameters."""
|
|
12640
|
+
|
|
12641
|
+
http_options: Optional[HttpOptions] = Field(
|
|
12642
|
+
default=None, description="""Used to override HTTP request options."""
|
|
12643
|
+
)
|
|
12644
|
+
page_size: Optional[int] = Field(default=None, description="""""")
|
|
12645
|
+
page_token: Optional[str] = Field(default=None, description="""""")
|
|
12646
|
+
|
|
12647
|
+
|
|
12648
|
+
class ListDocumentsConfigDict(TypedDict, total=False):
|
|
12649
|
+
"""Config for optional parameters."""
|
|
12650
|
+
|
|
12651
|
+
http_options: Optional[HttpOptionsDict]
|
|
12652
|
+
"""Used to override HTTP request options."""
|
|
12653
|
+
|
|
12654
|
+
page_size: Optional[int]
|
|
12655
|
+
""""""
|
|
12656
|
+
|
|
12657
|
+
page_token: Optional[str]
|
|
12658
|
+
""""""
|
|
12659
|
+
|
|
12660
|
+
|
|
12661
|
+
ListDocumentsConfigOrDict = Union[ListDocumentsConfig, ListDocumentsConfigDict]
|
|
12662
|
+
|
|
12663
|
+
|
|
12664
|
+
class _ListDocumentsParameters(_common.BaseModel):
|
|
12665
|
+
"""Config for documents.list parameters."""
|
|
12666
|
+
|
|
12667
|
+
parent: Optional[str] = Field(
|
|
12668
|
+
default=None,
|
|
12669
|
+
description="""The resource name of the FileSearchStores. Example: `fileSearchStore/file-search-store-foo`""",
|
|
12670
|
+
)
|
|
12671
|
+
config: Optional[ListDocumentsConfig] = Field(
|
|
12672
|
+
default=None, description=""""""
|
|
12673
|
+
)
|
|
12674
|
+
|
|
12675
|
+
|
|
12676
|
+
class _ListDocumentsParametersDict(TypedDict, total=False):
|
|
12677
|
+
"""Config for documents.list parameters."""
|
|
12678
|
+
|
|
12679
|
+
parent: Optional[str]
|
|
12680
|
+
"""The resource name of the FileSearchStores. Example: `fileSearchStore/file-search-store-foo`"""
|
|
12681
|
+
|
|
12682
|
+
config: Optional[ListDocumentsConfigDict]
|
|
12683
|
+
""""""
|
|
12684
|
+
|
|
12685
|
+
|
|
12686
|
+
_ListDocumentsParametersOrDict = Union[
|
|
12687
|
+
_ListDocumentsParameters, _ListDocumentsParametersDict
|
|
12688
|
+
]
|
|
12689
|
+
|
|
12690
|
+
|
|
12691
|
+
class ListDocumentsResponse(_common.BaseModel):
|
|
12692
|
+
"""Config for documents.list return value."""
|
|
12693
|
+
|
|
12694
|
+
sdk_http_response: Optional[HttpResponse] = Field(
|
|
12695
|
+
default=None, description="""Used to retain the full HTTP response."""
|
|
12696
|
+
)
|
|
12697
|
+
next_page_token: Optional[str] = Field(
|
|
12698
|
+
default=None,
|
|
12699
|
+
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.""",
|
|
12700
|
+
)
|
|
12701
|
+
documents: Optional[list[Document]] = Field(
|
|
12702
|
+
default=None, description="""The returned `Document`s."""
|
|
12703
|
+
)
|
|
12704
|
+
|
|
12705
|
+
|
|
12706
|
+
class ListDocumentsResponseDict(TypedDict, total=False):
|
|
12707
|
+
"""Config for documents.list return value."""
|
|
12708
|
+
|
|
12709
|
+
sdk_http_response: Optional[HttpResponseDict]
|
|
12710
|
+
"""Used to retain the full HTTP response."""
|
|
12711
|
+
|
|
12712
|
+
next_page_token: Optional[str]
|
|
12713
|
+
"""A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no more pages."""
|
|
12714
|
+
|
|
12715
|
+
documents: Optional[list[DocumentDict]]
|
|
12716
|
+
"""The returned `Document`s."""
|
|
12717
|
+
|
|
12718
|
+
|
|
12719
|
+
ListDocumentsResponseOrDict = Union[
|
|
12720
|
+
ListDocumentsResponse, ListDocumentsResponseDict
|
|
12721
|
+
]
|
|
12722
|
+
|
|
12723
|
+
|
|
12724
|
+
class CreateFileSearchStoreConfig(_common.BaseModel):
|
|
12725
|
+
"""Optional parameters for creating a file search store."""
|
|
12726
|
+
|
|
12727
|
+
http_options: Optional[HttpOptions] = Field(
|
|
12728
|
+
default=None, description="""Used to override HTTP request options."""
|
|
12729
|
+
)
|
|
12730
|
+
display_name: Optional[str] = Field(
|
|
12731
|
+
default=None,
|
|
12732
|
+
description="""The human-readable display name for the file search store.
|
|
12733
|
+
""",
|
|
12734
|
+
)
|
|
12735
|
+
|
|
12736
|
+
|
|
12737
|
+
class CreateFileSearchStoreConfigDict(TypedDict, total=False):
|
|
12738
|
+
"""Optional parameters for creating a file search store."""
|
|
12739
|
+
|
|
12740
|
+
http_options: Optional[HttpOptionsDict]
|
|
12741
|
+
"""Used to override HTTP request options."""
|
|
12742
|
+
|
|
12743
|
+
display_name: Optional[str]
|
|
12744
|
+
"""The human-readable display name for the file search store.
|
|
12745
|
+
"""
|
|
12746
|
+
|
|
12747
|
+
|
|
12748
|
+
CreateFileSearchStoreConfigOrDict = Union[
|
|
12749
|
+
CreateFileSearchStoreConfig, CreateFileSearchStoreConfigDict
|
|
12750
|
+
]
|
|
12751
|
+
|
|
12752
|
+
|
|
12753
|
+
class _CreateFileSearchStoreParameters(_common.BaseModel):
|
|
12754
|
+
"""Config for file_search_stores.create parameters."""
|
|
12755
|
+
|
|
12756
|
+
config: Optional[CreateFileSearchStoreConfig] = Field(
|
|
12757
|
+
default=None,
|
|
12758
|
+
description="""Optional parameters for creating a file search store.
|
|
12759
|
+
""",
|
|
12760
|
+
)
|
|
12761
|
+
|
|
12762
|
+
|
|
12763
|
+
class _CreateFileSearchStoreParametersDict(TypedDict, total=False):
|
|
12764
|
+
"""Config for file_search_stores.create parameters."""
|
|
12765
|
+
|
|
12766
|
+
config: Optional[CreateFileSearchStoreConfigDict]
|
|
12767
|
+
"""Optional parameters for creating a file search store.
|
|
12768
|
+
"""
|
|
12769
|
+
|
|
12770
|
+
|
|
12771
|
+
_CreateFileSearchStoreParametersOrDict = Union[
|
|
12772
|
+
_CreateFileSearchStoreParameters, _CreateFileSearchStoreParametersDict
|
|
12773
|
+
]
|
|
12774
|
+
|
|
12775
|
+
|
|
12776
|
+
class FileSearchStore(_common.BaseModel):
|
|
12777
|
+
"""A collection of Documents."""
|
|
12778
|
+
|
|
12779
|
+
name: Optional[str] = Field(
|
|
12780
|
+
default=None,
|
|
12781
|
+
description="""The resource name of the FileSearchStore. Example: `fileSearchStores/my-file-search-store-123`""",
|
|
12782
|
+
)
|
|
12783
|
+
display_name: Optional[str] = Field(
|
|
12784
|
+
default=None,
|
|
12785
|
+
description="""The human-readable display name for the FileSearchStore.""",
|
|
12786
|
+
)
|
|
12787
|
+
create_time: Optional[datetime.datetime] = Field(
|
|
12788
|
+
default=None,
|
|
12789
|
+
description="""The Timestamp of when the FileSearchStore was created.""",
|
|
12790
|
+
)
|
|
12791
|
+
update_time: Optional[datetime.datetime] = Field(
|
|
12792
|
+
default=None,
|
|
12793
|
+
description="""The Timestamp of when the FileSearchStore was last updated.""",
|
|
12794
|
+
)
|
|
12795
|
+
active_documents_count: Optional[int] = Field(
|
|
12796
|
+
default=None,
|
|
12797
|
+
description="""The number of documents in the FileSearchStore that are active and ready for retrieval.""",
|
|
12798
|
+
)
|
|
12799
|
+
pending_documents_count: Optional[int] = Field(
|
|
12800
|
+
default=None,
|
|
12801
|
+
description="""The number of documents in the FileSearchStore that are being processed.""",
|
|
12802
|
+
)
|
|
12803
|
+
failed_documents_count: Optional[int] = Field(
|
|
12804
|
+
default=None,
|
|
12805
|
+
description="""The number of documents in the FileSearchStore that have failed processing.""",
|
|
12806
|
+
)
|
|
12807
|
+
size_bytes: Optional[int] = Field(
|
|
12808
|
+
default=None,
|
|
12809
|
+
description="""The size of raw bytes ingested into the FileSearchStore. This is the
|
|
12810
|
+
total size of all the documents in the FileSearchStore.""",
|
|
12811
|
+
)
|
|
12812
|
+
|
|
12813
|
+
|
|
12814
|
+
class FileSearchStoreDict(TypedDict, total=False):
|
|
12815
|
+
"""A collection of Documents."""
|
|
12816
|
+
|
|
12817
|
+
name: Optional[str]
|
|
12818
|
+
"""The resource name of the FileSearchStore. Example: `fileSearchStores/my-file-search-store-123`"""
|
|
12819
|
+
|
|
12820
|
+
display_name: Optional[str]
|
|
12821
|
+
"""The human-readable display name for the FileSearchStore."""
|
|
12822
|
+
|
|
12823
|
+
create_time: Optional[datetime.datetime]
|
|
12824
|
+
"""The Timestamp of when the FileSearchStore was created."""
|
|
12825
|
+
|
|
12826
|
+
update_time: Optional[datetime.datetime]
|
|
12827
|
+
"""The Timestamp of when the FileSearchStore was last updated."""
|
|
12828
|
+
|
|
12829
|
+
active_documents_count: Optional[int]
|
|
12830
|
+
"""The number of documents in the FileSearchStore that are active and ready for retrieval."""
|
|
12831
|
+
|
|
12832
|
+
pending_documents_count: Optional[int]
|
|
12833
|
+
"""The number of documents in the FileSearchStore that are being processed."""
|
|
12834
|
+
|
|
12835
|
+
failed_documents_count: Optional[int]
|
|
12836
|
+
"""The number of documents in the FileSearchStore that have failed processing."""
|
|
12837
|
+
|
|
12838
|
+
size_bytes: Optional[int]
|
|
12839
|
+
"""The size of raw bytes ingested into the FileSearchStore. This is the
|
|
12840
|
+
total size of all the documents in the FileSearchStore."""
|
|
12841
|
+
|
|
12842
|
+
|
|
12843
|
+
FileSearchStoreOrDict = Union[FileSearchStore, FileSearchStoreDict]
|
|
12844
|
+
|
|
12845
|
+
|
|
12846
|
+
class GetFileSearchStoreConfig(_common.BaseModel):
|
|
12847
|
+
"""Optional parameters for getting a FileSearchStore."""
|
|
12848
|
+
|
|
12849
|
+
http_options: Optional[HttpOptions] = Field(
|
|
12850
|
+
default=None, description="""Used to override HTTP request options."""
|
|
12851
|
+
)
|
|
12852
|
+
|
|
12853
|
+
|
|
12854
|
+
class GetFileSearchStoreConfigDict(TypedDict, total=False):
|
|
12855
|
+
"""Optional parameters for getting a FileSearchStore."""
|
|
12856
|
+
|
|
12857
|
+
http_options: Optional[HttpOptionsDict]
|
|
12858
|
+
"""Used to override HTTP request options."""
|
|
12859
|
+
|
|
12860
|
+
|
|
12861
|
+
GetFileSearchStoreConfigOrDict = Union[
|
|
12862
|
+
GetFileSearchStoreConfig, GetFileSearchStoreConfigDict
|
|
12863
|
+
]
|
|
12864
|
+
|
|
12865
|
+
|
|
12866
|
+
class _GetFileSearchStoreParameters(_common.BaseModel):
|
|
12867
|
+
"""Config for file_search_stores.get parameters."""
|
|
12868
|
+
|
|
12869
|
+
name: Optional[str] = Field(
|
|
12870
|
+
default=None,
|
|
12871
|
+
description="""The resource name of the FileSearchStore. Example: `fileSearchStores/my-file-search-store-123`""",
|
|
12872
|
+
)
|
|
12873
|
+
config: Optional[GetFileSearchStoreConfig] = Field(
|
|
12874
|
+
default=None, description="""Optional parameters for the request."""
|
|
12875
|
+
)
|
|
12876
|
+
|
|
12877
|
+
|
|
12878
|
+
class _GetFileSearchStoreParametersDict(TypedDict, total=False):
|
|
12879
|
+
"""Config for file_search_stores.get parameters."""
|
|
12880
|
+
|
|
12881
|
+
name: Optional[str]
|
|
12882
|
+
"""The resource name of the FileSearchStore. Example: `fileSearchStores/my-file-search-store-123`"""
|
|
12883
|
+
|
|
12884
|
+
config: Optional[GetFileSearchStoreConfigDict]
|
|
12885
|
+
"""Optional parameters for the request."""
|
|
12886
|
+
|
|
12887
|
+
|
|
12888
|
+
_GetFileSearchStoreParametersOrDict = Union[
|
|
12889
|
+
_GetFileSearchStoreParameters, _GetFileSearchStoreParametersDict
|
|
12890
|
+
]
|
|
12891
|
+
|
|
12892
|
+
|
|
12893
|
+
class DeleteFileSearchStoreConfig(_common.BaseModel):
|
|
12894
|
+
"""Optional parameters for deleting a FileSearchStore."""
|
|
12895
|
+
|
|
12896
|
+
http_options: Optional[HttpOptions] = Field(
|
|
12897
|
+
default=None, description="""Used to override HTTP request options."""
|
|
12898
|
+
)
|
|
12899
|
+
force: Optional[bool] = Field(
|
|
12900
|
+
default=None,
|
|
12901
|
+
description="""If set to true, any Documents and objects related to this FileSearchStore will also be deleted.
|
|
12902
|
+
If false (the default), a FAILED_PRECONDITION error will be returned if
|
|
12903
|
+
the FileSearchStore contains any Documents.
|
|
12904
|
+
""",
|
|
12905
|
+
)
|
|
12906
|
+
|
|
12907
|
+
|
|
12908
|
+
class DeleteFileSearchStoreConfigDict(TypedDict, total=False):
|
|
12909
|
+
"""Optional parameters for deleting a FileSearchStore."""
|
|
12910
|
+
|
|
12911
|
+
http_options: Optional[HttpOptionsDict]
|
|
12912
|
+
"""Used to override HTTP request options."""
|
|
12913
|
+
|
|
12914
|
+
force: Optional[bool]
|
|
12915
|
+
"""If set to true, any Documents and objects related to this FileSearchStore will also be deleted.
|
|
12916
|
+
If false (the default), a FAILED_PRECONDITION error will be returned if
|
|
12917
|
+
the FileSearchStore contains any Documents.
|
|
12918
|
+
"""
|
|
12919
|
+
|
|
12920
|
+
|
|
12921
|
+
DeleteFileSearchStoreConfigOrDict = Union[
|
|
12922
|
+
DeleteFileSearchStoreConfig, DeleteFileSearchStoreConfigDict
|
|
12923
|
+
]
|
|
12924
|
+
|
|
12925
|
+
|
|
12926
|
+
class _DeleteFileSearchStoreParameters(_common.BaseModel):
|
|
12927
|
+
"""Config for file_search_stores.delete parameters."""
|
|
12928
|
+
|
|
12929
|
+
name: Optional[str] = Field(
|
|
12930
|
+
default=None,
|
|
12931
|
+
description="""The resource name of the FileSearchStore. Example: `fileSearchStores/my-file-search-store-123`""",
|
|
12932
|
+
)
|
|
12933
|
+
config: Optional[DeleteFileSearchStoreConfig] = Field(
|
|
12934
|
+
default=None, description="""Optional parameters for the request."""
|
|
12935
|
+
)
|
|
12936
|
+
|
|
12937
|
+
|
|
12938
|
+
class _DeleteFileSearchStoreParametersDict(TypedDict, total=False):
|
|
12939
|
+
"""Config for file_search_stores.delete parameters."""
|
|
12940
|
+
|
|
12941
|
+
name: Optional[str]
|
|
12942
|
+
"""The resource name of the FileSearchStore. Example: `fileSearchStores/my-file-search-store-123`"""
|
|
12943
|
+
|
|
12944
|
+
config: Optional[DeleteFileSearchStoreConfigDict]
|
|
12945
|
+
"""Optional parameters for the request."""
|
|
12946
|
+
|
|
12947
|
+
|
|
12948
|
+
_DeleteFileSearchStoreParametersOrDict = Union[
|
|
12949
|
+
_DeleteFileSearchStoreParameters, _DeleteFileSearchStoreParametersDict
|
|
12950
|
+
]
|
|
12951
|
+
|
|
12952
|
+
|
|
12953
|
+
class ListFileSearchStoresConfig(_common.BaseModel):
|
|
12954
|
+
"""Optional parameters for listing FileSearchStore."""
|
|
12955
|
+
|
|
12956
|
+
http_options: Optional[HttpOptions] = Field(
|
|
12957
|
+
default=None, description="""Used to override HTTP request options."""
|
|
12958
|
+
)
|
|
12959
|
+
page_size: Optional[int] = Field(default=None, description="""""")
|
|
12960
|
+
page_token: Optional[str] = Field(default=None, description="""""")
|
|
12961
|
+
|
|
12962
|
+
|
|
12963
|
+
class ListFileSearchStoresConfigDict(TypedDict, total=False):
|
|
12964
|
+
"""Optional parameters for listing FileSearchStore."""
|
|
12965
|
+
|
|
12966
|
+
http_options: Optional[HttpOptionsDict]
|
|
12967
|
+
"""Used to override HTTP request options."""
|
|
12968
|
+
|
|
12969
|
+
page_size: Optional[int]
|
|
12970
|
+
""""""
|
|
12971
|
+
|
|
12972
|
+
page_token: Optional[str]
|
|
12973
|
+
""""""
|
|
12974
|
+
|
|
12975
|
+
|
|
12976
|
+
ListFileSearchStoresConfigOrDict = Union[
|
|
12977
|
+
ListFileSearchStoresConfig, ListFileSearchStoresConfigDict
|
|
12978
|
+
]
|
|
12979
|
+
|
|
12980
|
+
|
|
12981
|
+
class _ListFileSearchStoresParameters(_common.BaseModel):
|
|
12982
|
+
"""Config for file_search_stores.list parameters."""
|
|
11830
12983
|
|
|
11831
|
-
|
|
11832
|
-
|
|
11833
|
-
|
|
12984
|
+
config: Optional[ListFileSearchStoresConfig] = Field(
|
|
12985
|
+
default=None, description="""Optional parameters for the list request."""
|
|
12986
|
+
)
|
|
11834
12987
|
|
|
11835
|
-
config: Optional[GetCachedContentConfigDict]
|
|
11836
|
-
"""Optional parameters for the request.
|
|
11837
|
-
"""
|
|
11838
12988
|
|
|
12989
|
+
class _ListFileSearchStoresParametersDict(TypedDict, total=False):
|
|
12990
|
+
"""Config for file_search_stores.list parameters."""
|
|
11839
12991
|
|
|
11840
|
-
|
|
11841
|
-
|
|
12992
|
+
config: Optional[ListFileSearchStoresConfigDict]
|
|
12993
|
+
"""Optional parameters for the list request."""
|
|
12994
|
+
|
|
12995
|
+
|
|
12996
|
+
_ListFileSearchStoresParametersOrDict = Union[
|
|
12997
|
+
_ListFileSearchStoresParameters, _ListFileSearchStoresParametersDict
|
|
11842
12998
|
]
|
|
11843
12999
|
|
|
11844
13000
|
|
|
11845
|
-
class
|
|
11846
|
-
"""
|
|
13001
|
+
class ListFileSearchStoresResponse(_common.BaseModel):
|
|
13002
|
+
"""Config for file_search_stores.list return value."""
|
|
11847
13003
|
|
|
11848
|
-
|
|
11849
|
-
default=None, description="""Used to
|
|
13004
|
+
sdk_http_response: Optional[HttpResponse] = Field(
|
|
13005
|
+
default=None, description="""Used to retain the full HTTP response."""
|
|
13006
|
+
)
|
|
13007
|
+
next_page_token: Optional[str] = Field(default=None, description="""""")
|
|
13008
|
+
file_search_stores: Optional[list[FileSearchStore]] = Field(
|
|
13009
|
+
default=None, description="""The returned file search stores."""
|
|
11850
13010
|
)
|
|
11851
13011
|
|
|
11852
13012
|
|
|
11853
|
-
class
|
|
11854
|
-
"""
|
|
13013
|
+
class ListFileSearchStoresResponseDict(TypedDict, total=False):
|
|
13014
|
+
"""Config for file_search_stores.list return value."""
|
|
11855
13015
|
|
|
11856
|
-
|
|
11857
|
-
"""Used to
|
|
13016
|
+
sdk_http_response: Optional[HttpResponseDict]
|
|
13017
|
+
"""Used to retain the full HTTP response."""
|
|
13018
|
+
|
|
13019
|
+
next_page_token: Optional[str]
|
|
13020
|
+
""""""
|
|
11858
13021
|
|
|
13022
|
+
file_search_stores: Optional[list[FileSearchStoreDict]]
|
|
13023
|
+
"""The returned file search stores."""
|
|
11859
13024
|
|
|
11860
|
-
|
|
11861
|
-
|
|
13025
|
+
|
|
13026
|
+
ListFileSearchStoresResponseOrDict = Union[
|
|
13027
|
+
ListFileSearchStoresResponse, ListFileSearchStoresResponseDict
|
|
11862
13028
|
]
|
|
11863
13029
|
|
|
11864
13030
|
|
|
11865
|
-
class
|
|
11866
|
-
"""
|
|
13031
|
+
class WhiteSpaceConfig(_common.BaseModel):
|
|
13032
|
+
"""Configuration for a white space chunking algorithm."""
|
|
11867
13033
|
|
|
11868
|
-
|
|
11869
|
-
default=None,
|
|
11870
|
-
description="""The server-generated resource name of the cached content.
|
|
11871
|
-
""",
|
|
13034
|
+
max_tokens_per_chunk: Optional[int] = Field(
|
|
13035
|
+
default=None, description="""Maximum number of tokens per chunk."""
|
|
11872
13036
|
)
|
|
11873
|
-
|
|
13037
|
+
max_overlap_tokens: Optional[int] = Field(
|
|
11874
13038
|
default=None,
|
|
11875
|
-
description="""
|
|
11876
|
-
""",
|
|
13039
|
+
description="""Maximum number of overlapping tokens between two adjacent chunks.""",
|
|
11877
13040
|
)
|
|
11878
13041
|
|
|
11879
13042
|
|
|
11880
|
-
class
|
|
11881
|
-
"""
|
|
13043
|
+
class WhiteSpaceConfigDict(TypedDict, total=False):
|
|
13044
|
+
"""Configuration for a white space chunking algorithm."""
|
|
11882
13045
|
|
|
11883
|
-
|
|
11884
|
-
"""
|
|
11885
|
-
"""
|
|
13046
|
+
max_tokens_per_chunk: Optional[int]
|
|
13047
|
+
"""Maximum number of tokens per chunk."""
|
|
11886
13048
|
|
|
11887
|
-
|
|
11888
|
-
"""
|
|
11889
|
-
"""
|
|
13049
|
+
max_overlap_tokens: Optional[int]
|
|
13050
|
+
"""Maximum number of overlapping tokens between two adjacent chunks."""
|
|
11890
13051
|
|
|
11891
13052
|
|
|
11892
|
-
|
|
11893
|
-
_DeleteCachedContentParameters, _DeleteCachedContentParametersDict
|
|
11894
|
-
]
|
|
13053
|
+
WhiteSpaceConfigOrDict = Union[WhiteSpaceConfig, WhiteSpaceConfigDict]
|
|
11895
13054
|
|
|
11896
13055
|
|
|
11897
|
-
class
|
|
11898
|
-
"""
|
|
13056
|
+
class ChunkingConfig(_common.BaseModel):
|
|
13057
|
+
"""Config for telling the service how to chunk the file."""
|
|
11899
13058
|
|
|
11900
|
-
|
|
11901
|
-
default=None, description="""
|
|
13059
|
+
white_space_config: Optional[WhiteSpaceConfig] = Field(
|
|
13060
|
+
default=None, description="""White space chunking configuration."""
|
|
11902
13061
|
)
|
|
11903
13062
|
|
|
11904
13063
|
|
|
11905
|
-
class
|
|
11906
|
-
"""
|
|
13064
|
+
class ChunkingConfigDict(TypedDict, total=False):
|
|
13065
|
+
"""Config for telling the service how to chunk the file."""
|
|
11907
13066
|
|
|
11908
|
-
|
|
11909
|
-
"""
|
|
13067
|
+
white_space_config: Optional[WhiteSpaceConfigDict]
|
|
13068
|
+
"""White space chunking configuration."""
|
|
11910
13069
|
|
|
11911
13070
|
|
|
11912
|
-
|
|
11913
|
-
DeleteCachedContentResponse, DeleteCachedContentResponseDict
|
|
11914
|
-
]
|
|
13071
|
+
ChunkingConfigOrDict = Union[ChunkingConfig, ChunkingConfigDict]
|
|
11915
13072
|
|
|
11916
13073
|
|
|
11917
|
-
class
|
|
11918
|
-
"""Optional parameters for
|
|
13074
|
+
class UploadToFileSearchStoreConfig(_common.BaseModel):
|
|
13075
|
+
"""Optional parameters for uploading a file to a FileSearchStore."""
|
|
11919
13076
|
|
|
11920
13077
|
http_options: Optional[HttpOptions] = Field(
|
|
11921
13078
|
default=None, description="""Used to override HTTP request options."""
|
|
11922
13079
|
)
|
|
11923
|
-
|
|
13080
|
+
should_return_http_response: Optional[bool] = Field(
|
|
11924
13081
|
default=None,
|
|
11925
|
-
description="""
|
|
13082
|
+
description=""" If true, the raw HTTP response will be returned in the 'sdk_http_response' field.""",
|
|
11926
13083
|
)
|
|
11927
|
-
|
|
13084
|
+
mime_type: Optional[str] = Field(
|
|
11928
13085
|
default=None,
|
|
11929
|
-
description="""
|
|
13086
|
+
description="""MIME type of the file to be uploaded. If not provided, it will be inferred from the file extension.""",
|
|
13087
|
+
)
|
|
13088
|
+
display_name: Optional[str] = Field(
|
|
13089
|
+
default=None, description="""Display name of the created document."""
|
|
13090
|
+
)
|
|
13091
|
+
custom_metadata: Optional[list[CustomMetadata]] = Field(
|
|
13092
|
+
default=None,
|
|
13093
|
+
description="""User provided custom metadata stored as key-value pairs used for querying.""",
|
|
13094
|
+
)
|
|
13095
|
+
chunking_config: Optional[ChunkingConfig] = Field(
|
|
13096
|
+
default=None,
|
|
13097
|
+
description="""Config for telling the service how to chunk the file.""",
|
|
11930
13098
|
)
|
|
11931
13099
|
|
|
11932
13100
|
|
|
11933
|
-
class
|
|
11934
|
-
"""Optional parameters for
|
|
13101
|
+
class UploadToFileSearchStoreConfigDict(TypedDict, total=False):
|
|
13102
|
+
"""Optional parameters for uploading a file to a FileSearchStore."""
|
|
11935
13103
|
|
|
11936
13104
|
http_options: Optional[HttpOptionsDict]
|
|
11937
13105
|
"""Used to override HTTP request options."""
|
|
11938
13106
|
|
|
11939
|
-
|
|
11940
|
-
"""
|
|
13107
|
+
should_return_http_response: Optional[bool]
|
|
13108
|
+
""" If true, the raw HTTP response will be returned in the 'sdk_http_response' field."""
|
|
11941
13109
|
|
|
11942
|
-
|
|
11943
|
-
"""
|
|
13110
|
+
mime_type: Optional[str]
|
|
13111
|
+
"""MIME type of the file to be uploaded. If not provided, it will be inferred from the file extension."""
|
|
11944
13112
|
|
|
13113
|
+
display_name: Optional[str]
|
|
13114
|
+
"""Display name of the created document."""
|
|
11945
13115
|
|
|
11946
|
-
|
|
11947
|
-
|
|
13116
|
+
custom_metadata: Optional[list[CustomMetadataDict]]
|
|
13117
|
+
"""User provided custom metadata stored as key-value pairs used for querying."""
|
|
13118
|
+
|
|
13119
|
+
chunking_config: Optional[ChunkingConfigDict]
|
|
13120
|
+
"""Config for telling the service how to chunk the file."""
|
|
13121
|
+
|
|
13122
|
+
|
|
13123
|
+
UploadToFileSearchStoreConfigOrDict = Union[
|
|
13124
|
+
UploadToFileSearchStoreConfig, UploadToFileSearchStoreConfigDict
|
|
11948
13125
|
]
|
|
11949
13126
|
|
|
11950
13127
|
|
|
11951
|
-
class
|
|
13128
|
+
class _UploadToFileSearchStoreParameters(_common.BaseModel):
|
|
13129
|
+
"""Generates the parameters for the private _upload_to_file_search_store method."""
|
|
11952
13130
|
|
|
11953
|
-
|
|
13131
|
+
file_search_store_name: Optional[str] = Field(
|
|
11954
13132
|
default=None,
|
|
11955
|
-
description="""The
|
|
11956
|
-
""",
|
|
13133
|
+
description="""The resource name of the FileSearchStore. Example: `fileSearchStores/my-file-search-store-123`""",
|
|
11957
13134
|
)
|
|
11958
|
-
config: Optional[
|
|
13135
|
+
config: Optional[UploadToFileSearchStoreConfig] = Field(
|
|
11959
13136
|
default=None,
|
|
11960
|
-
description="""
|
|
11961
|
-
""",
|
|
13137
|
+
description="""Used to override the default configuration.""",
|
|
11962
13138
|
)
|
|
11963
13139
|
|
|
11964
13140
|
|
|
11965
|
-
class
|
|
13141
|
+
class _UploadToFileSearchStoreParametersDict(TypedDict, total=False):
|
|
13142
|
+
"""Generates the parameters for the private _upload_to_file_search_store method."""
|
|
11966
13143
|
|
|
11967
|
-
|
|
11968
|
-
"""The
|
|
11969
|
-
"""
|
|
13144
|
+
file_search_store_name: Optional[str]
|
|
13145
|
+
"""The resource name of the FileSearchStore. Example: `fileSearchStores/my-file-search-store-123`"""
|
|
11970
13146
|
|
|
11971
|
-
config: Optional[
|
|
11972
|
-
"""
|
|
11973
|
-
"""
|
|
13147
|
+
config: Optional[UploadToFileSearchStoreConfigDict]
|
|
13148
|
+
"""Used to override the default configuration."""
|
|
11974
13149
|
|
|
11975
13150
|
|
|
11976
|
-
|
|
11977
|
-
|
|
13151
|
+
_UploadToFileSearchStoreParametersOrDict = Union[
|
|
13152
|
+
_UploadToFileSearchStoreParameters, _UploadToFileSearchStoreParametersDict
|
|
11978
13153
|
]
|
|
11979
13154
|
|
|
11980
13155
|
|
|
11981
|
-
class
|
|
11982
|
-
"""
|
|
13156
|
+
class UploadToFileSearchStoreResumableResponse(_common.BaseModel):
|
|
13157
|
+
"""Response for the resumable upload method."""
|
|
13158
|
+
|
|
13159
|
+
sdk_http_response: Optional[HttpResponse] = Field(
|
|
13160
|
+
default=None, description="""Used to retain the full HTTP response."""
|
|
13161
|
+
)
|
|
13162
|
+
|
|
13163
|
+
|
|
13164
|
+
class UploadToFileSearchStoreResumableResponseDict(TypedDict, total=False):
|
|
13165
|
+
"""Response for the resumable upload method."""
|
|
13166
|
+
|
|
13167
|
+
sdk_http_response: Optional[HttpResponseDict]
|
|
13168
|
+
"""Used to retain the full HTTP response."""
|
|
13169
|
+
|
|
13170
|
+
|
|
13171
|
+
UploadToFileSearchStoreResumableResponseOrDict = Union[
|
|
13172
|
+
UploadToFileSearchStoreResumableResponse,
|
|
13173
|
+
UploadToFileSearchStoreResumableResponseDict,
|
|
13174
|
+
]
|
|
13175
|
+
|
|
13176
|
+
|
|
13177
|
+
class ImportFileConfig(_common.BaseModel):
|
|
13178
|
+
"""Optional parameters for importing a file."""
|
|
11983
13179
|
|
|
11984
13180
|
http_options: Optional[HttpOptions] = Field(
|
|
11985
13181
|
default=None, description="""Used to override HTTP request options."""
|
|
11986
13182
|
)
|
|
11987
|
-
|
|
11988
|
-
|
|
13183
|
+
custom_metadata: Optional[list[CustomMetadata]] = Field(
|
|
13184
|
+
default=None,
|
|
13185
|
+
description="""User provided custom metadata stored as key-value pairs used for querying.""",
|
|
13186
|
+
)
|
|
13187
|
+
chunking_config: Optional[ChunkingConfig] = Field(
|
|
13188
|
+
default=None,
|
|
13189
|
+
description="""Config for telling the service how to chunk the file.""",
|
|
13190
|
+
)
|
|
11989
13191
|
|
|
11990
13192
|
|
|
11991
|
-
class
|
|
11992
|
-
"""
|
|
13193
|
+
class ImportFileConfigDict(TypedDict, total=False):
|
|
13194
|
+
"""Optional parameters for importing a file."""
|
|
11993
13195
|
|
|
11994
13196
|
http_options: Optional[HttpOptionsDict]
|
|
11995
13197
|
"""Used to override HTTP request options."""
|
|
11996
13198
|
|
|
11997
|
-
|
|
11998
|
-
""""""
|
|
13199
|
+
custom_metadata: Optional[list[CustomMetadataDict]]
|
|
13200
|
+
"""User provided custom metadata stored as key-value pairs used for querying."""
|
|
11999
13201
|
|
|
12000
|
-
|
|
12001
|
-
""""""
|
|
13202
|
+
chunking_config: Optional[ChunkingConfigDict]
|
|
13203
|
+
"""Config for telling the service how to chunk the file."""
|
|
12002
13204
|
|
|
12003
13205
|
|
|
12004
|
-
|
|
12005
|
-
ListCachedContentsConfig, ListCachedContentsConfigDict
|
|
12006
|
-
]
|
|
13206
|
+
ImportFileConfigOrDict = Union[ImportFileConfig, ImportFileConfigDict]
|
|
12007
13207
|
|
|
12008
13208
|
|
|
12009
|
-
class
|
|
12010
|
-
"""
|
|
13209
|
+
class _ImportFileParameters(_common.BaseModel):
|
|
13210
|
+
"""Config for file_search_stores.import_file parameters."""
|
|
12011
13211
|
|
|
12012
|
-
|
|
13212
|
+
file_search_store_name: Optional[str] = Field(
|
|
12013
13213
|
default=None,
|
|
12014
|
-
description="""
|
|
12015
|
-
|
|
13214
|
+
description="""The resource name of the FileSearchStore. Example: `fileSearchStores/my-file-search-store-123`""",
|
|
13215
|
+
)
|
|
13216
|
+
file_name: Optional[str] = Field(
|
|
13217
|
+
default=None,
|
|
13218
|
+
description="""The name of the File API File to import. Example: `files/abc-123`""",
|
|
13219
|
+
)
|
|
13220
|
+
config: Optional[ImportFileConfig] = Field(
|
|
13221
|
+
default=None, description="""Optional parameters for the request."""
|
|
12016
13222
|
)
|
|
12017
13223
|
|
|
12018
13224
|
|
|
12019
|
-
class
|
|
12020
|
-
"""
|
|
13225
|
+
class _ImportFileParametersDict(TypedDict, total=False):
|
|
13226
|
+
"""Config for file_search_stores.import_file parameters."""
|
|
12021
13227
|
|
|
12022
|
-
|
|
12023
|
-
"""
|
|
12024
|
-
"""
|
|
13228
|
+
file_search_store_name: Optional[str]
|
|
13229
|
+
"""The resource name of the FileSearchStore. Example: `fileSearchStores/my-file-search-store-123`"""
|
|
12025
13230
|
|
|
13231
|
+
file_name: Optional[str]
|
|
13232
|
+
"""The name of the File API File to import. Example: `files/abc-123`"""
|
|
12026
13233
|
|
|
12027
|
-
|
|
12028
|
-
|
|
13234
|
+
config: Optional[ImportFileConfigDict]
|
|
13235
|
+
"""Optional parameters for the request."""
|
|
13236
|
+
|
|
13237
|
+
|
|
13238
|
+
_ImportFileParametersOrDict = Union[
|
|
13239
|
+
_ImportFileParameters, _ImportFileParametersDict
|
|
12029
13240
|
]
|
|
12030
13241
|
|
|
12031
13242
|
|
|
12032
|
-
class
|
|
13243
|
+
class ImportFileResponse(_common.BaseModel):
|
|
13244
|
+
"""Response for ImportFile to import a File API file with a file search store."""
|
|
12033
13245
|
|
|
12034
13246
|
sdk_http_response: Optional[HttpResponse] = Field(
|
|
12035
13247
|
default=None, description="""Used to retain the full HTTP response."""
|
|
12036
13248
|
)
|
|
12037
|
-
|
|
12038
|
-
cached_contents: Optional[list[CachedContent]] = Field(
|
|
13249
|
+
parent: Optional[str] = Field(
|
|
12039
13250
|
default=None,
|
|
12040
|
-
description="""
|
|
12041
|
-
|
|
13251
|
+
description="""The name of the FileSearchStore containing Documents.""",
|
|
13252
|
+
)
|
|
13253
|
+
document_name: Optional[str] = Field(
|
|
13254
|
+
default=None, description="""The identifier for the Document imported."""
|
|
12042
13255
|
)
|
|
12043
13256
|
|
|
12044
13257
|
|
|
12045
|
-
class
|
|
13258
|
+
class ImportFileResponseDict(TypedDict, total=False):
|
|
13259
|
+
"""Response for ImportFile to import a File API file with a file search store."""
|
|
12046
13260
|
|
|
12047
13261
|
sdk_http_response: Optional[HttpResponseDict]
|
|
12048
13262
|
"""Used to retain the full HTTP response."""
|
|
12049
13263
|
|
|
12050
|
-
|
|
12051
|
-
""""""
|
|
13264
|
+
parent: Optional[str]
|
|
13265
|
+
"""The name of the FileSearchStore containing Documents."""
|
|
12052
13266
|
|
|
12053
|
-
|
|
12054
|
-
"""
|
|
12055
|
-
"""
|
|
13267
|
+
document_name: Optional[str]
|
|
13268
|
+
"""The identifier for the Document imported."""
|
|
12056
13269
|
|
|
12057
13270
|
|
|
12058
|
-
|
|
12059
|
-
|
|
12060
|
-
|
|
13271
|
+
ImportFileResponseOrDict = Union[ImportFileResponse, ImportFileResponseDict]
|
|
13272
|
+
|
|
13273
|
+
|
|
13274
|
+
class ImportFileOperation(_common.BaseModel, Operation):
|
|
13275
|
+
"""Long-running operation for importing a file to a FileSearchStore."""
|
|
13276
|
+
|
|
13277
|
+
response: Optional[ImportFileResponse] = Field(
|
|
13278
|
+
default=None,
|
|
13279
|
+
description="""The result of the ImportFile operation, available when the operation is done.""",
|
|
13280
|
+
)
|
|
13281
|
+
|
|
13282
|
+
@classmethod
|
|
13283
|
+
def from_api_response(
|
|
13284
|
+
cls, api_response: Any, is_vertex_ai: bool = False
|
|
13285
|
+
) -> Self:
|
|
13286
|
+
"""Instantiates a ImportFileOperation from an API response."""
|
|
13287
|
+
|
|
13288
|
+
response_dict = _ImportFileOperation_from_mldev(api_response)
|
|
13289
|
+
return cls._from_response(response=response_dict, kwargs={})
|
|
12061
13290
|
|
|
12062
13291
|
|
|
12063
13292
|
class ListFilesConfig(_common.BaseModel):
|
|
@@ -12745,6 +13974,52 @@ _CreateBatchJobParametersOrDict = Union[
|
|
|
12745
13974
|
]
|
|
12746
13975
|
|
|
12747
13976
|
|
|
13977
|
+
class CompletionStats(_common.BaseModel):
|
|
13978
|
+
"""Success and error statistics of processing multiple entities (for example, DataItems or structured data rows) in batch.
|
|
13979
|
+
|
|
13980
|
+
This data type is not supported in Gemini API.
|
|
13981
|
+
"""
|
|
13982
|
+
|
|
13983
|
+
failed_count: Optional[int] = Field(
|
|
13984
|
+
default=None,
|
|
13985
|
+
description="""Output only. The number of entities for which any error was encountered.""",
|
|
13986
|
+
)
|
|
13987
|
+
incomplete_count: Optional[int] = Field(
|
|
13988
|
+
default=None,
|
|
13989
|
+
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).""",
|
|
13990
|
+
)
|
|
13991
|
+
successful_count: Optional[int] = Field(
|
|
13992
|
+
default=None,
|
|
13993
|
+
description="""Output only. The number of entities that had been processed successfully.""",
|
|
13994
|
+
)
|
|
13995
|
+
successful_forecast_point_count: Optional[int] = Field(
|
|
13996
|
+
default=None,
|
|
13997
|
+
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.""",
|
|
13998
|
+
)
|
|
13999
|
+
|
|
14000
|
+
|
|
14001
|
+
class CompletionStatsDict(TypedDict, total=False):
|
|
14002
|
+
"""Success and error statistics of processing multiple entities (for example, DataItems or structured data rows) in batch.
|
|
14003
|
+
|
|
14004
|
+
This data type is not supported in Gemini API.
|
|
14005
|
+
"""
|
|
14006
|
+
|
|
14007
|
+
failed_count: Optional[int]
|
|
14008
|
+
"""Output only. The number of entities for which any error was encountered."""
|
|
14009
|
+
|
|
14010
|
+
incomplete_count: Optional[int]
|
|
14011
|
+
"""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)."""
|
|
14012
|
+
|
|
14013
|
+
successful_count: Optional[int]
|
|
14014
|
+
"""Output only. The number of entities that had been processed successfully."""
|
|
14015
|
+
|
|
14016
|
+
successful_forecast_point_count: Optional[int]
|
|
14017
|
+
"""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."""
|
|
14018
|
+
|
|
14019
|
+
|
|
14020
|
+
CompletionStatsOrDict = Union[CompletionStats, CompletionStatsDict]
|
|
14021
|
+
|
|
14022
|
+
|
|
12748
14023
|
class BatchJob(_common.BaseModel):
|
|
12749
14024
|
"""Config for batches.create return value."""
|
|
12750
14025
|
|
|
@@ -12778,7 +14053,7 @@ class BatchJob(_common.BaseModel):
|
|
|
12778
14053
|
)
|
|
12779
14054
|
end_time: Optional[datetime.datetime] = Field(
|
|
12780
14055
|
default=None,
|
|
12781
|
-
description="""The time when the BatchJob was completed.
|
|
14056
|
+
description="""The time when the BatchJob was completed. This field is for Vertex AI only.
|
|
12782
14057
|
""",
|
|
12783
14058
|
)
|
|
12784
14059
|
update_time: Optional[datetime.datetime] = Field(
|
|
@@ -12793,7 +14068,7 @@ class BatchJob(_common.BaseModel):
|
|
|
12793
14068
|
)
|
|
12794
14069
|
src: Optional[BatchJobSource] = Field(
|
|
12795
14070
|
default=None,
|
|
12796
|
-
description="""Configuration for the input data.
|
|
14071
|
+
description="""Configuration for the input data. This field is for Vertex AI only.
|
|
12797
14072
|
""",
|
|
12798
14073
|
)
|
|
12799
14074
|
dest: Optional[BatchJobDestination] = Field(
|
|
@@ -12801,6 +14076,11 @@ class BatchJob(_common.BaseModel):
|
|
|
12801
14076
|
description="""Configuration for the output data.
|
|
12802
14077
|
""",
|
|
12803
14078
|
)
|
|
14079
|
+
completion_stats: Optional[CompletionStats] = Field(
|
|
14080
|
+
default=None,
|
|
14081
|
+
description="""Statistics on completed and failed prediction instances. This field is for Vertex AI only.
|
|
14082
|
+
""",
|
|
14083
|
+
)
|
|
12804
14084
|
|
|
12805
14085
|
@property
|
|
12806
14086
|
def done(self) -> bool:
|
|
@@ -12855,7 +14135,7 @@ class BatchJobDict(TypedDict, total=False):
|
|
|
12855
14135
|
"""Output only. Time when the Job for the first time entered the `JOB_STATE_RUNNING` state."""
|
|
12856
14136
|
|
|
12857
14137
|
end_time: Optional[datetime.datetime]
|
|
12858
|
-
"""The time when the BatchJob was completed.
|
|
14138
|
+
"""The time when the BatchJob was completed. This field is for Vertex AI only.
|
|
12859
14139
|
"""
|
|
12860
14140
|
|
|
12861
14141
|
update_time: Optional[datetime.datetime]
|
|
@@ -12867,13 +14147,17 @@ class BatchJobDict(TypedDict, total=False):
|
|
|
12867
14147
|
"""
|
|
12868
14148
|
|
|
12869
14149
|
src: Optional[BatchJobSourceDict]
|
|
12870
|
-
"""Configuration for the input data.
|
|
14150
|
+
"""Configuration for the input data. This field is for Vertex AI only.
|
|
12871
14151
|
"""
|
|
12872
14152
|
|
|
12873
14153
|
dest: Optional[BatchJobDestinationDict]
|
|
12874
14154
|
"""Configuration for the output data.
|
|
12875
14155
|
"""
|
|
12876
14156
|
|
|
14157
|
+
completion_stats: Optional[CompletionStatsDict]
|
|
14158
|
+
"""Statistics on completed and failed prediction instances. This field is for Vertex AI only.
|
|
14159
|
+
"""
|
|
14160
|
+
|
|
12877
14161
|
|
|
12878
14162
|
BatchJobOrDict = Union[BatchJob, BatchJobDict]
|
|
12879
14163
|
|
|
@@ -16551,3 +17835,54 @@ class RougeSpecDict(TypedDict, total=False):
|
|
|
16551
17835
|
|
|
16552
17836
|
|
|
16553
17837
|
RougeSpecOrDict = Union[RougeSpec, RougeSpecDict]
|
|
17838
|
+
|
|
17839
|
+
|
|
17840
|
+
class UploadToFileSearchStoreResponse(_common.BaseModel):
|
|
17841
|
+
"""The response when long-running operation for uploading a file to a FileSearchStore complete."""
|
|
17842
|
+
|
|
17843
|
+
sdk_http_response: Optional[HttpResponse] = Field(
|
|
17844
|
+
default=None, description="""Used to retain the full HTTP response."""
|
|
17845
|
+
)
|
|
17846
|
+
parent: Optional[str] = Field(
|
|
17847
|
+
default=None,
|
|
17848
|
+
description="""The name of the FileSearchStore containing Documents.""",
|
|
17849
|
+
)
|
|
17850
|
+
document_name: Optional[str] = Field(
|
|
17851
|
+
default=None, description="""The identifier for the Document imported."""
|
|
17852
|
+
)
|
|
17853
|
+
|
|
17854
|
+
|
|
17855
|
+
class UploadToFileSearchStoreResponseDict(TypedDict, total=False):
|
|
17856
|
+
"""The response when long-running operation for uploading a file to a FileSearchStore complete."""
|
|
17857
|
+
|
|
17858
|
+
sdk_http_response: Optional[HttpResponseDict]
|
|
17859
|
+
"""Used to retain the full HTTP response."""
|
|
17860
|
+
|
|
17861
|
+
parent: Optional[str]
|
|
17862
|
+
"""The name of the FileSearchStore containing Documents."""
|
|
17863
|
+
|
|
17864
|
+
document_name: Optional[str]
|
|
17865
|
+
"""The identifier for the Document imported."""
|
|
17866
|
+
|
|
17867
|
+
|
|
17868
|
+
UploadToFileSearchStoreResponseOrDict = Union[
|
|
17869
|
+
UploadToFileSearchStoreResponse, UploadToFileSearchStoreResponseDict
|
|
17870
|
+
]
|
|
17871
|
+
|
|
17872
|
+
|
|
17873
|
+
class UploadToFileSearchStoreOperation(_common.BaseModel, Operation):
|
|
17874
|
+
"""Long-running operation for uploading a file to a FileSearchStore."""
|
|
17875
|
+
|
|
17876
|
+
response: Optional[UploadToFileSearchStoreResponse] = Field(
|
|
17877
|
+
default=None,
|
|
17878
|
+
description="""The result of the UploadToFileSearchStore operation, available when the operation is done.""",
|
|
17879
|
+
)
|
|
17880
|
+
|
|
17881
|
+
@classmethod
|
|
17882
|
+
def from_api_response(
|
|
17883
|
+
cls, api_response: Any, is_vertex_ai: bool = False
|
|
17884
|
+
) -> Self:
|
|
17885
|
+
"""Instantiates a UploadToFileSearchStoreOperation from an API response."""
|
|
17886
|
+
|
|
17887
|
+
response_dict = _UploadToFileSearchStoreOperation_from_mldev(api_response)
|
|
17888
|
+
return cls._from_response(response=response_dict, kwargs={})
|