shengsuanyun-gemini-api 1.38.0

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.
@@ -0,0 +1,1159 @@
1
+ /** The generic reusable api auth config. Deprecated. Please use AuthConfig (google/cloud/aiplatform/master/auth.proto) instead. This data type is not supported in Gemini API. */
2
+ declare interface ApiAuth {
3
+ /** The API secret. */
4
+ apiKeyConfig?: ApiAuthApiKeyConfig;
5
+ }
6
+
7
+ /** The API secret. This data type is not supported in Gemini API. */
8
+ declare interface ApiAuthApiKeyConfig {
9
+ /** Required. The SecretManager secret version resource name storing API key. e.g. projects/{project}/secrets/{secret}/versions/{version} */
10
+ apiKeySecretVersion?: string;
11
+ /** The API key string. Either this or `api_key_secret_version` must be set. */
12
+ apiKeyString?: string;
13
+ }
14
+
15
+ /** Config for authentication with API key. This data type is not supported in Gemini API. */
16
+ declare interface ApiKeyConfig {
17
+ /** 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. */
18
+ apiKeySecret?: string;
19
+ /** Optional. The API key to be used in the request directly. */
20
+ apiKeyString?: string;
21
+ /** Optional. The location of the API key. */
22
+ httpElementLocation?: HttpElementLocation;
23
+ /** 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. */
24
+ name?: string;
25
+ }
26
+
27
+ /** The API spec that the external API implements. This enum is not supported in Gemini API. */
28
+ declare enum ApiSpec {
29
+ /**
30
+ * Unspecified API spec. This value should not be used.
31
+ */
32
+ API_SPEC_UNSPECIFIED = "API_SPEC_UNSPECIFIED",
33
+ /**
34
+ * Simple search API spec.
35
+ */
36
+ SIMPLE_SEARCH = "SIMPLE_SEARCH",
37
+ /**
38
+ * Elastic search API spec.
39
+ */
40
+ ELASTIC_SEARCH = "ELASTIC_SEARCH"
41
+ }
42
+
43
+ /** Auth configuration to run the extension. This data type is not supported in Gemini API. */
44
+ declare interface AuthConfig {
45
+ /** Config for API key auth. */
46
+ apiKeyConfig?: ApiKeyConfig;
47
+ /** Type of auth scheme. */
48
+ authType?: AuthType;
49
+ /** Config for Google Service Account auth. */
50
+ googleServiceAccountConfig?: AuthConfigGoogleServiceAccountConfig;
51
+ /** Config for HTTP Basic auth. */
52
+ httpBasicAuthConfig?: AuthConfigHttpBasicAuthConfig;
53
+ /** Config for user oauth. */
54
+ oauthConfig?: AuthConfigOauthConfig;
55
+ /** Config for user OIDC auth. */
56
+ oidcConfig?: AuthConfigOidcConfig;
57
+ }
58
+
59
+ /** Config for Google Service Account Authentication. This data type is not supported in Gemini API. */
60
+ declare interface AuthConfigGoogleServiceAccountConfig {
61
+ /** Optional. The service account that the extension execution service runs as. - If the service account is specified, the `iam.serviceAccounts.getAccessToken` 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 service account. - If not specified, the Vertex AI Extension Service Agent will be used to execute the Extension. */
62
+ serviceAccount?: string;
63
+ }
64
+
65
+ /** Config for HTTP Basic Authentication. This data type is not supported in Gemini API. */
66
+ declare interface AuthConfigHttpBasicAuthConfig {
67
+ /** Required. The name of the SecretManager secret version resource storing the base64 encoded credentials. Format: `projects/{project}/secrets/{secrete}/versions/{version}` - 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. */
68
+ credentialSecret?: string;
69
+ }
70
+
71
+ /** Config for user oauth. This data type is not supported in Gemini API. */
72
+ declare interface AuthConfigOauthConfig {
73
+ /** Access token for extension endpoint. Only used to propagate token from [[ExecuteExtensionRequest.runtime_auth_config]] at request time. */
74
+ accessToken?: string;
75
+ /** The service account used to generate access tokens for executing the Extension. - If the service account is specified, the `iam.serviceAccounts.getAccessToken` permission should be granted to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) on the provided service account. */
76
+ serviceAccount?: string;
77
+ }
78
+
79
+ /** Config for user OIDC auth. This data type is not supported in Gemini API. */
80
+ declare interface AuthConfigOidcConfig {
81
+ /** OpenID Connect formatted ID token for extension endpoint. Only used to propagate token from [[ExecuteExtensionRequest.runtime_auth_config]] at request time. */
82
+ idToken?: string;
83
+ /** The service account used to generate an OpenID Connect (OIDC)-compatible JWT token signed by the Google OIDC Provider (accounts.google.com) for extension endpoint (https://cloud.google.com/iam/docs/create-short-lived-credentials-direct#sa-credentials-oidc). - The audience for the token will be set to the URL in the server url defined in the OpenApi spec. - If the service account is provided, the service account should grant `iam.serviceAccounts.getOpenIdToken` permission to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents). */
84
+ serviceAccount?: string;
85
+ }
86
+
87
+ /** Type of auth scheme. This enum is not supported in Gemini API. */
88
+ declare enum AuthType {
89
+ AUTH_TYPE_UNSPECIFIED = "AUTH_TYPE_UNSPECIFIED",
90
+ /**
91
+ * No Auth.
92
+ */
93
+ NO_AUTH = "NO_AUTH",
94
+ /**
95
+ * API Key Auth.
96
+ */
97
+ API_KEY_AUTH = "API_KEY_AUTH",
98
+ /**
99
+ * HTTP Basic Auth.
100
+ */
101
+ HTTP_BASIC_AUTH = "HTTP_BASIC_AUTH",
102
+ /**
103
+ * Google Service Account Auth.
104
+ */
105
+ GOOGLE_SERVICE_ACCOUNT_AUTH = "GOOGLE_SERVICE_ACCOUNT_AUTH",
106
+ /**
107
+ * OAuth auth.
108
+ */
109
+ OAUTH = "OAUTH",
110
+ /**
111
+ * OpenID Connect (OIDC) Auth.
112
+ */
113
+ OIDC_AUTH = "OIDC_AUTH"
114
+ }
115
+
116
+ /** Specifies the function Behavior. Currently only supported by the BidiGenerateContent method. This enum is not supported in Vertex AI. */
117
+ declare enum Behavior {
118
+ /**
119
+ * This value is unused.
120
+ */
121
+ UNSPECIFIED = "UNSPECIFIED",
122
+ /**
123
+ * If set, the system will wait to receive the function response before continuing the conversation.
124
+ */
125
+ BLOCKING = "BLOCKING",
126
+ /**
127
+ * If set, the system will not wait to receive the function response. Instead, it will attempt to handle function responses as they become available while maintaining the conversation between the user and the model.
128
+ */
129
+ NON_BLOCKING = "NON_BLOCKING"
130
+ }
131
+
132
+ /** Content blob. */
133
+ declare interface Blob_2 {
134
+ /** Required. Raw bytes.
135
+ * @remarks Encoded as base64 string. */
136
+ data?: string;
137
+ /** Optional. Display name of the blob. Used to provide a label or filename to distinguish blobs. This field is only returned in PromptMessage for prompt management. It is currently used in the Gemini GenerateContent calls only when server side tools (code_execution, google_search, and url_context) are enabled. This field is not supported in Gemini API. */
138
+ displayName?: string;
139
+ /** Required. The IANA standard MIME type of the source data. */
140
+ mimeType?: string;
141
+ }
142
+
143
+ /** Result of executing the [ExecutableCode]. Only generated when using the [CodeExecution] tool, and always follows a `part` containing the [ExecutableCode]. */
144
+ declare interface CodeExecutionResult {
145
+ /** Required. Outcome of the code execution. */
146
+ outcome?: Outcome;
147
+ /** Optional. Contains stdout when code execution is successful, stderr or other description otherwise. */
148
+ output?: string;
149
+ }
150
+
151
+ /** Tool to support computer use. */
152
+ declare interface ComputerUse {
153
+ /** Required. The environment being operated. */
154
+ environment?: Environment;
155
+ /** By default, predefined functions are included in the final model call.
156
+ Some of them can be explicitly excluded from being automatically included.
157
+ This can serve two purposes:
158
+ 1. Using a more restricted / different action space.
159
+ 2. Improving the definitions / instructions of predefined functions. */
160
+ excludedPredefinedFunctions?: string[];
161
+ }
162
+
163
+ /** Local tokenizer compute tokens result. */
164
+ export declare interface ComputeTokensResult {
165
+ /** Lists of tokens info from the input. */
166
+ tokensInfo?: TokensInfo[];
167
+ }
168
+
169
+ /** Contains the multi-part content of a message. */
170
+ declare interface Content {
171
+ /** List of parts that constitute a single message. Each part may have
172
+ a different IANA MIME type. */
173
+ parts?: Part[];
174
+ /** Optional. The producer of the content. Must be either 'user' or 'model'. Useful to set for multi-turn conversations, otherwise can be left blank or unset. */
175
+ role?: string;
176
+ }
177
+
178
+ declare type ContentListUnion = Content | Content[] | PartUnion | PartUnion[];
179
+
180
+ declare type ContentUnion = Content | PartUnion[] | PartUnion;
181
+
182
+ /** Config for the count_tokens method. */
183
+ declare interface CountTokensConfig {
184
+ /** Used to override HTTP request options. */
185
+ httpOptions?: HttpOptions;
186
+ /** Abort signal which can be used to cancel the request.
187
+
188
+ NOTE: AbortSignal is a client-only operation. Using it to cancel an
189
+ operation will not cancel the request in the service. You will still
190
+ be charged usage for any applicable operations.
191
+ */
192
+ abortSignal?: AbortSignal;
193
+ /** Instructions for the model to steer it toward better performance.
194
+ */
195
+ systemInstruction?: ContentUnion;
196
+ /** Code that enables the system to interact with external systems to
197
+ perform an action outside of the knowledge and scope of the model.
198
+ */
199
+ tools?: Tool[];
200
+ /** Configuration that the model uses to generate the response. Not
201
+ supported by the Gemini Developer API.
202
+ */
203
+ generationConfig?: GenerationConfig;
204
+ }
205
+
206
+ /** Local tokenizer count tokens result. */
207
+ export declare interface CountTokensResult {
208
+ /** The total number of tokens. */
209
+ totalTokens?: number;
210
+ }
211
+
212
+ /** Describes the options to customize dynamic retrieval. */
213
+ declare interface DynamicRetrievalConfig {
214
+ /** Optional. The threshold to be used in dynamic retrieval. If not set, a system default value is used. */
215
+ dynamicThreshold?: number;
216
+ /** The mode of the predictor to be used in dynamic retrieval. */
217
+ mode?: DynamicRetrievalConfigMode;
218
+ }
219
+
220
+ /** The mode of the predictor to be used in dynamic retrieval. */
221
+ declare enum DynamicRetrievalConfigMode {
222
+ /**
223
+ * Always trigger retrieval.
224
+ */
225
+ MODE_UNSPECIFIED = "MODE_UNSPECIFIED",
226
+ /**
227
+ * Run retrieval only when system decides it is necessary.
228
+ */
229
+ MODE_DYNAMIC = "MODE_DYNAMIC"
230
+ }
231
+
232
+ /** Tool to search public web data, powered by Vertex AI Search and Sec4 compliance. This data type is not supported in Gemini API. */
233
+ declare interface EnterpriseWebSearch {
234
+ /** Optional. List of domains to be excluded from the search results. The default limit is 2000 domains. */
235
+ excludeDomains?: string[];
236
+ /** Optional. Sites with confidence level chosen & above this value will be blocked from the search results. */
237
+ blockingConfidence?: PhishBlockThreshold;
238
+ }
239
+
240
+ /** The environment being operated. */
241
+ declare enum Environment {
242
+ /**
243
+ * Defaults to browser.
244
+ */
245
+ ENVIRONMENT_UNSPECIFIED = "ENVIRONMENT_UNSPECIFIED",
246
+ /**
247
+ * Operates in a web browser.
248
+ */
249
+ ENVIRONMENT_BROWSER = "ENVIRONMENT_BROWSER"
250
+ }
251
+
252
+ /** Code generated by the model that is meant to be executed, and the result returned to the model. Generated when using the [CodeExecution] tool, in which the code will be automatically executed, and a corresponding [CodeExecutionResult] will also be generated. */
253
+ declare interface ExecutableCode {
254
+ /** Required. The code to be executed. */
255
+ code?: string;
256
+ /** Required. Programming language of the `code`. */
257
+ language?: Language;
258
+ }
259
+
260
+ /** Retrieve from data source powered by external API for grounding. The external API is not owned by Google, but need to follow the pre-defined API spec. This data type is not supported in Gemini API. */
261
+ declare interface ExternalApi {
262
+ /** The authentication config to access the API. Deprecated. Please use auth_config instead. */
263
+ apiAuth?: ApiAuth;
264
+ /** The API spec that the external API implements. */
265
+ apiSpec?: ApiSpec;
266
+ /** The authentication config to access the API. */
267
+ authConfig?: AuthConfig;
268
+ /** Parameters for the elastic search API. */
269
+ elasticSearchParams?: ExternalApiElasticSearchParams;
270
+ /** The endpoint of the external API. The system will call the API at this endpoint to retrieve the data for grounding. Example: https://acme.com:443/search */
271
+ endpoint?: string;
272
+ /** Parameters for the simple search API. */
273
+ simpleSearchParams?: ExternalApiSimpleSearchParams;
274
+ }
275
+
276
+ /** The search parameters to use for the ELASTIC_SEARCH spec. This data type is not supported in Gemini API. */
277
+ declare interface ExternalApiElasticSearchParams {
278
+ /** The ElasticSearch index to use. */
279
+ index?: string;
280
+ /** Optional. Number of hits (chunks) to request. When specified, it is passed to Elasticsearch as the `num_hits` param. */
281
+ numHits?: number;
282
+ /** The ElasticSearch search template to use. */
283
+ searchTemplate?: string;
284
+ }
285
+
286
+ /** The search parameters to use for SIMPLE_SEARCH spec. This data type is not supported in Gemini API. */
287
+ declare interface ExternalApiSimpleSearchParams {
288
+ }
289
+
290
+ /** Options for feature selection preference. */
291
+ declare enum FeatureSelectionPreference {
292
+ FEATURE_SELECTION_PREFERENCE_UNSPECIFIED = "FEATURE_SELECTION_PREFERENCE_UNSPECIFIED",
293
+ PRIORITIZE_QUALITY = "PRIORITIZE_QUALITY",
294
+ BALANCED = "BALANCED",
295
+ PRIORITIZE_COST = "PRIORITIZE_COST"
296
+ }
297
+
298
+ /** URI based data. */
299
+ declare interface FileData {
300
+ /** Optional. Display name of the file data. Used to provide a label or filename to distinguish file datas. This field is only returned in PromptMessage for prompt management. It is currently used in the Gemini GenerateContent calls only when server side tools (code_execution, google_search, and url_context) are enabled. This field is not supported in Gemini API. */
301
+ displayName?: string;
302
+ /** Required. URI. */
303
+ fileUri?: string;
304
+ /** Required. The IANA standard MIME type of the source data. */
305
+ mimeType?: string;
306
+ }
307
+
308
+ /** Tool to retrieve knowledge from the File Search Stores. */
309
+ declare interface FileSearch {
310
+ /** The names of the file_search_stores to retrieve from.
311
+ Example: `fileSearchStores/my-file-search-store-123` */
312
+ fileSearchStoreNames?: string[];
313
+ /** The number of file search retrieval chunks to retrieve. */
314
+ topK?: number;
315
+ /** Metadata filter to apply to the file search retrieval documents. See https://google.aip.dev/160 for the syntax of the filter expression. */
316
+ metadataFilter?: string;
317
+ }
318
+
319
+ /** A function call. */
320
+ declare interface FunctionCall {
321
+ /** The unique id of the function call. If populated, the client to execute the
322
+ `function_call` and return the response with the matching `id`. */
323
+ id?: string;
324
+ /** Optional. The function parameters and values in JSON object format. See [FunctionDeclaration.parameters] for parameter details. */
325
+ args?: Record<string, unknown>;
326
+ /** Optional. The name of the function to call. Matches [FunctionDeclaration.name]. */
327
+ name?: string;
328
+ /** Optional. The partial argument value of the function call. If provided, represents the arguments/fields that are streamed incrementally. This field is not supported in Gemini API. */
329
+ partialArgs?: PartialArg[];
330
+ /** Optional. Whether this is the last part of the FunctionCall. If true, another partial message for the current FunctionCall is expected to follow. This field is not supported in Gemini API. */
331
+ willContinue?: boolean;
332
+ }
333
+
334
+ /** Structured representation of a function declaration as defined by the [OpenAPI 3.0 specification](https://spec.openapis.org/oas/v3.0.3). Included in this declaration are the function name, description, parameters and response type. This FunctionDeclaration is a representation of a block of code that can be used as a `Tool` by the model and executed by the client. */
335
+ declare interface FunctionDeclaration {
336
+ /** Optional. Description and purpose of the function. Model uses it to decide how and whether to call the function. */
337
+ description?: string;
338
+ /** Required. The name of the function to call. Must start with a letter or an underscore. Must be a-z, A-Z, 0-9, or contain underscores, dots and dashes, with a maximum length of 64. */
339
+ name?: string;
340
+ /** Optional. Describes the parameters to this function in JSON Schema Object format. Reflects the Open API 3.03 Parameter Object. string Key: the name of the parameter. Parameter names are case sensitive. Schema Value: the Schema defining the type used for the parameter. For function with no parameters, this can be left unset. Parameter names must start with a letter or an underscore and must only contain chars a-z, A-Z, 0-9, or underscores with a maximum length of 64. Example with 1 required and 1 optional parameter: type: OBJECT properties: param1: type: STRING param2: type: INTEGER required: - param1 */
341
+ parameters?: Schema;
342
+ /** Optional. Describes the parameters to the function in JSON Schema format. The schema must describe an object where the properties are the parameters to the function. For example: ``` { "type": "object", "properties": { "name": { "type": "string" }, "age": { "type": "integer" } }, "additionalProperties": false, "required": ["name", "age"], "propertyOrdering": ["name", "age"] } ``` This field is mutually exclusive with `parameters`. */
343
+ parametersJsonSchema?: unknown;
344
+ /** Optional. Describes the output from this function in JSON Schema format. Reflects the Open API 3.03 Response Object. The Schema defines the type used for the response value of the function. */
345
+ response?: Schema;
346
+ /** Optional. Describes the output from this function in JSON Schema format. The value specified by the schema is the response value of the function. This field is mutually exclusive with `response`. */
347
+ responseJsonSchema?: unknown;
348
+ /** Optional. Specifies the function Behavior. Currently only supported by the BidiGenerateContent method. This field is not supported in Vertex AI. */
349
+ behavior?: Behavior;
350
+ }
351
+
352
+ /** A function response. */
353
+ declare class FunctionResponse {
354
+ /** Signals that function call continues, and more responses will be returned, turning the function call into a generator. Is only applicable to NON_BLOCKING function calls (see FunctionDeclaration.behavior for details), ignored otherwise. If false, the default, future responses will not be considered. Is only applicable to NON_BLOCKING function calls, is ignored otherwise. If set to false, future responses will not be considered. It is allowed to return empty `response` with `will_continue=False` to signal that the function call is finished. */
355
+ willContinue?: boolean;
356
+ /** Specifies how the response should be scheduled in the conversation. Only applicable to NON_BLOCKING function calls, is ignored otherwise. Defaults to WHEN_IDLE. */
357
+ scheduling?: FunctionResponseScheduling;
358
+ /** List of parts that constitute a function response. Each part may
359
+ have a different IANA MIME type. */
360
+ parts?: FunctionResponsePart[];
361
+ /** Optional. The id of the function call this response is for. Populated by the client to match the corresponding function call `id`. */
362
+ id?: string;
363
+ /** Required. The name of the function to call. Matches [FunctionDeclaration.name] and [FunctionCall.name]. */
364
+ name?: string;
365
+ /** Required. The function response in JSON object format. Use "output" key to specify function output and "error" key to specify error details (if any). If "output" and "error" keys are not specified, then whole "response" is treated as function output. */
366
+ response?: Record<string, unknown>;
367
+ }
368
+
369
+ /** Raw media bytes for function response.
370
+
371
+ Text should not be sent as raw bytes, use the FunctionResponse.response
372
+ field. */
373
+ declare class FunctionResponseBlob {
374
+ /** Required. The IANA standard MIME type of the source data. */
375
+ mimeType?: string;
376
+ /** Required. Inline media bytes.
377
+ * @remarks Encoded as base64 string. */
378
+ data?: string;
379
+ /** Optional. Display name of the blob.
380
+ Used to provide a label or filename to distinguish blobs. */
381
+ displayName?: string;
382
+ }
383
+
384
+ /** URI based data for function response. */
385
+ declare class FunctionResponseFileData {
386
+ /** Required. URI. */
387
+ fileUri?: string;
388
+ /** Required. The IANA standard MIME type of the source data. */
389
+ mimeType?: string;
390
+ /** Optional. Display name of the file.
391
+ Used to provide a label or filename to distinguish files. */
392
+ displayName?: string;
393
+ }
394
+
395
+ /** A datatype containing media that is part of a `FunctionResponse` message.
396
+
397
+ A `FunctionResponsePart` consists of data which has an associated datatype. A
398
+ `FunctionResponsePart` can only contain one of the accepted types in
399
+ `FunctionResponsePart.data`.
400
+
401
+ A `FunctionResponsePart` must have a fixed IANA MIME type identifying the
402
+ type and subtype of the media if the `inline_data` field is filled with raw
403
+ bytes. */
404
+ declare class FunctionResponsePart {
405
+ /** Optional. Inline media bytes. */
406
+ inlineData?: FunctionResponseBlob;
407
+ /** Optional. URI based data. */
408
+ fileData?: FunctionResponseFileData;
409
+ }
410
+
411
+ /** Specifies how the response should be scheduled in the conversation. */
412
+ declare enum FunctionResponseScheduling {
413
+ /**
414
+ * This value is unused.
415
+ */
416
+ SCHEDULING_UNSPECIFIED = "SCHEDULING_UNSPECIFIED",
417
+ /**
418
+ * Only add the result to the conversation context, do not interrupt or trigger generation.
419
+ */
420
+ SILENT = "SILENT",
421
+ /**
422
+ * Add the result to the conversation context, and prompt to generate output without interrupting ongoing generation.
423
+ */
424
+ WHEN_IDLE = "WHEN_IDLE",
425
+ /**
426
+ * Add the result to the conversation context, interrupt ongoing generation and prompt to generate output.
427
+ */
428
+ INTERRUPT = "INTERRUPT"
429
+ }
430
+
431
+ /** Generation config. */
432
+ declare interface GenerationConfig {
433
+ /** Optional. Config for model selection. */
434
+ modelSelectionConfig?: ModelSelectionConfig;
435
+ /** Output schema of the generated response. This is an alternative to
436
+ `response_schema` that accepts [JSON Schema](https://json-schema.org/).
437
+ */
438
+ responseJsonSchema?: unknown;
439
+ /** Optional. If enabled, audio timestamp will be included in the request to the model. This field is not supported in Gemini API. */
440
+ audioTimestamp?: boolean;
441
+ /** Optional. Number of candidates to generate. */
442
+ candidateCount?: number;
443
+ /** Optional. If enabled, the model will detect emotions and adapt its responses accordingly. This field is not supported in Gemini API. */
444
+ enableAffectiveDialog?: boolean;
445
+ /** Optional. Frequency penalties. */
446
+ frequencyPenalty?: number;
447
+ /** Optional. Logit probabilities. */
448
+ logprobs?: number;
449
+ /** Optional. The maximum number of output tokens to generate per message. */
450
+ maxOutputTokens?: number;
451
+ /** Optional. If specified, the media resolution specified will be used. */
452
+ mediaResolution?: MediaResolution;
453
+ /** Optional. Positive penalties. */
454
+ presencePenalty?: number;
455
+ /** Optional. If true, export the logprobs results in response. */
456
+ responseLogprobs?: boolean;
457
+ /** Optional. Output response mimetype of the generated candidate text. Supported mimetype: - `text/plain`: (default) Text output. - `application/json`: JSON response in the candidates. The model needs to be prompted to output the appropriate response type, otherwise the behavior is undefined. This is a preview feature. */
458
+ responseMimeType?: string;
459
+ /** Optional. The modalities of the response. */
460
+ responseModalities?: Modality[];
461
+ /** Optional. The `Schema` object allows the definition of input and output data types. These types can be objects, but also primitives and arrays. Represents a select subset of an [OpenAPI 3.0 schema object](https://spec.openapis.org/oas/v3.0.3#schema). If set, a compatible response_mime_type must also be set. Compatible mimetypes: `application/json`: Schema for JSON response. */
462
+ responseSchema?: Schema;
463
+ /** Optional. Routing configuration. This field is not supported in Gemini API. */
464
+ routingConfig?: GenerationConfigRoutingConfig;
465
+ /** Optional. Seed. */
466
+ seed?: number;
467
+ /** Optional. The speech generation config. */
468
+ speechConfig?: SpeechConfig;
469
+ /** Optional. Stop sequences. */
470
+ stopSequences?: string[];
471
+ /** Optional. Controls the randomness of predictions. */
472
+ temperature?: number;
473
+ /** Optional. Config for thinking features. An error will be returned if this field is set for models that don't support thinking. */
474
+ thinkingConfig?: ThinkingConfig;
475
+ /** Optional. If specified, top-k sampling will be used. */
476
+ topK?: number;
477
+ /** Optional. If specified, nucleus sampling will be used. */
478
+ topP?: number;
479
+ /** Optional. Enables enhanced civic answers. It may not be available for all models. This field is not supported in Vertex AI. */
480
+ enableEnhancedCivicAnswers?: boolean;
481
+ }
482
+
483
+ /** The configuration for routing the request to a specific model. This data type is not supported in Gemini API. */
484
+ declare interface GenerationConfigRoutingConfig {
485
+ /** Automated routing. */
486
+ autoMode?: GenerationConfigRoutingConfigAutoRoutingMode;
487
+ /** Manual routing. */
488
+ manualMode?: GenerationConfigRoutingConfigManualRoutingMode;
489
+ }
490
+
491
+ /** When automated routing is specified, the routing will be determined by the pretrained routing model and customer provided model routing preference. This data type is not supported in Gemini API. */
492
+ declare interface GenerationConfigRoutingConfigAutoRoutingMode {
493
+ /** The model routing preference. */
494
+ modelRoutingPreference?: 'UNKNOWN' | 'PRIORITIZE_QUALITY' | 'BALANCED' | 'PRIORITIZE_COST';
495
+ }
496
+
497
+ /** When manual routing is set, the specified model will be used directly. This data type is not supported in Gemini API. */
498
+ declare interface GenerationConfigRoutingConfigManualRoutingMode {
499
+ /** The model name to use. Only the public LLM models are accepted. See [Supported models](https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/inference#supported-models). */
500
+ modelName?: string;
501
+ }
502
+
503
+ /** Tool to retrieve public maps data for grounding, powered by Google. */
504
+ declare interface GoogleMaps {
505
+ /** The authentication config to access the API. Only API key is supported. This field is not supported in Gemini API. */
506
+ authConfig?: AuthConfig;
507
+ /** Optional. If true, include the widget context token in the response. */
508
+ enableWidget?: boolean;
509
+ }
510
+
511
+ /** GoogleSearch tool type. Tool to support Google Search in Model. Powered by Google. */
512
+ declare interface GoogleSearch {
513
+ /** 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. */
514
+ excludeDomains?: string[];
515
+ /** Optional. Sites with confidence level chosen & above this value will be blocked from the search results. This field is not supported in Gemini API. */
516
+ blockingConfidence?: PhishBlockThreshold;
517
+ /** 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. */
518
+ timeRangeFilter?: Interval;
519
+ }
520
+
521
+ /** Tool to retrieve public web data for grounding, powered by Google. */
522
+ declare interface GoogleSearchRetrieval {
523
+ /** Specifies the dynamic retrieval configuration for the given source. */
524
+ dynamicRetrievalConfig?: DynamicRetrievalConfig;
525
+ }
526
+
527
+ /** The location of the API key. This enum is not supported in Gemini API. */
528
+ declare enum HttpElementLocation {
529
+ HTTP_IN_UNSPECIFIED = "HTTP_IN_UNSPECIFIED",
530
+ /**
531
+ * Element is in the HTTP request query.
532
+ */
533
+ HTTP_IN_QUERY = "HTTP_IN_QUERY",
534
+ /**
535
+ * Element is in the HTTP request header.
536
+ */
537
+ HTTP_IN_HEADER = "HTTP_IN_HEADER",
538
+ /**
539
+ * Element is in the HTTP request path.
540
+ */
541
+ HTTP_IN_PATH = "HTTP_IN_PATH",
542
+ /**
543
+ * Element is in the HTTP request body.
544
+ */
545
+ HTTP_IN_BODY = "HTTP_IN_BODY",
546
+ /**
547
+ * Element is in the HTTP request cookie.
548
+ */
549
+ HTTP_IN_COOKIE = "HTTP_IN_COOKIE"
550
+ }
551
+
552
+ /** HTTP options to be used in each of the requests. */
553
+ declare interface HttpOptions {
554
+ /** The base URL for the AI platform service endpoint. */
555
+ baseUrl?: string;
556
+ /** The resource scope used to constructing the resource name when base_url is set */
557
+ baseUrlResourceScope?: ResourceScope;
558
+ /** Specifies the version of the API to use. */
559
+ apiVersion?: string;
560
+ /** Additional HTTP headers to be sent with the request. */
561
+ headers?: Record<string, string>;
562
+ /** Timeout for the request in milliseconds. */
563
+ timeout?: number;
564
+ /** Extra parameters to add to the request body.
565
+ The structure must match the backend API's request structure.
566
+ - VertexAI backend API docs: https://cloud.google.com/vertex-ai/docs/reference/rest
567
+ - GeminiAPI backend API docs: https://ai.google.dev/api/rest */
568
+ extraBody?: Record<string, unknown>;
569
+ }
570
+
571
+ /** Represents a time interval, encoded as a Timestamp start (inclusive) and a Timestamp end (exclusive). The start must be less than or equal to the end. When the start equals the end, the interval is empty (matches no time). When both start and end are unspecified, the interval matches any time. */
572
+ declare interface Interval {
573
+ /** Optional. Exclusive end of the interval. If specified, a Timestamp matching this interval will have to be before the end. */
574
+ endTime?: string;
575
+ /** Optional. Inclusive start of the interval. If specified, a Timestamp matching this interval will have to be the same or after the start. */
576
+ startTime?: string;
577
+ }
578
+
579
+ /** Programming language of the `code`. */
580
+ declare enum Language {
581
+ /**
582
+ * Unspecified language. This value should not be used.
583
+ */
584
+ LANGUAGE_UNSPECIFIED = "LANGUAGE_UNSPECIFIED",
585
+ /**
586
+ * Python >= 3.10, with numpy and simpy available.
587
+ */
588
+ PYTHON = "PYTHON"
589
+ }
590
+
591
+ /**
592
+ * LocalTokenizer for Node.js environment.
593
+ *
594
+ * Provides local tokenization for Gemini models without requiring API calls.
595
+ * Automatically uses Node.js platform (filesystem caching in temp directory).
596
+ *
597
+ * @example
598
+ * ```typescript
599
+ * import {LocalTokenizer} from '@google/genai/node';
600
+ *
601
+ * const tokenizer = new LocalTokenizer('gemini-2.0-flash-001');
602
+ * const result = await tokenizer.countTokens("What is your name?");
603
+ * console.log(result.totalTokens); // 5
604
+ * ```
605
+ *
606
+ * @experimental This API is experimental and may change in future versions.
607
+ */
608
+ export declare class LocalTokenizer {
609
+ private baseTokenizer;
610
+ /**
611
+ * Creates a new LocalTokenizer for Node.js.
612
+ *
613
+ * @param modelName Gemini model name (e.g., 'gemini-2.0-flash-001')
614
+ */
615
+ constructor(modelName: string);
616
+ /**
617
+ * Counts the number of tokens in the given content.
618
+ *
619
+ * @param contents The contents to tokenize
620
+ * @param config Optional configuration for counting tokens
621
+ * @return A CountTokensResult containing the total number of tokens
622
+ */
623
+ countTokens(contents: ContentListUnion, config?: CountTokensConfig): Promise<CountTokensResult>;
624
+ /**
625
+ * Computes detailed token information for the given content.
626
+ *
627
+ * @param contents The contents to tokenize
628
+ * @return A ComputeTokensResult containing token IDs, bytes, and roles
629
+ */
630
+ computeTokens(contents: ContentListUnion): Promise<ComputeTokensResult>;
631
+ }
632
+
633
+ /** The media resolution to use. */
634
+ declare enum MediaResolution {
635
+ /**
636
+ * Media resolution has not been set
637
+ */
638
+ MEDIA_RESOLUTION_UNSPECIFIED = "MEDIA_RESOLUTION_UNSPECIFIED",
639
+ /**
640
+ * Media resolution set to low (64 tokens).
641
+ */
642
+ MEDIA_RESOLUTION_LOW = "MEDIA_RESOLUTION_LOW",
643
+ /**
644
+ * Media resolution set to medium (256 tokens).
645
+ */
646
+ MEDIA_RESOLUTION_MEDIUM = "MEDIA_RESOLUTION_MEDIUM",
647
+ /**
648
+ * Media resolution set to high (zoomed reframing with 256 tokens).
649
+ */
650
+ MEDIA_RESOLUTION_HIGH = "MEDIA_RESOLUTION_HIGH"
651
+ }
652
+
653
+ /** Server content modalities. */
654
+ declare enum Modality {
655
+ /**
656
+ * The modality is unspecified.
657
+ */
658
+ MODALITY_UNSPECIFIED = "MODALITY_UNSPECIFIED",
659
+ /**
660
+ * Indicates the model should return text
661
+ */
662
+ TEXT = "TEXT",
663
+ /**
664
+ * Indicates the model should return images.
665
+ */
666
+ IMAGE = "IMAGE",
667
+ /**
668
+ * Indicates the model should return audio.
669
+ */
670
+ AUDIO = "AUDIO"
671
+ }
672
+
673
+ /** Config for model selection. */
674
+ declare interface ModelSelectionConfig {
675
+ /** Options for feature selection preference. */
676
+ featureSelectionPreference?: FeatureSelectionPreference;
677
+ }
678
+
679
+ /** Configuration for a multi-speaker text-to-speech request. */
680
+ declare interface MultiSpeakerVoiceConfig {
681
+ /** Required. A list of configurations for the voices of the speakers. Exactly two speaker voice configurations must be provided. */
682
+ speakerVoiceConfigs?: SpeakerVoiceConfig[];
683
+ }
684
+
685
+ /** Outcome of the code execution. */
686
+ declare enum Outcome {
687
+ /**
688
+ * Unspecified status. This value should not be used.
689
+ */
690
+ OUTCOME_UNSPECIFIED = "OUTCOME_UNSPECIFIED",
691
+ /**
692
+ * Code execution completed successfully.
693
+ */
694
+ OUTCOME_OK = "OUTCOME_OK",
695
+ /**
696
+ * Code execution finished but with a failure. `stderr` should contain the reason.
697
+ */
698
+ OUTCOME_FAILED = "OUTCOME_FAILED",
699
+ /**
700
+ * Code execution ran for too long, and was cancelled. There may or may not be a partial output present.
701
+ */
702
+ OUTCOME_DEADLINE_EXCEEDED = "OUTCOME_DEADLINE_EXCEEDED"
703
+ }
704
+
705
+ /** A datatype containing media content.
706
+
707
+ Exactly one field within a Part should be set, representing the specific type
708
+ of content being conveyed. Using multiple fields within the same `Part`
709
+ instance is considered invalid. */
710
+ declare interface Part {
711
+ /** Media resolution for the input media.
712
+ */
713
+ mediaResolution?: PartMediaResolution;
714
+ /** Optional. Result of executing the [ExecutableCode]. */
715
+ codeExecutionResult?: CodeExecutionResult;
716
+ /** Optional. Code generated by the model that is meant to be executed. */
717
+ executableCode?: ExecutableCode;
718
+ /** Optional. URI based data. */
719
+ fileData?: FileData;
720
+ /** Optional. A predicted [FunctionCall] returned from the model that contains a string representing the [FunctionDeclaration.name] with the parameters and their values. */
721
+ functionCall?: FunctionCall;
722
+ /** Optional. The result output of a [FunctionCall] that contains a string representing the [FunctionDeclaration.name] and a structured JSON object containing any output from the function call. It is used as context to the model. */
723
+ functionResponse?: FunctionResponse;
724
+ /** Optional. Inlined bytes data. */
725
+ inlineData?: Blob_2;
726
+ /** Optional. Text part (can be code). */
727
+ text?: string;
728
+ /** Optional. Indicates if the part is thought from the model. */
729
+ thought?: boolean;
730
+ /** Optional. An opaque signature for the thought so it can be reused in subsequent requests.
731
+ * @remarks Encoded as base64 string. */
732
+ thoughtSignature?: string;
733
+ /** Optional. Video metadata. The metadata should only be specified while the video data is presented in inline_data or file_data. */
734
+ videoMetadata?: VideoMetadata;
735
+ }
736
+
737
+ /** Partial argument value of the function call. This data type is not supported in Gemini API. */
738
+ declare interface PartialArg {
739
+ /** Optional. Represents a null value. */
740
+ nullValue?: 'NULL_VALUE';
741
+ /** Optional. Represents a double value. */
742
+ numberValue?: number;
743
+ /** Optional. Represents a string value. */
744
+ stringValue?: string;
745
+ /** Optional. Represents a boolean value. */
746
+ boolValue?: boolean;
747
+ /** Required. A JSON Path (RFC 9535) to the argument being streamed. https://datatracker.ietf.org/doc/html/rfc9535. e.g. "$.foo.bar[0].data". */
748
+ jsonPath?: string;
749
+ /** Optional. Whether this is not the last part of the same json_path. If true, another PartialArg message for the current json_path is expected to follow. */
750
+ willContinue?: boolean;
751
+ }
752
+
753
+ /** Media resolution for the input media. */
754
+ declare interface PartMediaResolution {
755
+ /** The tokenization quality used for given media.
756
+ */
757
+ level?: PartMediaResolutionLevel;
758
+ /** Specifies the required sequence length for media tokenization.
759
+ */
760
+ numTokens?: number;
761
+ }
762
+
763
+ /** The tokenization quality used for given media. */
764
+ declare enum PartMediaResolutionLevel {
765
+ /**
766
+ * Media resolution has not been set.
767
+ */
768
+ MEDIA_RESOLUTION_UNSPECIFIED = "MEDIA_RESOLUTION_UNSPECIFIED",
769
+ /**
770
+ * Media resolution set to low.
771
+ */
772
+ MEDIA_RESOLUTION_LOW = "MEDIA_RESOLUTION_LOW",
773
+ /**
774
+ * Media resolution set to medium.
775
+ */
776
+ MEDIA_RESOLUTION_MEDIUM = "MEDIA_RESOLUTION_MEDIUM",
777
+ /**
778
+ * Media resolution set to high.
779
+ */
780
+ MEDIA_RESOLUTION_HIGH = "MEDIA_RESOLUTION_HIGH",
781
+ /**
782
+ * Media resolution set to ultra high.
783
+ */
784
+ MEDIA_RESOLUTION_ULTRA_HIGH = "MEDIA_RESOLUTION_ULTRA_HIGH"
785
+ }
786
+
787
+ declare type PartUnion = Part | string;
788
+
789
+ /** Sites with confidence level chosen & above this value will be blocked from the search results. This enum is not supported in Gemini API. */
790
+ declare enum PhishBlockThreshold {
791
+ /**
792
+ * Defaults to unspecified.
793
+ */
794
+ PHISH_BLOCK_THRESHOLD_UNSPECIFIED = "PHISH_BLOCK_THRESHOLD_UNSPECIFIED",
795
+ /**
796
+ * Blocks Low and above confidence URL that is risky.
797
+ */
798
+ BLOCK_LOW_AND_ABOVE = "BLOCK_LOW_AND_ABOVE",
799
+ /**
800
+ * Blocks Medium and above confidence URL that is risky.
801
+ */
802
+ BLOCK_MEDIUM_AND_ABOVE = "BLOCK_MEDIUM_AND_ABOVE",
803
+ /**
804
+ * Blocks High and above confidence URL that is risky.
805
+ */
806
+ BLOCK_HIGH_AND_ABOVE = "BLOCK_HIGH_AND_ABOVE",
807
+ /**
808
+ * Blocks Higher and above confidence URL that is risky.
809
+ */
810
+ BLOCK_HIGHER_AND_ABOVE = "BLOCK_HIGHER_AND_ABOVE",
811
+ /**
812
+ * Blocks Very high and above confidence URL that is risky.
813
+ */
814
+ BLOCK_VERY_HIGH_AND_ABOVE = "BLOCK_VERY_HIGH_AND_ABOVE",
815
+ /**
816
+ * Blocks Extremely high confidence URL that is risky.
817
+ */
818
+ BLOCK_ONLY_EXTREMELY_HIGH = "BLOCK_ONLY_EXTREMELY_HIGH"
819
+ }
820
+
821
+ /** The configuration for the prebuilt speaker to use. */
822
+ declare interface PrebuiltVoiceConfig {
823
+ /** The name of the preset voice to use. */
824
+ voiceName?: string;
825
+ }
826
+
827
+ /** Specifies the context retrieval config. This data type is not supported in Gemini API. */
828
+ declare interface RagRetrievalConfig {
829
+ /** Optional. Config for filters. */
830
+ filter?: RagRetrievalConfigFilter;
831
+ /** Optional. Config for Hybrid Search. */
832
+ hybridSearch?: RagRetrievalConfigHybridSearch;
833
+ /** Optional. Config for ranking and reranking. */
834
+ ranking?: RagRetrievalConfigRanking;
835
+ /** Optional. The number of contexts to retrieve. */
836
+ topK?: number;
837
+ }
838
+
839
+ /** Config for filters. This data type is not supported in Gemini API. */
840
+ declare interface RagRetrievalConfigFilter {
841
+ /** Optional. String for metadata filtering. */
842
+ metadataFilter?: string;
843
+ /** Optional. Only returns contexts with vector distance smaller than the threshold. */
844
+ vectorDistanceThreshold?: number;
845
+ /** Optional. Only returns contexts with vector similarity larger than the threshold. */
846
+ vectorSimilarityThreshold?: number;
847
+ }
848
+
849
+ /** Config for Hybrid Search. This data type is not supported in Gemini API. */
850
+ declare interface RagRetrievalConfigHybridSearch {
851
+ /** Optional. Alpha value controls the weight between dense and sparse vector search results. The range is [0, 1], while 0 means sparse vector search only and 1 means dense vector search only. The default value is 0.5 which balances sparse and dense vector search equally. */
852
+ alpha?: number;
853
+ }
854
+
855
+ /** Config for ranking and reranking. This data type is not supported in Gemini API. */
856
+ declare interface RagRetrievalConfigRanking {
857
+ /** Optional. Config for LlmRanker. */
858
+ llmRanker?: RagRetrievalConfigRankingLlmRanker;
859
+ /** Optional. Config for Rank Service. */
860
+ rankService?: RagRetrievalConfigRankingRankService;
861
+ }
862
+
863
+ /** Config for LlmRanker. This data type is not supported in Gemini API. */
864
+ declare interface RagRetrievalConfigRankingLlmRanker {
865
+ /** Optional. The model name used for ranking. See [Supported models](https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/inference#supported-models). */
866
+ modelName?: string;
867
+ }
868
+
869
+ /** Config for Rank Service. This data type is not supported in Gemini API. */
870
+ declare interface RagRetrievalConfigRankingRankService {
871
+ /** Optional. The model name of the rank service. Format: `semantic-ranker-512@latest` */
872
+ modelName?: string;
873
+ }
874
+
875
+ /** ReplicatedVoiceConfig is used to configure replicated voice. */
876
+ declare interface ReplicatedVoiceConfig {
877
+ /** The mime type of the replicated voice.
878
+ */
879
+ mimeType?: string;
880
+ /** The sample audio of the replicated voice.
881
+
882
+ * @remarks Encoded as base64 string. */
883
+ voiceSampleAudio?: string;
884
+ }
885
+
886
+ /** Resource scope. */
887
+ declare enum ResourceScope {
888
+ /**
889
+ * When setting base_url, this value configures resource scope to be the collection.
890
+ The resource name will not include api version, project, or location.
891
+ For example, if base_url is set to "https://aiplatform.googleapis.com",
892
+ then the resource name for a Model would be
893
+ "https://aiplatform.googleapis.com/publishers/google/models/gemini-3-pro-preview
894
+ */
895
+ COLLECTION = "COLLECTION"
896
+ }
897
+
898
+ /** Defines a retrieval tool that model can call to access external knowledge. This data type is not supported in Gemini API. */
899
+ declare interface Retrieval {
900
+ /** Optional. Deprecated. This option is no longer supported. */
901
+ disableAttribution?: boolean;
902
+ /** Use data source powered by external API for grounding. */
903
+ externalApi?: ExternalApi;
904
+ /** Set to use data source powered by Vertex AI Search. */
905
+ vertexAiSearch?: VertexAISearch;
906
+ /** Set to use data source powered by Vertex RAG store. User data is uploaded via the VertexRagDataService. */
907
+ vertexRagStore?: VertexRagStore;
908
+ }
909
+
910
+ /** Schema is used to define the format of input/output data.
911
+
912
+ Represents a select subset of an [OpenAPI 3.0 schema
913
+ object](https://spec.openapis.org/oas/v3.0.3#schema-object). More fields may
914
+ be added in the future as needed. */
915
+ declare interface Schema {
916
+ /** Optional. The value should be validated against any (one or more) of the subschemas in the list. */
917
+ anyOf?: Schema[];
918
+ /** Optional. Default value of the data. */
919
+ default?: unknown;
920
+ /** Optional. The description of the data. */
921
+ description?: string;
922
+ /** Optional. Possible values of the element of primitive type with enum format. Examples: 1. We can define direction as : {type:STRING, format:enum, enum:["EAST", NORTH", "SOUTH", "WEST"]} 2. We can define apartment number as : {type:INTEGER, format:enum, enum:["101", "201", "301"]} */
923
+ enum?: string[];
924
+ /** Optional. Example of the object. Will only populated when the object is the root. */
925
+ example?: unknown;
926
+ /** Optional. The format of the data. Supported formats: for NUMBER type: "float", "double" for INTEGER type: "int32", "int64" for STRING type: "email", "byte", etc */
927
+ format?: string;
928
+ /** Optional. SCHEMA FIELDS FOR TYPE ARRAY Schema of the elements of Type.ARRAY. */
929
+ items?: Schema;
930
+ /** Optional. Maximum number of the elements for Type.ARRAY. */
931
+ maxItems?: string;
932
+ /** Optional. Maximum length of the Type.STRING */
933
+ maxLength?: string;
934
+ /** Optional. Maximum number of the properties for Type.OBJECT. */
935
+ maxProperties?: string;
936
+ /** Optional. Maximum value of the Type.INTEGER and Type.NUMBER */
937
+ maximum?: number;
938
+ /** Optional. Minimum number of the elements for Type.ARRAY. */
939
+ minItems?: string;
940
+ /** Optional. SCHEMA FIELDS FOR TYPE STRING Minimum length of the Type.STRING */
941
+ minLength?: string;
942
+ /** Optional. Minimum number of the properties for Type.OBJECT. */
943
+ minProperties?: string;
944
+ /** Optional. SCHEMA FIELDS FOR TYPE INTEGER and NUMBER Minimum value of the Type.INTEGER and Type.NUMBER */
945
+ minimum?: number;
946
+ /** Optional. Indicates if the value may be null. */
947
+ nullable?: boolean;
948
+ /** Optional. Pattern of the Type.STRING to restrict a string to a regular expression. */
949
+ pattern?: string;
950
+ /** Optional. SCHEMA FIELDS FOR TYPE OBJECT Properties of Type.OBJECT. */
951
+ properties?: Record<string, Schema>;
952
+ /** Optional. The order of the properties. Not a standard field in open api spec. Only used to support the order of the properties. */
953
+ propertyOrdering?: string[];
954
+ /** Optional. Required properties of Type.OBJECT. */
955
+ required?: string[];
956
+ /** Optional. The title of the Schema. */
957
+ title?: string;
958
+ /** Optional. The type of the data. */
959
+ type?: Type;
960
+ }
961
+
962
+ /** Configuration for a single speaker in a multi speaker setup. */
963
+ declare interface SpeakerVoiceConfig {
964
+ /** Required. The name of the speaker. This should be the same as the speaker name used in the prompt. */
965
+ speaker?: string;
966
+ /** Required. The configuration for the voice of this speaker. */
967
+ voiceConfig?: VoiceConfig;
968
+ }
969
+
970
+ declare interface SpeechConfig {
971
+ /** Configuration for the voice of the response. */
972
+ voiceConfig?: VoiceConfig;
973
+ /** Optional. Language code (ISO 639. e.g. en-US) for the speech synthesization. */
974
+ languageCode?: string;
975
+ /** The configuration for a multi-speaker text-to-speech request. This field is mutually exclusive with `voice_config`. */
976
+ multiSpeakerVoiceConfig?: MultiSpeakerVoiceConfig;
977
+ }
978
+
979
+ /** The thinking features configuration. */
980
+ declare interface ThinkingConfig {
981
+ /** Indicates whether to include thoughts in the response. If true, thoughts are returned only if the model supports thought and thoughts are available.
982
+ */
983
+ includeThoughts?: boolean;
984
+ /** Indicates the thinking budget in tokens. 0 is DISABLED. -1 is AUTOMATIC. The default values and allowed ranges are model dependent.
985
+ */
986
+ thinkingBudget?: number;
987
+ /** Optional. The number of thoughts tokens that the model should generate. */
988
+ thinkingLevel?: ThinkingLevel;
989
+ }
990
+
991
+ /** The number of thoughts tokens that the model should generate. */
992
+ declare enum ThinkingLevel {
993
+ /**
994
+ * Unspecified thinking level.
995
+ */
996
+ THINKING_LEVEL_UNSPECIFIED = "THINKING_LEVEL_UNSPECIFIED",
997
+ /**
998
+ * Low thinking level.
999
+ */
1000
+ LOW = "LOW",
1001
+ /**
1002
+ * Medium thinking level.
1003
+ */
1004
+ MEDIUM = "MEDIUM",
1005
+ /**
1006
+ * High thinking level.
1007
+ */
1008
+ HIGH = "HIGH",
1009
+ /**
1010
+ * MINIMAL thinking level.
1011
+ */
1012
+ MINIMAL = "MINIMAL"
1013
+ }
1014
+
1015
+ /** Tokens info with a list of tokens and the corresponding list of token ids. */
1016
+ export declare interface TokensInfo {
1017
+ /** Optional fields for the role from the corresponding Content. */
1018
+ role?: string;
1019
+ /** A list of token ids from the input. */
1020
+ tokenIds?: string[];
1021
+ /** A list of tokens from the input.
1022
+ * @remarks Encoded as base64 string. */
1023
+ tokens?: string[];
1024
+ }
1025
+
1026
+ /** Tool details of a tool that the model may use to generate a response. */
1027
+ declare interface Tool {
1028
+ /** 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. */
1029
+ retrieval?: Retrieval;
1030
+ /** Optional. Tool to support the model interacting directly with the
1031
+ computer. If enabled, it automatically populates computer-use specific
1032
+ Function Declarations. */
1033
+ computerUse?: ComputerUse;
1034
+ /** Optional. Tool to retrieve knowledge from the File Search Stores. */
1035
+ fileSearch?: FileSearch;
1036
+ /** Optional. CodeExecution tool type. Enables the model to execute code as part of generation. */
1037
+ codeExecution?: ToolCodeExecution;
1038
+ /** Optional. Tool to support searching public web data, powered by Vertex AI Search and Sec4 compliance. This field is not supported in Gemini API. */
1039
+ enterpriseWebSearch?: EnterpriseWebSearch;
1040
+ /** Optional. Function tool type. One or more function declarations to be passed to the model along with the current user query. Model may decide to call a subset of these functions by populating FunctionCall in the response. User should provide a FunctionResponse for each function call in the next turn. Based on the function responses, Model will generate the final response back to the user. Maximum 512 function declarations can be provided. */
1041
+ functionDeclarations?: FunctionDeclaration[];
1042
+ /** Optional. GoogleMaps tool type. Tool to support Google Maps in Model. */
1043
+ googleMaps?: GoogleMaps;
1044
+ /** Optional. GoogleSearch tool type. Tool to support Google Search in Model. Powered by Google. */
1045
+ googleSearch?: GoogleSearch;
1046
+ /** Optional. Specialized retrieval tool that is powered by Google Search. */
1047
+ googleSearchRetrieval?: GoogleSearchRetrieval;
1048
+ /** Optional. Tool to support URL context retrieval. */
1049
+ urlContext?: UrlContext;
1050
+ }
1051
+
1052
+ /** Tool that executes code generated by the model, and automatically returns the result to the model. See also [ExecutableCode]and [CodeExecutionResult] which are input and output to this tool. This data type is not supported in Gemini API. */
1053
+ declare interface ToolCodeExecution {
1054
+ }
1055
+
1056
+ /** The type of the data. */
1057
+ declare enum Type {
1058
+ /**
1059
+ * Not specified, should not be used.
1060
+ */
1061
+ TYPE_UNSPECIFIED = "TYPE_UNSPECIFIED",
1062
+ /**
1063
+ * OpenAPI string type
1064
+ */
1065
+ STRING = "STRING",
1066
+ /**
1067
+ * OpenAPI number type
1068
+ */
1069
+ NUMBER = "NUMBER",
1070
+ /**
1071
+ * OpenAPI integer type
1072
+ */
1073
+ INTEGER = "INTEGER",
1074
+ /**
1075
+ * OpenAPI boolean type
1076
+ */
1077
+ BOOLEAN = "BOOLEAN",
1078
+ /**
1079
+ * OpenAPI array type
1080
+ */
1081
+ ARRAY = "ARRAY",
1082
+ /**
1083
+ * OpenAPI object type
1084
+ */
1085
+ OBJECT = "OBJECT",
1086
+ /**
1087
+ * Null type
1088
+ */
1089
+ NULL = "NULL"
1090
+ }
1091
+
1092
+ /** Tool to support URL context. */
1093
+ declare interface UrlContext {
1094
+ }
1095
+
1096
+ /** Retrieve from Vertex AI Search datastore or engine for grounding. datastore and engine are mutually exclusive. See https://cloud.google.com/products/agent-builder. This data type is not supported in Gemini API. */
1097
+ declare interface VertexAISearch {
1098
+ /** Specifications that define the specific DataStores to be searched, along with configurations for those data stores. This is only considered for Engines with multiple data stores. It should only be set if engine is used. */
1099
+ dataStoreSpecs?: VertexAISearchDataStoreSpec[];
1100
+ /** Optional. Fully-qualified Vertex AI Search data store resource ID. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{dataStore}` */
1101
+ datastore?: string;
1102
+ /** Optional. Fully-qualified Vertex AI Search engine resource ID. Format: `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}` */
1103
+ engine?: string;
1104
+ /** Optional. Filter strings to be passed to the search API. */
1105
+ filter?: string;
1106
+ /** Optional. Number of search results to return per query. The default value is 10. The maximumm allowed value is 10. */
1107
+ maxResults?: number;
1108
+ }
1109
+
1110
+ /** Define data stores within engine to filter on in a search call and configurations for those data stores. For more information, see https://cloud.google.com/generative-ai-app-builder/docs/reference/rpc/google.cloud.discoveryengine.v1#datastorespec. This data type is not supported in Gemini API. */
1111
+ declare interface VertexAISearchDataStoreSpec {
1112
+ /** Full resource name of DataStore, such as Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{dataStore}` */
1113
+ dataStore?: string;
1114
+ /** Optional. Filter specification to filter documents in the data store specified by data_store field. For more information on filtering, see [Filtering](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata) */
1115
+ filter?: string;
1116
+ }
1117
+
1118
+ /** Retrieve from Vertex RAG Store for grounding. This data type is not supported in Gemini API. */
1119
+ declare interface VertexRagStore {
1120
+ /** Optional. Deprecated. Please use rag_resources instead. */
1121
+ ragCorpora?: string[];
1122
+ /** Optional. The representation of the rag source. It can be used to specify corpus only or ragfiles. Currently only support one corpus or multiple files from one corpus. In the future we may open up multiple corpora support. */
1123
+ ragResources?: VertexRagStoreRagResource[];
1124
+ /** Optional. The retrieval config for the Rag query. */
1125
+ ragRetrievalConfig?: RagRetrievalConfig;
1126
+ /** Optional. Number of top k results to return from the selected corpora. */
1127
+ similarityTopK?: number;
1128
+ /** Optional. Currently only supported for Gemini Multimodal Live API. In Gemini Multimodal Live API, if `store_context` bool is specified, Gemini will leverage it to automatically memorize the interactions between the client and Gemini, and retrieve context when needed to augment the response generation for users' ongoing and future interactions. */
1129
+ storeContext?: boolean;
1130
+ /** Optional. Only return results with vector distance smaller than the threshold. */
1131
+ vectorDistanceThreshold?: number;
1132
+ }
1133
+
1134
+ /** The definition of the Rag resource. This data type is not supported in Gemini API. */
1135
+ declare interface VertexRagStoreRagResource {
1136
+ /** Optional. RagCorpora resource name. Format: `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}` */
1137
+ ragCorpus?: string;
1138
+ /** Optional. rag_file_id. The files should be in the same rag_corpus set in rag_corpus field. */
1139
+ ragFileIds?: string[];
1140
+ }
1141
+
1142
+ /** Metadata describes the input video content. */
1143
+ declare interface VideoMetadata {
1144
+ /** Optional. The end offset of the video. */
1145
+ endOffset?: string;
1146
+ /** Optional. The frame rate of the video sent to the model. If not specified, the default value will be 1.0. The fps range is (0.0, 24.0]. */
1147
+ fps?: number;
1148
+ /** Optional. The start offset of the video. */
1149
+ startOffset?: string;
1150
+ }
1151
+
1152
+ declare interface VoiceConfig {
1153
+ /** If true, the model will use a replicated voice for the response. */
1154
+ replicatedVoiceConfig?: ReplicatedVoiceConfig;
1155
+ /** The configuration for the prebuilt voice to use. */
1156
+ prebuiltVoiceConfig?: PrebuiltVoiceConfig;
1157
+ }
1158
+
1159
+ export { }