@google/genai 2.4.0 → 2.6.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.
- package/dist/genai.d.ts +148 -72
- package/dist/index.cjs +470 -36
- package/dist/index.mjs +471 -37
- package/dist/index.mjs.map +1 -1
- package/dist/node/index.cjs +470 -36
- package/dist/node/index.mjs +471 -37
- package/dist/node/index.mjs.map +1 -1
- package/dist/node/node.d.ts +148 -72
- package/dist/tokenizer/node.cjs +56 -16
- package/dist/tokenizer/node.d.ts +26 -21
- package/dist/tokenizer/node.mjs +56 -16
- package/dist/tokenizer/node.mjs.map +1 -1
- package/dist/vertex_internal/index.cjs +57 -17
- package/dist/vertex_internal/index.cjs.map +1 -1
- package/dist/vertex_internal/index.d.ts +143 -67
- package/dist/vertex_internal/index.js +57 -17
- package/dist/vertex_internal/index.js.map +1 -1
- package/dist/web/index.mjs +471 -37
- package/dist/web/index.mjs.map +1 -1
- package/dist/web/web.d.ts +148 -72
- package/package.json +1 -1
|
@@ -565,7 +565,7 @@ declare interface BatchJobOutputInfo {
|
|
|
565
565
|
vertexMultimodalDatasetName?: string;
|
|
566
566
|
/** The full path of the Cloud Storage directory created, into which the prediction output is written. */
|
|
567
567
|
gcsOutputDirectory?: string;
|
|
568
|
-
/** The name of the BigQuery table created, in `
|
|
568
|
+
/** The name of the BigQuery table created, in `predictions_TIMESTAMP` format, into which the prediction output is written. */
|
|
569
569
|
bigqueryOutputTable?: string;
|
|
570
570
|
}
|
|
571
571
|
|
|
@@ -864,15 +864,13 @@ declare interface CitationMetadata {
|
|
|
864
864
|
citations?: Citation[];
|
|
865
865
|
}
|
|
866
866
|
|
|
867
|
-
/** Result of executing the `
|
|
868
|
-
|
|
869
|
-
Generated only when the `CodeExecution` tool is used. */
|
|
867
|
+
/** Result of executing the ExecutableCode. Generated only when the `CodeExecution` tool is used. */
|
|
870
868
|
declare interface CodeExecutionResult {
|
|
871
869
|
/** Required. Outcome of the code execution. */
|
|
872
870
|
outcome?: Outcome;
|
|
873
871
|
/** Optional. Contains stdout when code execution is successful, stderr or other description otherwise. */
|
|
874
872
|
output?: string;
|
|
875
|
-
/** The identifier of the `ExecutableCode` part this result is for. Only populated if the corresponding `ExecutableCode` has an id. */
|
|
873
|
+
/** Optional. The identifier of the `ExecutableCode` part this result is for. Only populated if the corresponding `ExecutableCode` has an id. This field is not supported in Vertex AI. */
|
|
876
874
|
id?: string;
|
|
877
875
|
}
|
|
878
876
|
|
|
@@ -898,6 +896,9 @@ declare interface ComputerUse {
|
|
|
898
896
|
1. Using a more restricted / different action space.
|
|
899
897
|
2. Improving the definitions / instructions of predefined functions. */
|
|
900
898
|
excludedPredefinedFunctions?: string[];
|
|
899
|
+
/** Optional. Whether enable the prompt injection detection check on computer-use request.
|
|
900
|
+
*/
|
|
901
|
+
enablePromptInjectionDetection?: boolean;
|
|
901
902
|
}
|
|
902
903
|
|
|
903
904
|
/** Optional parameters for computing tokens. */
|
|
@@ -1722,35 +1723,51 @@ declare interface DistillationDataStats {
|
|
|
1722
1723
|
trainingDatasetStats?: DatasetStats;
|
|
1723
1724
|
}
|
|
1724
1725
|
|
|
1725
|
-
/**
|
|
1726
|
+
/** Distillation hyperparameters for tuning. */
|
|
1726
1727
|
declare interface DistillationHyperParameters {
|
|
1727
|
-
/**
|
|
1728
|
+
/** The size of the adapter. Can be 'small', 'medium', or 'large'. */
|
|
1728
1729
|
adapterSize?: AdapterSize;
|
|
1729
|
-
/**
|
|
1730
|
+
/** Number of complete passes the model makes over the entire training dataset
|
|
1731
|
+
during training. */
|
|
1730
1732
|
epochCount?: string;
|
|
1731
|
-
/**
|
|
1733
|
+
/** Multiplier for adjusting the default learning rate. */
|
|
1732
1734
|
learningRateMultiplier?: number;
|
|
1733
|
-
/**
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1735
|
+
/** Generation config for Distillation teacher model sampling. Only the
|
|
1736
|
+
following fields are supported for distillation teacher samplings:
|
|
1737
|
+
- temperature
|
|
1738
|
+
- top_p
|
|
1739
|
+
- top_k
|
|
1740
|
+
- candidate_count
|
|
1741
|
+
- thinking_config */
|
|
1742
|
+
generationConfig?: GenerationConfig;
|
|
1743
|
+
/** The learning rate for distillation tuning. */
|
|
1738
1744
|
learningRate?: number;
|
|
1745
|
+
/** Batch size for tuning. This feature is only available for open
|
|
1746
|
+
source models. */
|
|
1747
|
+
batchSize?: number;
|
|
1739
1748
|
}
|
|
1740
1749
|
|
|
1741
|
-
/**
|
|
1750
|
+
/** Distillation sampling spec for tuning. */
|
|
1742
1751
|
declare interface DistillationSamplingSpec {
|
|
1743
|
-
/**
|
|
1752
|
+
/** The base teacher model that is being distilled. See [Supported
|
|
1753
|
+
models](https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/tuning#supported_models). */
|
|
1744
1754
|
baseTeacherModel?: string;
|
|
1745
|
-
/**
|
|
1755
|
+
/** The resource name of the Tuned teacher model. Format:
|
|
1756
|
+
`projects/{project}/locations/{location}/models/{model}`. */
|
|
1746
1757
|
tunedTeacherModelSource?: string;
|
|
1747
|
-
/**
|
|
1758
|
+
/** Cloud Storage path to file containing validation dataset for distillation.
|
|
1759
|
+
The dataset must be formatted as a JSONL file. */
|
|
1748
1760
|
validationDatasetUri?: string;
|
|
1761
|
+
/** Cloud Storage path to file containing prompt dataset for distillation.
|
|
1762
|
+
The dataset must be formatted as a JSONL file. */
|
|
1763
|
+
promptDatasetUri?: string;
|
|
1764
|
+
/** Hyperparameters for distillation tuning. */
|
|
1765
|
+
hyperparameters?: DistillationHyperParameters;
|
|
1749
1766
|
}
|
|
1750
1767
|
|
|
1751
1768
|
/** Distillation tuning spec for tuning. */
|
|
1752
1769
|
declare interface DistillationSpec {
|
|
1753
|
-
/**
|
|
1770
|
+
/** Optional. Cloud Storage path to file containing prompt dataset for distillation. The dataset must be formatted as a JSONL file. */
|
|
1754
1771
|
promptDatasetUri?: string;
|
|
1755
1772
|
/** The base teacher model that is being distilled. See [Supported models](https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/tuning#supported_models). */
|
|
1756
1773
|
baseTeacherModel?: string;
|
|
@@ -1766,7 +1783,7 @@ declare interface DistillationSpec {
|
|
|
1766
1783
|
tunedTeacherModelSource?: string;
|
|
1767
1784
|
/** Optional. Cloud Storage path to file containing validation dataset for tuning. The dataset must be formatted as a JSONL file. */
|
|
1768
1785
|
validationDatasetUri?: string;
|
|
1769
|
-
/**
|
|
1786
|
+
/** Optional. Specifies the tuning mode for distillation (sft part). This feature is only available for open source models. */
|
|
1770
1787
|
tuningMode?: TuningMode;
|
|
1771
1788
|
}
|
|
1772
1789
|
|
|
@@ -1978,15 +1995,6 @@ declare interface EmbedContentBatch {
|
|
|
1978
1995
|
|
|
1979
1996
|
/** Optional parameters for the embed_content method. */
|
|
1980
1997
|
declare interface EmbedContentConfig {
|
|
1981
|
-
/** Used to override HTTP request options. */
|
|
1982
|
-
httpOptions?: HttpOptions;
|
|
1983
|
-
/** Abort signal which can be used to cancel the request.
|
|
1984
|
-
|
|
1985
|
-
NOTE: AbortSignal is a client-only operation. Using it to cancel an
|
|
1986
|
-
operation will not cancel the request in the service. You will still
|
|
1987
|
-
be charged usage for any applicable operations.
|
|
1988
|
-
*/
|
|
1989
|
-
abortSignal?: AbortSignal;
|
|
1990
1998
|
/** Type of task for which the embedding will be used.
|
|
1991
1999
|
*/
|
|
1992
2000
|
taskType?: string;
|
|
@@ -2016,6 +2024,15 @@ declare interface EmbedContentConfig {
|
|
|
2016
2024
|
Only applicable to Gemini Embedding 2 models.
|
|
2017
2025
|
*/
|
|
2018
2026
|
audioTrackExtraction?: boolean;
|
|
2027
|
+
/** Used to override HTTP request options. */
|
|
2028
|
+
httpOptions?: HttpOptions;
|
|
2029
|
+
/** Abort signal which can be used to cancel the request.
|
|
2030
|
+
|
|
2031
|
+
NOTE: AbortSignal is a client-only operation. Using it to cancel an
|
|
2032
|
+
operation will not cancel the request in the service. You will still
|
|
2033
|
+
be charged usage for any applicable operations.
|
|
2034
|
+
*/
|
|
2035
|
+
abortSignal?: AbortSignal;
|
|
2019
2036
|
}
|
|
2020
2037
|
|
|
2021
2038
|
/** Request-level metadata for the Gemini Enterprise Agent Platform Embed Content API. */
|
|
@@ -2148,7 +2165,15 @@ declare enum Environment {
|
|
|
2148
2165
|
/**
|
|
2149
2166
|
* Operates in a web browser.
|
|
2150
2167
|
*/
|
|
2151
|
-
ENVIRONMENT_BROWSER = "ENVIRONMENT_BROWSER"
|
|
2168
|
+
ENVIRONMENT_BROWSER = "ENVIRONMENT_BROWSER",
|
|
2169
|
+
/**
|
|
2170
|
+
* Operates in a mobile environment.
|
|
2171
|
+
*/
|
|
2172
|
+
ENVIRONMENT_MOBILE = "ENVIRONMENT_MOBILE",
|
|
2173
|
+
/**
|
|
2174
|
+
* Operates in a desktop environment.
|
|
2175
|
+
*/
|
|
2176
|
+
ENVIRONMENT_DESKTOP = "ENVIRONMENT_DESKTOP"
|
|
2152
2177
|
}
|
|
2153
2178
|
|
|
2154
2179
|
/** The results from an evaluation run performed by the EvaluationService. This data type is not supported in Gemini API. */
|
|
@@ -2187,17 +2212,13 @@ declare interface ExactMatchMetricValue {
|
|
|
2187
2212
|
score?: number;
|
|
2188
2213
|
}
|
|
2189
2214
|
|
|
2190
|
-
/**
|
|
2191
|
-
|
|
2192
|
-
Only generated when using the `CodeExecution` tool, in which the code will
|
|
2193
|
-
be automatically executed, and a corresponding `CodeExecutionResult` will
|
|
2194
|
-
also be generated. */
|
|
2215
|
+
/** 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. */
|
|
2195
2216
|
declare interface ExecutableCode {
|
|
2196
2217
|
/** Required. The code to be executed. */
|
|
2197
2218
|
code?: string;
|
|
2198
2219
|
/** Required. Programming language of the `code`. */
|
|
2199
2220
|
language?: Language;
|
|
2200
|
-
/** Unique identifier of the `ExecutableCode` part. The server returns the `CodeExecutionResult` with the matching `id`. */
|
|
2221
|
+
/** Optional. Unique identifier of the `ExecutableCode` part. The server returns the `CodeExecutionResult` with the matching `id`. This field is not supported in Vertex AI. */
|
|
2201
2222
|
id?: string;
|
|
2202
2223
|
}
|
|
2203
2224
|
|
|
@@ -2314,22 +2335,21 @@ declare interface FileSearch {
|
|
|
2314
2335
|
|
|
2315
2336
|
/** A collection of Documents. */
|
|
2316
2337
|
declare interface FileSearchStore {
|
|
2317
|
-
/** The resource name
|
|
2338
|
+
/** Output only. Immutable. Identifier. The `FileSearchStore` resource name. It is an ID (name excluding the "fileSearchStores/" prefix) that can contain up to 40 characters that are lowercase alphanumeric or dashes (-). It is output only. The unique name will be derived from `display_name` along with a 12 character random suffix. Example: `fileSearchStores/my-awesome-file-search-store-123a456b789c` If `display_name` is not provided, the name will be randomly generated. */
|
|
2318
2339
|
name?: string;
|
|
2319
|
-
/** The human-readable display name for the FileSearchStore. */
|
|
2340
|
+
/** Optional. The human-readable display name for the `FileSearchStore`. The display name must be no more than 512 characters in length, including spaces. Example: "Docs on Semantic Retriever". */
|
|
2320
2341
|
displayName?: string;
|
|
2321
|
-
/** The Timestamp of when the FileSearchStore was created. */
|
|
2342
|
+
/** Output only. The Timestamp of when the `FileSearchStore` was created. */
|
|
2322
2343
|
createTime?: string;
|
|
2323
|
-
/** The Timestamp of when the FileSearchStore was last updated. */
|
|
2344
|
+
/** Output only. The Timestamp of when the `FileSearchStore` was last updated. */
|
|
2324
2345
|
updateTime?: string;
|
|
2325
|
-
/** The number of documents in the FileSearchStore that are active and ready for retrieval. */
|
|
2346
|
+
/** Output only. The number of documents in the `FileSearchStore` that are active and ready for retrieval. */
|
|
2326
2347
|
activeDocumentsCount?: string;
|
|
2327
|
-
/** The number of documents in the FileSearchStore that are being processed. */
|
|
2348
|
+
/** Output only. The number of documents in the `FileSearchStore` that are being processed. */
|
|
2328
2349
|
pendingDocumentsCount?: string;
|
|
2329
|
-
/** The number of documents in the FileSearchStore that have failed processing. */
|
|
2350
|
+
/** Output only. The number of documents in the `FileSearchStore` that have failed processing. */
|
|
2330
2351
|
failedDocumentsCount?: string;
|
|
2331
|
-
/** The size of raw bytes ingested into the FileSearchStore
|
|
2332
|
-
total size of all the documents in the FileSearchStore. */
|
|
2352
|
+
/** Output only. The size of raw bytes ingested into the `FileSearchStore`. This is the total size of all the documents in the `FileSearchStore`. */
|
|
2333
2353
|
sizeBytes?: string;
|
|
2334
2354
|
/** The embedding model used by the FileSearchStore. */
|
|
2335
2355
|
embeddingModel?: string;
|
|
@@ -2469,9 +2489,9 @@ declare interface FunctionCall {
|
|
|
2469
2489
|
/** The unique id of the function call. If populated, the client to execute the
|
|
2470
2490
|
`function_call` and return the response with the matching `id`. */
|
|
2471
2491
|
id?: string;
|
|
2472
|
-
/** Optional. The function parameters and values in JSON object format. See
|
|
2492
|
+
/** Optional. The function parameters and values in JSON object format. See FunctionDeclaration.parameters for parameter details. */
|
|
2473
2493
|
args?: Record<string, unknown>;
|
|
2474
|
-
/** Optional. The name of the function to call. Matches
|
|
2494
|
+
/** Optional. The name of the function to call. Matches FunctionDeclaration.name. */
|
|
2475
2495
|
name?: string;
|
|
2476
2496
|
/** 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. */
|
|
2477
2497
|
partialArgs?: PartialArg[];
|
|
@@ -2481,11 +2501,11 @@ declare interface FunctionCall {
|
|
|
2481
2501
|
|
|
2482
2502
|
/** Function calling config. */
|
|
2483
2503
|
declare interface FunctionCallingConfig {
|
|
2484
|
-
/** Optional. Function names to call. Only set when the Mode is ANY. Function names should match
|
|
2504
|
+
/** Optional. Function names to call. Only set when the Mode is ANY. Function names should match FunctionDeclaration.name. With mode set to ANY, model will predict a function call from the set of function names provided. */
|
|
2485
2505
|
allowedFunctionNames?: string[];
|
|
2486
2506
|
/** Optional. Function calling mode. */
|
|
2487
2507
|
mode?: FunctionCallingConfigMode;
|
|
2488
|
-
/** Optional. When set to true, arguments of a single function call will be streamed out in multiple parts/contents/responses. Partial parameter results will be returned in the
|
|
2508
|
+
/** Optional. When set to true, arguments of a single function call will be streamed out in multiple parts/contents/responses. Partial parameter results will be returned in the `FunctionCall.partial_args` field. This field is not supported in Gemini API. */
|
|
2489
2509
|
streamFunctionCallArguments?: boolean;
|
|
2490
2510
|
}
|
|
2491
2511
|
|
|
@@ -2517,7 +2537,7 @@ declare enum FunctionCallingConfigMode {
|
|
|
2517
2537
|
declare interface FunctionDeclaration {
|
|
2518
2538
|
/** Optional. Description and purpose of the function. Model uses it to decide how and whether to call the function. */
|
|
2519
2539
|
description?: string;
|
|
2520
|
-
/** 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, colons and dashes, with a maximum length of
|
|
2540
|
+
/** 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, colons and dashes, with a maximum length of 128. */
|
|
2521
2541
|
name?: string;
|
|
2522
2542
|
/** 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 */
|
|
2523
2543
|
parameters?: Schema;
|
|
@@ -2542,7 +2562,7 @@ declare class FunctionResponse {
|
|
|
2542
2562
|
parts?: FunctionResponsePart[];
|
|
2543
2563
|
/** Optional. The id of the function call this response is for. Populated by the client to match the corresponding function call `id`. */
|
|
2544
2564
|
id?: string;
|
|
2545
|
-
/** Required. The name of the function to call. Matches
|
|
2565
|
+
/** Required. The name of the function to call. Matches FunctionDeclaration.name and FunctionCall.name. */
|
|
2546
2566
|
name?: string;
|
|
2547
2567
|
/** 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. */
|
|
2548
2568
|
response?: Record<string, unknown>;
|
|
@@ -3270,7 +3290,7 @@ declare interface GenerationConfig {
|
|
|
3270
3290
|
presencePenalty?: number;
|
|
3271
3291
|
/** Optional. If set to true, the log probabilities of the output tokens are returned. Log probabilities are the logarithm of the probability of a token appearing in the output. A higher log probability means the token is more likely to be generated. This can be useful for analyzing the model's confidence in its own output and for debugging. */
|
|
3272
3292
|
responseLogprobs?: boolean;
|
|
3273
|
-
/** Optional. The IANA standard MIME type of the response. The model will generate output that conforms to this MIME type. Supported values include 'text/plain' (default) and 'application/json'. The model needs to be prompted to output the appropriate response type, otherwise the behavior is undefined.
|
|
3293
|
+
/** Optional. The IANA standard MIME type of the response. The model will generate output that conforms to this MIME type. Supported values include 'text/plain' (default) and 'application/json'. The model needs to be prompted to output the appropriate response type, otherwise the behavior is undefined. */
|
|
3274
3294
|
responseMimeType?: string;
|
|
3275
3295
|
/** Optional. The modalities of the response. The model will generate a response that includes all the specified modalities. For example, if this is set to `[TEXT, IMAGE]`, the response will include both text and an image. */
|
|
3276
3296
|
responseModalities?: Modality[];
|
|
@@ -3677,9 +3697,9 @@ declare interface GroundingChunkRetrievedContext {
|
|
|
3677
3697
|
customMetadata?: GroundingChunkCustomMetadata[];
|
|
3678
3698
|
/** Optional. Name of the `FileSearchStore` containing the document. Example: `fileSearchStores/123`. This field is not supported in Vertex AI. */
|
|
3679
3699
|
fileSearchStore?: string;
|
|
3680
|
-
/** Optional. Page number of the retrieved context. This field is not supported in Vertex AI. */
|
|
3700
|
+
/** Optional. Page number of the retrieved context, if applicable. This field is not supported in Vertex AI. */
|
|
3681
3701
|
pageNumber?: number;
|
|
3682
|
-
/** Optional.
|
|
3702
|
+
/** Optional. The media blob resource name for multimodal file search results. Format: fileSearchStores/{file_search_store_id}/media/{blob_id}. This field is not supported in Vertex AI. */
|
|
3683
3703
|
mediaId?: string;
|
|
3684
3704
|
}
|
|
3685
3705
|
|
|
@@ -5197,7 +5217,7 @@ declare enum MaskReferenceMode {
|
|
|
5197
5217
|
MASK_MODE_SEMANTIC = "MASK_MODE_SEMANTIC"
|
|
5198
5218
|
}
|
|
5199
5219
|
|
|
5200
|
-
/** A MCPServer is a server that can be called by the model to perform actions. It is a server that implements the MCP protocol. Next ID:
|
|
5220
|
+
/** A MCPServer is a server that can be called by the model to perform actions. It is a server that implements the MCP protocol. Next ID: 6. This data type is not supported in Vertex AI. */
|
|
5201
5221
|
declare interface McpServer {
|
|
5202
5222
|
/** The name of the MCPServer. */
|
|
5203
5223
|
name?: string;
|
|
@@ -5525,15 +5545,15 @@ declare enum Outcome {
|
|
|
5525
5545
|
*/
|
|
5526
5546
|
OUTCOME_UNSPECIFIED = "OUTCOME_UNSPECIFIED",
|
|
5527
5547
|
/**
|
|
5528
|
-
* Code execution completed successfully.
|
|
5548
|
+
* Code execution completed successfully. `output` contains the stdout, if any.
|
|
5529
5549
|
*/
|
|
5530
5550
|
OUTCOME_OK = "OUTCOME_OK",
|
|
5531
5551
|
/**
|
|
5532
|
-
* Code execution
|
|
5552
|
+
* Code execution failed. `output` contains the stderr and stdout, if any.
|
|
5533
5553
|
*/
|
|
5534
5554
|
OUTCOME_FAILED = "OUTCOME_FAILED",
|
|
5535
5555
|
/**
|
|
5536
|
-
* Code execution ran for too long, and was cancelled. There may or may not be a partial output present.
|
|
5556
|
+
* Code execution ran for too long, and was cancelled. There may or may not be a partial `output` present.
|
|
5537
5557
|
*/
|
|
5538
5558
|
OUTCOME_DEADLINE_EXCEEDED = "OUTCOME_DEADLINE_EXCEEDED"
|
|
5539
5559
|
}
|
|
@@ -5834,6 +5854,10 @@ declare interface RagChunk {
|
|
|
5834
5854
|
pageSpan?: RagChunkPageSpan;
|
|
5835
5855
|
/** The content of the chunk. */
|
|
5836
5856
|
text?: string;
|
|
5857
|
+
/** The ID of the chunk. */
|
|
5858
|
+
chunkId?: string;
|
|
5859
|
+
/** The ID of the file that the chunk belongs to. */
|
|
5860
|
+
fileId?: string;
|
|
5837
5861
|
}
|
|
5838
5862
|
|
|
5839
5863
|
/** Represents where the chunk starts and ends in the document. This data type is not supported in Gemini API. */
|
|
@@ -6820,7 +6844,7 @@ declare interface ToolCall {
|
|
|
6820
6844
|
args?: Record<string, unknown>;
|
|
6821
6845
|
}
|
|
6822
6846
|
|
|
6823
|
-
/** Tool that executes code generated by the model, and automatically returns the result to the model. See also
|
|
6847
|
+
/** 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. */
|
|
6824
6848
|
declare interface ToolCodeExecution {
|
|
6825
6849
|
}
|
|
6826
6850
|
|
|
@@ -7057,10 +7081,11 @@ declare interface TuningJob {
|
|
|
7057
7081
|
tuningJobState?: TuningJobState;
|
|
7058
7082
|
/** Tuning Spec for Veo Tuning. */
|
|
7059
7083
|
veoTuningSpec?: VeoTuningSpec;
|
|
7060
|
-
/** Optional. Spec for creating a distillation dataset. */
|
|
7061
|
-
distillationSamplingSpec?: DistillationSamplingSpec;
|
|
7062
7084
|
/** Output only. Tuning Job metadata. */
|
|
7063
7085
|
tuningJobMetadata?: TuningJobMetadata;
|
|
7086
|
+
/** Tuning Spec for Veo LoRA Tuning. */
|
|
7087
|
+
veoLoraTuningSpec?: VeoLoraTuningSpec;
|
|
7088
|
+
distillationSamplingSpec?: DistillationSamplingSpec;
|
|
7064
7089
|
}
|
|
7065
7090
|
|
|
7066
7091
|
/** Tuning job metadata. This data type is not supported in Gemini API. */
|
|
@@ -7145,7 +7170,23 @@ declare interface TuningOperation {
|
|
|
7145
7170
|
error?: Record<string, unknown>;
|
|
7146
7171
|
}
|
|
7147
7172
|
|
|
7148
|
-
/** The tuning
|
|
7173
|
+
/** The speed of the tuning job. Only supported for Veo 3.0 models. This enum is not supported in Gemini API. */
|
|
7174
|
+
declare enum TuningSpeed {
|
|
7175
|
+
/**
|
|
7176
|
+
* The default / unset value. For Veo 3.0 models, this defaults to FAST.
|
|
7177
|
+
*/
|
|
7178
|
+
TUNING_SPEED_UNSPECIFIED = "TUNING_SPEED_UNSPECIFIED",
|
|
7179
|
+
/**
|
|
7180
|
+
* Regular tuning speed.
|
|
7181
|
+
*/
|
|
7182
|
+
REGULAR = "REGULAR",
|
|
7183
|
+
/**
|
|
7184
|
+
* Fast tuning speed.
|
|
7185
|
+
*/
|
|
7186
|
+
FAST = "FAST"
|
|
7187
|
+
}
|
|
7188
|
+
|
|
7189
|
+
/** The tuning task for Veo. This enum is not supported in Gemini API. */
|
|
7149
7190
|
declare enum TuningTask {
|
|
7150
7191
|
/**
|
|
7151
7192
|
* Default value. This value is unused.
|
|
@@ -7357,8 +7398,8 @@ declare namespace types {
|
|
|
7357
7398
|
createPartFromExecutableCode,
|
|
7358
7399
|
createUserContent,
|
|
7359
7400
|
createModelContent,
|
|
7360
|
-
Language,
|
|
7361
7401
|
Outcome,
|
|
7402
|
+
Language,
|
|
7362
7403
|
FunctionResponseScheduling,
|
|
7363
7404
|
Type,
|
|
7364
7405
|
Environment,
|
|
@@ -7390,7 +7431,9 @@ declare namespace types {
|
|
|
7390
7431
|
TuningJobState,
|
|
7391
7432
|
AggregationMetric,
|
|
7392
7433
|
PairwiseChoice,
|
|
7434
|
+
TuningSpeed,
|
|
7393
7435
|
TuningTask,
|
|
7436
|
+
VideoOrientation,
|
|
7394
7437
|
DocumentState,
|
|
7395
7438
|
PartMediaResolutionLevel,
|
|
7396
7439
|
ToolType,
|
|
@@ -7423,11 +7466,11 @@ declare namespace types {
|
|
|
7423
7466
|
Scale,
|
|
7424
7467
|
MusicGenerationMode,
|
|
7425
7468
|
LiveMusicPlaybackControl,
|
|
7426
|
-
ExecutableCode,
|
|
7427
|
-
CodeExecutionResult,
|
|
7428
7469
|
PartMediaResolution,
|
|
7429
7470
|
ToolCall,
|
|
7430
7471
|
ToolResponse,
|
|
7472
|
+
CodeExecutionResult,
|
|
7473
|
+
ExecutableCode,
|
|
7431
7474
|
FileData,
|
|
7432
7475
|
PartialArg,
|
|
7433
7476
|
FunctionCall,
|
|
@@ -7615,6 +7658,7 @@ declare namespace types {
|
|
|
7615
7658
|
PreferenceOptimizationHyperParameters,
|
|
7616
7659
|
PreferenceOptimizationSpec,
|
|
7617
7660
|
DistillationHyperParameters,
|
|
7661
|
+
DistillationSamplingSpec,
|
|
7618
7662
|
DistillationSpec,
|
|
7619
7663
|
GoogleRpcStatus,
|
|
7620
7664
|
PreTunedModel,
|
|
@@ -7650,8 +7694,8 @@ declare namespace types {
|
|
|
7650
7694
|
FullFineTuningSpec,
|
|
7651
7695
|
VeoHyperParameters,
|
|
7652
7696
|
VeoTuningSpec,
|
|
7653
|
-
DistillationSamplingSpec,
|
|
7654
7697
|
TuningJobMetadata,
|
|
7698
|
+
VeoLoraTuningSpec,
|
|
7655
7699
|
TuningJob,
|
|
7656
7700
|
ListTuningJobsConfig,
|
|
7657
7701
|
ListTuningJobsParameters,
|
|
@@ -8192,10 +8236,26 @@ declare interface VeoHyperParameters {
|
|
|
8192
8236
|
epochCount?: string;
|
|
8193
8237
|
/** Optional. Multiplier for adjusting the default learning rate. */
|
|
8194
8238
|
learningRateMultiplier?: number;
|
|
8195
|
-
/**
|
|
8239
|
+
/** The tuning task for Veo. */
|
|
8196
8240
|
tuningTask?: TuningTask;
|
|
8197
8241
|
/** Optional. The ratio of Google internal dataset to use in the training mixture, in range of `[0, 1)`. If `0.2`, it means 20% of Google internal dataset and 80% of user dataset will be used for training. If not set, the default value is 0.1. */
|
|
8198
8242
|
veoDataMixtureRatio?: number;
|
|
8243
|
+
/** Optional. The adapter size for LoRA tuning. */
|
|
8244
|
+
adapterSize?: AdapterSize;
|
|
8245
|
+
/** The speed of the tuning job. Only supported for Veo 3.0 models. */
|
|
8246
|
+
tuningSpeed?: TuningSpeed;
|
|
8247
|
+
}
|
|
8248
|
+
|
|
8249
|
+
/** Tuning Spec for Veo LoRA Model Tuning. This data type is not supported in Gemini API. */
|
|
8250
|
+
declare interface VeoLoraTuningSpec {
|
|
8251
|
+
/** Optional. Hyperparameters for Veo LoRA. */
|
|
8252
|
+
hyperParameters?: VeoHyperParameters;
|
|
8253
|
+
/** Required. Training dataset used for tuning. The dataset can be specified as either a Cloud Storage path to a JSONL file or as the resource name of a Vertex Multimodal Dataset. */
|
|
8254
|
+
trainingDatasetUri?: string;
|
|
8255
|
+
/** Optional. Validation dataset used for tuning. The dataset can be specified as either a Cloud Storage path to a JSONL file or as the resource name of a Vertex Multimodal Dataset. */
|
|
8256
|
+
validationDatasetUri?: string;
|
|
8257
|
+
/** Optional. The orientation of the video. Defaults to LANDSCAPE. */
|
|
8258
|
+
videoOrientation?: VideoOrientation;
|
|
8199
8259
|
}
|
|
8200
8260
|
|
|
8201
8261
|
/** Tuning Spec for Veo Model Tuning. This data type is not supported in Gemini API. */
|
|
@@ -8360,6 +8420,22 @@ declare interface VideoMetadata {
|
|
|
8360
8420
|
startOffset?: string;
|
|
8361
8421
|
}
|
|
8362
8422
|
|
|
8423
|
+
/** The orientation of the video. Defaults to LANDSCAPE. This enum is not supported in Gemini API. */
|
|
8424
|
+
declare enum VideoOrientation {
|
|
8425
|
+
/**
|
|
8426
|
+
* Unspecified video orientation. Defaults to landscape.
|
|
8427
|
+
*/
|
|
8428
|
+
VIDEO_ORIENTATION_UNSPECIFIED = "VIDEO_ORIENTATION_UNSPECIFIED",
|
|
8429
|
+
/**
|
|
8430
|
+
* Landscape orientation (e.g. 16:9, 1280x720).
|
|
8431
|
+
*/
|
|
8432
|
+
LANDSCAPE = "LANDSCAPE",
|
|
8433
|
+
/**
|
|
8434
|
+
* Portrait orientation (e.g. 9:16, 720x1280).
|
|
8435
|
+
*/
|
|
8436
|
+
PORTRAIT = "PORTRAIT"
|
|
8437
|
+
}
|
|
8438
|
+
|
|
8363
8439
|
/** Voice activity signal. */
|
|
8364
8440
|
declare interface VoiceActivity {
|
|
8365
8441
|
/** The type of the voice activity signal. */
|
|
@@ -328,18 +328,6 @@ function uploadToFileSearchStoreResponseFromMldev(fromObject) {
|
|
|
328
328
|
* Copyright 2025 Google LLC
|
|
329
329
|
* SPDX-License-Identifier: Apache-2.0
|
|
330
330
|
*/
|
|
331
|
-
/** Programming language of the `code`. */
|
|
332
|
-
var Language;
|
|
333
|
-
(function (Language) {
|
|
334
|
-
/**
|
|
335
|
-
* Unspecified language. This value should not be used.
|
|
336
|
-
*/
|
|
337
|
-
Language["LANGUAGE_UNSPECIFIED"] = "LANGUAGE_UNSPECIFIED";
|
|
338
|
-
/**
|
|
339
|
-
* Python >= 3.10, with numpy and simpy available.
|
|
340
|
-
*/
|
|
341
|
-
Language["PYTHON"] = "PYTHON";
|
|
342
|
-
})(Language || (Language = {}));
|
|
343
331
|
/** Outcome of the code execution. */
|
|
344
332
|
var Outcome;
|
|
345
333
|
(function (Outcome) {
|
|
@@ -348,18 +336,30 @@ var Outcome;
|
|
|
348
336
|
*/
|
|
349
337
|
Outcome["OUTCOME_UNSPECIFIED"] = "OUTCOME_UNSPECIFIED";
|
|
350
338
|
/**
|
|
351
|
-
* Code execution completed successfully.
|
|
339
|
+
* Code execution completed successfully. `output` contains the stdout, if any.
|
|
352
340
|
*/
|
|
353
341
|
Outcome["OUTCOME_OK"] = "OUTCOME_OK";
|
|
354
342
|
/**
|
|
355
|
-
* Code execution
|
|
343
|
+
* Code execution failed. `output` contains the stderr and stdout, if any.
|
|
356
344
|
*/
|
|
357
345
|
Outcome["OUTCOME_FAILED"] = "OUTCOME_FAILED";
|
|
358
346
|
/**
|
|
359
|
-
* Code execution ran for too long, and was cancelled. There may or may not be a partial output present.
|
|
347
|
+
* Code execution ran for too long, and was cancelled. There may or may not be a partial `output` present.
|
|
360
348
|
*/
|
|
361
349
|
Outcome["OUTCOME_DEADLINE_EXCEEDED"] = "OUTCOME_DEADLINE_EXCEEDED";
|
|
362
350
|
})(Outcome || (Outcome = {}));
|
|
351
|
+
/** Programming language of the `code`. */
|
|
352
|
+
var Language;
|
|
353
|
+
(function (Language) {
|
|
354
|
+
/**
|
|
355
|
+
* Unspecified language. This value should not be used.
|
|
356
|
+
*/
|
|
357
|
+
Language["LANGUAGE_UNSPECIFIED"] = "LANGUAGE_UNSPECIFIED";
|
|
358
|
+
/**
|
|
359
|
+
* Python >= 3.10, with numpy and simpy available.
|
|
360
|
+
*/
|
|
361
|
+
Language["PYTHON"] = "PYTHON";
|
|
362
|
+
})(Language || (Language = {}));
|
|
363
363
|
/** Specifies how the response should be scheduled in the conversation. */
|
|
364
364
|
var FunctionResponseScheduling;
|
|
365
365
|
(function (FunctionResponseScheduling) {
|
|
@@ -427,6 +427,14 @@ var Environment;
|
|
|
427
427
|
* Operates in a web browser.
|
|
428
428
|
*/
|
|
429
429
|
Environment["ENVIRONMENT_BROWSER"] = "ENVIRONMENT_BROWSER";
|
|
430
|
+
/**
|
|
431
|
+
* Operates in a mobile environment.
|
|
432
|
+
*/
|
|
433
|
+
Environment["ENVIRONMENT_MOBILE"] = "ENVIRONMENT_MOBILE";
|
|
434
|
+
/**
|
|
435
|
+
* Operates in a desktop environment.
|
|
436
|
+
*/
|
|
437
|
+
Environment["ENVIRONMENT_DESKTOP"] = "ENVIRONMENT_DESKTOP";
|
|
430
438
|
})(Environment || (Environment = {}));
|
|
431
439
|
/** Type of auth scheme. This enum is not supported in Gemini API. */
|
|
432
440
|
var AuthType;
|
|
@@ -1212,7 +1220,23 @@ var PairwiseChoice;
|
|
|
1212
1220
|
*/
|
|
1213
1221
|
PairwiseChoice["TIE"] = "TIE";
|
|
1214
1222
|
})(PairwiseChoice || (PairwiseChoice = {}));
|
|
1215
|
-
/** The tuning
|
|
1223
|
+
/** The speed of the tuning job. Only supported for Veo 3.0 models. This enum is not supported in Gemini API. */
|
|
1224
|
+
var TuningSpeed;
|
|
1225
|
+
(function (TuningSpeed) {
|
|
1226
|
+
/**
|
|
1227
|
+
* The default / unset value. For Veo 3.0 models, this defaults to FAST.
|
|
1228
|
+
*/
|
|
1229
|
+
TuningSpeed["TUNING_SPEED_UNSPECIFIED"] = "TUNING_SPEED_UNSPECIFIED";
|
|
1230
|
+
/**
|
|
1231
|
+
* Regular tuning speed.
|
|
1232
|
+
*/
|
|
1233
|
+
TuningSpeed["REGULAR"] = "REGULAR";
|
|
1234
|
+
/**
|
|
1235
|
+
* Fast tuning speed.
|
|
1236
|
+
*/
|
|
1237
|
+
TuningSpeed["FAST"] = "FAST";
|
|
1238
|
+
})(TuningSpeed || (TuningSpeed = {}));
|
|
1239
|
+
/** The tuning task for Veo. This enum is not supported in Gemini API. */
|
|
1216
1240
|
var TuningTask;
|
|
1217
1241
|
(function (TuningTask) {
|
|
1218
1242
|
/**
|
|
@@ -1232,6 +1256,22 @@ var TuningTask;
|
|
|
1232
1256
|
*/
|
|
1233
1257
|
TuningTask["TUNING_TASK_R2V"] = "TUNING_TASK_R2V";
|
|
1234
1258
|
})(TuningTask || (TuningTask = {}));
|
|
1259
|
+
/** The orientation of the video. Defaults to LANDSCAPE. This enum is not supported in Gemini API. */
|
|
1260
|
+
var VideoOrientation;
|
|
1261
|
+
(function (VideoOrientation) {
|
|
1262
|
+
/**
|
|
1263
|
+
* Unspecified video orientation. Defaults to landscape.
|
|
1264
|
+
*/
|
|
1265
|
+
VideoOrientation["VIDEO_ORIENTATION_UNSPECIFIED"] = "VIDEO_ORIENTATION_UNSPECIFIED";
|
|
1266
|
+
/**
|
|
1267
|
+
* Landscape orientation (e.g. 16:9, 1280x720).
|
|
1268
|
+
*/
|
|
1269
|
+
VideoOrientation["LANDSCAPE"] = "LANDSCAPE";
|
|
1270
|
+
/**
|
|
1271
|
+
* Portrait orientation (e.g. 9:16, 720x1280).
|
|
1272
|
+
*/
|
|
1273
|
+
VideoOrientation["PORTRAIT"] = "PORTRAIT";
|
|
1274
|
+
})(VideoOrientation || (VideoOrientation = {}));
|
|
1235
1275
|
/** Output only. Current state of the `Document`. This enum is not supported in Vertex AI. */
|
|
1236
1276
|
var DocumentState;
|
|
1237
1277
|
(function (DocumentState) {
|
|
@@ -2050,7 +2090,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
|
|
|
2050
2090
|
const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
|
|
2051
2091
|
const USER_AGENT_HEADER = 'User-Agent';
|
|
2052
2092
|
const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
|
|
2053
|
-
const SDK_VERSION = '2.
|
|
2093
|
+
const SDK_VERSION = '2.6.0'; // x-release-please-version
|
|
2054
2094
|
const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
|
|
2055
2095
|
const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
|
|
2056
2096
|
const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';
|