google-genai 1.47.0__py3-none-any.whl → 1.49.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- google/genai/_api_client.py +5 -1
- google/genai/_extra_utils.py +36 -3
- google/genai/_live_converters.py +28 -17
- google/genai/_operations_converters.py +96 -0
- google/genai/_replay_api_client.py +24 -39
- google/genai/_tokens_converters.py +15 -7
- google/genai/batches.py +20 -7
- google/genai/caches.py +21 -10
- google/genai/client.py +11 -0
- google/genai/documents.py +549 -0
- google/genai/errors.py +1 -1
- google/genai/file_search_stores.py +1312 -0
- google/genai/models.py +139 -23
- google/genai/pagers.py +7 -1
- google/genai/tunings.py +313 -2
- google/genai/types.py +1705 -393
- google/genai/version.py +1 -1
- {google_genai-1.47.0.dist-info → google_genai-1.49.0.dist-info}/METADATA +2 -3
- google_genai-1.49.0.dist-info/RECORD +41 -0
- google_genai-1.47.0.dist-info/RECORD +0 -39
- {google_genai-1.47.0.dist-info → google_genai-1.49.0.dist-info}/WHEEL +0 -0
- {google_genai-1.47.0.dist-info → google_genai-1.49.0.dist-info}/licenses/LICENSE +0 -0
- {google_genai-1.47.0.dist-info → google_genai-1.49.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
|
|
|
@@ -182,6 +185,20 @@ class Mode(_common.CaseInSensitiveEnum):
|
|
|
182
185
|
"""Run retrieval only when system decides it is necessary."""
|
|
183
186
|
|
|
184
187
|
|
|
188
|
+
class ApiSpec(_common.CaseInSensitiveEnum):
|
|
189
|
+
"""The API spec that the external API implements.
|
|
190
|
+
|
|
191
|
+
This enum is not supported in Gemini API.
|
|
192
|
+
"""
|
|
193
|
+
|
|
194
|
+
API_SPEC_UNSPECIFIED = 'API_SPEC_UNSPECIFIED'
|
|
195
|
+
"""Unspecified API spec. This value should not be used."""
|
|
196
|
+
SIMPLE_SEARCH = 'SIMPLE_SEARCH'
|
|
197
|
+
"""Simple search API spec."""
|
|
198
|
+
ELASTIC_SEARCH = 'ELASTIC_SEARCH'
|
|
199
|
+
"""Elastic search API spec."""
|
|
200
|
+
|
|
201
|
+
|
|
185
202
|
class AuthType(_common.CaseInSensitiveEnum):
|
|
186
203
|
"""Type of auth scheme. This enum is not supported in Gemini API."""
|
|
187
204
|
|
|
@@ -200,18 +217,42 @@ class AuthType(_common.CaseInSensitiveEnum):
|
|
|
200
217
|
"""OpenID Connect (OIDC) Auth."""
|
|
201
218
|
|
|
202
219
|
|
|
203
|
-
class
|
|
204
|
-
"""The API
|
|
220
|
+
class HttpElementLocation(_common.CaseInSensitiveEnum):
|
|
221
|
+
"""The location of the API key. This enum is not supported in Gemini API."""
|
|
222
|
+
|
|
223
|
+
HTTP_IN_UNSPECIFIED = 'HTTP_IN_UNSPECIFIED'
|
|
224
|
+
HTTP_IN_QUERY = 'HTTP_IN_QUERY'
|
|
225
|
+
"""Element is in the HTTP request query."""
|
|
226
|
+
HTTP_IN_HEADER = 'HTTP_IN_HEADER'
|
|
227
|
+
"""Element is in the HTTP request header."""
|
|
228
|
+
HTTP_IN_PATH = 'HTTP_IN_PATH'
|
|
229
|
+
"""Element is in the HTTP request path."""
|
|
230
|
+
HTTP_IN_BODY = 'HTTP_IN_BODY'
|
|
231
|
+
"""Element is in the HTTP request body."""
|
|
232
|
+
HTTP_IN_COOKIE = 'HTTP_IN_COOKIE'
|
|
233
|
+
"""Element is in the HTTP request cookie."""
|
|
234
|
+
|
|
235
|
+
|
|
236
|
+
class PhishBlockThreshold(_common.CaseInSensitiveEnum):
|
|
237
|
+
"""Sites with confidence level chosen & above this value will be blocked from the search results.
|
|
205
238
|
|
|
206
239
|
This enum is not supported in Gemini API.
|
|
207
240
|
"""
|
|
208
241
|
|
|
209
|
-
|
|
210
|
-
"""
|
|
211
|
-
|
|
212
|
-
"""
|
|
213
|
-
|
|
214
|
-
"""
|
|
242
|
+
PHISH_BLOCK_THRESHOLD_UNSPECIFIED = 'PHISH_BLOCK_THRESHOLD_UNSPECIFIED'
|
|
243
|
+
"""Defaults to unspecified."""
|
|
244
|
+
BLOCK_LOW_AND_ABOVE = 'BLOCK_LOW_AND_ABOVE'
|
|
245
|
+
"""Blocks Low and above confidence URL that is risky."""
|
|
246
|
+
BLOCK_MEDIUM_AND_ABOVE = 'BLOCK_MEDIUM_AND_ABOVE'
|
|
247
|
+
"""Blocks Medium and above confidence URL that is risky."""
|
|
248
|
+
BLOCK_HIGH_AND_ABOVE = 'BLOCK_HIGH_AND_ABOVE'
|
|
249
|
+
"""Blocks High and above confidence URL that is risky."""
|
|
250
|
+
BLOCK_HIGHER_AND_ABOVE = 'BLOCK_HIGHER_AND_ABOVE'
|
|
251
|
+
"""Blocks Higher and above confidence URL that is risky."""
|
|
252
|
+
BLOCK_VERY_HIGH_AND_ABOVE = 'BLOCK_VERY_HIGH_AND_ABOVE'
|
|
253
|
+
"""Blocks Very high and above confidence URL that is risky."""
|
|
254
|
+
BLOCK_ONLY_EXTREMELY_HIGH = 'BLOCK_ONLY_EXTREMELY_HIGH'
|
|
255
|
+
"""Blocks Extremely high confidence URL that is risky."""
|
|
215
256
|
|
|
216
257
|
|
|
217
258
|
class HarmCategory(_common.CaseInSensitiveEnum):
|
|
@@ -387,14 +428,13 @@ class BlockedReason(_common.CaseInSensitiveEnum):
|
|
|
387
428
|
class TrafficType(_common.CaseInSensitiveEnum):
|
|
388
429
|
"""Output only.
|
|
389
430
|
|
|
390
|
-
|
|
391
|
-
Provisioned Throughput quota. This enum is not supported in Gemini API.
|
|
431
|
+
The traffic type for this request. This enum is not supported in Gemini API.
|
|
392
432
|
"""
|
|
393
433
|
|
|
394
434
|
TRAFFIC_TYPE_UNSPECIFIED = 'TRAFFIC_TYPE_UNSPECIFIED'
|
|
395
435
|
"""Unspecified request traffic type."""
|
|
396
436
|
ON_DEMAND = 'ON_DEMAND'
|
|
397
|
-
"""
|
|
437
|
+
"""The request was processed using Pay-As-You-Go quota."""
|
|
398
438
|
PROVISIONED_THROUGHPUT = 'PROVISIONED_THROUGHPUT'
|
|
399
439
|
"""Type for Provisioned Throughput traffic."""
|
|
400
440
|
|
|
@@ -496,6 +536,8 @@ class TuningTask(_common.CaseInSensitiveEnum):
|
|
|
496
536
|
"""Tuning task for image to video."""
|
|
497
537
|
TUNING_TASK_T2V = 'TUNING_TASK_T2V'
|
|
498
538
|
"""Tuning task for text to video."""
|
|
539
|
+
TUNING_TASK_R2V = 'TUNING_TASK_R2V'
|
|
540
|
+
"""Tuning task for reference to video."""
|
|
499
541
|
|
|
500
542
|
|
|
501
543
|
class JSONSchemaType(Enum):
|
|
@@ -713,6 +755,15 @@ class TuningMethod(_common.CaseInSensitiveEnum):
|
|
|
713
755
|
"""Preference optimization tuning."""
|
|
714
756
|
|
|
715
757
|
|
|
758
|
+
class DocumentState(_common.CaseInSensitiveEnum):
|
|
759
|
+
"""State for the lifecycle of a Document."""
|
|
760
|
+
|
|
761
|
+
STATE_UNSPECIFIED = 'STATE_UNSPECIFIED'
|
|
762
|
+
STATE_PENDING = 'STATE_PENDING'
|
|
763
|
+
STATE_ACTIVE = 'STATE_ACTIVE'
|
|
764
|
+
STATE_FAILED = 'STATE_FAILED'
|
|
765
|
+
|
|
766
|
+
|
|
716
767
|
class FileState(_common.CaseInSensitiveEnum):
|
|
717
768
|
"""State for the lifecycle of a File."""
|
|
718
769
|
|
|
@@ -882,7 +933,7 @@ class FunctionCall(_common.BaseModel):
|
|
|
882
933
|
)
|
|
883
934
|
name: Optional[str] = Field(
|
|
884
935
|
default=None,
|
|
885
|
-
description="""
|
|
936
|
+
description="""Optional. The name of the function to call. Matches [FunctionDeclaration.name].""",
|
|
886
937
|
)
|
|
887
938
|
|
|
888
939
|
|
|
@@ -897,7 +948,7 @@ class FunctionCallDict(TypedDict, total=False):
|
|
|
897
948
|
"""Optional. The function parameters and values in JSON object format. See [FunctionDeclaration.parameters] for parameter details."""
|
|
898
949
|
|
|
899
950
|
name: Optional[str]
|
|
900
|
-
"""
|
|
951
|
+
"""Optional. The name of the function to call. Matches [FunctionDeclaration.name]."""
|
|
901
952
|
|
|
902
953
|
|
|
903
954
|
FunctionCallOrDict = Union[FunctionCall, FunctionCallDict]
|
|
@@ -1338,6 +1389,81 @@ class Part(_common.BaseModel):
|
|
|
1338
1389
|
description="""Optional. Video metadata. The metadata should only be specified while the video data is presented in inline_data or file_data.""",
|
|
1339
1390
|
)
|
|
1340
1391
|
|
|
1392
|
+
def __init__(
|
|
1393
|
+
self,
|
|
1394
|
+
value: Optional['PartUnionDict'] = None,
|
|
1395
|
+
/,
|
|
1396
|
+
*,
|
|
1397
|
+
video_metadata: Optional[VideoMetadata] = None,
|
|
1398
|
+
thought: Optional[bool] = None,
|
|
1399
|
+
inline_data: Optional[Blob] = None,
|
|
1400
|
+
file_data: Optional[FileData] = None,
|
|
1401
|
+
thought_signature: Optional[bytes] = None,
|
|
1402
|
+
function_call: Optional[FunctionCall] = None,
|
|
1403
|
+
code_execution_result: Optional[CodeExecutionResult] = None,
|
|
1404
|
+
executable_code: Optional[ExecutableCode] = None,
|
|
1405
|
+
function_response: Optional[FunctionResponse] = None,
|
|
1406
|
+
text: Optional[str] = None,
|
|
1407
|
+
# Pydantic allows CamelCase in addition to snake_case attribute
|
|
1408
|
+
# names. kwargs here catch these aliases.
|
|
1409
|
+
**kwargs: Any,
|
|
1410
|
+
):
|
|
1411
|
+
part_dict = dict(
|
|
1412
|
+
video_metadata=video_metadata,
|
|
1413
|
+
thought=thought,
|
|
1414
|
+
inline_data=inline_data,
|
|
1415
|
+
file_data=file_data,
|
|
1416
|
+
thought_signature=thought_signature,
|
|
1417
|
+
function_call=function_call,
|
|
1418
|
+
code_execution_result=code_execution_result,
|
|
1419
|
+
executable_code=executable_code,
|
|
1420
|
+
function_response=function_response,
|
|
1421
|
+
text=text,
|
|
1422
|
+
)
|
|
1423
|
+
part_dict = {k: v for k, v in part_dict.items() if v is not None}
|
|
1424
|
+
|
|
1425
|
+
if part_dict and value is not None:
|
|
1426
|
+
raise ValueError(
|
|
1427
|
+
'Positional and keyword arguments can not be combined when '
|
|
1428
|
+
'initializing a Part.'
|
|
1429
|
+
)
|
|
1430
|
+
|
|
1431
|
+
if value is None:
|
|
1432
|
+
pass
|
|
1433
|
+
elif isinstance(value, str):
|
|
1434
|
+
part_dict['text'] = value
|
|
1435
|
+
elif isinstance(value, File):
|
|
1436
|
+
if not value.uri or not value.mime_type:
|
|
1437
|
+
raise ValueError('file uri and mime_type are required.')
|
|
1438
|
+
part_dict['file_data'] = FileData(
|
|
1439
|
+
file_uri=value.uri,
|
|
1440
|
+
mime_type=value.mime_type,
|
|
1441
|
+
display_name=value.display_name,
|
|
1442
|
+
)
|
|
1443
|
+
elif isinstance(value, dict):
|
|
1444
|
+
try:
|
|
1445
|
+
Part.model_validate(value)
|
|
1446
|
+
part_dict.update(value) # type: ignore[arg-type]
|
|
1447
|
+
except pydantic.ValidationError:
|
|
1448
|
+
part_dict['file_data'] = FileData.model_validate(value)
|
|
1449
|
+
elif isinstance(value, Part):
|
|
1450
|
+
part_dict.update(value.dict())
|
|
1451
|
+
elif 'image' in value.__class__.__name__.lower():
|
|
1452
|
+
# PIL.Image case.
|
|
1453
|
+
|
|
1454
|
+
suffix = value.format.lower() if value.format else 'jpeg'
|
|
1455
|
+
mimetype = f'image/{suffix}'
|
|
1456
|
+
bytes_io = io.BytesIO()
|
|
1457
|
+
value.save(bytes_io, suffix.upper())
|
|
1458
|
+
|
|
1459
|
+
part_dict['inline_data'] = Blob(
|
|
1460
|
+
data=bytes_io.getvalue(), mime_type=mimetype
|
|
1461
|
+
)
|
|
1462
|
+
else:
|
|
1463
|
+
raise ValueError(f'Unsupported content part type: {type(value)}')
|
|
1464
|
+
|
|
1465
|
+
super().__init__(**part_dict, **kwargs)
|
|
1466
|
+
|
|
1341
1467
|
def as_image(self) -> Optional['Image']:
|
|
1342
1468
|
"""Returns the part as a PIL Image, or None if the part is not an image."""
|
|
1343
1469
|
if not self.inline_data:
|
|
@@ -1883,8 +2009,39 @@ class Schema(_common.BaseModel):
|
|
|
1883
2009
|
def json_schema(self) -> JSONSchema:
|
|
1884
2010
|
"""Converts the Schema object to a JSONSchema object, that is compatible with 2020-12 JSON Schema draft.
|
|
1885
2011
|
|
|
1886
|
-
|
|
2012
|
+
Note: Conversion of fields that are not included in the JSONSchema class
|
|
2013
|
+
are ignored.
|
|
2014
|
+
Json Schema is now supported natively by both Vertex AI and Gemini API.
|
|
2015
|
+
Users
|
|
2016
|
+
are recommended to pass/receive Json Schema directly to/from the API. For
|
|
2017
|
+
example:
|
|
2018
|
+
1. the counter part of GenerateContentConfig.response_schema is
|
|
2019
|
+
GenerateContentConfig.response_json_schema, which accepts [JSON
|
|
2020
|
+
Schema](https://json-schema.org/)
|
|
2021
|
+
2. the counter part of FunctionDeclaration.parameters is
|
|
2022
|
+
FunctionDeclaration.parameters_json_schema, which accepts [JSON
|
|
2023
|
+
Schema](https://json-schema.org/)
|
|
2024
|
+
3. the counter part of FunctionDeclaration.response is
|
|
2025
|
+
FunctionDeclaration.response_json_schema, which accepts [JSON
|
|
2026
|
+
Schema](https://json-schema.org/)
|
|
1887
2027
|
"""
|
|
2028
|
+
|
|
2029
|
+
info_message = """
|
|
2030
|
+
Note: Conversion of fields that are not included in the JSONSchema class are
|
|
2031
|
+
ignored.
|
|
2032
|
+
Json Schema is now supported natively by both Vertex AI and Gemini API. Users
|
|
2033
|
+
are recommended to pass/receive Json Schema directly to/from the API. For example:
|
|
2034
|
+
1. the counter part of GenerateContentConfig.response_schema is
|
|
2035
|
+
GenerateContentConfig.response_json_schema, which accepts [JSON
|
|
2036
|
+
Schema](https://json-schema.org/)
|
|
2037
|
+
2. the counter part of FunctionDeclaration.parameters is
|
|
2038
|
+
FunctionDeclaration.parameters_json_schema, which accepts [JSON
|
|
2039
|
+
Schema](https://json-schema.org/)
|
|
2040
|
+
3. the counter part of FunctionDeclaration.response is
|
|
2041
|
+
FunctionDeclaration.response_json_schema, which accepts [JSON
|
|
2042
|
+
Schema](https://json-schema.org/)
|
|
2043
|
+
"""
|
|
2044
|
+
logger.info(info_message)
|
|
1888
2045
|
json_schema_field_names: set[str] = set(JSONSchema.model_fields.keys())
|
|
1889
2046
|
schema_field_names: tuple[str] = (
|
|
1890
2047
|
'items',
|
|
@@ -1955,27 +2112,57 @@ class Schema(_common.BaseModel):
|
|
|
1955
2112
|
) -> 'Schema':
|
|
1956
2113
|
"""Converts a JSONSchema object to a Schema object.
|
|
1957
2114
|
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
2115
|
+
Note: Conversion of fields that are not included in the JSONSchema class
|
|
2116
|
+
are ignored.
|
|
2117
|
+
Json Schema is now supported natively by both Vertex AI and Gemini API.
|
|
2118
|
+
Users
|
|
2119
|
+
are recommended to pass/receive Json Schema directly to/from the API. For
|
|
2120
|
+
example:
|
|
2121
|
+
1. the counter part of GenerateContentConfig.response_schema is
|
|
2122
|
+
GenerateContentConfig.response_json_schema, which accepts [JSON
|
|
2123
|
+
Schema](https://json-schema.org/)
|
|
2124
|
+
2. the counter part of FunctionDeclaration.parameters is
|
|
2125
|
+
FunctionDeclaration.parameters_json_schema, which accepts [JSON
|
|
2126
|
+
Schema](https://json-schema.org/)
|
|
2127
|
+
3. the counter part of FunctionDeclaration.response is
|
|
2128
|
+
FunctionDeclaration.response_json_schema, which accepts [JSON
|
|
2129
|
+
Schema](https://json-schema.org/)
|
|
2130
|
+
The JSONSchema is compatible with 2020-12 JSON Schema draft, specified by
|
|
2131
|
+
OpenAPI 3.1.
|
|
2132
|
+
|
|
2133
|
+
Args:
|
|
2134
|
+
json_schema: JSONSchema object to be converted.
|
|
2135
|
+
api_option: API option to be used. If set to 'VERTEX_AI', the
|
|
2136
|
+
JSONSchema will be converted to a Schema object that is compatible
|
|
2137
|
+
with Vertex AI API. If set to 'GEMINI_API', the JSONSchema will be
|
|
2138
|
+
converted to a Schema object that is compatible with Gemini API.
|
|
2139
|
+
Default is 'GEMINI_API'.
|
|
2140
|
+
raise_error_on_unsupported_field: If set to True, an error will be
|
|
2141
|
+
raised if the JSONSchema contains any unsupported fields. Default is
|
|
2142
|
+
False.
|
|
2143
|
+
|
|
2144
|
+
Returns:
|
|
2145
|
+
Schema object that is compatible with the specified API option.
|
|
2146
|
+
Raises:
|
|
2147
|
+
ValueError: If the JSONSchema contains any unsupported fields and
|
|
2148
|
+
raise_error_on_unsupported_field is set to True. Or if the JSONSchema
|
|
2149
|
+
is not compatible with the specified API option.
|
|
1978
2150
|
"""
|
|
2151
|
+
info_message = """
|
|
2152
|
+
Note: Conversion of fields that are not included in the JSONSchema class are ignored.
|
|
2153
|
+
Json Schema is now supported natively by both Vertex AI and Gemini API. Users
|
|
2154
|
+
are recommended to pass/receive Json Schema directly to/from the API. For example:
|
|
2155
|
+
1. the counter part of GenerateContentConfig.response_schema is
|
|
2156
|
+
GenerateContentConfig.response_json_schema, which accepts [JSON
|
|
2157
|
+
Schema](https://json-schema.org/)
|
|
2158
|
+
2. the counter part of FunctionDeclaration.parameters is
|
|
2159
|
+
FunctionDeclaration.parameters_json_schema, which accepts [JSON
|
|
2160
|
+
Schema](https://json-schema.org/)
|
|
2161
|
+
3. the counter part of FunctionDeclaration.response is
|
|
2162
|
+
FunctionDeclaration.response_json_schema, which accepts [JSON
|
|
2163
|
+
Schema](https://json-schema.org/)
|
|
2164
|
+
"""
|
|
2165
|
+
logger.info(info_message)
|
|
1979
2166
|
google_schema_field_names: set[str] = set(cls.model_fields.keys())
|
|
1980
2167
|
schema_field_names: tuple[str, ...] = (
|
|
1981
2168
|
'items',
|
|
@@ -2691,20 +2878,166 @@ GoogleSearchRetrievalOrDict = Union[
|
|
|
2691
2878
|
]
|
|
2692
2879
|
|
|
2693
2880
|
|
|
2881
|
+
class ComputerUse(_common.BaseModel):
|
|
2882
|
+
"""Tool to support computer use."""
|
|
2883
|
+
|
|
2884
|
+
environment: Optional[Environment] = Field(
|
|
2885
|
+
default=None, description="""Required. The environment being operated."""
|
|
2886
|
+
)
|
|
2887
|
+
excluded_predefined_functions: Optional[list[str]] = Field(
|
|
2888
|
+
default=None,
|
|
2889
|
+
description="""By default, predefined functions are included in the final model call.
|
|
2890
|
+
Some of them can be explicitly excluded from being automatically included.
|
|
2891
|
+
This can serve two purposes:
|
|
2892
|
+
1. Using a more restricted / different action space.
|
|
2893
|
+
2. Improving the definitions / instructions of predefined functions.""",
|
|
2894
|
+
)
|
|
2895
|
+
|
|
2896
|
+
|
|
2897
|
+
class ComputerUseDict(TypedDict, total=False):
|
|
2898
|
+
"""Tool to support computer use."""
|
|
2899
|
+
|
|
2900
|
+
environment: Optional[Environment]
|
|
2901
|
+
"""Required. The environment being operated."""
|
|
2902
|
+
|
|
2903
|
+
excluded_predefined_functions: Optional[list[str]]
|
|
2904
|
+
"""By default, predefined functions are included in the final model call.
|
|
2905
|
+
Some of them can be explicitly excluded from being automatically included.
|
|
2906
|
+
This can serve two purposes:
|
|
2907
|
+
1. Using a more restricted / different action space.
|
|
2908
|
+
2. Improving the definitions / instructions of predefined functions."""
|
|
2909
|
+
|
|
2910
|
+
|
|
2911
|
+
ComputerUseOrDict = Union[ComputerUse, ComputerUseDict]
|
|
2912
|
+
|
|
2913
|
+
|
|
2914
|
+
class FileSearch(_common.BaseModel):
|
|
2915
|
+
"""Tool to retrieve knowledge from the File Search Stores."""
|
|
2916
|
+
|
|
2917
|
+
file_search_store_names: Optional[list[str]] = Field(
|
|
2918
|
+
default=None,
|
|
2919
|
+
description="""The names of the file_search_stores to retrieve from.
|
|
2920
|
+
Example: `fileSearchStores/my-file-search-store-123`""",
|
|
2921
|
+
)
|
|
2922
|
+
top_k: Optional[int] = Field(
|
|
2923
|
+
default=None,
|
|
2924
|
+
description="""The number of file search retrieval chunks to retrieve.""",
|
|
2925
|
+
)
|
|
2926
|
+
metadata_filter: Optional[str] = Field(
|
|
2927
|
+
default=None,
|
|
2928
|
+
description="""Metadata filter to apply to the file search retrieval documents. See https://google.aip.dev/160 for the syntax of the filter expression.""",
|
|
2929
|
+
)
|
|
2930
|
+
|
|
2931
|
+
|
|
2932
|
+
class FileSearchDict(TypedDict, total=False):
|
|
2933
|
+
"""Tool to retrieve knowledge from the File Search Stores."""
|
|
2934
|
+
|
|
2935
|
+
file_search_store_names: Optional[list[str]]
|
|
2936
|
+
"""The names of the file_search_stores to retrieve from.
|
|
2937
|
+
Example: `fileSearchStores/my-file-search-store-123`"""
|
|
2938
|
+
|
|
2939
|
+
top_k: Optional[int]
|
|
2940
|
+
"""The number of file search retrieval chunks to retrieve."""
|
|
2941
|
+
|
|
2942
|
+
metadata_filter: Optional[str]
|
|
2943
|
+
"""Metadata filter to apply to the file search retrieval documents. See https://google.aip.dev/160 for the syntax of the filter expression."""
|
|
2944
|
+
|
|
2945
|
+
|
|
2946
|
+
FileSearchOrDict = Union[FileSearch, FileSearchDict]
|
|
2947
|
+
|
|
2948
|
+
|
|
2949
|
+
class ApiAuthApiKeyConfig(_common.BaseModel):
|
|
2950
|
+
"""The API secret. This data type is not supported in Gemini API."""
|
|
2951
|
+
|
|
2952
|
+
api_key_secret_version: Optional[str] = Field(
|
|
2953
|
+
default=None,
|
|
2954
|
+
description="""Required. The SecretManager secret version resource name storing API key. e.g. projects/{project}/secrets/{secret}/versions/{version}""",
|
|
2955
|
+
)
|
|
2956
|
+
api_key_string: Optional[str] = Field(
|
|
2957
|
+
default=None,
|
|
2958
|
+
description="""The API key string. Either this or `api_key_secret_version` must be set.""",
|
|
2959
|
+
)
|
|
2960
|
+
|
|
2961
|
+
|
|
2962
|
+
class ApiAuthApiKeyConfigDict(TypedDict, total=False):
|
|
2963
|
+
"""The API secret. This data type is not supported in Gemini API."""
|
|
2964
|
+
|
|
2965
|
+
api_key_secret_version: Optional[str]
|
|
2966
|
+
"""Required. The SecretManager secret version resource name storing API key. e.g. projects/{project}/secrets/{secret}/versions/{version}"""
|
|
2967
|
+
|
|
2968
|
+
api_key_string: Optional[str]
|
|
2969
|
+
"""The API key string. Either this or `api_key_secret_version` must be set."""
|
|
2970
|
+
|
|
2971
|
+
|
|
2972
|
+
ApiAuthApiKeyConfigOrDict = Union[ApiAuthApiKeyConfig, ApiAuthApiKeyConfigDict]
|
|
2973
|
+
|
|
2974
|
+
|
|
2975
|
+
class ApiAuth(_common.BaseModel):
|
|
2976
|
+
"""The generic reusable api auth config.
|
|
2977
|
+
|
|
2978
|
+
Deprecated. Please use AuthConfig (google/cloud/aiplatform/master/auth.proto)
|
|
2979
|
+
instead. This data type is not supported in Gemini API.
|
|
2980
|
+
"""
|
|
2981
|
+
|
|
2982
|
+
api_key_config: Optional[ApiAuthApiKeyConfig] = Field(
|
|
2983
|
+
default=None, description="""The API secret."""
|
|
2984
|
+
)
|
|
2985
|
+
|
|
2986
|
+
|
|
2987
|
+
class ApiAuthDict(TypedDict, total=False):
|
|
2988
|
+
"""The generic reusable api auth config.
|
|
2989
|
+
|
|
2990
|
+
Deprecated. Please use AuthConfig (google/cloud/aiplatform/master/auth.proto)
|
|
2991
|
+
instead. This data type is not supported in Gemini API.
|
|
2992
|
+
"""
|
|
2993
|
+
|
|
2994
|
+
api_key_config: Optional[ApiAuthApiKeyConfigDict]
|
|
2995
|
+
"""The API secret."""
|
|
2996
|
+
|
|
2997
|
+
|
|
2998
|
+
ApiAuthOrDict = Union[ApiAuth, ApiAuthDict]
|
|
2999
|
+
|
|
3000
|
+
|
|
2694
3001
|
class ApiKeyConfig(_common.BaseModel):
|
|
2695
|
-
"""Config for authentication with API key.
|
|
3002
|
+
"""Config for authentication with API key.
|
|
2696
3003
|
|
|
3004
|
+
This data type is not supported in Gemini API.
|
|
3005
|
+
"""
|
|
3006
|
+
|
|
3007
|
+
api_key_secret: Optional[str] = Field(
|
|
3008
|
+
default=None,
|
|
3009
|
+
description="""Optional. The name of the SecretManager secret version resource storing the API key. Format: `projects/{project}/secrets/{secrete}/versions/{version}` - If both `api_key_secret` and `api_key_string` are specified, this field takes precedence over `api_key_string`. - If specified, the `secretmanager.versions.access` permission should be granted to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) on the specified resource.""",
|
|
3010
|
+
)
|
|
2697
3011
|
api_key_string: Optional[str] = Field(
|
|
2698
3012
|
default=None,
|
|
2699
|
-
description="""The API key to be used in the request directly.""",
|
|
3013
|
+
description="""Optional. The API key to be used in the request directly.""",
|
|
3014
|
+
)
|
|
3015
|
+
http_element_location: Optional[HttpElementLocation] = Field(
|
|
3016
|
+
default=None, description="""Optional. The location of the API key."""
|
|
3017
|
+
)
|
|
3018
|
+
name: Optional[str] = Field(
|
|
3019
|
+
default=None,
|
|
3020
|
+
description="""Optional. The parameter name of the API key. E.g. If the API request is "https://example.com/act?api_key=", "api_key" would be the parameter name.""",
|
|
2700
3021
|
)
|
|
2701
3022
|
|
|
2702
3023
|
|
|
2703
3024
|
class ApiKeyConfigDict(TypedDict, total=False):
|
|
2704
|
-
"""Config for authentication with API key.
|
|
3025
|
+
"""Config for authentication with API key.
|
|
3026
|
+
|
|
3027
|
+
This data type is not supported in Gemini API.
|
|
3028
|
+
"""
|
|
3029
|
+
|
|
3030
|
+
api_key_secret: Optional[str]
|
|
3031
|
+
"""Optional. The name of the SecretManager secret version resource storing the API key. Format: `projects/{project}/secrets/{secrete}/versions/{version}` - If both `api_key_secret` and `api_key_string` are specified, this field takes precedence over `api_key_string`. - If specified, the `secretmanager.versions.access` permission should be granted to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) on the specified resource."""
|
|
2705
3032
|
|
|
2706
3033
|
api_key_string: Optional[str]
|
|
2707
|
-
"""The API key to be used in the request directly."""
|
|
3034
|
+
"""Optional. The API key to be used in the request directly."""
|
|
3035
|
+
|
|
3036
|
+
http_element_location: Optional[HttpElementLocation]
|
|
3037
|
+
"""Optional. The location of the API key."""
|
|
3038
|
+
|
|
3039
|
+
name: Optional[str]
|
|
3040
|
+
"""Optional. The parameter name of the API key. E.g. If the API request is "https://example.com/act?api_key=", "api_key" would be the parameter name."""
|
|
2708
3041
|
|
|
2709
3042
|
|
|
2710
3043
|
ApiKeyConfigOrDict = Union[ApiKeyConfig, ApiKeyConfigDict]
|
|
@@ -2828,7 +3161,10 @@ AuthConfigOidcConfigOrDict = Union[
|
|
|
2828
3161
|
|
|
2829
3162
|
|
|
2830
3163
|
class AuthConfig(_common.BaseModel):
|
|
2831
|
-
"""Auth configuration to run the extension.
|
|
3164
|
+
"""Auth configuration to run the extension.
|
|
3165
|
+
|
|
3166
|
+
This data type is not supported in Gemini API.
|
|
3167
|
+
"""
|
|
2832
3168
|
|
|
2833
3169
|
api_key_config: Optional[ApiKeyConfig] = Field(
|
|
2834
3170
|
default=None, description="""Config for API key auth."""
|
|
@@ -2853,7 +3189,10 @@ class AuthConfig(_common.BaseModel):
|
|
|
2853
3189
|
|
|
2854
3190
|
|
|
2855
3191
|
class AuthConfigDict(TypedDict, total=False):
|
|
2856
|
-
"""Auth configuration to run the extension.
|
|
3192
|
+
"""Auth configuration to run the extension.
|
|
3193
|
+
|
|
3194
|
+
This data type is not supported in Gemini API.
|
|
3195
|
+
"""
|
|
2857
3196
|
|
|
2858
3197
|
api_key_config: Optional[ApiKeyConfigDict]
|
|
2859
3198
|
"""Config for API key auth."""
|
|
@@ -2879,172 +3218,61 @@ class AuthConfigDict(TypedDict, total=False):
|
|
|
2879
3218
|
AuthConfigOrDict = Union[AuthConfig, AuthConfigDict]
|
|
2880
3219
|
|
|
2881
3220
|
|
|
2882
|
-
class
|
|
2883
|
-
"""
|
|
3221
|
+
class ExternalApiElasticSearchParams(_common.BaseModel):
|
|
3222
|
+
"""The search parameters to use for the ELASTIC_SEARCH spec.
|
|
2884
3223
|
|
|
2885
|
-
|
|
2886
|
-
|
|
2887
|
-
|
|
3224
|
+
This data type is not supported in Gemini API.
|
|
3225
|
+
"""
|
|
3226
|
+
|
|
3227
|
+
index: Optional[str] = Field(
|
|
3228
|
+
default=None, description="""The ElasticSearch index to use."""
|
|
2888
3229
|
)
|
|
2889
|
-
|
|
3230
|
+
num_hits: Optional[int] = Field(
|
|
2890
3231
|
default=None,
|
|
2891
|
-
description="""Optional.
|
|
3232
|
+
description="""Optional. Number of hits (chunks) to request. When specified, it is passed to Elasticsearch as the `num_hits` param.""",
|
|
3233
|
+
)
|
|
3234
|
+
search_template: Optional[str] = Field(
|
|
3235
|
+
default=None, description="""The ElasticSearch search template to use."""
|
|
2892
3236
|
)
|
|
2893
3237
|
|
|
2894
3238
|
|
|
2895
|
-
class
|
|
2896
|
-
"""
|
|
3239
|
+
class ExternalApiElasticSearchParamsDict(TypedDict, total=False):
|
|
3240
|
+
"""The search parameters to use for the ELASTIC_SEARCH spec.
|
|
2897
3241
|
|
|
2898
|
-
|
|
2899
|
-
"""
|
|
3242
|
+
This data type is not supported in Gemini API.
|
|
3243
|
+
"""
|
|
2900
3244
|
|
|
2901
|
-
|
|
2902
|
-
"""
|
|
3245
|
+
index: Optional[str]
|
|
3246
|
+
"""The ElasticSearch index to use."""
|
|
2903
3247
|
|
|
3248
|
+
num_hits: Optional[int]
|
|
3249
|
+
"""Optional. Number of hits (chunks) to request. When specified, it is passed to Elasticsearch as the `num_hits` param."""
|
|
2904
3250
|
|
|
2905
|
-
|
|
3251
|
+
search_template: Optional[str]
|
|
3252
|
+
"""The ElasticSearch search template to use."""
|
|
2906
3253
|
|
|
2907
3254
|
|
|
2908
|
-
|
|
2909
|
-
|
|
3255
|
+
ExternalApiElasticSearchParamsOrDict = Union[
|
|
3256
|
+
ExternalApiElasticSearchParams, ExternalApiElasticSearchParamsDict
|
|
3257
|
+
]
|
|
2910
3258
|
|
|
2911
|
-
environment: Optional[Environment] = Field(
|
|
2912
|
-
default=None, description="""Required. The environment being operated."""
|
|
2913
|
-
)
|
|
2914
|
-
excluded_predefined_functions: Optional[list[str]] = Field(
|
|
2915
|
-
default=None,
|
|
2916
|
-
description="""By default, predefined functions are included in the final model call.
|
|
2917
|
-
Some of them can be explicitly excluded from being automatically included.
|
|
2918
|
-
This can serve two purposes:
|
|
2919
|
-
1. Using a more restricted / different action space.
|
|
2920
|
-
2. Improving the definitions / instructions of predefined functions.""",
|
|
2921
|
-
)
|
|
2922
3259
|
|
|
3260
|
+
class ExternalApiSimpleSearchParams(_common.BaseModel):
|
|
3261
|
+
"""The search parameters to use for SIMPLE_SEARCH spec.
|
|
2923
3262
|
|
|
2924
|
-
|
|
2925
|
-
"""
|
|
3263
|
+
This data type is not supported in Gemini API.
|
|
3264
|
+
"""
|
|
2926
3265
|
|
|
2927
|
-
|
|
2928
|
-
"""Required. The environment being operated."""
|
|
3266
|
+
pass
|
|
2929
3267
|
|
|
2930
|
-
excluded_predefined_functions: Optional[list[str]]
|
|
2931
|
-
"""By default, predefined functions are included in the final model call.
|
|
2932
|
-
Some of them can be explicitly excluded from being automatically included.
|
|
2933
|
-
This can serve two purposes:
|
|
2934
|
-
1. Using a more restricted / different action space.
|
|
2935
|
-
2. Improving the definitions / instructions of predefined functions."""
|
|
2936
3268
|
|
|
3269
|
+
class ExternalApiSimpleSearchParamsDict(TypedDict, total=False):
|
|
3270
|
+
"""The search parameters to use for SIMPLE_SEARCH spec.
|
|
2937
3271
|
|
|
2938
|
-
|
|
3272
|
+
This data type is not supported in Gemini API.
|
|
3273
|
+
"""
|
|
2939
3274
|
|
|
2940
|
-
|
|
2941
|
-
class ApiAuthApiKeyConfig(_common.BaseModel):
|
|
2942
|
-
"""The API secret. This data type is not supported in Gemini API."""
|
|
2943
|
-
|
|
2944
|
-
api_key_secret_version: Optional[str] = Field(
|
|
2945
|
-
default=None,
|
|
2946
|
-
description="""Required. The SecretManager secret version resource name storing API key. e.g. projects/{project}/secrets/{secret}/versions/{version}""",
|
|
2947
|
-
)
|
|
2948
|
-
api_key_string: Optional[str] = Field(
|
|
2949
|
-
default=None,
|
|
2950
|
-
description="""The API key string. Either this or `api_key_secret_version` must be set.""",
|
|
2951
|
-
)
|
|
2952
|
-
|
|
2953
|
-
|
|
2954
|
-
class ApiAuthApiKeyConfigDict(TypedDict, total=False):
|
|
2955
|
-
"""The API secret. This data type is not supported in Gemini API."""
|
|
2956
|
-
|
|
2957
|
-
api_key_secret_version: Optional[str]
|
|
2958
|
-
"""Required. The SecretManager secret version resource name storing API key. e.g. projects/{project}/secrets/{secret}/versions/{version}"""
|
|
2959
|
-
|
|
2960
|
-
api_key_string: Optional[str]
|
|
2961
|
-
"""The API key string. Either this or `api_key_secret_version` must be set."""
|
|
2962
|
-
|
|
2963
|
-
|
|
2964
|
-
ApiAuthApiKeyConfigOrDict = Union[ApiAuthApiKeyConfig, ApiAuthApiKeyConfigDict]
|
|
2965
|
-
|
|
2966
|
-
|
|
2967
|
-
class ApiAuth(_common.BaseModel):
|
|
2968
|
-
"""The generic reusable api auth config.
|
|
2969
|
-
|
|
2970
|
-
Deprecated. Please use AuthConfig (google/cloud/aiplatform/master/auth.proto)
|
|
2971
|
-
instead. This data type is not supported in Gemini API.
|
|
2972
|
-
"""
|
|
2973
|
-
|
|
2974
|
-
api_key_config: Optional[ApiAuthApiKeyConfig] = Field(
|
|
2975
|
-
default=None, description="""The API secret."""
|
|
2976
|
-
)
|
|
2977
|
-
|
|
2978
|
-
|
|
2979
|
-
class ApiAuthDict(TypedDict, total=False):
|
|
2980
|
-
"""The generic reusable api auth config.
|
|
2981
|
-
|
|
2982
|
-
Deprecated. Please use AuthConfig (google/cloud/aiplatform/master/auth.proto)
|
|
2983
|
-
instead. This data type is not supported in Gemini API.
|
|
2984
|
-
"""
|
|
2985
|
-
|
|
2986
|
-
api_key_config: Optional[ApiAuthApiKeyConfigDict]
|
|
2987
|
-
"""The API secret."""
|
|
2988
|
-
|
|
2989
|
-
|
|
2990
|
-
ApiAuthOrDict = Union[ApiAuth, ApiAuthDict]
|
|
2991
|
-
|
|
2992
|
-
|
|
2993
|
-
class ExternalApiElasticSearchParams(_common.BaseModel):
|
|
2994
|
-
"""The search parameters to use for the ELASTIC_SEARCH spec.
|
|
2995
|
-
|
|
2996
|
-
This data type is not supported in Gemini API.
|
|
2997
|
-
"""
|
|
2998
|
-
|
|
2999
|
-
index: Optional[str] = Field(
|
|
3000
|
-
default=None, description="""The ElasticSearch index to use."""
|
|
3001
|
-
)
|
|
3002
|
-
num_hits: Optional[int] = Field(
|
|
3003
|
-
default=None,
|
|
3004
|
-
description="""Optional. Number of hits (chunks) to request. When specified, it is passed to Elasticsearch as the `num_hits` param.""",
|
|
3005
|
-
)
|
|
3006
|
-
search_template: Optional[str] = Field(
|
|
3007
|
-
default=None, description="""The ElasticSearch search template to use."""
|
|
3008
|
-
)
|
|
3009
|
-
|
|
3010
|
-
|
|
3011
|
-
class ExternalApiElasticSearchParamsDict(TypedDict, total=False):
|
|
3012
|
-
"""The search parameters to use for the ELASTIC_SEARCH spec.
|
|
3013
|
-
|
|
3014
|
-
This data type is not supported in Gemini API.
|
|
3015
|
-
"""
|
|
3016
|
-
|
|
3017
|
-
index: Optional[str]
|
|
3018
|
-
"""The ElasticSearch index to use."""
|
|
3019
|
-
|
|
3020
|
-
num_hits: Optional[int]
|
|
3021
|
-
"""Optional. Number of hits (chunks) to request. When specified, it is passed to Elasticsearch as the `num_hits` param."""
|
|
3022
|
-
|
|
3023
|
-
search_template: Optional[str]
|
|
3024
|
-
"""The ElasticSearch search template to use."""
|
|
3025
|
-
|
|
3026
|
-
|
|
3027
|
-
ExternalApiElasticSearchParamsOrDict = Union[
|
|
3028
|
-
ExternalApiElasticSearchParams, ExternalApiElasticSearchParamsDict
|
|
3029
|
-
]
|
|
3030
|
-
|
|
3031
|
-
|
|
3032
|
-
class ExternalApiSimpleSearchParams(_common.BaseModel):
|
|
3033
|
-
"""The search parameters to use for SIMPLE_SEARCH spec.
|
|
3034
|
-
|
|
3035
|
-
This data type is not supported in Gemini API.
|
|
3036
|
-
"""
|
|
3037
|
-
|
|
3038
|
-
pass
|
|
3039
|
-
|
|
3040
|
-
|
|
3041
|
-
class ExternalApiSimpleSearchParamsDict(TypedDict, total=False):
|
|
3042
|
-
"""The search parameters to use for SIMPLE_SEARCH spec.
|
|
3043
|
-
|
|
3044
|
-
This data type is not supported in Gemini API.
|
|
3045
|
-
"""
|
|
3046
|
-
|
|
3047
|
-
pass
|
|
3275
|
+
pass
|
|
3048
3276
|
|
|
3049
3277
|
|
|
3050
3278
|
ExternalApiSimpleSearchParamsOrDict = Union[
|
|
@@ -3554,6 +3782,10 @@ class EnterpriseWebSearch(_common.BaseModel):
|
|
|
3554
3782
|
default=None,
|
|
3555
3783
|
description="""Optional. List of domains to be excluded from the search results. The default limit is 2000 domains.""",
|
|
3556
3784
|
)
|
|
3785
|
+
blocking_confidence: Optional[PhishBlockThreshold] = Field(
|
|
3786
|
+
default=None,
|
|
3787
|
+
description="""Optional. Sites with confidence level chosen & above this value will be blocked from the search results.""",
|
|
3788
|
+
)
|
|
3557
3789
|
|
|
3558
3790
|
|
|
3559
3791
|
class EnterpriseWebSearchDict(TypedDict, total=False):
|
|
@@ -3565,10 +3797,39 @@ class EnterpriseWebSearchDict(TypedDict, total=False):
|
|
|
3565
3797
|
exclude_domains: Optional[list[str]]
|
|
3566
3798
|
"""Optional. List of domains to be excluded from the search results. The default limit is 2000 domains."""
|
|
3567
3799
|
|
|
3800
|
+
blocking_confidence: Optional[PhishBlockThreshold]
|
|
3801
|
+
"""Optional. Sites with confidence level chosen & above this value will be blocked from the search results."""
|
|
3802
|
+
|
|
3568
3803
|
|
|
3569
3804
|
EnterpriseWebSearchOrDict = Union[EnterpriseWebSearch, EnterpriseWebSearchDict]
|
|
3570
3805
|
|
|
3571
3806
|
|
|
3807
|
+
class GoogleMaps(_common.BaseModel):
|
|
3808
|
+
"""Tool to retrieve public maps data for grounding, powered by Google."""
|
|
3809
|
+
|
|
3810
|
+
auth_config: Optional[AuthConfig] = Field(
|
|
3811
|
+
default=None,
|
|
3812
|
+
description="""The authentication config to access the API. Only API key is supported. This field is not supported in Gemini API.""",
|
|
3813
|
+
)
|
|
3814
|
+
enable_widget: Optional[bool] = Field(
|
|
3815
|
+
default=None,
|
|
3816
|
+
description="""Optional. If true, include the widget context token in the response.""",
|
|
3817
|
+
)
|
|
3818
|
+
|
|
3819
|
+
|
|
3820
|
+
class GoogleMapsDict(TypedDict, total=False):
|
|
3821
|
+
"""Tool to retrieve public maps data for grounding, powered by Google."""
|
|
3822
|
+
|
|
3823
|
+
auth_config: Optional[AuthConfigDict]
|
|
3824
|
+
"""The authentication config to access the API. Only API key is supported. This field is not supported in Gemini API."""
|
|
3825
|
+
|
|
3826
|
+
enable_widget: Optional[bool]
|
|
3827
|
+
"""Optional. If true, include the widget context token in the response."""
|
|
3828
|
+
|
|
3829
|
+
|
|
3830
|
+
GoogleMapsOrDict = Union[GoogleMaps, GoogleMapsDict]
|
|
3831
|
+
|
|
3832
|
+
|
|
3572
3833
|
class Interval(_common.BaseModel):
|
|
3573
3834
|
"""Represents a time interval, encoded as a Timestamp start (inclusive) and a Timestamp end (exclusive).
|
|
3574
3835
|
|
|
@@ -3615,6 +3876,10 @@ class GoogleSearch(_common.BaseModel):
|
|
|
3615
3876
|
default=None,
|
|
3616
3877
|
description="""Optional. List of domains to be excluded from the search results. The default limit is 2000 domains. Example: ["amazon.com", "facebook.com"]. This field is not supported in Gemini API.""",
|
|
3617
3878
|
)
|
|
3879
|
+
blocking_confidence: Optional[PhishBlockThreshold] = Field(
|
|
3880
|
+
default=None,
|
|
3881
|
+
description="""Optional. Sites with confidence level chosen & above this value will be blocked from the search results. This field is not supported in Gemini API.""",
|
|
3882
|
+
)
|
|
3618
3883
|
time_range_filter: Optional[Interval] = Field(
|
|
3619
3884
|
default=None,
|
|
3620
3885
|
description="""Optional. Filter search results to a specific time range. If customers set a start time, they must set an end time (and vice versa). This field is not supported in Vertex AI.""",
|
|
@@ -3630,6 +3895,9 @@ class GoogleSearchDict(TypedDict, total=False):
|
|
|
3630
3895
|
exclude_domains: Optional[list[str]]
|
|
3631
3896
|
"""Optional. List of domains to be excluded from the search results. The default limit is 2000 domains. Example: ["amazon.com", "facebook.com"]. This field is not supported in Gemini API."""
|
|
3632
3897
|
|
|
3898
|
+
blocking_confidence: Optional[PhishBlockThreshold]
|
|
3899
|
+
"""Optional. Sites with confidence level chosen & above this value will be blocked from the search results. This field is not supported in Gemini API."""
|
|
3900
|
+
|
|
3633
3901
|
time_range_filter: Optional[IntervalDict]
|
|
3634
3902
|
"""Optional. Filter search results to a specific time range. If customers set a start time, they must set an end time (and vice versa). This field is not supported in Vertex AI."""
|
|
3635
3903
|
|
|
@@ -3665,12 +3933,7 @@ class Tool(_common.BaseModel):
|
|
|
3665
3933
|
)
|
|
3666
3934
|
google_search_retrieval: Optional[GoogleSearchRetrieval] = Field(
|
|
3667
3935
|
default=None,
|
|
3668
|
-
description="""Optional.
|
|
3669
|
-
)
|
|
3670
|
-
google_maps: Optional[GoogleMaps] = Field(
|
|
3671
|
-
default=None,
|
|
3672
|
-
description="""Optional. Google Maps tool type. Specialized retrieval tool
|
|
3673
|
-
that is powered by Google Maps.""",
|
|
3936
|
+
description="""Optional. Specialized retrieval tool that is powered by Google Search.""",
|
|
3674
3937
|
)
|
|
3675
3938
|
computer_use: Optional[ComputerUse] = Field(
|
|
3676
3939
|
default=None,
|
|
@@ -3678,6 +3941,10 @@ class Tool(_common.BaseModel):
|
|
|
3678
3941
|
computer. If enabled, it automatically populates computer-use specific
|
|
3679
3942
|
Function Declarations.""",
|
|
3680
3943
|
)
|
|
3944
|
+
file_search: Optional[FileSearch] = Field(
|
|
3945
|
+
default=None,
|
|
3946
|
+
description="""Optional. Tool to retrieve knowledge from the File Search Stores.""",
|
|
3947
|
+
)
|
|
3681
3948
|
code_execution: Optional[ToolCodeExecution] = Field(
|
|
3682
3949
|
default=None,
|
|
3683
3950
|
description="""Optional. CodeExecution tool type. Enables the model to execute code as part of generation.""",
|
|
@@ -3686,6 +3953,10 @@ class Tool(_common.BaseModel):
|
|
|
3686
3953
|
default=None,
|
|
3687
3954
|
description="""Optional. Tool to support searching public web data, powered by Vertex AI Search and Sec4 compliance. This field is not supported in Gemini API.""",
|
|
3688
3955
|
)
|
|
3956
|
+
google_maps: Optional[GoogleMaps] = Field(
|
|
3957
|
+
default=None,
|
|
3958
|
+
description="""Optional. GoogleMaps tool type. Tool to support Google Maps in Model.""",
|
|
3959
|
+
)
|
|
3689
3960
|
google_search: Optional[GoogleSearch] = Field(
|
|
3690
3961
|
default=None,
|
|
3691
3962
|
description="""Optional. GoogleSearch tool type. Tool to support Google Search in Model. Powered by Google.""",
|
|
@@ -3706,23 +3977,25 @@ class ToolDict(TypedDict, total=False):
|
|
|
3706
3977
|
"""Optional. Retrieval tool type. System will always execute the provided retrieval tool(s) to get external knowledge to answer the prompt. Retrieval results are presented to the model for generation. This field is not supported in Gemini API."""
|
|
3707
3978
|
|
|
3708
3979
|
google_search_retrieval: Optional[GoogleSearchRetrievalDict]
|
|
3709
|
-
"""Optional.
|
|
3710
|
-
|
|
3711
|
-
google_maps: Optional[GoogleMapsDict]
|
|
3712
|
-
"""Optional. Google Maps tool type. Specialized retrieval tool
|
|
3713
|
-
that is powered by Google Maps."""
|
|
3980
|
+
"""Optional. Specialized retrieval tool that is powered by Google Search."""
|
|
3714
3981
|
|
|
3715
3982
|
computer_use: Optional[ComputerUseDict]
|
|
3716
3983
|
"""Optional. Tool to support the model interacting directly with the
|
|
3717
3984
|
computer. If enabled, it automatically populates computer-use specific
|
|
3718
3985
|
Function Declarations."""
|
|
3719
3986
|
|
|
3987
|
+
file_search: Optional[FileSearchDict]
|
|
3988
|
+
"""Optional. Tool to retrieve knowledge from the File Search Stores."""
|
|
3989
|
+
|
|
3720
3990
|
code_execution: Optional[ToolCodeExecutionDict]
|
|
3721
3991
|
"""Optional. CodeExecution tool type. Enables the model to execute code as part of generation."""
|
|
3722
3992
|
|
|
3723
3993
|
enterprise_web_search: Optional[EnterpriseWebSearchDict]
|
|
3724
3994
|
"""Optional. Tool to support searching public web data, powered by Vertex AI Search and Sec4 compliance. This field is not supported in Gemini API."""
|
|
3725
3995
|
|
|
3996
|
+
google_maps: Optional[GoogleMapsDict]
|
|
3997
|
+
"""Optional. GoogleMaps tool type. Tool to support Google Maps in Model."""
|
|
3998
|
+
|
|
3726
3999
|
google_search: Optional[GoogleSearchDict]
|
|
3727
4000
|
"""Optional. GoogleSearch tool type. Tool to support Google Search in Model. Powered by Google."""
|
|
3728
4001
|
|
|
@@ -3965,6 +4238,12 @@ class ImageConfig(_common.BaseModel):
|
|
|
3965
4238
|
description="""Aspect ratio of the generated images. Supported values are
|
|
3966
4239
|
"1:1", "2:3", "3:2", "3:4", "4:3", "9:16", "16:9", and "21:9".""",
|
|
3967
4240
|
)
|
|
4241
|
+
image_size: Optional[str] = Field(
|
|
4242
|
+
default=None,
|
|
4243
|
+
description="""Optional. Specifies the size of generated images. Supported
|
|
4244
|
+
values are `1K`, `2K`, `4K`. If not specified, the model will use default
|
|
4245
|
+
value `1K`.""",
|
|
4246
|
+
)
|
|
3968
4247
|
|
|
3969
4248
|
|
|
3970
4249
|
class ImageConfigDict(TypedDict, total=False):
|
|
@@ -3974,6 +4253,11 @@ class ImageConfigDict(TypedDict, total=False):
|
|
|
3974
4253
|
"""Aspect ratio of the generated images. Supported values are
|
|
3975
4254
|
"1:1", "2:3", "3:2", "3:4", "4:3", "9:16", "16:9", and "21:9"."""
|
|
3976
4255
|
|
|
4256
|
+
image_size: Optional[str]
|
|
4257
|
+
"""Optional. Specifies the size of generated images. Supported
|
|
4258
|
+
values are `1K`, `2K`, `4K`. If not specified, the model will use default
|
|
4259
|
+
value `1K`."""
|
|
4260
|
+
|
|
3977
4261
|
|
|
3978
4262
|
ImageConfigOrDict = Union[ImageConfig, ImageConfigDict]
|
|
3979
4263
|
|
|
@@ -5079,13 +5363,13 @@ class GroundingChunkMaps(_common.BaseModel):
|
|
|
5079
5363
|
description="""This Place's resource name, in `places/{place_id}` format. Can be used to look up the Place.""",
|
|
5080
5364
|
)
|
|
5081
5365
|
text: Optional[str] = Field(
|
|
5082
|
-
default=None, description="""Text of the
|
|
5366
|
+
default=None, description="""Text of the place answer."""
|
|
5083
5367
|
)
|
|
5084
5368
|
title: Optional[str] = Field(
|
|
5085
|
-
default=None, description="""Title of the
|
|
5369
|
+
default=None, description="""Title of the place."""
|
|
5086
5370
|
)
|
|
5087
5371
|
uri: Optional[str] = Field(
|
|
5088
|
-
default=None, description="""URI reference of the
|
|
5372
|
+
default=None, description="""URI reference of the place."""
|
|
5089
5373
|
)
|
|
5090
5374
|
|
|
5091
5375
|
|
|
@@ -5099,13 +5383,13 @@ class GroundingChunkMapsDict(TypedDict, total=False):
|
|
|
5099
5383
|
"""This Place's resource name, in `places/{place_id}` format. Can be used to look up the Place."""
|
|
5100
5384
|
|
|
5101
5385
|
text: Optional[str]
|
|
5102
|
-
"""Text of the
|
|
5386
|
+
"""Text of the place answer."""
|
|
5103
5387
|
|
|
5104
5388
|
title: Optional[str]
|
|
5105
|
-
"""Title of the
|
|
5389
|
+
"""Title of the place."""
|
|
5106
5390
|
|
|
5107
5391
|
uri: Optional[str]
|
|
5108
|
-
"""URI reference of the
|
|
5392
|
+
"""URI reference of the place."""
|
|
5109
5393
|
|
|
5110
5394
|
|
|
5111
5395
|
GroundingChunkMapsOrDict = Union[GroundingChunkMaps, GroundingChunkMapsDict]
|
|
@@ -5860,94 +6144,97 @@ ModalityTokenCountOrDict = Union[ModalityTokenCount, ModalityTokenCountDict]
|
|
|
5860
6144
|
|
|
5861
6145
|
|
|
5862
6146
|
class GenerateContentResponseUsageMetadata(_common.BaseModel):
|
|
5863
|
-
"""Usage metadata about response
|
|
6147
|
+
"""Usage metadata about the content generation request and response.
|
|
5864
6148
|
|
|
5865
|
-
This
|
|
6149
|
+
This message provides a detailed breakdown of token usage and other relevant
|
|
6150
|
+
metrics. This data type is not supported in Gemini API.
|
|
5866
6151
|
"""
|
|
5867
6152
|
|
|
5868
6153
|
cache_tokens_details: Optional[list[ModalityTokenCount]] = Field(
|
|
5869
6154
|
default=None,
|
|
5870
|
-
description="""Output only.
|
|
6155
|
+
description="""Output only. A detailed breakdown of the token count for each modality in the cached content.""",
|
|
5871
6156
|
)
|
|
5872
6157
|
cached_content_token_count: Optional[int] = Field(
|
|
5873
6158
|
default=None,
|
|
5874
|
-
description="""Output only.
|
|
6159
|
+
description="""Output only. The number of tokens in the cached content that was used for this request.""",
|
|
5875
6160
|
)
|
|
5876
6161
|
candidates_token_count: Optional[int] = Field(
|
|
5877
|
-
default=None,
|
|
6162
|
+
default=None,
|
|
6163
|
+
description="""The total number of tokens in the generated candidates.""",
|
|
5878
6164
|
)
|
|
5879
6165
|
candidates_tokens_details: Optional[list[ModalityTokenCount]] = Field(
|
|
5880
6166
|
default=None,
|
|
5881
|
-
description="""Output only.
|
|
6167
|
+
description="""Output only. A detailed breakdown of the token count for each modality in the generated candidates.""",
|
|
5882
6168
|
)
|
|
5883
6169
|
prompt_token_count: Optional[int] = Field(
|
|
5884
6170
|
default=None,
|
|
5885
|
-
description="""
|
|
6171
|
+
description="""The total number of tokens in the prompt. This includes any text, images, or other media provided in the request. When `cached_content` is set, this also includes the number of tokens in the cached content.""",
|
|
5886
6172
|
)
|
|
5887
6173
|
prompt_tokens_details: Optional[list[ModalityTokenCount]] = Field(
|
|
5888
6174
|
default=None,
|
|
5889
|
-
description="""Output only.
|
|
6175
|
+
description="""Output only. A detailed breakdown of the token count for each modality in the prompt.""",
|
|
5890
6176
|
)
|
|
5891
6177
|
thoughts_token_count: Optional[int] = Field(
|
|
5892
6178
|
default=None,
|
|
5893
|
-
description="""Output only.
|
|
6179
|
+
description="""Output only. The number of tokens that were part of the model's generated "thoughts" output, if applicable.""",
|
|
5894
6180
|
)
|
|
5895
6181
|
tool_use_prompt_token_count: Optional[int] = Field(
|
|
5896
6182
|
default=None,
|
|
5897
|
-
description="""Output only.
|
|
6183
|
+
description="""Output only. The number of tokens in the results from tool executions, which are provided back to the model as input, if applicable.""",
|
|
5898
6184
|
)
|
|
5899
6185
|
tool_use_prompt_tokens_details: Optional[list[ModalityTokenCount]] = Field(
|
|
5900
6186
|
default=None,
|
|
5901
|
-
description="""Output only.
|
|
6187
|
+
description="""Output only. A detailed breakdown by modality of the token counts from the results of tool executions, which are provided back to the model as input.""",
|
|
5902
6188
|
)
|
|
5903
6189
|
total_token_count: Optional[int] = Field(
|
|
5904
6190
|
default=None,
|
|
5905
|
-
description="""
|
|
6191
|
+
description="""The total number of tokens for the entire request. This is the sum of `prompt_token_count`, `candidates_token_count`, `tool_use_prompt_token_count`, and `thoughts_token_count`.""",
|
|
5906
6192
|
)
|
|
5907
6193
|
traffic_type: Optional[TrafficType] = Field(
|
|
5908
6194
|
default=None,
|
|
5909
|
-
description="""Output only.
|
|
6195
|
+
description="""Output only. The traffic type for this request.""",
|
|
5910
6196
|
)
|
|
5911
6197
|
|
|
5912
6198
|
|
|
5913
6199
|
class GenerateContentResponseUsageMetadataDict(TypedDict, total=False):
|
|
5914
|
-
"""Usage metadata about response
|
|
6200
|
+
"""Usage metadata about the content generation request and response.
|
|
5915
6201
|
|
|
5916
|
-
This
|
|
6202
|
+
This message provides a detailed breakdown of token usage and other relevant
|
|
6203
|
+
metrics. This data type is not supported in Gemini API.
|
|
5917
6204
|
"""
|
|
5918
6205
|
|
|
5919
6206
|
cache_tokens_details: Optional[list[ModalityTokenCountDict]]
|
|
5920
|
-
"""Output only.
|
|
6207
|
+
"""Output only. A detailed breakdown of the token count for each modality in the cached content."""
|
|
5921
6208
|
|
|
5922
6209
|
cached_content_token_count: Optional[int]
|
|
5923
|
-
"""Output only.
|
|
6210
|
+
"""Output only. The number of tokens in the cached content that was used for this request."""
|
|
5924
6211
|
|
|
5925
6212
|
candidates_token_count: Optional[int]
|
|
5926
|
-
"""
|
|
6213
|
+
"""The total number of tokens in the generated candidates."""
|
|
5927
6214
|
|
|
5928
6215
|
candidates_tokens_details: Optional[list[ModalityTokenCountDict]]
|
|
5929
|
-
"""Output only.
|
|
6216
|
+
"""Output only. A detailed breakdown of the token count for each modality in the generated candidates."""
|
|
5930
6217
|
|
|
5931
6218
|
prompt_token_count: Optional[int]
|
|
5932
|
-
"""
|
|
6219
|
+
"""The total number of tokens in the prompt. This includes any text, images, or other media provided in the request. When `cached_content` is set, this also includes the number of tokens in the cached content."""
|
|
5933
6220
|
|
|
5934
6221
|
prompt_tokens_details: Optional[list[ModalityTokenCountDict]]
|
|
5935
|
-
"""Output only.
|
|
6222
|
+
"""Output only. A detailed breakdown of the token count for each modality in the prompt."""
|
|
5936
6223
|
|
|
5937
6224
|
thoughts_token_count: Optional[int]
|
|
5938
|
-
"""Output only.
|
|
6225
|
+
"""Output only. The number of tokens that were part of the model's generated "thoughts" output, if applicable."""
|
|
5939
6226
|
|
|
5940
6227
|
tool_use_prompt_token_count: Optional[int]
|
|
5941
|
-
"""Output only.
|
|
6228
|
+
"""Output only. The number of tokens in the results from tool executions, which are provided back to the model as input, if applicable."""
|
|
5942
6229
|
|
|
5943
6230
|
tool_use_prompt_tokens_details: Optional[list[ModalityTokenCountDict]]
|
|
5944
|
-
"""Output only.
|
|
6231
|
+
"""Output only. A detailed breakdown by modality of the token counts from the results of tool executions, which are provided back to the model as input."""
|
|
5945
6232
|
|
|
5946
6233
|
total_token_count: Optional[int]
|
|
5947
|
-
"""
|
|
6234
|
+
"""The total number of tokens for the entire request. This is the sum of `prompt_token_count`, `candidates_token_count`, `tool_use_prompt_token_count`, and `thoughts_token_count`."""
|
|
5948
6235
|
|
|
5949
6236
|
traffic_type: Optional[TrafficType]
|
|
5950
|
-
"""Output only.
|
|
6237
|
+
"""Output only. The traffic type for this request."""
|
|
5951
6238
|
|
|
5952
6239
|
|
|
5953
6240
|
GenerateContentResponseUsageMetadataOrDict = Union[
|
|
@@ -5993,10 +6280,18 @@ class GenerateContentResponse(_common.BaseModel):
|
|
|
5993
6280
|
description="""First candidate from the parsed response if response_schema is provided. Not available for streaming.""",
|
|
5994
6281
|
)
|
|
5995
6282
|
|
|
5996
|
-
def _get_text(self, warn_property: str =
|
|
6283
|
+
def _get_text(self, warn_property: Optional[str] = None) -> Optional[str]:
|
|
5997
6284
|
"""Returns the concatenation of all text parts in the response.
|
|
5998
6285
|
|
|
5999
|
-
This is an internal method that allows customizing the warning
|
|
6286
|
+
This is an internal method that allows customizing or disabling the warning
|
|
6287
|
+
message.
|
|
6288
|
+
|
|
6289
|
+
Args:
|
|
6290
|
+
warn_property: The property name that is being accessed. This is used to
|
|
6291
|
+
customize the warning message. If None, no warning will be logged.
|
|
6292
|
+
|
|
6293
|
+
Returns:
|
|
6294
|
+
The concatenation of all text parts in the response.
|
|
6000
6295
|
"""
|
|
6001
6296
|
if (
|
|
6002
6297
|
not self.candidates
|
|
@@ -6004,7 +6299,7 @@ class GenerateContentResponse(_common.BaseModel):
|
|
|
6004
6299
|
or not self.candidates[0].content.parts
|
|
6005
6300
|
):
|
|
6006
6301
|
return None
|
|
6007
|
-
if len(self.candidates) > 1:
|
|
6302
|
+
if len(self.candidates) > 1 and warn_property:
|
|
6008
6303
|
logger.warning(
|
|
6009
6304
|
f'there are {len(self.candidates)} candidates, returning'
|
|
6010
6305
|
f' {warn_property} result from the first candidate. Access'
|
|
@@ -6025,7 +6320,7 @@ class GenerateContentResponse(_common.BaseModel):
|
|
|
6025
6320
|
continue
|
|
6026
6321
|
any_text_part_text = True
|
|
6027
6322
|
text += part.text
|
|
6028
|
-
if non_text_parts:
|
|
6323
|
+
if non_text_parts and warn_property:
|
|
6029
6324
|
logger.warning(
|
|
6030
6325
|
'Warning: there are non-text parts in the response:'
|
|
6031
6326
|
f' {non_text_parts}, returning concatenated {warn_property} result'
|
|
@@ -6054,7 +6349,10 @@ class GenerateContentResponse(_common.BaseModel):
|
|
|
6054
6349
|
|
|
6055
6350
|
@property
|
|
6056
6351
|
def text(self) -> Optional[str]:
|
|
6057
|
-
"""Returns the concatenation of all text parts in the response.
|
|
6352
|
+
"""Returns the concatenation of all text parts in the response.
|
|
6353
|
+
|
|
6354
|
+
If there are multiple candidates, returns the text from only the first one.
|
|
6355
|
+
"""
|
|
6058
6356
|
return self._get_text(warn_property='text')
|
|
6059
6357
|
|
|
6060
6358
|
@property
|
|
@@ -6145,7 +6443,7 @@ class GenerateContentResponse(_common.BaseModel):
|
|
|
6145
6443
|
):
|
|
6146
6444
|
# Pydantic schema.
|
|
6147
6445
|
try:
|
|
6148
|
-
result_text = result._get_text(
|
|
6446
|
+
result_text = result._get_text()
|
|
6149
6447
|
if result_text is not None:
|
|
6150
6448
|
result.parsed = response_schema.model_validate_json(result_text)
|
|
6151
6449
|
# may not be a valid json per stream response
|
|
@@ -6154,11 +6452,10 @@ class GenerateContentResponse(_common.BaseModel):
|
|
|
6154
6452
|
except json.decoder.JSONDecodeError:
|
|
6155
6453
|
pass
|
|
6156
6454
|
elif (
|
|
6157
|
-
isinstance(response_schema, EnumMeta)
|
|
6158
|
-
and result._get_text(warn_property='parsed') is not None
|
|
6455
|
+
isinstance(response_schema, EnumMeta) and result._get_text() is not None
|
|
6159
6456
|
):
|
|
6160
6457
|
# Enum with "application/json" returns response in double quotes.
|
|
6161
|
-
result_text = result._get_text(
|
|
6458
|
+
result_text = result._get_text()
|
|
6162
6459
|
if result_text is None:
|
|
6163
6460
|
raise ValueError('Response is empty.')
|
|
6164
6461
|
enum_value = result_text.replace('"', '')
|
|
@@ -6179,7 +6476,7 @@ class GenerateContentResponse(_common.BaseModel):
|
|
|
6179
6476
|
placeholder: response_schema # type: ignore[valid-type]
|
|
6180
6477
|
|
|
6181
6478
|
try:
|
|
6182
|
-
result_text = result._get_text(
|
|
6479
|
+
result_text = result._get_text()
|
|
6183
6480
|
if result_text is not None:
|
|
6184
6481
|
parsed = {'placeholder': json.loads(result_text)}
|
|
6185
6482
|
placeholder = Placeholder.model_validate(parsed)
|
|
@@ -6196,7 +6493,7 @@ class GenerateContentResponse(_common.BaseModel):
|
|
|
6196
6493
|
# want the result converted to. So just return json.
|
|
6197
6494
|
# JSON schema.
|
|
6198
6495
|
try:
|
|
6199
|
-
result_text = result._get_text(
|
|
6496
|
+
result_text = result._get_text()
|
|
6200
6497
|
if result_text is not None:
|
|
6201
6498
|
result.parsed = json.loads(result_text)
|
|
6202
6499
|
# may not be a valid json per stream response
|
|
@@ -6208,7 +6505,7 @@ class GenerateContentResponse(_common.BaseModel):
|
|
|
6208
6505
|
for union_type in union_types:
|
|
6209
6506
|
if issubclass(union_type, pydantic.BaseModel):
|
|
6210
6507
|
try:
|
|
6211
|
-
result_text = result._get_text(
|
|
6508
|
+
result_text = result._get_text()
|
|
6212
6509
|
if result_text is not None:
|
|
6213
6510
|
|
|
6214
6511
|
class Placeholder(pydantic.BaseModel): # type: ignore[no-redef]
|
|
@@ -6223,7 +6520,7 @@ class GenerateContentResponse(_common.BaseModel):
|
|
|
6223
6520
|
pass
|
|
6224
6521
|
else:
|
|
6225
6522
|
try:
|
|
6226
|
-
result_text = result._get_text(
|
|
6523
|
+
result_text = result._get_text()
|
|
6227
6524
|
if result_text is not None:
|
|
6228
6525
|
result.parsed = json.loads(result_text)
|
|
6229
6526
|
# may not be a valid json per stream response
|
|
@@ -8455,32 +8752,26 @@ VoiceConfigOrDict = Union[VoiceConfig, VoiceConfigDict]
|
|
|
8455
8752
|
|
|
8456
8753
|
|
|
8457
8754
|
class SpeakerVoiceConfig(_common.BaseModel):
|
|
8458
|
-
"""
|
|
8459
|
-
|
|
8460
|
-
This data type is not supported in Vertex AI.
|
|
8461
|
-
"""
|
|
8755
|
+
"""Configuration for a single speaker in a multi speaker setup."""
|
|
8462
8756
|
|
|
8463
8757
|
speaker: Optional[str] = Field(
|
|
8464
8758
|
default=None,
|
|
8465
|
-
description="""Required. The name of the speaker
|
|
8759
|
+
description="""Required. The name of the speaker. This should be the same as the speaker name used in the prompt.""",
|
|
8466
8760
|
)
|
|
8467
8761
|
voice_config: Optional[VoiceConfig] = Field(
|
|
8468
8762
|
default=None,
|
|
8469
|
-
description="""Required. The configuration for the voice
|
|
8763
|
+
description="""Required. The configuration for the voice of this speaker.""",
|
|
8470
8764
|
)
|
|
8471
8765
|
|
|
8472
8766
|
|
|
8473
8767
|
class SpeakerVoiceConfigDict(TypedDict, total=False):
|
|
8474
|
-
"""
|
|
8475
|
-
|
|
8476
|
-
This data type is not supported in Vertex AI.
|
|
8477
|
-
"""
|
|
8768
|
+
"""Configuration for a single speaker in a multi speaker setup."""
|
|
8478
8769
|
|
|
8479
8770
|
speaker: Optional[str]
|
|
8480
|
-
"""Required. The name of the speaker
|
|
8771
|
+
"""Required. The name of the speaker. This should be the same as the speaker name used in the prompt."""
|
|
8481
8772
|
|
|
8482
8773
|
voice_config: Optional[VoiceConfigDict]
|
|
8483
|
-
"""Required. The configuration for the voice
|
|
8774
|
+
"""Required. The configuration for the voice of this speaker."""
|
|
8484
8775
|
|
|
8485
8776
|
|
|
8486
8777
|
SpeakerVoiceConfigOrDict = Union[SpeakerVoiceConfig, SpeakerVoiceConfigDict]
|
|
@@ -8518,6 +8809,12 @@ class GenerationConfig(_common.BaseModel):
|
|
|
8518
8809
|
model_selection_config: Optional[ModelSelectionConfig] = Field(
|
|
8519
8810
|
default=None, description="""Optional. Config for model selection."""
|
|
8520
8811
|
)
|
|
8812
|
+
response_json_schema: Optional[Any] = Field(
|
|
8813
|
+
default=None,
|
|
8814
|
+
description="""Output schema of the generated response. This is an alternative to
|
|
8815
|
+
`response_schema` that accepts [JSON Schema](https://json-schema.org/).
|
|
8816
|
+
""",
|
|
8817
|
+
)
|
|
8521
8818
|
audio_timestamp: Optional[bool] = Field(
|
|
8522
8819
|
default=None,
|
|
8523
8820
|
description="""Optional. If enabled, audio timestamp will be included in the request to the model. This field is not supported in Gemini API.""",
|
|
@@ -8547,10 +8844,6 @@ class GenerationConfig(_common.BaseModel):
|
|
|
8547
8844
|
presence_penalty: Optional[float] = Field(
|
|
8548
8845
|
default=None, description="""Optional. Positive penalties."""
|
|
8549
8846
|
)
|
|
8550
|
-
response_json_schema: Optional[Any] = Field(
|
|
8551
|
-
default=None,
|
|
8552
|
-
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.""",
|
|
8553
|
-
)
|
|
8554
8847
|
response_logprobs: Optional[bool] = Field(
|
|
8555
8848
|
default=None,
|
|
8556
8849
|
description="""Optional. If true, export the logprobs results in response.""",
|
|
@@ -8605,6 +8898,11 @@ class GenerationConfigDict(TypedDict, total=False):
|
|
|
8605
8898
|
model_selection_config: Optional[ModelSelectionConfigDict]
|
|
8606
8899
|
"""Optional. Config for model selection."""
|
|
8607
8900
|
|
|
8901
|
+
response_json_schema: Optional[Any]
|
|
8902
|
+
"""Output schema of the generated response. This is an alternative to
|
|
8903
|
+
`response_schema` that accepts [JSON Schema](https://json-schema.org/).
|
|
8904
|
+
"""
|
|
8905
|
+
|
|
8608
8906
|
audio_timestamp: Optional[bool]
|
|
8609
8907
|
"""Optional. If enabled, audio timestamp will be included in the request to the model. This field is not supported in Gemini API."""
|
|
8610
8908
|
|
|
@@ -8629,9 +8927,6 @@ class GenerationConfigDict(TypedDict, total=False):
|
|
|
8629
8927
|
presence_penalty: Optional[float]
|
|
8630
8928
|
"""Optional. Positive penalties."""
|
|
8631
8929
|
|
|
8632
|
-
response_json_schema: Optional[Any]
|
|
8633
|
-
"""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."""
|
|
8634
|
-
|
|
8635
8930
|
response_logprobs: Optional[bool]
|
|
8636
8931
|
"""Optional. If true, export the logprobs results in response."""
|
|
8637
8932
|
|
|
@@ -9720,6 +10015,10 @@ PreferenceOptimizationHyperParametersOrDict = Union[
|
|
|
9720
10015
|
class PreferenceOptimizationSpec(_common.BaseModel):
|
|
9721
10016
|
"""Preference optimization tuning spec for tuning."""
|
|
9722
10017
|
|
|
10018
|
+
export_last_checkpoint_only: Optional[bool] = Field(
|
|
10019
|
+
default=None,
|
|
10020
|
+
description="""Optional. If set to true, disable intermediate checkpoints for Preference Optimization and only the last checkpoint will be exported. Otherwise, enable intermediate checkpoints for Preference Optimization. Default is false.""",
|
|
10021
|
+
)
|
|
9723
10022
|
hyper_parameters: Optional[PreferenceOptimizationHyperParameters] = Field(
|
|
9724
10023
|
default=None,
|
|
9725
10024
|
description="""Optional. Hyperparameters for Preference Optimization.""",
|
|
@@ -9737,6 +10036,9 @@ class PreferenceOptimizationSpec(_common.BaseModel):
|
|
|
9737
10036
|
class PreferenceOptimizationSpecDict(TypedDict, total=False):
|
|
9738
10037
|
"""Preference optimization tuning spec for tuning."""
|
|
9739
10038
|
|
|
10039
|
+
export_last_checkpoint_only: Optional[bool]
|
|
10040
|
+
"""Optional. If set to true, disable intermediate checkpoints for Preference Optimization and only the last checkpoint will be exported. Otherwise, enable intermediate checkpoints for Preference Optimization. Default is false."""
|
|
10041
|
+
|
|
9740
10042
|
hyper_parameters: Optional[PreferenceOptimizationHyperParametersDict]
|
|
9741
10043
|
"""Optional. Hyperparameters for Preference Optimization."""
|
|
9742
10044
|
|
|
@@ -9829,6 +10131,10 @@ class AutoraterConfig(_common.BaseModel):
|
|
|
9829
10131
|
Tuned model endpoint format:
|
|
9830
10132
|
`projects/{project}/locations/{location}/endpoints/{endpoint}`""",
|
|
9831
10133
|
)
|
|
10134
|
+
generation_config: Optional[GenerationConfig] = Field(
|
|
10135
|
+
default=None,
|
|
10136
|
+
description="""Configuration options for model generation and outputs.""",
|
|
10137
|
+
)
|
|
9832
10138
|
|
|
9833
10139
|
|
|
9834
10140
|
class AutoraterConfigDict(TypedDict, total=False):
|
|
@@ -9857,6 +10163,9 @@ class AutoraterConfigDict(TypedDict, total=False):
|
|
|
9857
10163
|
Tuned model endpoint format:
|
|
9858
10164
|
`projects/{project}/locations/{location}/endpoints/{endpoint}`"""
|
|
9859
10165
|
|
|
10166
|
+
generation_config: Optional[GenerationConfigDict]
|
|
10167
|
+
"""Configuration options for model generation and outputs."""
|
|
10168
|
+
|
|
9860
10169
|
|
|
9861
10170
|
AutoraterConfigOrDict = Union[AutoraterConfig, AutoraterConfigDict]
|
|
9862
10171
|
|
|
@@ -9904,12 +10213,11 @@ class Metric(_common.BaseModel):
|
|
|
9904
10213
|
"""An optional string indicating the version of the metric."""
|
|
9905
10214
|
|
|
9906
10215
|
@model_validator(mode='after') # type: ignore[arg-type]
|
|
9907
|
-
|
|
9908
|
-
|
|
9909
|
-
if not model.name:
|
|
10216
|
+
def validate_name(self) -> 'Metric':
|
|
10217
|
+
if not self.name:
|
|
9910
10218
|
raise ValueError('Metric name cannot be empty.')
|
|
9911
|
-
|
|
9912
|
-
return
|
|
10219
|
+
self.name = self.name.lower()
|
|
10220
|
+
return self
|
|
9913
10221
|
|
|
9914
10222
|
def to_yaml_file(self, file_path: str, version: Optional[str] = None) -> None:
|
|
9915
10223
|
"""Dumps the metric object to a YAML file.
|
|
@@ -10981,7 +11289,7 @@ class TuningJob(_common.BaseModel):
|
|
|
10981
11289
|
)
|
|
10982
11290
|
tuned_model_display_name: Optional[str] = Field(
|
|
10983
11291
|
default=None,
|
|
10984
|
-
description="""Optional. The display name of the TunedModel. The name can be up to 128 characters long and can consist of any UTF-8 characters.""",
|
|
11292
|
+
description="""Optional. The display name of the TunedModel. The name can be up to 128 characters long and can consist of any UTF-8 characters. For continuous tuning, tuned_model_display_name will by default use the same display name as the pre-tuned model. If a new display name is provided, the tuning job will create a new model instead of a new version.""",
|
|
10985
11293
|
)
|
|
10986
11294
|
veo_tuning_spec: Optional[VeoTuningSpec] = Field(
|
|
10987
11295
|
default=None, description="""Tuning Spec for Veo Tuning."""
|
|
@@ -11074,7 +11382,7 @@ class TuningJobDict(TypedDict, total=False):
|
|
|
11074
11382
|
"""The service account that the tuningJob workload runs as. If not specified, the Vertex AI Secure Fine-Tuned Service Agent in the project will be used. See https://cloud.google.com/iam/docs/service-agents#vertex-ai-secure-fine-tuning-service-agent Users starting the pipeline must have the `iam.serviceAccounts.actAs` permission on this service account."""
|
|
11075
11383
|
|
|
11076
11384
|
tuned_model_display_name: Optional[str]
|
|
11077
|
-
"""Optional. The display name of the TunedModel. The name can be up to 128 characters long and can consist of any UTF-8 characters."""
|
|
11385
|
+
"""Optional. The display name of the TunedModel. The name can be up to 128 characters long and can consist of any UTF-8 characters. For continuous tuning, tuned_model_display_name will by default use the same display name as the pre-tuned model. If a new display name is provided, the tuning job will create a new model instead of a new version."""
|
|
11078
11386
|
|
|
11079
11387
|
veo_tuning_spec: Optional[VeoTuningSpecDict]
|
|
11080
11388
|
"""Tuning Spec for Veo Tuning."""
|
|
@@ -11779,239 +12087,1137 @@ class _GetCachedContentParameters(_common.BaseModel):
|
|
|
11779
12087
|
)
|
|
11780
12088
|
|
|
11781
12089
|
|
|
11782
|
-
class _GetCachedContentParametersDict(TypedDict, total=False):
|
|
11783
|
-
"""Parameters for caches.get method."""
|
|
12090
|
+
class _GetCachedContentParametersDict(TypedDict, total=False):
|
|
12091
|
+
"""Parameters for caches.get method."""
|
|
12092
|
+
|
|
12093
|
+
name: Optional[str]
|
|
12094
|
+
"""The server-generated resource name of the cached content.
|
|
12095
|
+
"""
|
|
12096
|
+
|
|
12097
|
+
config: Optional[GetCachedContentConfigDict]
|
|
12098
|
+
"""Optional parameters for the request.
|
|
12099
|
+
"""
|
|
12100
|
+
|
|
12101
|
+
|
|
12102
|
+
_GetCachedContentParametersOrDict = Union[
|
|
12103
|
+
_GetCachedContentParameters, _GetCachedContentParametersDict
|
|
12104
|
+
]
|
|
12105
|
+
|
|
12106
|
+
|
|
12107
|
+
class DeleteCachedContentConfig(_common.BaseModel):
|
|
12108
|
+
"""Optional parameters for caches.delete method."""
|
|
12109
|
+
|
|
12110
|
+
http_options: Optional[HttpOptions] = Field(
|
|
12111
|
+
default=None, description="""Used to override HTTP request options."""
|
|
12112
|
+
)
|
|
12113
|
+
|
|
12114
|
+
|
|
12115
|
+
class DeleteCachedContentConfigDict(TypedDict, total=False):
|
|
12116
|
+
"""Optional parameters for caches.delete method."""
|
|
12117
|
+
|
|
12118
|
+
http_options: Optional[HttpOptionsDict]
|
|
12119
|
+
"""Used to override HTTP request options."""
|
|
12120
|
+
|
|
12121
|
+
|
|
12122
|
+
DeleteCachedContentConfigOrDict = Union[
|
|
12123
|
+
DeleteCachedContentConfig, DeleteCachedContentConfigDict
|
|
12124
|
+
]
|
|
12125
|
+
|
|
12126
|
+
|
|
12127
|
+
class _DeleteCachedContentParameters(_common.BaseModel):
|
|
12128
|
+
"""Parameters for caches.delete method."""
|
|
12129
|
+
|
|
12130
|
+
name: Optional[str] = Field(
|
|
12131
|
+
default=None,
|
|
12132
|
+
description="""The server-generated resource name of the cached content.
|
|
12133
|
+
""",
|
|
12134
|
+
)
|
|
12135
|
+
config: Optional[DeleteCachedContentConfig] = Field(
|
|
12136
|
+
default=None,
|
|
12137
|
+
description="""Optional parameters for the request.
|
|
12138
|
+
""",
|
|
12139
|
+
)
|
|
12140
|
+
|
|
12141
|
+
|
|
12142
|
+
class _DeleteCachedContentParametersDict(TypedDict, total=False):
|
|
12143
|
+
"""Parameters for caches.delete method."""
|
|
12144
|
+
|
|
12145
|
+
name: Optional[str]
|
|
12146
|
+
"""The server-generated resource name of the cached content.
|
|
12147
|
+
"""
|
|
12148
|
+
|
|
12149
|
+
config: Optional[DeleteCachedContentConfigDict]
|
|
12150
|
+
"""Optional parameters for the request.
|
|
12151
|
+
"""
|
|
12152
|
+
|
|
12153
|
+
|
|
12154
|
+
_DeleteCachedContentParametersOrDict = Union[
|
|
12155
|
+
_DeleteCachedContentParameters, _DeleteCachedContentParametersDict
|
|
12156
|
+
]
|
|
12157
|
+
|
|
12158
|
+
|
|
12159
|
+
class DeleteCachedContentResponse(_common.BaseModel):
|
|
12160
|
+
"""Empty response for caches.delete method."""
|
|
12161
|
+
|
|
12162
|
+
sdk_http_response: Optional[HttpResponse] = Field(
|
|
12163
|
+
default=None, description="""Used to retain the full HTTP response."""
|
|
12164
|
+
)
|
|
12165
|
+
|
|
12166
|
+
|
|
12167
|
+
class DeleteCachedContentResponseDict(TypedDict, total=False):
|
|
12168
|
+
"""Empty response for caches.delete method."""
|
|
12169
|
+
|
|
12170
|
+
sdk_http_response: Optional[HttpResponseDict]
|
|
12171
|
+
"""Used to retain the full HTTP response."""
|
|
12172
|
+
|
|
12173
|
+
|
|
12174
|
+
DeleteCachedContentResponseOrDict = Union[
|
|
12175
|
+
DeleteCachedContentResponse, DeleteCachedContentResponseDict
|
|
12176
|
+
]
|
|
12177
|
+
|
|
12178
|
+
|
|
12179
|
+
class UpdateCachedContentConfig(_common.BaseModel):
|
|
12180
|
+
"""Optional parameters for caches.update method."""
|
|
12181
|
+
|
|
12182
|
+
http_options: Optional[HttpOptions] = Field(
|
|
12183
|
+
default=None, description="""Used to override HTTP request options."""
|
|
12184
|
+
)
|
|
12185
|
+
ttl: Optional[str] = Field(
|
|
12186
|
+
default=None,
|
|
12187
|
+
description="""The TTL for this resource. The expiration time is computed: now + TTL. It is a duration string, with up to nine fractional digits, terminated by 's'. Example: "3.5s".""",
|
|
12188
|
+
)
|
|
12189
|
+
expire_time: Optional[datetime.datetime] = Field(
|
|
12190
|
+
default=None,
|
|
12191
|
+
description="""Timestamp of when this resource is considered expired. Uses RFC 3339 format, Example: 2014-10-02T15:01:23Z.""",
|
|
12192
|
+
)
|
|
12193
|
+
|
|
12194
|
+
|
|
12195
|
+
class UpdateCachedContentConfigDict(TypedDict, total=False):
|
|
12196
|
+
"""Optional parameters for caches.update method."""
|
|
12197
|
+
|
|
12198
|
+
http_options: Optional[HttpOptionsDict]
|
|
12199
|
+
"""Used to override HTTP request options."""
|
|
12200
|
+
|
|
12201
|
+
ttl: Optional[str]
|
|
12202
|
+
"""The TTL for this resource. The expiration time is computed: now + TTL. It is a duration string, with up to nine fractional digits, terminated by 's'. Example: "3.5s"."""
|
|
12203
|
+
|
|
12204
|
+
expire_time: Optional[datetime.datetime]
|
|
12205
|
+
"""Timestamp of when this resource is considered expired. Uses RFC 3339 format, Example: 2014-10-02T15:01:23Z."""
|
|
12206
|
+
|
|
12207
|
+
|
|
12208
|
+
UpdateCachedContentConfigOrDict = Union[
|
|
12209
|
+
UpdateCachedContentConfig, UpdateCachedContentConfigDict
|
|
12210
|
+
]
|
|
12211
|
+
|
|
12212
|
+
|
|
12213
|
+
class _UpdateCachedContentParameters(_common.BaseModel):
|
|
12214
|
+
|
|
12215
|
+
name: Optional[str] = Field(
|
|
12216
|
+
default=None,
|
|
12217
|
+
description="""The server-generated resource name of the cached content.
|
|
12218
|
+
""",
|
|
12219
|
+
)
|
|
12220
|
+
config: Optional[UpdateCachedContentConfig] = Field(
|
|
12221
|
+
default=None,
|
|
12222
|
+
description="""Configuration that contains optional parameters.
|
|
12223
|
+
""",
|
|
12224
|
+
)
|
|
12225
|
+
|
|
12226
|
+
|
|
12227
|
+
class _UpdateCachedContentParametersDict(TypedDict, total=False):
|
|
12228
|
+
|
|
12229
|
+
name: Optional[str]
|
|
12230
|
+
"""The server-generated resource name of the cached content.
|
|
12231
|
+
"""
|
|
12232
|
+
|
|
12233
|
+
config: Optional[UpdateCachedContentConfigDict]
|
|
12234
|
+
"""Configuration that contains optional parameters.
|
|
12235
|
+
"""
|
|
12236
|
+
|
|
12237
|
+
|
|
12238
|
+
_UpdateCachedContentParametersOrDict = Union[
|
|
12239
|
+
_UpdateCachedContentParameters, _UpdateCachedContentParametersDict
|
|
12240
|
+
]
|
|
12241
|
+
|
|
12242
|
+
|
|
12243
|
+
class ListCachedContentsConfig(_common.BaseModel):
|
|
12244
|
+
"""Config for caches.list method."""
|
|
12245
|
+
|
|
12246
|
+
http_options: Optional[HttpOptions] = Field(
|
|
12247
|
+
default=None, description="""Used to override HTTP request options."""
|
|
12248
|
+
)
|
|
12249
|
+
page_size: Optional[int] = Field(default=None, description="""""")
|
|
12250
|
+
page_token: Optional[str] = Field(default=None, description="""""")
|
|
12251
|
+
|
|
12252
|
+
|
|
12253
|
+
class ListCachedContentsConfigDict(TypedDict, total=False):
|
|
12254
|
+
"""Config for caches.list method."""
|
|
12255
|
+
|
|
12256
|
+
http_options: Optional[HttpOptionsDict]
|
|
12257
|
+
"""Used to override HTTP request options."""
|
|
12258
|
+
|
|
12259
|
+
page_size: Optional[int]
|
|
12260
|
+
""""""
|
|
12261
|
+
|
|
12262
|
+
page_token: Optional[str]
|
|
12263
|
+
""""""
|
|
12264
|
+
|
|
12265
|
+
|
|
12266
|
+
ListCachedContentsConfigOrDict = Union[
|
|
12267
|
+
ListCachedContentsConfig, ListCachedContentsConfigDict
|
|
12268
|
+
]
|
|
12269
|
+
|
|
12270
|
+
|
|
12271
|
+
class _ListCachedContentsParameters(_common.BaseModel):
|
|
12272
|
+
"""Parameters for caches.list method."""
|
|
12273
|
+
|
|
12274
|
+
config: Optional[ListCachedContentsConfig] = Field(
|
|
12275
|
+
default=None,
|
|
12276
|
+
description="""Configuration that contains optional parameters.
|
|
12277
|
+
""",
|
|
12278
|
+
)
|
|
12279
|
+
|
|
12280
|
+
|
|
12281
|
+
class _ListCachedContentsParametersDict(TypedDict, total=False):
|
|
12282
|
+
"""Parameters for caches.list method."""
|
|
12283
|
+
|
|
12284
|
+
config: Optional[ListCachedContentsConfigDict]
|
|
12285
|
+
"""Configuration that contains optional parameters.
|
|
12286
|
+
"""
|
|
12287
|
+
|
|
12288
|
+
|
|
12289
|
+
_ListCachedContentsParametersOrDict = Union[
|
|
12290
|
+
_ListCachedContentsParameters, _ListCachedContentsParametersDict
|
|
12291
|
+
]
|
|
12292
|
+
|
|
12293
|
+
|
|
12294
|
+
class ListCachedContentsResponse(_common.BaseModel):
|
|
12295
|
+
|
|
12296
|
+
sdk_http_response: Optional[HttpResponse] = Field(
|
|
12297
|
+
default=None, description="""Used to retain the full HTTP response."""
|
|
12298
|
+
)
|
|
12299
|
+
next_page_token: Optional[str] = Field(default=None, description="""""")
|
|
12300
|
+
cached_contents: Optional[list[CachedContent]] = Field(
|
|
12301
|
+
default=None,
|
|
12302
|
+
description="""List of cached contents.
|
|
12303
|
+
""",
|
|
12304
|
+
)
|
|
12305
|
+
|
|
12306
|
+
|
|
12307
|
+
class ListCachedContentsResponseDict(TypedDict, total=False):
|
|
12308
|
+
|
|
12309
|
+
sdk_http_response: Optional[HttpResponseDict]
|
|
12310
|
+
"""Used to retain the full HTTP response."""
|
|
12311
|
+
|
|
12312
|
+
next_page_token: Optional[str]
|
|
12313
|
+
""""""
|
|
12314
|
+
|
|
12315
|
+
cached_contents: Optional[list[CachedContentDict]]
|
|
12316
|
+
"""List of cached contents.
|
|
12317
|
+
"""
|
|
12318
|
+
|
|
12319
|
+
|
|
12320
|
+
ListCachedContentsResponseOrDict = Union[
|
|
12321
|
+
ListCachedContentsResponse, ListCachedContentsResponseDict
|
|
12322
|
+
]
|
|
12323
|
+
|
|
12324
|
+
|
|
12325
|
+
class GetDocumentConfig(_common.BaseModel):
|
|
12326
|
+
"""Optional Config."""
|
|
12327
|
+
|
|
12328
|
+
http_options: Optional[HttpOptions] = Field(
|
|
12329
|
+
default=None, description="""Used to override HTTP request options."""
|
|
12330
|
+
)
|
|
12331
|
+
|
|
12332
|
+
|
|
12333
|
+
class GetDocumentConfigDict(TypedDict, total=False):
|
|
12334
|
+
"""Optional Config."""
|
|
12335
|
+
|
|
12336
|
+
http_options: Optional[HttpOptionsDict]
|
|
12337
|
+
"""Used to override HTTP request options."""
|
|
12338
|
+
|
|
12339
|
+
|
|
12340
|
+
GetDocumentConfigOrDict = Union[GetDocumentConfig, GetDocumentConfigDict]
|
|
12341
|
+
|
|
12342
|
+
|
|
12343
|
+
class _GetDocumentParameters(_common.BaseModel):
|
|
12344
|
+
"""Parameters for documents.get."""
|
|
12345
|
+
|
|
12346
|
+
name: Optional[str] = Field(
|
|
12347
|
+
default=None,
|
|
12348
|
+
description="""The resource name of the Document.
|
|
12349
|
+
Example: fileSearchStores/file-search-store-foo/documents/documents-bar""",
|
|
12350
|
+
)
|
|
12351
|
+
config: Optional[GetDocumentConfig] = Field(
|
|
12352
|
+
default=None, description="""Optional parameters for the request."""
|
|
12353
|
+
)
|
|
12354
|
+
|
|
12355
|
+
|
|
12356
|
+
class _GetDocumentParametersDict(TypedDict, total=False):
|
|
12357
|
+
"""Parameters for documents.get."""
|
|
12358
|
+
|
|
12359
|
+
name: Optional[str]
|
|
12360
|
+
"""The resource name of the Document.
|
|
12361
|
+
Example: fileSearchStores/file-search-store-foo/documents/documents-bar"""
|
|
12362
|
+
|
|
12363
|
+
config: Optional[GetDocumentConfigDict]
|
|
12364
|
+
"""Optional parameters for the request."""
|
|
12365
|
+
|
|
12366
|
+
|
|
12367
|
+
_GetDocumentParametersOrDict = Union[
|
|
12368
|
+
_GetDocumentParameters, _GetDocumentParametersDict
|
|
12369
|
+
]
|
|
12370
|
+
|
|
12371
|
+
|
|
12372
|
+
class StringList(_common.BaseModel):
|
|
12373
|
+
"""User provided string values assigned to a single metadata key.
|
|
12374
|
+
|
|
12375
|
+
This data type is not supported in Vertex AI.
|
|
12376
|
+
"""
|
|
12377
|
+
|
|
12378
|
+
values: Optional[list[str]] = Field(
|
|
12379
|
+
default=None,
|
|
12380
|
+
description="""The string values of the metadata to store.""",
|
|
12381
|
+
)
|
|
12382
|
+
|
|
12383
|
+
|
|
12384
|
+
class StringListDict(TypedDict, total=False):
|
|
12385
|
+
"""User provided string values assigned to a single metadata key.
|
|
12386
|
+
|
|
12387
|
+
This data type is not supported in Vertex AI.
|
|
12388
|
+
"""
|
|
12389
|
+
|
|
12390
|
+
values: Optional[list[str]]
|
|
12391
|
+
"""The string values of the metadata to store."""
|
|
12392
|
+
|
|
12393
|
+
|
|
12394
|
+
StringListOrDict = Union[StringList, StringListDict]
|
|
12395
|
+
|
|
12396
|
+
|
|
12397
|
+
class CustomMetadata(_common.BaseModel):
|
|
12398
|
+
"""User provided metadata stored as key-value pairs.
|
|
12399
|
+
|
|
12400
|
+
This data type is not supported in Vertex AI.
|
|
12401
|
+
"""
|
|
12402
|
+
|
|
12403
|
+
key: Optional[str] = Field(
|
|
12404
|
+
default=None,
|
|
12405
|
+
description="""Required. The key of the metadata to store.""",
|
|
12406
|
+
)
|
|
12407
|
+
numeric_value: Optional[float] = Field(
|
|
12408
|
+
default=None,
|
|
12409
|
+
description="""The numeric value of the metadata to store.""",
|
|
12410
|
+
)
|
|
12411
|
+
string_list_value: Optional[StringList] = Field(
|
|
12412
|
+
default=None,
|
|
12413
|
+
description="""The StringList value of the metadata to store.""",
|
|
12414
|
+
)
|
|
12415
|
+
string_value: Optional[str] = Field(
|
|
12416
|
+
default=None, description="""The string value of the metadata to store."""
|
|
12417
|
+
)
|
|
12418
|
+
|
|
12419
|
+
|
|
12420
|
+
class CustomMetadataDict(TypedDict, total=False):
|
|
12421
|
+
"""User provided metadata stored as key-value pairs.
|
|
12422
|
+
|
|
12423
|
+
This data type is not supported in Vertex AI.
|
|
12424
|
+
"""
|
|
12425
|
+
|
|
12426
|
+
key: Optional[str]
|
|
12427
|
+
"""Required. The key of the metadata to store."""
|
|
12428
|
+
|
|
12429
|
+
numeric_value: Optional[float]
|
|
12430
|
+
"""The numeric value of the metadata to store."""
|
|
12431
|
+
|
|
12432
|
+
string_list_value: Optional[StringListDict]
|
|
12433
|
+
"""The StringList value of the metadata to store."""
|
|
12434
|
+
|
|
12435
|
+
string_value: Optional[str]
|
|
12436
|
+
"""The string value of the metadata to store."""
|
|
12437
|
+
|
|
12438
|
+
|
|
12439
|
+
CustomMetadataOrDict = Union[CustomMetadata, CustomMetadataDict]
|
|
12440
|
+
|
|
12441
|
+
|
|
12442
|
+
class Document(_common.BaseModel):
|
|
12443
|
+
"""A Document is a collection of Chunks."""
|
|
12444
|
+
|
|
12445
|
+
name: Optional[str] = Field(
|
|
12446
|
+
default=None,
|
|
12447
|
+
description="""The resource name of the Document.
|
|
12448
|
+
Example: fileSearchStores/file-search-store-foo/documents/documents-bar""",
|
|
12449
|
+
)
|
|
12450
|
+
display_name: Optional[str] = Field(
|
|
12451
|
+
default=None,
|
|
12452
|
+
description="""The human-readable display name for the Document.""",
|
|
12453
|
+
)
|
|
12454
|
+
state: Optional[DocumentState] = Field(
|
|
12455
|
+
default=None, description="""The current state of the Document."""
|
|
12456
|
+
)
|
|
12457
|
+
size_bytes: Optional[int] = Field(
|
|
12458
|
+
default=None, description="""The size of the Document in bytes."""
|
|
12459
|
+
)
|
|
12460
|
+
mime_type: Optional[str] = Field(
|
|
12461
|
+
default=None, description="""The MIME type of the Document."""
|
|
12462
|
+
)
|
|
12463
|
+
create_time: Optional[datetime.datetime] = Field(
|
|
12464
|
+
default=None,
|
|
12465
|
+
description="""Output only. The Timestamp of when the `Document` was created.""",
|
|
12466
|
+
)
|
|
12467
|
+
custom_metadata: Optional[list[CustomMetadata]] = Field(
|
|
12468
|
+
default=None,
|
|
12469
|
+
description="""Optional. User provided custom metadata stored as key-value pairs used for querying. A `Document` can have a maximum of 20 `CustomMetadata`.""",
|
|
12470
|
+
)
|
|
12471
|
+
update_time: Optional[datetime.datetime] = Field(
|
|
12472
|
+
default=None,
|
|
12473
|
+
description="""Output only. The Timestamp of when the `Document` was last updated.""",
|
|
12474
|
+
)
|
|
12475
|
+
|
|
12476
|
+
|
|
12477
|
+
class DocumentDict(TypedDict, total=False):
|
|
12478
|
+
"""A Document is a collection of Chunks."""
|
|
12479
|
+
|
|
12480
|
+
name: Optional[str]
|
|
12481
|
+
"""The resource name of the Document.
|
|
12482
|
+
Example: fileSearchStores/file-search-store-foo/documents/documents-bar"""
|
|
12483
|
+
|
|
12484
|
+
display_name: Optional[str]
|
|
12485
|
+
"""The human-readable display name for the Document."""
|
|
12486
|
+
|
|
12487
|
+
state: Optional[DocumentState]
|
|
12488
|
+
"""The current state of the Document."""
|
|
12489
|
+
|
|
12490
|
+
size_bytes: Optional[int]
|
|
12491
|
+
"""The size of the Document in bytes."""
|
|
12492
|
+
|
|
12493
|
+
mime_type: Optional[str]
|
|
12494
|
+
"""The MIME type of the Document."""
|
|
12495
|
+
|
|
12496
|
+
create_time: Optional[datetime.datetime]
|
|
12497
|
+
"""Output only. The Timestamp of when the `Document` was created."""
|
|
12498
|
+
|
|
12499
|
+
custom_metadata: Optional[list[CustomMetadataDict]]
|
|
12500
|
+
"""Optional. User provided custom metadata stored as key-value pairs used for querying. A `Document` can have a maximum of 20 `CustomMetadata`."""
|
|
12501
|
+
|
|
12502
|
+
update_time: Optional[datetime.datetime]
|
|
12503
|
+
"""Output only. The Timestamp of when the `Document` was last updated."""
|
|
12504
|
+
|
|
12505
|
+
|
|
12506
|
+
DocumentOrDict = Union[Document, DocumentDict]
|
|
12507
|
+
|
|
12508
|
+
|
|
12509
|
+
class DeleteDocumentConfig(_common.BaseModel):
|
|
12510
|
+
"""Config for optional parameters."""
|
|
12511
|
+
|
|
12512
|
+
http_options: Optional[HttpOptions] = Field(
|
|
12513
|
+
default=None, description="""Used to override HTTP request options."""
|
|
12514
|
+
)
|
|
12515
|
+
force: Optional[bool] = Field(
|
|
12516
|
+
default=None,
|
|
12517
|
+
description="""If set to true, any `Chunk`s and objects related to this `Document` will
|
|
12518
|
+
also be deleted.
|
|
12519
|
+
""",
|
|
12520
|
+
)
|
|
12521
|
+
|
|
12522
|
+
|
|
12523
|
+
class DeleteDocumentConfigDict(TypedDict, total=False):
|
|
12524
|
+
"""Config for optional parameters."""
|
|
12525
|
+
|
|
12526
|
+
http_options: Optional[HttpOptionsDict]
|
|
12527
|
+
"""Used to override HTTP request options."""
|
|
12528
|
+
|
|
12529
|
+
force: Optional[bool]
|
|
12530
|
+
"""If set to true, any `Chunk`s and objects related to this `Document` will
|
|
12531
|
+
also be deleted.
|
|
12532
|
+
"""
|
|
12533
|
+
|
|
12534
|
+
|
|
12535
|
+
DeleteDocumentConfigOrDict = Union[
|
|
12536
|
+
DeleteDocumentConfig, DeleteDocumentConfigDict
|
|
12537
|
+
]
|
|
12538
|
+
|
|
12539
|
+
|
|
12540
|
+
class _DeleteDocumentParameters(_common.BaseModel):
|
|
12541
|
+
"""Config for documents.delete parameters."""
|
|
12542
|
+
|
|
12543
|
+
name: Optional[str] = Field(
|
|
12544
|
+
default=None,
|
|
12545
|
+
description="""The resource name of the Document.
|
|
12546
|
+
Example: fileSearchStores/file-search-store-foo/documents/documents-bar""",
|
|
12547
|
+
)
|
|
12548
|
+
config: Optional[DeleteDocumentConfig] = Field(
|
|
12549
|
+
default=None, description="""Optional parameters for the request."""
|
|
12550
|
+
)
|
|
12551
|
+
|
|
12552
|
+
|
|
12553
|
+
class _DeleteDocumentParametersDict(TypedDict, total=False):
|
|
12554
|
+
"""Config for documents.delete parameters."""
|
|
12555
|
+
|
|
12556
|
+
name: Optional[str]
|
|
12557
|
+
"""The resource name of the Document.
|
|
12558
|
+
Example: fileSearchStores/file-search-store-foo/documents/documents-bar"""
|
|
12559
|
+
|
|
12560
|
+
config: Optional[DeleteDocumentConfigDict]
|
|
12561
|
+
"""Optional parameters for the request."""
|
|
12562
|
+
|
|
12563
|
+
|
|
12564
|
+
_DeleteDocumentParametersOrDict = Union[
|
|
12565
|
+
_DeleteDocumentParameters, _DeleteDocumentParametersDict
|
|
12566
|
+
]
|
|
12567
|
+
|
|
12568
|
+
|
|
12569
|
+
class ListDocumentsConfig(_common.BaseModel):
|
|
12570
|
+
"""Config for optional parameters."""
|
|
12571
|
+
|
|
12572
|
+
http_options: Optional[HttpOptions] = Field(
|
|
12573
|
+
default=None, description="""Used to override HTTP request options."""
|
|
12574
|
+
)
|
|
12575
|
+
page_size: Optional[int] = Field(default=None, description="""""")
|
|
12576
|
+
page_token: Optional[str] = Field(default=None, description="""""")
|
|
12577
|
+
|
|
12578
|
+
|
|
12579
|
+
class ListDocumentsConfigDict(TypedDict, total=False):
|
|
12580
|
+
"""Config for optional parameters."""
|
|
12581
|
+
|
|
12582
|
+
http_options: Optional[HttpOptionsDict]
|
|
12583
|
+
"""Used to override HTTP request options."""
|
|
12584
|
+
|
|
12585
|
+
page_size: Optional[int]
|
|
12586
|
+
""""""
|
|
12587
|
+
|
|
12588
|
+
page_token: Optional[str]
|
|
12589
|
+
""""""
|
|
12590
|
+
|
|
12591
|
+
|
|
12592
|
+
ListDocumentsConfigOrDict = Union[ListDocumentsConfig, ListDocumentsConfigDict]
|
|
12593
|
+
|
|
12594
|
+
|
|
12595
|
+
class _ListDocumentsParameters(_common.BaseModel):
|
|
12596
|
+
"""Config for documents.list parameters."""
|
|
12597
|
+
|
|
12598
|
+
parent: Optional[str] = Field(
|
|
12599
|
+
default=None,
|
|
12600
|
+
description="""The resource name of the FileSearchStores. Example: `fileSearchStore/file-search-store-foo`""",
|
|
12601
|
+
)
|
|
12602
|
+
config: Optional[ListDocumentsConfig] = Field(
|
|
12603
|
+
default=None, description=""""""
|
|
12604
|
+
)
|
|
12605
|
+
|
|
12606
|
+
|
|
12607
|
+
class _ListDocumentsParametersDict(TypedDict, total=False):
|
|
12608
|
+
"""Config for documents.list parameters."""
|
|
12609
|
+
|
|
12610
|
+
parent: Optional[str]
|
|
12611
|
+
"""The resource name of the FileSearchStores. Example: `fileSearchStore/file-search-store-foo`"""
|
|
12612
|
+
|
|
12613
|
+
config: Optional[ListDocumentsConfigDict]
|
|
12614
|
+
""""""
|
|
12615
|
+
|
|
12616
|
+
|
|
12617
|
+
_ListDocumentsParametersOrDict = Union[
|
|
12618
|
+
_ListDocumentsParameters, _ListDocumentsParametersDict
|
|
12619
|
+
]
|
|
12620
|
+
|
|
12621
|
+
|
|
12622
|
+
class ListDocumentsResponse(_common.BaseModel):
|
|
12623
|
+
"""Config for documents.list return value."""
|
|
12624
|
+
|
|
12625
|
+
sdk_http_response: Optional[HttpResponse] = Field(
|
|
12626
|
+
default=None, description="""Used to retain the full HTTP response."""
|
|
12627
|
+
)
|
|
12628
|
+
next_page_token: Optional[str] = Field(
|
|
12629
|
+
default=None,
|
|
12630
|
+
description="""A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no more pages.""",
|
|
12631
|
+
)
|
|
12632
|
+
documents: Optional[list[Document]] = Field(
|
|
12633
|
+
default=None, description="""The returned `Document`s."""
|
|
12634
|
+
)
|
|
12635
|
+
|
|
12636
|
+
|
|
12637
|
+
class ListDocumentsResponseDict(TypedDict, total=False):
|
|
12638
|
+
"""Config for documents.list return value."""
|
|
12639
|
+
|
|
12640
|
+
sdk_http_response: Optional[HttpResponseDict]
|
|
12641
|
+
"""Used to retain the full HTTP response."""
|
|
12642
|
+
|
|
12643
|
+
next_page_token: Optional[str]
|
|
12644
|
+
"""A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no more pages."""
|
|
12645
|
+
|
|
12646
|
+
documents: Optional[list[DocumentDict]]
|
|
12647
|
+
"""The returned `Document`s."""
|
|
12648
|
+
|
|
12649
|
+
|
|
12650
|
+
ListDocumentsResponseOrDict = Union[
|
|
12651
|
+
ListDocumentsResponse, ListDocumentsResponseDict
|
|
12652
|
+
]
|
|
12653
|
+
|
|
12654
|
+
|
|
12655
|
+
class CreateFileSearchStoreConfig(_common.BaseModel):
|
|
12656
|
+
"""Optional parameters for creating a file search store."""
|
|
12657
|
+
|
|
12658
|
+
http_options: Optional[HttpOptions] = Field(
|
|
12659
|
+
default=None, description="""Used to override HTTP request options."""
|
|
12660
|
+
)
|
|
12661
|
+
display_name: Optional[str] = Field(
|
|
12662
|
+
default=None,
|
|
12663
|
+
description="""The human-readable display name for the file search store.
|
|
12664
|
+
""",
|
|
12665
|
+
)
|
|
12666
|
+
|
|
12667
|
+
|
|
12668
|
+
class CreateFileSearchStoreConfigDict(TypedDict, total=False):
|
|
12669
|
+
"""Optional parameters for creating a file search store."""
|
|
12670
|
+
|
|
12671
|
+
http_options: Optional[HttpOptionsDict]
|
|
12672
|
+
"""Used to override HTTP request options."""
|
|
12673
|
+
|
|
12674
|
+
display_name: Optional[str]
|
|
12675
|
+
"""The human-readable display name for the file search store.
|
|
12676
|
+
"""
|
|
12677
|
+
|
|
12678
|
+
|
|
12679
|
+
CreateFileSearchStoreConfigOrDict = Union[
|
|
12680
|
+
CreateFileSearchStoreConfig, CreateFileSearchStoreConfigDict
|
|
12681
|
+
]
|
|
12682
|
+
|
|
12683
|
+
|
|
12684
|
+
class _CreateFileSearchStoreParameters(_common.BaseModel):
|
|
12685
|
+
"""Config for file_search_stores.create parameters."""
|
|
12686
|
+
|
|
12687
|
+
config: Optional[CreateFileSearchStoreConfig] = Field(
|
|
12688
|
+
default=None,
|
|
12689
|
+
description="""Optional parameters for creating a file search store.
|
|
12690
|
+
""",
|
|
12691
|
+
)
|
|
12692
|
+
|
|
12693
|
+
|
|
12694
|
+
class _CreateFileSearchStoreParametersDict(TypedDict, total=False):
|
|
12695
|
+
"""Config for file_search_stores.create parameters."""
|
|
12696
|
+
|
|
12697
|
+
config: Optional[CreateFileSearchStoreConfigDict]
|
|
12698
|
+
"""Optional parameters for creating a file search store.
|
|
12699
|
+
"""
|
|
12700
|
+
|
|
12701
|
+
|
|
12702
|
+
_CreateFileSearchStoreParametersOrDict = Union[
|
|
12703
|
+
_CreateFileSearchStoreParameters, _CreateFileSearchStoreParametersDict
|
|
12704
|
+
]
|
|
12705
|
+
|
|
12706
|
+
|
|
12707
|
+
class FileSearchStore(_common.BaseModel):
|
|
12708
|
+
"""A collection of Documents."""
|
|
12709
|
+
|
|
12710
|
+
name: Optional[str] = Field(
|
|
12711
|
+
default=None,
|
|
12712
|
+
description="""The resource name of the FileSearchStore. Example: `fileSearchStores/my-file-search-store-123`""",
|
|
12713
|
+
)
|
|
12714
|
+
display_name: Optional[str] = Field(
|
|
12715
|
+
default=None,
|
|
12716
|
+
description="""The human-readable display name for the FileSearchStore.""",
|
|
12717
|
+
)
|
|
12718
|
+
create_time: Optional[datetime.datetime] = Field(
|
|
12719
|
+
default=None,
|
|
12720
|
+
description="""The Timestamp of when the FileSearchStore was created.""",
|
|
12721
|
+
)
|
|
12722
|
+
update_time: Optional[datetime.datetime] = Field(
|
|
12723
|
+
default=None,
|
|
12724
|
+
description="""The Timestamp of when the FileSearchStore was last updated.""",
|
|
12725
|
+
)
|
|
12726
|
+
active_documents_count: Optional[int] = Field(
|
|
12727
|
+
default=None,
|
|
12728
|
+
description="""The number of documents in the FileSearchStore that are active and ready for retrieval.""",
|
|
12729
|
+
)
|
|
12730
|
+
pending_documents_count: Optional[int] = Field(
|
|
12731
|
+
default=None,
|
|
12732
|
+
description="""The number of documents in the FileSearchStore that are being processed.""",
|
|
12733
|
+
)
|
|
12734
|
+
failed_documents_count: Optional[int] = Field(
|
|
12735
|
+
default=None,
|
|
12736
|
+
description="""The number of documents in the FileSearchStore that have failed processing.""",
|
|
12737
|
+
)
|
|
12738
|
+
size_bytes: Optional[int] = Field(
|
|
12739
|
+
default=None,
|
|
12740
|
+
description="""The size of raw bytes ingested into the FileSearchStore. This is the
|
|
12741
|
+
total size of all the documents in the FileSearchStore.""",
|
|
12742
|
+
)
|
|
12743
|
+
|
|
12744
|
+
|
|
12745
|
+
class FileSearchStoreDict(TypedDict, total=False):
|
|
12746
|
+
"""A collection of Documents."""
|
|
12747
|
+
|
|
12748
|
+
name: Optional[str]
|
|
12749
|
+
"""The resource name of the FileSearchStore. Example: `fileSearchStores/my-file-search-store-123`"""
|
|
12750
|
+
|
|
12751
|
+
display_name: Optional[str]
|
|
12752
|
+
"""The human-readable display name for the FileSearchStore."""
|
|
12753
|
+
|
|
12754
|
+
create_time: Optional[datetime.datetime]
|
|
12755
|
+
"""The Timestamp of when the FileSearchStore was created."""
|
|
12756
|
+
|
|
12757
|
+
update_time: Optional[datetime.datetime]
|
|
12758
|
+
"""The Timestamp of when the FileSearchStore was last updated."""
|
|
12759
|
+
|
|
12760
|
+
active_documents_count: Optional[int]
|
|
12761
|
+
"""The number of documents in the FileSearchStore that are active and ready for retrieval."""
|
|
12762
|
+
|
|
12763
|
+
pending_documents_count: Optional[int]
|
|
12764
|
+
"""The number of documents in the FileSearchStore that are being processed."""
|
|
12765
|
+
|
|
12766
|
+
failed_documents_count: Optional[int]
|
|
12767
|
+
"""The number of documents in the FileSearchStore that have failed processing."""
|
|
12768
|
+
|
|
12769
|
+
size_bytes: Optional[int]
|
|
12770
|
+
"""The size of raw bytes ingested into the FileSearchStore. This is the
|
|
12771
|
+
total size of all the documents in the FileSearchStore."""
|
|
12772
|
+
|
|
12773
|
+
|
|
12774
|
+
FileSearchStoreOrDict = Union[FileSearchStore, FileSearchStoreDict]
|
|
12775
|
+
|
|
12776
|
+
|
|
12777
|
+
class GetFileSearchStoreConfig(_common.BaseModel):
|
|
12778
|
+
"""Optional parameters for getting a FileSearchStore."""
|
|
12779
|
+
|
|
12780
|
+
http_options: Optional[HttpOptions] = Field(
|
|
12781
|
+
default=None, description="""Used to override HTTP request options."""
|
|
12782
|
+
)
|
|
12783
|
+
|
|
12784
|
+
|
|
12785
|
+
class GetFileSearchStoreConfigDict(TypedDict, total=False):
|
|
12786
|
+
"""Optional parameters for getting a FileSearchStore."""
|
|
12787
|
+
|
|
12788
|
+
http_options: Optional[HttpOptionsDict]
|
|
12789
|
+
"""Used to override HTTP request options."""
|
|
12790
|
+
|
|
12791
|
+
|
|
12792
|
+
GetFileSearchStoreConfigOrDict = Union[
|
|
12793
|
+
GetFileSearchStoreConfig, GetFileSearchStoreConfigDict
|
|
12794
|
+
]
|
|
12795
|
+
|
|
12796
|
+
|
|
12797
|
+
class _GetFileSearchStoreParameters(_common.BaseModel):
|
|
12798
|
+
"""Config for file_search_stores.get parameters."""
|
|
12799
|
+
|
|
12800
|
+
name: Optional[str] = Field(
|
|
12801
|
+
default=None,
|
|
12802
|
+
description="""The resource name of the FileSearchStore. Example: `fileSearchStores/my-file-search-store-123`""",
|
|
12803
|
+
)
|
|
12804
|
+
config: Optional[GetFileSearchStoreConfig] = Field(
|
|
12805
|
+
default=None, description="""Optional parameters for the request."""
|
|
12806
|
+
)
|
|
12807
|
+
|
|
12808
|
+
|
|
12809
|
+
class _GetFileSearchStoreParametersDict(TypedDict, total=False):
|
|
12810
|
+
"""Config for file_search_stores.get parameters."""
|
|
12811
|
+
|
|
12812
|
+
name: Optional[str]
|
|
12813
|
+
"""The resource name of the FileSearchStore. Example: `fileSearchStores/my-file-search-store-123`"""
|
|
12814
|
+
|
|
12815
|
+
config: Optional[GetFileSearchStoreConfigDict]
|
|
12816
|
+
"""Optional parameters for the request."""
|
|
12817
|
+
|
|
12818
|
+
|
|
12819
|
+
_GetFileSearchStoreParametersOrDict = Union[
|
|
12820
|
+
_GetFileSearchStoreParameters, _GetFileSearchStoreParametersDict
|
|
12821
|
+
]
|
|
12822
|
+
|
|
12823
|
+
|
|
12824
|
+
class DeleteFileSearchStoreConfig(_common.BaseModel):
|
|
12825
|
+
"""Optional parameters for deleting a FileSearchStore."""
|
|
12826
|
+
|
|
12827
|
+
http_options: Optional[HttpOptions] = Field(
|
|
12828
|
+
default=None, description="""Used to override HTTP request options."""
|
|
12829
|
+
)
|
|
12830
|
+
force: Optional[bool] = Field(
|
|
12831
|
+
default=None,
|
|
12832
|
+
description="""If set to true, any Documents and objects related to this FileSearchStore will also be deleted.
|
|
12833
|
+
If false (the default), a FAILED_PRECONDITION error will be returned if
|
|
12834
|
+
the FileSearchStore contains any Documents.
|
|
12835
|
+
""",
|
|
12836
|
+
)
|
|
12837
|
+
|
|
12838
|
+
|
|
12839
|
+
class DeleteFileSearchStoreConfigDict(TypedDict, total=False):
|
|
12840
|
+
"""Optional parameters for deleting a FileSearchStore."""
|
|
12841
|
+
|
|
12842
|
+
http_options: Optional[HttpOptionsDict]
|
|
12843
|
+
"""Used to override HTTP request options."""
|
|
12844
|
+
|
|
12845
|
+
force: Optional[bool]
|
|
12846
|
+
"""If set to true, any Documents and objects related to this FileSearchStore will also be deleted.
|
|
12847
|
+
If false (the default), a FAILED_PRECONDITION error will be returned if
|
|
12848
|
+
the FileSearchStore contains any Documents.
|
|
12849
|
+
"""
|
|
12850
|
+
|
|
12851
|
+
|
|
12852
|
+
DeleteFileSearchStoreConfigOrDict = Union[
|
|
12853
|
+
DeleteFileSearchStoreConfig, DeleteFileSearchStoreConfigDict
|
|
12854
|
+
]
|
|
12855
|
+
|
|
12856
|
+
|
|
12857
|
+
class _DeleteFileSearchStoreParameters(_common.BaseModel):
|
|
12858
|
+
"""Config for file_search_stores.delete parameters."""
|
|
12859
|
+
|
|
12860
|
+
name: Optional[str] = Field(
|
|
12861
|
+
default=None,
|
|
12862
|
+
description="""The resource name of the FileSearchStore. Example: `fileSearchStores/my-file-search-store-123`""",
|
|
12863
|
+
)
|
|
12864
|
+
config: Optional[DeleteFileSearchStoreConfig] = Field(
|
|
12865
|
+
default=None, description="""Optional parameters for the request."""
|
|
12866
|
+
)
|
|
12867
|
+
|
|
12868
|
+
|
|
12869
|
+
class _DeleteFileSearchStoreParametersDict(TypedDict, total=False):
|
|
12870
|
+
"""Config for file_search_stores.delete parameters."""
|
|
12871
|
+
|
|
12872
|
+
name: Optional[str]
|
|
12873
|
+
"""The resource name of the FileSearchStore. Example: `fileSearchStores/my-file-search-store-123`"""
|
|
12874
|
+
|
|
12875
|
+
config: Optional[DeleteFileSearchStoreConfigDict]
|
|
12876
|
+
"""Optional parameters for the request."""
|
|
12877
|
+
|
|
12878
|
+
|
|
12879
|
+
_DeleteFileSearchStoreParametersOrDict = Union[
|
|
12880
|
+
_DeleteFileSearchStoreParameters, _DeleteFileSearchStoreParametersDict
|
|
12881
|
+
]
|
|
12882
|
+
|
|
12883
|
+
|
|
12884
|
+
class ListFileSearchStoresConfig(_common.BaseModel):
|
|
12885
|
+
"""Optional parameters for listing FileSearchStore."""
|
|
12886
|
+
|
|
12887
|
+
http_options: Optional[HttpOptions] = Field(
|
|
12888
|
+
default=None, description="""Used to override HTTP request options."""
|
|
12889
|
+
)
|
|
12890
|
+
page_size: Optional[int] = Field(default=None, description="""""")
|
|
12891
|
+
page_token: Optional[str] = Field(default=None, description="""""")
|
|
12892
|
+
|
|
12893
|
+
|
|
12894
|
+
class ListFileSearchStoresConfigDict(TypedDict, total=False):
|
|
12895
|
+
"""Optional parameters for listing FileSearchStore."""
|
|
12896
|
+
|
|
12897
|
+
http_options: Optional[HttpOptionsDict]
|
|
12898
|
+
"""Used to override HTTP request options."""
|
|
12899
|
+
|
|
12900
|
+
page_size: Optional[int]
|
|
12901
|
+
""""""
|
|
12902
|
+
|
|
12903
|
+
page_token: Optional[str]
|
|
12904
|
+
""""""
|
|
12905
|
+
|
|
12906
|
+
|
|
12907
|
+
ListFileSearchStoresConfigOrDict = Union[
|
|
12908
|
+
ListFileSearchStoresConfig, ListFileSearchStoresConfigDict
|
|
12909
|
+
]
|
|
12910
|
+
|
|
12911
|
+
|
|
12912
|
+
class _ListFileSearchStoresParameters(_common.BaseModel):
|
|
12913
|
+
"""Config for file_search_stores.list parameters."""
|
|
11784
12914
|
|
|
11785
|
-
|
|
11786
|
-
|
|
11787
|
-
|
|
12915
|
+
config: Optional[ListFileSearchStoresConfig] = Field(
|
|
12916
|
+
default=None, description="""Optional parameters for the list request."""
|
|
12917
|
+
)
|
|
11788
12918
|
|
|
11789
|
-
config: Optional[GetCachedContentConfigDict]
|
|
11790
|
-
"""Optional parameters for the request.
|
|
11791
|
-
"""
|
|
11792
12919
|
|
|
12920
|
+
class _ListFileSearchStoresParametersDict(TypedDict, total=False):
|
|
12921
|
+
"""Config for file_search_stores.list parameters."""
|
|
11793
12922
|
|
|
11794
|
-
|
|
11795
|
-
|
|
12923
|
+
config: Optional[ListFileSearchStoresConfigDict]
|
|
12924
|
+
"""Optional parameters for the list request."""
|
|
12925
|
+
|
|
12926
|
+
|
|
12927
|
+
_ListFileSearchStoresParametersOrDict = Union[
|
|
12928
|
+
_ListFileSearchStoresParameters, _ListFileSearchStoresParametersDict
|
|
11796
12929
|
]
|
|
11797
12930
|
|
|
11798
12931
|
|
|
11799
|
-
class
|
|
11800
|
-
"""
|
|
12932
|
+
class ListFileSearchStoresResponse(_common.BaseModel):
|
|
12933
|
+
"""Config for file_search_stores.list return value."""
|
|
11801
12934
|
|
|
11802
|
-
|
|
11803
|
-
default=None, description="""Used to
|
|
12935
|
+
sdk_http_response: Optional[HttpResponse] = Field(
|
|
12936
|
+
default=None, description="""Used to retain the full HTTP response."""
|
|
12937
|
+
)
|
|
12938
|
+
next_page_token: Optional[str] = Field(default=None, description="""""")
|
|
12939
|
+
file_search_stores: Optional[list[FileSearchStore]] = Field(
|
|
12940
|
+
default=None, description="""The returned file search stores."""
|
|
11804
12941
|
)
|
|
11805
12942
|
|
|
11806
12943
|
|
|
11807
|
-
class
|
|
11808
|
-
"""
|
|
12944
|
+
class ListFileSearchStoresResponseDict(TypedDict, total=False):
|
|
12945
|
+
"""Config for file_search_stores.list return value."""
|
|
11809
12946
|
|
|
11810
|
-
|
|
11811
|
-
"""Used to
|
|
12947
|
+
sdk_http_response: Optional[HttpResponseDict]
|
|
12948
|
+
"""Used to retain the full HTTP response."""
|
|
12949
|
+
|
|
12950
|
+
next_page_token: Optional[str]
|
|
12951
|
+
""""""
|
|
11812
12952
|
|
|
12953
|
+
file_search_stores: Optional[list[FileSearchStoreDict]]
|
|
12954
|
+
"""The returned file search stores."""
|
|
11813
12955
|
|
|
11814
|
-
|
|
11815
|
-
|
|
12956
|
+
|
|
12957
|
+
ListFileSearchStoresResponseOrDict = Union[
|
|
12958
|
+
ListFileSearchStoresResponse, ListFileSearchStoresResponseDict
|
|
11816
12959
|
]
|
|
11817
12960
|
|
|
11818
12961
|
|
|
11819
|
-
class
|
|
11820
|
-
"""
|
|
12962
|
+
class WhiteSpaceConfig(_common.BaseModel):
|
|
12963
|
+
"""Configuration for a white space chunking algorithm."""
|
|
11821
12964
|
|
|
11822
|
-
|
|
11823
|
-
default=None,
|
|
11824
|
-
description="""The server-generated resource name of the cached content.
|
|
11825
|
-
""",
|
|
12965
|
+
max_tokens_per_chunk: Optional[int] = Field(
|
|
12966
|
+
default=None, description="""Maximum number of tokens per chunk."""
|
|
11826
12967
|
)
|
|
11827
|
-
|
|
12968
|
+
max_overlap_tokens: Optional[int] = Field(
|
|
11828
12969
|
default=None,
|
|
11829
|
-
description="""
|
|
11830
|
-
""",
|
|
12970
|
+
description="""Maximum number of overlapping tokens between two adjacent chunks.""",
|
|
11831
12971
|
)
|
|
11832
12972
|
|
|
11833
12973
|
|
|
11834
|
-
class
|
|
11835
|
-
"""
|
|
12974
|
+
class WhiteSpaceConfigDict(TypedDict, total=False):
|
|
12975
|
+
"""Configuration for a white space chunking algorithm."""
|
|
11836
12976
|
|
|
11837
|
-
|
|
11838
|
-
"""
|
|
11839
|
-
"""
|
|
12977
|
+
max_tokens_per_chunk: Optional[int]
|
|
12978
|
+
"""Maximum number of tokens per chunk."""
|
|
11840
12979
|
|
|
11841
|
-
|
|
11842
|
-
"""
|
|
11843
|
-
"""
|
|
12980
|
+
max_overlap_tokens: Optional[int]
|
|
12981
|
+
"""Maximum number of overlapping tokens between two adjacent chunks."""
|
|
11844
12982
|
|
|
11845
12983
|
|
|
11846
|
-
|
|
11847
|
-
_DeleteCachedContentParameters, _DeleteCachedContentParametersDict
|
|
11848
|
-
]
|
|
12984
|
+
WhiteSpaceConfigOrDict = Union[WhiteSpaceConfig, WhiteSpaceConfigDict]
|
|
11849
12985
|
|
|
11850
12986
|
|
|
11851
|
-
class
|
|
11852
|
-
"""
|
|
12987
|
+
class ChunkingConfig(_common.BaseModel):
|
|
12988
|
+
"""Config for telling the service how to chunk the file."""
|
|
11853
12989
|
|
|
11854
|
-
|
|
11855
|
-
default=None, description="""
|
|
12990
|
+
white_space_config: Optional[WhiteSpaceConfig] = Field(
|
|
12991
|
+
default=None, description="""White space chunking configuration."""
|
|
11856
12992
|
)
|
|
11857
12993
|
|
|
11858
12994
|
|
|
11859
|
-
class
|
|
11860
|
-
"""
|
|
12995
|
+
class ChunkingConfigDict(TypedDict, total=False):
|
|
12996
|
+
"""Config for telling the service how to chunk the file."""
|
|
11861
12997
|
|
|
11862
|
-
|
|
11863
|
-
"""
|
|
12998
|
+
white_space_config: Optional[WhiteSpaceConfigDict]
|
|
12999
|
+
"""White space chunking configuration."""
|
|
11864
13000
|
|
|
11865
13001
|
|
|
11866
|
-
|
|
11867
|
-
DeleteCachedContentResponse, DeleteCachedContentResponseDict
|
|
11868
|
-
]
|
|
13002
|
+
ChunkingConfigOrDict = Union[ChunkingConfig, ChunkingConfigDict]
|
|
11869
13003
|
|
|
11870
13004
|
|
|
11871
|
-
class
|
|
11872
|
-
"""Optional parameters for
|
|
13005
|
+
class UploadToFileSearchStoreConfig(_common.BaseModel):
|
|
13006
|
+
"""Optional parameters for uploading a file to a FileSearchStore."""
|
|
11873
13007
|
|
|
11874
13008
|
http_options: Optional[HttpOptions] = Field(
|
|
11875
13009
|
default=None, description="""Used to override HTTP request options."""
|
|
11876
13010
|
)
|
|
11877
|
-
|
|
13011
|
+
should_return_http_response: Optional[bool] = Field(
|
|
11878
13012
|
default=None,
|
|
11879
|
-
description="""
|
|
13013
|
+
description=""" If true, the raw HTTP response will be returned in the 'sdk_http_response' field.""",
|
|
11880
13014
|
)
|
|
11881
|
-
|
|
13015
|
+
mime_type: Optional[str] = Field(
|
|
11882
13016
|
default=None,
|
|
11883
|
-
description="""
|
|
13017
|
+
description="""MIME type of the file to be uploaded. If not provided, it will be inferred from the file extension.""",
|
|
13018
|
+
)
|
|
13019
|
+
display_name: Optional[str] = Field(
|
|
13020
|
+
default=None, description="""Display name of the created document."""
|
|
13021
|
+
)
|
|
13022
|
+
custom_metadata: Optional[list[CustomMetadata]] = Field(
|
|
13023
|
+
default=None,
|
|
13024
|
+
description="""User provided custom metadata stored as key-value pairs used for querying.""",
|
|
13025
|
+
)
|
|
13026
|
+
chunking_config: Optional[ChunkingConfig] = Field(
|
|
13027
|
+
default=None,
|
|
13028
|
+
description="""Config for telling the service how to chunk the file.""",
|
|
11884
13029
|
)
|
|
11885
13030
|
|
|
11886
13031
|
|
|
11887
|
-
class
|
|
11888
|
-
"""Optional parameters for
|
|
13032
|
+
class UploadToFileSearchStoreConfigDict(TypedDict, total=False):
|
|
13033
|
+
"""Optional parameters for uploading a file to a FileSearchStore."""
|
|
11889
13034
|
|
|
11890
13035
|
http_options: Optional[HttpOptionsDict]
|
|
11891
13036
|
"""Used to override HTTP request options."""
|
|
11892
13037
|
|
|
11893
|
-
|
|
11894
|
-
"""
|
|
13038
|
+
should_return_http_response: Optional[bool]
|
|
13039
|
+
""" If true, the raw HTTP response will be returned in the 'sdk_http_response' field."""
|
|
11895
13040
|
|
|
11896
|
-
|
|
11897
|
-
"""
|
|
13041
|
+
mime_type: Optional[str]
|
|
13042
|
+
"""MIME type of the file to be uploaded. If not provided, it will be inferred from the file extension."""
|
|
11898
13043
|
|
|
13044
|
+
display_name: Optional[str]
|
|
13045
|
+
"""Display name of the created document."""
|
|
11899
13046
|
|
|
11900
|
-
|
|
11901
|
-
|
|
13047
|
+
custom_metadata: Optional[list[CustomMetadataDict]]
|
|
13048
|
+
"""User provided custom metadata stored as key-value pairs used for querying."""
|
|
13049
|
+
|
|
13050
|
+
chunking_config: Optional[ChunkingConfigDict]
|
|
13051
|
+
"""Config for telling the service how to chunk the file."""
|
|
13052
|
+
|
|
13053
|
+
|
|
13054
|
+
UploadToFileSearchStoreConfigOrDict = Union[
|
|
13055
|
+
UploadToFileSearchStoreConfig, UploadToFileSearchStoreConfigDict
|
|
11902
13056
|
]
|
|
11903
13057
|
|
|
11904
13058
|
|
|
11905
|
-
class
|
|
13059
|
+
class _UploadToFileSearchStoreParameters(_common.BaseModel):
|
|
13060
|
+
"""Generates the parameters for the private _upload_to_file_search_store method."""
|
|
11906
13061
|
|
|
11907
|
-
|
|
13062
|
+
file_search_store_name: Optional[str] = Field(
|
|
11908
13063
|
default=None,
|
|
11909
|
-
description="""The
|
|
11910
|
-
""",
|
|
13064
|
+
description="""The resource name of the FileSearchStore. Example: `fileSearchStores/my-file-search-store-123`""",
|
|
11911
13065
|
)
|
|
11912
|
-
config: Optional[
|
|
13066
|
+
config: Optional[UploadToFileSearchStoreConfig] = Field(
|
|
11913
13067
|
default=None,
|
|
11914
|
-
description="""
|
|
11915
|
-
""",
|
|
13068
|
+
description="""Used to override the default configuration.""",
|
|
11916
13069
|
)
|
|
11917
13070
|
|
|
11918
13071
|
|
|
11919
|
-
class
|
|
13072
|
+
class _UploadToFileSearchStoreParametersDict(TypedDict, total=False):
|
|
13073
|
+
"""Generates the parameters for the private _upload_to_file_search_store method."""
|
|
11920
13074
|
|
|
11921
|
-
|
|
11922
|
-
"""The
|
|
11923
|
-
"""
|
|
13075
|
+
file_search_store_name: Optional[str]
|
|
13076
|
+
"""The resource name of the FileSearchStore. Example: `fileSearchStores/my-file-search-store-123`"""
|
|
11924
13077
|
|
|
11925
|
-
config: Optional[
|
|
11926
|
-
"""
|
|
11927
|
-
"""
|
|
13078
|
+
config: Optional[UploadToFileSearchStoreConfigDict]
|
|
13079
|
+
"""Used to override the default configuration."""
|
|
11928
13080
|
|
|
11929
13081
|
|
|
11930
|
-
|
|
11931
|
-
|
|
13082
|
+
_UploadToFileSearchStoreParametersOrDict = Union[
|
|
13083
|
+
_UploadToFileSearchStoreParameters, _UploadToFileSearchStoreParametersDict
|
|
11932
13084
|
]
|
|
11933
13085
|
|
|
11934
13086
|
|
|
11935
|
-
class
|
|
11936
|
-
"""
|
|
13087
|
+
class UploadToFileSearchStoreResumableResponse(_common.BaseModel):
|
|
13088
|
+
"""Response for the resumable upload method."""
|
|
13089
|
+
|
|
13090
|
+
sdk_http_response: Optional[HttpResponse] = Field(
|
|
13091
|
+
default=None, description="""Used to retain the full HTTP response."""
|
|
13092
|
+
)
|
|
13093
|
+
|
|
13094
|
+
|
|
13095
|
+
class UploadToFileSearchStoreResumableResponseDict(TypedDict, total=False):
|
|
13096
|
+
"""Response for the resumable upload method."""
|
|
13097
|
+
|
|
13098
|
+
sdk_http_response: Optional[HttpResponseDict]
|
|
13099
|
+
"""Used to retain the full HTTP response."""
|
|
13100
|
+
|
|
13101
|
+
|
|
13102
|
+
UploadToFileSearchStoreResumableResponseOrDict = Union[
|
|
13103
|
+
UploadToFileSearchStoreResumableResponse,
|
|
13104
|
+
UploadToFileSearchStoreResumableResponseDict,
|
|
13105
|
+
]
|
|
13106
|
+
|
|
13107
|
+
|
|
13108
|
+
class ImportFileConfig(_common.BaseModel):
|
|
13109
|
+
"""Optional parameters for importing a file."""
|
|
11937
13110
|
|
|
11938
13111
|
http_options: Optional[HttpOptions] = Field(
|
|
11939
13112
|
default=None, description="""Used to override HTTP request options."""
|
|
11940
13113
|
)
|
|
11941
|
-
|
|
11942
|
-
|
|
13114
|
+
custom_metadata: Optional[list[CustomMetadata]] = Field(
|
|
13115
|
+
default=None,
|
|
13116
|
+
description="""User provided custom metadata stored as key-value pairs used for querying.""",
|
|
13117
|
+
)
|
|
13118
|
+
chunking_config: Optional[ChunkingConfig] = Field(
|
|
13119
|
+
default=None,
|
|
13120
|
+
description="""Config for telling the service how to chunk the file.""",
|
|
13121
|
+
)
|
|
11943
13122
|
|
|
11944
13123
|
|
|
11945
|
-
class
|
|
11946
|
-
"""
|
|
13124
|
+
class ImportFileConfigDict(TypedDict, total=False):
|
|
13125
|
+
"""Optional parameters for importing a file."""
|
|
11947
13126
|
|
|
11948
13127
|
http_options: Optional[HttpOptionsDict]
|
|
11949
13128
|
"""Used to override HTTP request options."""
|
|
11950
13129
|
|
|
11951
|
-
|
|
11952
|
-
""""""
|
|
13130
|
+
custom_metadata: Optional[list[CustomMetadataDict]]
|
|
13131
|
+
"""User provided custom metadata stored as key-value pairs used for querying."""
|
|
11953
13132
|
|
|
11954
|
-
|
|
11955
|
-
""""""
|
|
13133
|
+
chunking_config: Optional[ChunkingConfigDict]
|
|
13134
|
+
"""Config for telling the service how to chunk the file."""
|
|
11956
13135
|
|
|
11957
13136
|
|
|
11958
|
-
|
|
11959
|
-
ListCachedContentsConfig, ListCachedContentsConfigDict
|
|
11960
|
-
]
|
|
13137
|
+
ImportFileConfigOrDict = Union[ImportFileConfig, ImportFileConfigDict]
|
|
11961
13138
|
|
|
11962
13139
|
|
|
11963
|
-
class
|
|
11964
|
-
"""
|
|
13140
|
+
class _ImportFileParameters(_common.BaseModel):
|
|
13141
|
+
"""Config for file_search_stores.import_file parameters."""
|
|
11965
13142
|
|
|
11966
|
-
|
|
13143
|
+
file_search_store_name: Optional[str] = Field(
|
|
11967
13144
|
default=None,
|
|
11968
|
-
description="""
|
|
11969
|
-
|
|
13145
|
+
description="""The resource name of the FileSearchStore. Example: `fileSearchStores/my-file-search-store-123`""",
|
|
13146
|
+
)
|
|
13147
|
+
file_name: Optional[str] = Field(
|
|
13148
|
+
default=None,
|
|
13149
|
+
description="""The name of the File API File to import. Example: `files/abc-123`""",
|
|
13150
|
+
)
|
|
13151
|
+
config: Optional[ImportFileConfig] = Field(
|
|
13152
|
+
default=None, description="""Optional parameters for the request."""
|
|
11970
13153
|
)
|
|
11971
13154
|
|
|
11972
13155
|
|
|
11973
|
-
class
|
|
11974
|
-
"""
|
|
13156
|
+
class _ImportFileParametersDict(TypedDict, total=False):
|
|
13157
|
+
"""Config for file_search_stores.import_file parameters."""
|
|
11975
13158
|
|
|
11976
|
-
|
|
11977
|
-
"""
|
|
11978
|
-
"""
|
|
13159
|
+
file_search_store_name: Optional[str]
|
|
13160
|
+
"""The resource name of the FileSearchStore. Example: `fileSearchStores/my-file-search-store-123`"""
|
|
11979
13161
|
|
|
13162
|
+
file_name: Optional[str]
|
|
13163
|
+
"""The name of the File API File to import. Example: `files/abc-123`"""
|
|
11980
13164
|
|
|
11981
|
-
|
|
11982
|
-
|
|
13165
|
+
config: Optional[ImportFileConfigDict]
|
|
13166
|
+
"""Optional parameters for the request."""
|
|
13167
|
+
|
|
13168
|
+
|
|
13169
|
+
_ImportFileParametersOrDict = Union[
|
|
13170
|
+
_ImportFileParameters, _ImportFileParametersDict
|
|
11983
13171
|
]
|
|
11984
13172
|
|
|
11985
13173
|
|
|
11986
|
-
class
|
|
13174
|
+
class ImportFileResponse(_common.BaseModel):
|
|
13175
|
+
"""Response for ImportFile to import a File API file with a file search store."""
|
|
11987
13176
|
|
|
11988
13177
|
sdk_http_response: Optional[HttpResponse] = Field(
|
|
11989
13178
|
default=None, description="""Used to retain the full HTTP response."""
|
|
11990
13179
|
)
|
|
11991
|
-
|
|
11992
|
-
cached_contents: Optional[list[CachedContent]] = Field(
|
|
13180
|
+
parent: Optional[str] = Field(
|
|
11993
13181
|
default=None,
|
|
11994
|
-
description="""
|
|
11995
|
-
|
|
13182
|
+
description="""The name of the FileSearchStore containing Documents.""",
|
|
13183
|
+
)
|
|
13184
|
+
document_name: Optional[str] = Field(
|
|
13185
|
+
default=None, description="""The identifier for the Document imported."""
|
|
11996
13186
|
)
|
|
11997
13187
|
|
|
11998
13188
|
|
|
11999
|
-
class
|
|
13189
|
+
class ImportFileResponseDict(TypedDict, total=False):
|
|
13190
|
+
"""Response for ImportFile to import a File API file with a file search store."""
|
|
12000
13191
|
|
|
12001
13192
|
sdk_http_response: Optional[HttpResponseDict]
|
|
12002
13193
|
"""Used to retain the full HTTP response."""
|
|
12003
13194
|
|
|
12004
|
-
|
|
12005
|
-
""""""
|
|
13195
|
+
parent: Optional[str]
|
|
13196
|
+
"""The name of the FileSearchStore containing Documents."""
|
|
12006
13197
|
|
|
12007
|
-
|
|
12008
|
-
"""
|
|
12009
|
-
"""
|
|
13198
|
+
document_name: Optional[str]
|
|
13199
|
+
"""The identifier for the Document imported."""
|
|
12010
13200
|
|
|
12011
13201
|
|
|
12012
|
-
|
|
12013
|
-
|
|
12014
|
-
|
|
13202
|
+
ImportFileResponseOrDict = Union[ImportFileResponse, ImportFileResponseDict]
|
|
13203
|
+
|
|
13204
|
+
|
|
13205
|
+
class ImportFileOperation(_common.BaseModel, Operation):
|
|
13206
|
+
"""Long-running operation for importing a file to a FileSearchStore."""
|
|
13207
|
+
|
|
13208
|
+
response: Optional[ImportFileResponse] = Field(
|
|
13209
|
+
default=None,
|
|
13210
|
+
description="""The result of the ImportFile operation, available when the operation is done.""",
|
|
13211
|
+
)
|
|
13212
|
+
|
|
13213
|
+
@classmethod
|
|
13214
|
+
def from_api_response(
|
|
13215
|
+
cls, api_response: Any, is_vertex_ai: bool = False
|
|
13216
|
+
) -> Self:
|
|
13217
|
+
"""Instantiates a ImportFileOperation from an API response."""
|
|
13218
|
+
|
|
13219
|
+
response_dict = _ImportFileOperation_from_mldev(api_response)
|
|
13220
|
+
return cls._from_response(response=response_dict, kwargs={})
|
|
12015
13221
|
|
|
12016
13222
|
|
|
12017
13223
|
class ListFilesConfig(_common.BaseModel):
|
|
@@ -12699,6 +13905,52 @@ _CreateBatchJobParametersOrDict = Union[
|
|
|
12699
13905
|
]
|
|
12700
13906
|
|
|
12701
13907
|
|
|
13908
|
+
class CompletionStats(_common.BaseModel):
|
|
13909
|
+
"""Success and error statistics of processing multiple entities (for example, DataItems or structured data rows) in batch.
|
|
13910
|
+
|
|
13911
|
+
This data type is not supported in Gemini API.
|
|
13912
|
+
"""
|
|
13913
|
+
|
|
13914
|
+
failed_count: Optional[int] = Field(
|
|
13915
|
+
default=None,
|
|
13916
|
+
description="""Output only. The number of entities for which any error was encountered.""",
|
|
13917
|
+
)
|
|
13918
|
+
incomplete_count: Optional[int] = Field(
|
|
13919
|
+
default=None,
|
|
13920
|
+
description="""Output only. In cases when enough errors are encountered a job, pipeline, or operation may be failed as a whole. Below is the number of entities for which the processing had not been finished (either in successful or failed state). Set to -1 if the number is unknown (for example, the operation failed before the total entity number could be collected).""",
|
|
13921
|
+
)
|
|
13922
|
+
successful_count: Optional[int] = Field(
|
|
13923
|
+
default=None,
|
|
13924
|
+
description="""Output only. The number of entities that had been processed successfully.""",
|
|
13925
|
+
)
|
|
13926
|
+
successful_forecast_point_count: Optional[int] = Field(
|
|
13927
|
+
default=None,
|
|
13928
|
+
description="""Output only. The number of the successful forecast points that are generated by the forecasting model. This is ONLY used by the forecasting batch prediction.""",
|
|
13929
|
+
)
|
|
13930
|
+
|
|
13931
|
+
|
|
13932
|
+
class CompletionStatsDict(TypedDict, total=False):
|
|
13933
|
+
"""Success and error statistics of processing multiple entities (for example, DataItems or structured data rows) in batch.
|
|
13934
|
+
|
|
13935
|
+
This data type is not supported in Gemini API.
|
|
13936
|
+
"""
|
|
13937
|
+
|
|
13938
|
+
failed_count: Optional[int]
|
|
13939
|
+
"""Output only. The number of entities for which any error was encountered."""
|
|
13940
|
+
|
|
13941
|
+
incomplete_count: Optional[int]
|
|
13942
|
+
"""Output only. In cases when enough errors are encountered a job, pipeline, or operation may be failed as a whole. Below is the number of entities for which the processing had not been finished (either in successful or failed state). Set to -1 if the number is unknown (for example, the operation failed before the total entity number could be collected)."""
|
|
13943
|
+
|
|
13944
|
+
successful_count: Optional[int]
|
|
13945
|
+
"""Output only. The number of entities that had been processed successfully."""
|
|
13946
|
+
|
|
13947
|
+
successful_forecast_point_count: Optional[int]
|
|
13948
|
+
"""Output only. The number of the successful forecast points that are generated by the forecasting model. This is ONLY used by the forecasting batch prediction."""
|
|
13949
|
+
|
|
13950
|
+
|
|
13951
|
+
CompletionStatsOrDict = Union[CompletionStats, CompletionStatsDict]
|
|
13952
|
+
|
|
13953
|
+
|
|
12702
13954
|
class BatchJob(_common.BaseModel):
|
|
12703
13955
|
"""Config for batches.create return value."""
|
|
12704
13956
|
|
|
@@ -12732,7 +13984,7 @@ class BatchJob(_common.BaseModel):
|
|
|
12732
13984
|
)
|
|
12733
13985
|
end_time: Optional[datetime.datetime] = Field(
|
|
12734
13986
|
default=None,
|
|
12735
|
-
description="""The time when the BatchJob was completed.
|
|
13987
|
+
description="""The time when the BatchJob was completed. This field is for Vertex AI only.
|
|
12736
13988
|
""",
|
|
12737
13989
|
)
|
|
12738
13990
|
update_time: Optional[datetime.datetime] = Field(
|
|
@@ -12747,7 +13999,7 @@ class BatchJob(_common.BaseModel):
|
|
|
12747
13999
|
)
|
|
12748
14000
|
src: Optional[BatchJobSource] = Field(
|
|
12749
14001
|
default=None,
|
|
12750
|
-
description="""Configuration for the input data.
|
|
14002
|
+
description="""Configuration for the input data. This field is for Vertex AI only.
|
|
12751
14003
|
""",
|
|
12752
14004
|
)
|
|
12753
14005
|
dest: Optional[BatchJobDestination] = Field(
|
|
@@ -12755,6 +14007,11 @@ class BatchJob(_common.BaseModel):
|
|
|
12755
14007
|
description="""Configuration for the output data.
|
|
12756
14008
|
""",
|
|
12757
14009
|
)
|
|
14010
|
+
completion_stats: Optional[CompletionStats] = Field(
|
|
14011
|
+
default=None,
|
|
14012
|
+
description="""Statistics on completed and failed prediction instances. This field is for Vertex AI only.
|
|
14013
|
+
""",
|
|
14014
|
+
)
|
|
12758
14015
|
|
|
12759
14016
|
@property
|
|
12760
14017
|
def done(self) -> bool:
|
|
@@ -12809,7 +14066,7 @@ class BatchJobDict(TypedDict, total=False):
|
|
|
12809
14066
|
"""Output only. Time when the Job for the first time entered the `JOB_STATE_RUNNING` state."""
|
|
12810
14067
|
|
|
12811
14068
|
end_time: Optional[datetime.datetime]
|
|
12812
|
-
"""The time when the BatchJob was completed.
|
|
14069
|
+
"""The time when the BatchJob was completed. This field is for Vertex AI only.
|
|
12813
14070
|
"""
|
|
12814
14071
|
|
|
12815
14072
|
update_time: Optional[datetime.datetime]
|
|
@@ -12821,13 +14078,17 @@ class BatchJobDict(TypedDict, total=False):
|
|
|
12821
14078
|
"""
|
|
12822
14079
|
|
|
12823
14080
|
src: Optional[BatchJobSourceDict]
|
|
12824
|
-
"""Configuration for the input data.
|
|
14081
|
+
"""Configuration for the input data. This field is for Vertex AI only.
|
|
12825
14082
|
"""
|
|
12826
14083
|
|
|
12827
14084
|
dest: Optional[BatchJobDestinationDict]
|
|
12828
14085
|
"""Configuration for the output data.
|
|
12829
14086
|
"""
|
|
12830
14087
|
|
|
14088
|
+
completion_stats: Optional[CompletionStatsDict]
|
|
14089
|
+
"""Statistics on completed and failed prediction instances. This field is for Vertex AI only.
|
|
14090
|
+
"""
|
|
14091
|
+
|
|
12831
14092
|
|
|
12832
14093
|
BatchJobOrDict = Union[BatchJob, BatchJobDict]
|
|
12833
14094
|
|
|
@@ -16505,3 +17766,54 @@ class RougeSpecDict(TypedDict, total=False):
|
|
|
16505
17766
|
|
|
16506
17767
|
|
|
16507
17768
|
RougeSpecOrDict = Union[RougeSpec, RougeSpecDict]
|
|
17769
|
+
|
|
17770
|
+
|
|
17771
|
+
class UploadToFileSearchStoreResponse(_common.BaseModel):
|
|
17772
|
+
"""The response when long-running operation for uploading a file to a FileSearchStore complete."""
|
|
17773
|
+
|
|
17774
|
+
sdk_http_response: Optional[HttpResponse] = Field(
|
|
17775
|
+
default=None, description="""Used to retain the full HTTP response."""
|
|
17776
|
+
)
|
|
17777
|
+
parent: Optional[str] = Field(
|
|
17778
|
+
default=None,
|
|
17779
|
+
description="""The name of the FileSearchStore containing Documents.""",
|
|
17780
|
+
)
|
|
17781
|
+
document_name: Optional[str] = Field(
|
|
17782
|
+
default=None, description="""The identifier for the Document imported."""
|
|
17783
|
+
)
|
|
17784
|
+
|
|
17785
|
+
|
|
17786
|
+
class UploadToFileSearchStoreResponseDict(TypedDict, total=False):
|
|
17787
|
+
"""The response when long-running operation for uploading a file to a FileSearchStore complete."""
|
|
17788
|
+
|
|
17789
|
+
sdk_http_response: Optional[HttpResponseDict]
|
|
17790
|
+
"""Used to retain the full HTTP response."""
|
|
17791
|
+
|
|
17792
|
+
parent: Optional[str]
|
|
17793
|
+
"""The name of the FileSearchStore containing Documents."""
|
|
17794
|
+
|
|
17795
|
+
document_name: Optional[str]
|
|
17796
|
+
"""The identifier for the Document imported."""
|
|
17797
|
+
|
|
17798
|
+
|
|
17799
|
+
UploadToFileSearchStoreResponseOrDict = Union[
|
|
17800
|
+
UploadToFileSearchStoreResponse, UploadToFileSearchStoreResponseDict
|
|
17801
|
+
]
|
|
17802
|
+
|
|
17803
|
+
|
|
17804
|
+
class UploadToFileSearchStoreOperation(_common.BaseModel, Operation):
|
|
17805
|
+
"""Long-running operation for uploading a file to a FileSearchStore."""
|
|
17806
|
+
|
|
17807
|
+
response: Optional[UploadToFileSearchStoreResponse] = Field(
|
|
17808
|
+
default=None,
|
|
17809
|
+
description="""The result of the UploadToFileSearchStore operation, available when the operation is done.""",
|
|
17810
|
+
)
|
|
17811
|
+
|
|
17812
|
+
@classmethod
|
|
17813
|
+
def from_api_response(
|
|
17814
|
+
cls, api_response: Any, is_vertex_ai: bool = False
|
|
17815
|
+
) -> Self:
|
|
17816
|
+
"""Instantiates a UploadToFileSearchStoreOperation from an API response."""
|
|
17817
|
+
|
|
17818
|
+
response_dict = _UploadToFileSearchStoreOperation_from_mldev(api_response)
|
|
17819
|
+
return cls._from_response(response=response_dict, kwargs={})
|