@google/genai 1.50.0 → 1.51.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/README.md +12 -12
- package/dist/genai.d.ts +230 -358
- package/dist/index.cjs +164 -148
- package/dist/index.mjs +165 -149
- package/dist/index.mjs.map +1 -1
- package/dist/node/index.cjs +192 -158
- package/dist/node/index.mjs +193 -159
- package/dist/node/index.mjs.map +1 -1
- package/dist/node/node.d.ts +230 -358
- package/dist/tokenizer/node.cjs +15 -1
- package/dist/tokenizer/node.d.ts +1 -1
- package/dist/tokenizer/node.mjs +15 -1
- package/dist/tokenizer/node.mjs.map +1 -1
- package/dist/vertex_internal/index.cjs +16 -2
- package/dist/vertex_internal/index.cjs.map +1 -1
- package/dist/vertex_internal/index.d.ts +75 -24
- package/dist/vertex_internal/index.js +16 -2
- package/dist/vertex_internal/index.js.map +1 -1
- package/dist/web/index.mjs +158 -147
- package/dist/web/index.mjs.map +1 -1
- package/dist/web/web.d.ts +230 -358
- package/package.json +6 -1
package/dist/web/index.mjs
CHANGED
|
@@ -1602,7 +1602,7 @@ var FeatureSelectionPreference;
|
|
|
1602
1602
|
FeatureSelectionPreference["BALANCED"] = "BALANCED";
|
|
1603
1603
|
FeatureSelectionPreference["PRIORITIZE_COST"] = "PRIORITIZE_COST";
|
|
1604
1604
|
})(FeatureSelectionPreference || (FeatureSelectionPreference = {}));
|
|
1605
|
-
/** Enum representing the
|
|
1605
|
+
/** Enum representing the Gemini Enterprise Agent Platform embedding API to use. */
|
|
1606
1606
|
var EmbeddingApiType;
|
|
1607
1607
|
(function (EmbeddingApiType) {
|
|
1608
1608
|
/**
|
|
@@ -1760,6 +1760,20 @@ var VideoCompressionQuality;
|
|
|
1760
1760
|
*/
|
|
1761
1761
|
VideoCompressionQuality["LOSSLESS"] = "LOSSLESS";
|
|
1762
1762
|
})(VideoCompressionQuality || (VideoCompressionQuality = {}));
|
|
1763
|
+
/** Resize mode for the image input for video generation. */
|
|
1764
|
+
var ImageResizeMode;
|
|
1765
|
+
(function (ImageResizeMode) {
|
|
1766
|
+
/**
|
|
1767
|
+
* Crop the image to fit the correct aspect ratio (so we lose parts
|
|
1768
|
+
of the image in the process).
|
|
1769
|
+
*/
|
|
1770
|
+
ImageResizeMode["CROP"] = "CROP";
|
|
1771
|
+
/**
|
|
1772
|
+
* Pad the image to fit the correct aspect ratio (so we don't lose
|
|
1773
|
+
any parts of the image in the process).
|
|
1774
|
+
*/
|
|
1775
|
+
ImageResizeMode["PAD"] = "PAD";
|
|
1776
|
+
})(ImageResizeMode || (ImageResizeMode = {}));
|
|
1763
1777
|
/** Enum representing the tuning method. */
|
|
1764
1778
|
var TuningMethod;
|
|
1765
1779
|
(function (TuningMethod) {
|
|
@@ -3569,6 +3583,9 @@ function tBatchJobSource(client, src) {
|
|
|
3569
3583
|
else if (src.startsWith('bq://')) {
|
|
3570
3584
|
sourceObj = { format: 'bigquery', bigqueryUri: src };
|
|
3571
3585
|
}
|
|
3586
|
+
else if (/^projects\/[^/]+\/locations\/[^/]+\/datasets\/[^/]+$/.test(src)) {
|
|
3587
|
+
sourceObj = { format: 'vertex-dataset', vertexDatasetName: src };
|
|
3588
|
+
}
|
|
3572
3589
|
else {
|
|
3573
3590
|
throw new Error(`Unsupported string source for Vertex AI: ${src}`);
|
|
3574
3591
|
}
|
|
@@ -3594,14 +3611,18 @@ function tBatchJobSource(client, src) {
|
|
|
3594
3611
|
sourceObj = src;
|
|
3595
3612
|
}
|
|
3596
3613
|
// Validation logic
|
|
3597
|
-
const vertexSourcesCount = [
|
|
3614
|
+
const vertexSourcesCount = [
|
|
3615
|
+
sourceObj.gcsUri,
|
|
3616
|
+
sourceObj.bigqueryUri,
|
|
3617
|
+
sourceObj.vertexDatasetName,
|
|
3618
|
+
].filter(Boolean).length;
|
|
3598
3619
|
const mldevSourcesCount = [
|
|
3599
3620
|
sourceObj.inlinedRequests,
|
|
3600
3621
|
sourceObj.fileName,
|
|
3601
3622
|
].filter(Boolean).length;
|
|
3602
3623
|
if (client.isVertexAI()) {
|
|
3603
3624
|
if (mldevSourcesCount > 0 || vertexSourcesCount !== 1) {
|
|
3604
|
-
throw new Error('Exactly one of `gcsUri` or `
|
|
3625
|
+
throw new Error('Exactly one of `gcsUri`, `bigqueryUri`, or `vertexDatasetName` must be set for Vertex AI.');
|
|
3605
3626
|
}
|
|
3606
3627
|
}
|
|
3607
3628
|
else {
|
|
@@ -3820,6 +3841,12 @@ function batchJobDestinationFromVertex(fromObject) {
|
|
|
3820
3841
|
if (fromBigqueryUri != null) {
|
|
3821
3842
|
setValueByPath(toObject, ['bigqueryUri'], fromBigqueryUri);
|
|
3822
3843
|
}
|
|
3844
|
+
const fromVertexDataset = getValueByPath(fromObject, [
|
|
3845
|
+
'vertexMultimodalDatasetDestination',
|
|
3846
|
+
]);
|
|
3847
|
+
if (fromVertexDataset != null) {
|
|
3848
|
+
setValueByPath(toObject, ['vertexDataset'], vertexMultimodalDatasetDestinationFromVertex(fromVertexDataset));
|
|
3849
|
+
}
|
|
3823
3850
|
return toObject;
|
|
3824
3851
|
}
|
|
3825
3852
|
function batchJobDestinationToVertex(fromObject) {
|
|
@@ -3837,14 +3864,20 @@ function batchJobDestinationToVertex(fromObject) {
|
|
|
3837
3864
|
setValueByPath(toObject, ['bigqueryDestination', 'outputUri'], fromBigqueryUri);
|
|
3838
3865
|
}
|
|
3839
3866
|
if (getValueByPath(fromObject, ['fileName']) !== undefined) {
|
|
3840
|
-
throw new Error('fileName parameter is not supported in Vertex AI.');
|
|
3867
|
+
throw new Error('fileName parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).');
|
|
3841
3868
|
}
|
|
3842
3869
|
if (getValueByPath(fromObject, ['inlinedResponses']) !== undefined) {
|
|
3843
|
-
throw new Error('inlinedResponses parameter is not supported in Vertex AI.');
|
|
3870
|
+
throw new Error('inlinedResponses parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).');
|
|
3844
3871
|
}
|
|
3845
3872
|
if (getValueByPath(fromObject, ['inlinedEmbedContentResponses']) !==
|
|
3846
3873
|
undefined) {
|
|
3847
|
-
throw new Error('inlinedEmbedContentResponses parameter is not supported in Vertex AI.');
|
|
3874
|
+
throw new Error('inlinedEmbedContentResponses parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).');
|
|
3875
|
+
}
|
|
3876
|
+
const fromVertexDataset = getValueByPath(fromObject, [
|
|
3877
|
+
'vertexDataset',
|
|
3878
|
+
]);
|
|
3879
|
+
if (fromVertexDataset != null) {
|
|
3880
|
+
setValueByPath(toObject, ['vertexMultimodalDatasetDestination'], vertexMultimodalDatasetDestinationToVertex(fromVertexDataset));
|
|
3848
3881
|
}
|
|
3849
3882
|
return toObject;
|
|
3850
3883
|
}
|
|
@@ -3948,6 +3981,10 @@ function batchJobFromVertex(fromObject) {
|
|
|
3948
3981
|
if (fromCompletionStats != null) {
|
|
3949
3982
|
setValueByPath(toObject, ['completionStats'], fromCompletionStats);
|
|
3950
3983
|
}
|
|
3984
|
+
const fromOutputInfo = getValueByPath(fromObject, ['outputInfo']);
|
|
3985
|
+
if (fromOutputInfo != null) {
|
|
3986
|
+
setValueByPath(toObject, ['outputInfo'], fromOutputInfo);
|
|
3987
|
+
}
|
|
3951
3988
|
return toObject;
|
|
3952
3989
|
}
|
|
3953
3990
|
function batchJobSourceFromVertex(fromObject) {
|
|
@@ -3967,6 +4004,13 @@ function batchJobSourceFromVertex(fromObject) {
|
|
|
3967
4004
|
if (fromBigqueryUri != null) {
|
|
3968
4005
|
setValueByPath(toObject, ['bigqueryUri'], fromBigqueryUri);
|
|
3969
4006
|
}
|
|
4007
|
+
const fromVertexDatasetName = getValueByPath(fromObject, [
|
|
4008
|
+
'vertexMultimodalDatasetSource',
|
|
4009
|
+
'datasetName',
|
|
4010
|
+
]);
|
|
4011
|
+
if (fromVertexDatasetName != null) {
|
|
4012
|
+
setValueByPath(toObject, ['vertexDatasetName'], fromVertexDatasetName);
|
|
4013
|
+
}
|
|
3970
4014
|
return toObject;
|
|
3971
4015
|
}
|
|
3972
4016
|
function batchJobSourceToMldev(apiClient, fromObject) {
|
|
@@ -3996,6 +4040,9 @@ function batchJobSourceToMldev(apiClient, fromObject) {
|
|
|
3996
4040
|
}
|
|
3997
4041
|
setValueByPath(toObject, ['requests', 'requests'], transformedList);
|
|
3998
4042
|
}
|
|
4043
|
+
if (getValueByPath(fromObject, ['vertexDatasetName']) !== undefined) {
|
|
4044
|
+
throw new Error('vertexDatasetName parameter is not supported in Gemini API.');
|
|
4045
|
+
}
|
|
3999
4046
|
return toObject;
|
|
4000
4047
|
}
|
|
4001
4048
|
function batchJobSourceToVertex(fromObject) {
|
|
@@ -4013,10 +4060,16 @@ function batchJobSourceToVertex(fromObject) {
|
|
|
4013
4060
|
setValueByPath(toObject, ['bigquerySource', 'inputUri'], fromBigqueryUri);
|
|
4014
4061
|
}
|
|
4015
4062
|
if (getValueByPath(fromObject, ['fileName']) !== undefined) {
|
|
4016
|
-
throw new Error('fileName parameter is not supported in Vertex AI.');
|
|
4063
|
+
throw new Error('fileName parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).');
|
|
4017
4064
|
}
|
|
4018
4065
|
if (getValueByPath(fromObject, ['inlinedRequests']) !== undefined) {
|
|
4019
|
-
throw new Error('inlinedRequests parameter is not supported in Vertex AI.');
|
|
4066
|
+
throw new Error('inlinedRequests parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).');
|
|
4067
|
+
}
|
|
4068
|
+
const fromVertexDatasetName = getValueByPath(fromObject, [
|
|
4069
|
+
'vertexDatasetName',
|
|
4070
|
+
]);
|
|
4071
|
+
if (fromVertexDatasetName != null) {
|
|
4072
|
+
setValueByPath(toObject, ['vertexMultimodalDatasetSource', 'datasetName'], fromVertexDatasetName);
|
|
4020
4073
|
}
|
|
4021
4074
|
return toObject;
|
|
4022
4075
|
}
|
|
@@ -4171,7 +4224,7 @@ function createBatchJobConfigToVertex(fromObject, parentObject) {
|
|
|
4171
4224
|
setValueByPath(parentObject, ['outputConfig'], batchJobDestinationToVertex(tBatchJobDestination(fromDest)));
|
|
4172
4225
|
}
|
|
4173
4226
|
if (getValueByPath(fromObject, ['webhookConfig']) !== undefined) {
|
|
4174
|
-
throw new Error('webhookConfig parameter is not supported in Vertex AI.');
|
|
4227
|
+
throw new Error('webhookConfig parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).');
|
|
4175
4228
|
}
|
|
4176
4229
|
return toObject;
|
|
4177
4230
|
}
|
|
@@ -5013,6 +5066,35 @@ function toolToMldev$4(fromObject) {
|
|
|
5013
5066
|
}
|
|
5014
5067
|
return toObject;
|
|
5015
5068
|
}
|
|
5069
|
+
function vertexMultimodalDatasetDestinationFromVertex(fromObject) {
|
|
5070
|
+
const toObject = {};
|
|
5071
|
+
const fromBigqueryDestination = getValueByPath(fromObject, [
|
|
5072
|
+
'bigqueryDestination',
|
|
5073
|
+
'outputUri',
|
|
5074
|
+
]);
|
|
5075
|
+
if (fromBigqueryDestination != null) {
|
|
5076
|
+
setValueByPath(toObject, ['bigqueryDestination'], fromBigqueryDestination);
|
|
5077
|
+
}
|
|
5078
|
+
const fromDisplayName = getValueByPath(fromObject, ['displayName']);
|
|
5079
|
+
if (fromDisplayName != null) {
|
|
5080
|
+
setValueByPath(toObject, ['displayName'], fromDisplayName);
|
|
5081
|
+
}
|
|
5082
|
+
return toObject;
|
|
5083
|
+
}
|
|
5084
|
+
function vertexMultimodalDatasetDestinationToVertex(fromObject) {
|
|
5085
|
+
const toObject = {};
|
|
5086
|
+
const fromBigqueryDestination = getValueByPath(fromObject, [
|
|
5087
|
+
'bigqueryDestination',
|
|
5088
|
+
]);
|
|
5089
|
+
if (fromBigqueryDestination != null) {
|
|
5090
|
+
setValueByPath(toObject, ['bigqueryDestination', 'outputUri'], fromBigqueryDestination);
|
|
5091
|
+
}
|
|
5092
|
+
const fromDisplayName = getValueByPath(fromObject, ['displayName']);
|
|
5093
|
+
if (fromDisplayName != null) {
|
|
5094
|
+
setValueByPath(toObject, ['displayName'], fromDisplayName);
|
|
5095
|
+
}
|
|
5096
|
+
return toObject;
|
|
5097
|
+
}
|
|
5016
5098
|
|
|
5017
5099
|
/**
|
|
5018
5100
|
* @license
|
|
@@ -5267,7 +5349,7 @@ class Batches extends BaseModule {
|
|
|
5267
5349
|
this.createEmbeddings = async (params) => {
|
|
5268
5350
|
console.warn('batches.createEmbeddings() is experimental and may change without notice.');
|
|
5269
5351
|
if (this.apiClient.isVertexAI()) {
|
|
5270
|
-
throw new Error('Vertex AI does not support batches.createEmbeddings.');
|
|
5352
|
+
throw new Error('Gemini Enterprise Agent Platform (previously known as Vertex AI) does not support batches.createEmbeddings.');
|
|
5271
5353
|
}
|
|
5272
5354
|
return this.createEmbeddingsInternal(params);
|
|
5273
5355
|
};
|
|
@@ -5344,7 +5426,7 @@ class Batches extends BaseModule {
|
|
|
5344
5426
|
newConfig.dest = `${bigqueryUri}_dest_${timestampStr}`;
|
|
5345
5427
|
}
|
|
5346
5428
|
else {
|
|
5347
|
-
throw new Error('Unsupported source for Vertex AI: No GCS or BigQuery URI found.');
|
|
5429
|
+
throw new Error('Unsupported source for Gemini Enterprise Agent Platform (previously known as Vertex AI): No GCS or BigQuery URI found.');
|
|
5348
5430
|
}
|
|
5349
5431
|
}
|
|
5350
5432
|
return newConfig;
|
|
@@ -6029,7 +6111,7 @@ function functionDeclarationToVertex$2(fromObject) {
|
|
|
6029
6111
|
setValueByPath(toObject, ['responseJsonSchema'], fromResponseJsonSchema);
|
|
6030
6112
|
}
|
|
6031
6113
|
if (getValueByPath(fromObject, ['behavior']) !== undefined) {
|
|
6032
|
-
throw new Error('behavior parameter is not supported in Vertex AI.');
|
|
6114
|
+
throw new Error('behavior parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).');
|
|
6033
6115
|
}
|
|
6034
6116
|
return toObject;
|
|
6035
6117
|
}
|
|
@@ -6308,13 +6390,13 @@ function partToVertex$2(fromObject) {
|
|
|
6308
6390
|
setValueByPath(toObject, ['videoMetadata'], fromVideoMetadata);
|
|
6309
6391
|
}
|
|
6310
6392
|
if (getValueByPath(fromObject, ['toolCall']) !== undefined) {
|
|
6311
|
-
throw new Error('toolCall parameter is not supported in Vertex AI.');
|
|
6393
|
+
throw new Error('toolCall parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).');
|
|
6312
6394
|
}
|
|
6313
6395
|
if (getValueByPath(fromObject, ['toolResponse']) !== undefined) {
|
|
6314
|
-
throw new Error('toolResponse parameter is not supported in Vertex AI.');
|
|
6396
|
+
throw new Error('toolResponse parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).');
|
|
6315
6397
|
}
|
|
6316
6398
|
if (getValueByPath(fromObject, ['partMetadata']) !== undefined) {
|
|
6317
|
-
throw new Error('partMetadata parameter is not supported in Vertex AI.');
|
|
6399
|
+
throw new Error('partMetadata parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).');
|
|
6318
6400
|
}
|
|
6319
6401
|
return toObject;
|
|
6320
6402
|
}
|
|
@@ -6354,7 +6436,7 @@ function toolConfigToVertex$1(fromObject) {
|
|
|
6354
6436
|
}
|
|
6355
6437
|
if (getValueByPath(fromObject, ['includeServerSideToolInvocations']) !==
|
|
6356
6438
|
undefined) {
|
|
6357
|
-
throw new Error('includeServerSideToolInvocations parameter is not supported in Vertex AI.');
|
|
6439
|
+
throw new Error('includeServerSideToolInvocations parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).');
|
|
6358
6440
|
}
|
|
6359
6441
|
return toObject;
|
|
6360
6442
|
}
|
|
@@ -6436,7 +6518,7 @@ function toolToVertex$2(fromObject) {
|
|
|
6436
6518
|
setValueByPath(toObject, ['computerUse'], fromComputerUse);
|
|
6437
6519
|
}
|
|
6438
6520
|
if (getValueByPath(fromObject, ['fileSearch']) !== undefined) {
|
|
6439
|
-
throw new Error('fileSearch parameter is not supported in Vertex AI.');
|
|
6521
|
+
throw new Error('fileSearch parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).');
|
|
6440
6522
|
}
|
|
6441
6523
|
const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
|
|
6442
6524
|
if (fromGoogleSearch != null) {
|
|
@@ -6487,7 +6569,7 @@ function toolToVertex$2(fromObject) {
|
|
|
6487
6569
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
6488
6570
|
}
|
|
6489
6571
|
if (getValueByPath(fromObject, ['mcpServers']) !== undefined) {
|
|
6490
|
-
throw new Error('mcpServers parameter is not supported in Vertex AI.');
|
|
6572
|
+
throw new Error('mcpServers parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).');
|
|
6491
6573
|
}
|
|
6492
6574
|
return toObject;
|
|
6493
6575
|
}
|
|
@@ -6573,7 +6655,7 @@ class Caches extends BaseModule {
|
|
|
6573
6655
|
* @remarks
|
|
6574
6656
|
* Context caching is only supported for specific models. See [Gemini
|
|
6575
6657
|
* Developer API reference](https://ai.google.dev/gemini-api/docs/caching?lang=node/context-cac)
|
|
6576
|
-
* and [
|
|
6658
|
+
* and [Gemini Enterprise Agent Platform reference](https://cloud.google.com/vertex-ai/generative-ai/docs/context-cache/context-cache-overview#supported_models)
|
|
6577
6659
|
* for more information.
|
|
6578
6660
|
*
|
|
6579
6661
|
* @param params - The parameters for the create request.
|
|
@@ -7482,7 +7564,7 @@ class Files extends BaseModule {
|
|
|
7482
7564
|
}
|
|
7483
7565
|
/**
|
|
7484
7566
|
* Uploads a file asynchronously to the Gemini API.
|
|
7485
|
-
* This method is not available in Vertex AI.
|
|
7567
|
+
* This method is not available in Gemini Enterprise Agent Platform (previously known as Vertex AI).
|
|
7486
7568
|
* Supported upload sources:
|
|
7487
7569
|
* - Node.js: File path (string) or Blob object.
|
|
7488
7570
|
* - Browser: Blob object (e.g., File).
|
|
@@ -7508,7 +7590,7 @@ class Files extends BaseModule {
|
|
|
7508
7590
|
* @see {@link types.UploadFileParameters#config} for the optional
|
|
7509
7591
|
* config in the parameters.
|
|
7510
7592
|
* @return A promise that resolves to a `types.File` object.
|
|
7511
|
-
* @throws An error if called on a Vertex AI client.
|
|
7593
|
+
* @throws An error if called on a Gemini Enterprise Agent Platform (previously known as Vertex AI) client.
|
|
7512
7594
|
* @throws An error if the `mimeType` is not provided and can not be inferred,
|
|
7513
7595
|
* the `mimeType` can be provided in the `params.config` parameter.
|
|
7514
7596
|
* @throws An error occurs if a suitable upload location cannot be established.
|
|
@@ -7525,7 +7607,7 @@ class Files extends BaseModule {
|
|
|
7525
7607
|
*/
|
|
7526
7608
|
async upload(params) {
|
|
7527
7609
|
if (this.apiClient.isVertexAI()) {
|
|
7528
|
-
throw new Error('Vertex AI does not support uploading files. You can share files through a GCS bucket.');
|
|
7610
|
+
throw new Error('Gemini Enterprise Agent Platform (previously known as Vertex AI) does not support uploading files. You can share files through a GCS bucket.');
|
|
7529
7611
|
}
|
|
7530
7612
|
return this.apiClient
|
|
7531
7613
|
.uploadFile(params.file, params.config)
|
|
@@ -7929,7 +8011,7 @@ function functionDeclarationToVertex$1(fromObject) {
|
|
|
7929
8011
|
setValueByPath(toObject, ['responseJsonSchema'], fromResponseJsonSchema);
|
|
7930
8012
|
}
|
|
7931
8013
|
if (getValueByPath(fromObject, ['behavior']) !== undefined) {
|
|
7932
|
-
throw new Error('behavior parameter is not supported in Vertex AI.');
|
|
8014
|
+
throw new Error('behavior parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).');
|
|
7933
8015
|
}
|
|
7934
8016
|
return toObject;
|
|
7935
8017
|
}
|
|
@@ -8057,7 +8139,7 @@ function generationConfigToVertex$1(fromObject) {
|
|
|
8057
8139
|
}
|
|
8058
8140
|
if (getValueByPath(fromObject, ['enableEnhancedCivicAnswers']) !==
|
|
8059
8141
|
undefined) {
|
|
8060
|
-
throw new Error('enableEnhancedCivicAnswers parameter is not supported in Vertex AI.');
|
|
8142
|
+
throw new Error('enableEnhancedCivicAnswers parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).');
|
|
8061
8143
|
}
|
|
8062
8144
|
return toObject;
|
|
8063
8145
|
}
|
|
@@ -8673,13 +8755,13 @@ function partToVertex$1(fromObject) {
|
|
|
8673
8755
|
setValueByPath(toObject, ['videoMetadata'], fromVideoMetadata);
|
|
8674
8756
|
}
|
|
8675
8757
|
if (getValueByPath(fromObject, ['toolCall']) !== undefined) {
|
|
8676
|
-
throw new Error('toolCall parameter is not supported in Vertex AI.');
|
|
8758
|
+
throw new Error('toolCall parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).');
|
|
8677
8759
|
}
|
|
8678
8760
|
if (getValueByPath(fromObject, ['toolResponse']) !== undefined) {
|
|
8679
|
-
throw new Error('toolResponse parameter is not supported in Vertex AI.');
|
|
8761
|
+
throw new Error('toolResponse parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).');
|
|
8680
8762
|
}
|
|
8681
8763
|
if (getValueByPath(fromObject, ['partMetadata']) !== undefined) {
|
|
8682
|
-
throw new Error('partMetadata parameter is not supported in Vertex AI.');
|
|
8764
|
+
throw new Error('partMetadata parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).');
|
|
8683
8765
|
}
|
|
8684
8766
|
return toObject;
|
|
8685
8767
|
}
|
|
@@ -8787,7 +8869,7 @@ function toolToVertex$1(fromObject) {
|
|
|
8787
8869
|
setValueByPath(toObject, ['computerUse'], fromComputerUse);
|
|
8788
8870
|
}
|
|
8789
8871
|
if (getValueByPath(fromObject, ['fileSearch']) !== undefined) {
|
|
8790
|
-
throw new Error('fileSearch parameter is not supported in Vertex AI.');
|
|
8872
|
+
throw new Error('fileSearch parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).');
|
|
8791
8873
|
}
|
|
8792
8874
|
const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
|
|
8793
8875
|
if (fromGoogleSearch != null) {
|
|
@@ -8838,7 +8920,7 @@ function toolToVertex$1(fromObject) {
|
|
|
8838
8920
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
8839
8921
|
}
|
|
8840
8922
|
if (getValueByPath(fromObject, ['mcpServers']) !== undefined) {
|
|
8841
|
-
throw new Error('mcpServers parameter is not supported in Vertex AI.');
|
|
8923
|
+
throw new Error('mcpServers parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).');
|
|
8842
8924
|
}
|
|
8843
8925
|
return toObject;
|
|
8844
8926
|
}
|
|
@@ -9862,7 +9944,7 @@ function functionDeclarationToVertex(fromObject, _rootObject) {
|
|
|
9862
9944
|
setValueByPath(toObject, ['responseJsonSchema'], fromResponseJsonSchema);
|
|
9863
9945
|
}
|
|
9864
9946
|
if (getValueByPath(fromObject, ['behavior']) !== undefined) {
|
|
9865
|
-
throw new Error('behavior parameter is not supported in Vertex AI.');
|
|
9947
|
+
throw new Error('behavior parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).');
|
|
9866
9948
|
}
|
|
9867
9949
|
return toObject;
|
|
9868
9950
|
}
|
|
@@ -10197,7 +10279,7 @@ function generateContentConfigToVertex(apiClient, fromObject, parentObject, root
|
|
|
10197
10279
|
}
|
|
10198
10280
|
if (getValueByPath(fromObject, ['enableEnhancedCivicAnswers']) !==
|
|
10199
10281
|
undefined) {
|
|
10200
|
-
throw new Error('enableEnhancedCivicAnswers parameter is not supported in Vertex AI.');
|
|
10282
|
+
throw new Error('enableEnhancedCivicAnswers parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).');
|
|
10201
10283
|
}
|
|
10202
10284
|
const fromModelArmorConfig = getValueByPath(fromObject, [
|
|
10203
10285
|
'modelArmorConfig',
|
|
@@ -10691,6 +10773,9 @@ function generateVideosConfigToMldev(fromObject, parentObject, rootObject) {
|
|
|
10691
10773
|
if (parentObject !== undefined && fromWebhookConfig != null) {
|
|
10692
10774
|
setValueByPath(parentObject, ['webhookConfig'], fromWebhookConfig);
|
|
10693
10775
|
}
|
|
10776
|
+
if (getValueByPath(fromObject, ['resizeMode']) !== undefined) {
|
|
10777
|
+
throw new Error('resizeMode parameter is not supported in Gemini API.');
|
|
10778
|
+
}
|
|
10694
10779
|
return toObject;
|
|
10695
10780
|
}
|
|
10696
10781
|
function generateVideosConfigToVertex(fromObject, parentObject, rootObject) {
|
|
@@ -10786,7 +10871,11 @@ function generateVideosConfigToVertex(fromObject, parentObject, rootObject) {
|
|
|
10786
10871
|
setValueByPath(parentObject, ['labels'], fromLabels);
|
|
10787
10872
|
}
|
|
10788
10873
|
if (getValueByPath(fromObject, ['webhookConfig']) !== undefined) {
|
|
10789
|
-
throw new Error('webhookConfig parameter is not supported in Vertex AI.');
|
|
10874
|
+
throw new Error('webhookConfig parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).');
|
|
10875
|
+
}
|
|
10876
|
+
const fromResizeMode = getValueByPath(fromObject, ['resizeMode']);
|
|
10877
|
+
if (parentObject !== undefined && fromResizeMode != null) {
|
|
10878
|
+
setValueByPath(parentObject, ['parameters', 'resizeMode'], fromResizeMode);
|
|
10790
10879
|
}
|
|
10791
10880
|
return toObject;
|
|
10792
10881
|
}
|
|
@@ -11181,7 +11270,7 @@ function generationConfigToVertex(fromObject, _rootObject) {
|
|
|
11181
11270
|
}
|
|
11182
11271
|
if (getValueByPath(fromObject, ['enableEnhancedCivicAnswers']) !==
|
|
11183
11272
|
undefined) {
|
|
11184
|
-
throw new Error('enableEnhancedCivicAnswers parameter is not supported in Vertex AI.');
|
|
11273
|
+
throw new Error('enableEnhancedCivicAnswers parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).');
|
|
11185
11274
|
}
|
|
11186
11275
|
return toObject;
|
|
11187
11276
|
}
|
|
@@ -11741,13 +11830,13 @@ function partToVertex(fromObject, _rootObject) {
|
|
|
11741
11830
|
setValueByPath(toObject, ['videoMetadata'], fromVideoMetadata);
|
|
11742
11831
|
}
|
|
11743
11832
|
if (getValueByPath(fromObject, ['toolCall']) !== undefined) {
|
|
11744
|
-
throw new Error('toolCall parameter is not supported in Vertex AI.');
|
|
11833
|
+
throw new Error('toolCall parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).');
|
|
11745
11834
|
}
|
|
11746
11835
|
if (getValueByPath(fromObject, ['toolResponse']) !== undefined) {
|
|
11747
|
-
throw new Error('toolResponse parameter is not supported in Vertex AI.');
|
|
11836
|
+
throw new Error('toolResponse parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).');
|
|
11748
11837
|
}
|
|
11749
11838
|
if (getValueByPath(fromObject, ['partMetadata']) !== undefined) {
|
|
11750
|
-
throw new Error('partMetadata parameter is not supported in Vertex AI.');
|
|
11839
|
+
throw new Error('partMetadata parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).');
|
|
11751
11840
|
}
|
|
11752
11841
|
return toObject;
|
|
11753
11842
|
}
|
|
@@ -12104,7 +12193,7 @@ function toolConfigToVertex(fromObject, _rootObject) {
|
|
|
12104
12193
|
}
|
|
12105
12194
|
if (getValueByPath(fromObject, ['includeServerSideToolInvocations']) !==
|
|
12106
12195
|
undefined) {
|
|
12107
|
-
throw new Error('includeServerSideToolInvocations parameter is not supported in Vertex AI.');
|
|
12196
|
+
throw new Error('includeServerSideToolInvocations parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).');
|
|
12108
12197
|
}
|
|
12109
12198
|
return toObject;
|
|
12110
12199
|
}
|
|
@@ -12186,7 +12275,7 @@ function toolToVertex(fromObject, rootObject) {
|
|
|
12186
12275
|
setValueByPath(toObject, ['computerUse'], fromComputerUse);
|
|
12187
12276
|
}
|
|
12188
12277
|
if (getValueByPath(fromObject, ['fileSearch']) !== undefined) {
|
|
12189
|
-
throw new Error('fileSearch parameter is not supported in Vertex AI.');
|
|
12278
|
+
throw new Error('fileSearch parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).');
|
|
12190
12279
|
}
|
|
12191
12280
|
const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
|
|
12192
12281
|
if (fromGoogleSearch != null) {
|
|
@@ -12237,7 +12326,7 @@ function toolToVertex(fromObject, rootObject) {
|
|
|
12237
12326
|
setValueByPath(toObject, ['urlContext'], fromUrlContext);
|
|
12238
12327
|
}
|
|
12239
12328
|
if (getValueByPath(fromObject, ['mcpServers']) !== undefined) {
|
|
12240
|
-
throw new Error('mcpServers parameter is not supported in Vertex AI.');
|
|
12329
|
+
throw new Error('mcpServers parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).');
|
|
12241
12330
|
}
|
|
12242
12331
|
return toObject;
|
|
12243
12332
|
}
|
|
@@ -12795,7 +12884,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
|
|
|
12795
12884
|
const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
|
|
12796
12885
|
const USER_AGENT_HEADER = 'User-Agent';
|
|
12797
12886
|
const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
|
|
12798
|
-
const SDK_VERSION = '1.
|
|
12887
|
+
const SDK_VERSION = '1.51.0'; // x-release-please-version
|
|
12799
12888
|
const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
|
|
12800
12889
|
const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
|
|
12801
12890
|
const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';
|
|
@@ -14450,7 +14539,7 @@ class Models extends BaseModule {
|
|
|
14450
14539
|
/**
|
|
14451
14540
|
* Makes an API request to generate content with a given model.
|
|
14452
14541
|
*
|
|
14453
|
-
* For the `model` parameter, supported formats for
|
|
14542
|
+
* For the `model` parameter, supported formats for Gemini Enterprise Agent Platform API include:
|
|
14454
14543
|
* - The Gemini model ID, for example: 'gemini-2.0-flash'
|
|
14455
14544
|
* - The full resource name starts with 'projects/', for example:
|
|
14456
14545
|
* 'projects/my-project-id/locations/us-central1/publishers/google/models/gemini-2.0-flash'
|
|
@@ -14541,7 +14630,7 @@ class Models extends BaseModule {
|
|
|
14541
14630
|
* Makes an API request to generate content with a given model and yields the
|
|
14542
14631
|
* response in chunks.
|
|
14543
14632
|
*
|
|
14544
|
-
* For the `model` parameter, supported formats for
|
|
14633
|
+
* For the `model` parameter, supported formats for Gemini Enterprise Agent Platform API include:
|
|
14545
14634
|
* - The Gemini model ID, for example: 'gemini-2.0-flash'
|
|
14546
14635
|
* - The full resource name starts with 'projects/', for example:
|
|
14547
14636
|
* 'projects/my-project-id/locations/us-central1/publishers/google/models/gemini-2.0-flash'
|
|
@@ -14670,7 +14759,7 @@ class Models extends BaseModule {
|
|
|
14670
14759
|
if (this.apiClient.isVertexAI()) {
|
|
14671
14760
|
if (!actualParams.config.queryBase) {
|
|
14672
14761
|
if ((_a = actualParams.config) === null || _a === void 0 ? void 0 : _a.filter) {
|
|
14673
|
-
throw new Error('Filtering tuned models list for Vertex AI is not currently supported');
|
|
14762
|
+
throw new Error('Filtering tuned models list for Gemini Enterprise Agent Platform (previously known as Vertex AI) is not currently supported');
|
|
14674
14763
|
}
|
|
14675
14764
|
else {
|
|
14676
14765
|
actualParams.config.filter = 'labels.tune-type:*';
|
|
@@ -14715,7 +14804,7 @@ class Models extends BaseModule {
|
|
|
14715
14804
|
};
|
|
14716
14805
|
/**
|
|
14717
14806
|
* Upscales an image based on an image, upscale factor, and configuration.
|
|
14718
|
-
* Only supported in
|
|
14807
|
+
* Only supported in Gemini Enterprise Agent Platform currently.
|
|
14719
14808
|
*
|
|
14720
14809
|
* @param params - The parameters for upscaling an image.
|
|
14721
14810
|
* @return The response from the API.
|
|
@@ -15316,7 +15405,7 @@ class Models extends BaseModule {
|
|
|
15316
15405
|
});
|
|
15317
15406
|
}
|
|
15318
15407
|
else {
|
|
15319
|
-
throw new Error('This method is only supported by the Vertex AI.');
|
|
15408
|
+
throw new Error('This method is only supported by the Gemini Enterprise Agent Platform (previously known as Vertex AI).');
|
|
15320
15409
|
}
|
|
15321
15410
|
}
|
|
15322
15411
|
/**
|
|
@@ -15359,7 +15448,7 @@ class Models extends BaseModule {
|
|
|
15359
15448
|
});
|
|
15360
15449
|
}
|
|
15361
15450
|
else {
|
|
15362
|
-
throw new Error('This method is only supported by the Vertex AI.');
|
|
15451
|
+
throw new Error('This method is only supported by the Gemini Enterprise Agent Platform (previously known as Vertex AI).');
|
|
15363
15452
|
}
|
|
15364
15453
|
}
|
|
15365
15454
|
/**
|
|
@@ -15417,7 +15506,7 @@ class Models extends BaseModule {
|
|
|
15417
15506
|
});
|
|
15418
15507
|
}
|
|
15419
15508
|
else {
|
|
15420
|
-
throw new Error('This method is only supported by the Vertex AI.');
|
|
15509
|
+
throw new Error('This method is only supported by the Gemini Enterprise Agent Platform (previously known as Vertex AI).');
|
|
15421
15510
|
}
|
|
15422
15511
|
}
|
|
15423
15512
|
/**
|
|
@@ -15471,7 +15560,7 @@ class Models extends BaseModule {
|
|
|
15471
15560
|
});
|
|
15472
15561
|
}
|
|
15473
15562
|
else {
|
|
15474
|
-
throw new Error('This method is only supported by the Vertex AI.');
|
|
15563
|
+
throw new Error('This method is only supported by the Gemini Enterprise Agent Platform (previously known as Vertex AI).');
|
|
15475
15564
|
}
|
|
15476
15565
|
}
|
|
15477
15566
|
/**
|
|
@@ -15889,7 +15978,7 @@ class Models extends BaseModule {
|
|
|
15889
15978
|
});
|
|
15890
15979
|
}
|
|
15891
15980
|
else {
|
|
15892
|
-
throw new Error('This method is only supported by the Vertex AI.');
|
|
15981
|
+
throw new Error('This method is only supported by the Gemini Enterprise Agent Platform (previously known as Vertex AI).');
|
|
15893
15982
|
}
|
|
15894
15983
|
}
|
|
15895
15984
|
/**
|
|
@@ -16113,7 +16202,7 @@ class Operations extends BaseModule {
|
|
|
16113
16202
|
return response;
|
|
16114
16203
|
}
|
|
16115
16204
|
else {
|
|
16116
|
-
throw new Error('This method is only supported by the Vertex AI.');
|
|
16205
|
+
throw new Error('This method is only supported by the Gemini Enterprise Agent Platform (previously known as Vertex AI).');
|
|
16117
16206
|
}
|
|
16118
16207
|
}
|
|
16119
16208
|
}
|
|
@@ -17117,7 +17206,7 @@ class FileSearchStores extends BaseModule {
|
|
|
17117
17206
|
}
|
|
17118
17207
|
/**
|
|
17119
17208
|
* Uploads a file asynchronously to a given File Search Store.
|
|
17120
|
-
* This method is not available in Vertex AI.
|
|
17209
|
+
* This method is not available in Gemini Enterprise Agent Platform (previously known as Vertex AI).
|
|
17121
17210
|
* Supported upload sources:
|
|
17122
17211
|
* - Node.js: File path (string) or Blob object.
|
|
17123
17212
|
* - Browser: Blob object (e.g., File).
|
|
@@ -17136,7 +17225,7 @@ class FileSearchStores extends BaseModule {
|
|
|
17136
17225
|
* @see {@link types.UploadToFileSearchStoreParameters#config} for the optional
|
|
17137
17226
|
* config in the parameters.
|
|
17138
17227
|
* @return A promise that resolves to a long running operation.
|
|
17139
|
-
* @throws An error if called on a Vertex AI client.
|
|
17228
|
+
* @throws An error if called on a Gemini Enterprise Agent Platform (previously known as Vertex AI) client.
|
|
17140
17229
|
* @throws An error if the `mimeType` is not provided and can not be inferred,
|
|
17141
17230
|
* the `mimeType` can be provided in the `params.config` parameter.
|
|
17142
17231
|
* @throws An error occurs if a suitable upload location cannot be established.
|
|
@@ -17153,7 +17242,7 @@ class FileSearchStores extends BaseModule {
|
|
|
17153
17242
|
*/
|
|
17154
17243
|
async uploadToFileSearchStore(params) {
|
|
17155
17244
|
if (this.apiClient.isVertexAI()) {
|
|
17156
|
-
throw new Error('Vertex AI does not support uploading files to a file search store.');
|
|
17245
|
+
throw new Error('Gemini Enterprise Agent Platform (previously known as Vertex AI) does not support uploading files to a file search store.');
|
|
17157
17246
|
}
|
|
17158
17247
|
return this.apiClient.uploadFileToFileSearchStore(params.fileSearchStoreName, params.file, params.config);
|
|
17159
17248
|
}
|
|
@@ -18028,21 +18117,14 @@ class BaseWebhooks extends APIResource {
|
|
|
18028
18117
|
* Creates a new Webhook.
|
|
18029
18118
|
*/
|
|
18030
18119
|
create(params, options) {
|
|
18031
|
-
const { api_version = this._client.apiVersion
|
|
18032
|
-
return this._client.post(path `/${api_version}/webhooks`, Object.assign({
|
|
18033
|
-
}
|
|
18034
|
-
/**
|
|
18035
|
-
* Gets a specific Webhook.
|
|
18036
|
-
*/
|
|
18037
|
-
retrieve(id, params = {}, options) {
|
|
18038
|
-
const { api_version = this._client.apiVersion } = params !== null && params !== void 0 ? params : {};
|
|
18039
|
-
return this._client.get(path `/${api_version}/webhooks/${id}`, options);
|
|
18120
|
+
const { api_version = this._client.apiVersion } = params, body = __rest(params, ["api_version"]);
|
|
18121
|
+
return this._client.post(path `/${api_version}/webhooks`, Object.assign({ body }, options));
|
|
18040
18122
|
}
|
|
18041
18123
|
/**
|
|
18042
18124
|
* Updates an existing Webhook.
|
|
18043
18125
|
*/
|
|
18044
|
-
update(id, params, options) {
|
|
18045
|
-
const { api_version = this._client.apiVersion, update_mask } =
|
|
18126
|
+
update(id, params = {}, options) {
|
|
18127
|
+
const _a = params !== null && params !== void 0 ? params : {}, { api_version = this._client.apiVersion, update_mask } = _a, body = __rest(_a, ["api_version", "update_mask"]);
|
|
18046
18128
|
return this._client.patch(path `/${api_version}/webhooks/${id}`, Object.assign({ query: { update_mask }, body }, options));
|
|
18047
18129
|
}
|
|
18048
18130
|
/**
|
|
@@ -18059,6 +18141,13 @@ class BaseWebhooks extends APIResource {
|
|
|
18059
18141
|
const { api_version = this._client.apiVersion } = params !== null && params !== void 0 ? params : {};
|
|
18060
18142
|
return this._client.delete(path `/${api_version}/webhooks/${id}`, options);
|
|
18061
18143
|
}
|
|
18144
|
+
/**
|
|
18145
|
+
* Gets a specific Webhook.
|
|
18146
|
+
*/
|
|
18147
|
+
get(id, params = {}, options) {
|
|
18148
|
+
const { api_version = this._client.apiVersion } = params !== null && params !== void 0 ? params : {};
|
|
18149
|
+
return this._client.get(path `/${api_version}/webhooks/${id}`, options);
|
|
18150
|
+
}
|
|
18062
18151
|
/**
|
|
18063
18152
|
* Sends a ping event to a Webhook.
|
|
18064
18153
|
*/
|
|
@@ -19726,22 +19815,6 @@ function getTuningJobParametersToVertex(fromObject, _rootObject) {
|
|
|
19726
19815
|
}
|
|
19727
19816
|
return toObject;
|
|
19728
19817
|
}
|
|
19729
|
-
function listTuningJobsConfigToMldev(fromObject, parentObject, _rootObject) {
|
|
19730
|
-
const toObject = {};
|
|
19731
|
-
const fromPageSize = getValueByPath(fromObject, ['pageSize']);
|
|
19732
|
-
if (parentObject !== undefined && fromPageSize != null) {
|
|
19733
|
-
setValueByPath(parentObject, ['_query', 'pageSize'], fromPageSize);
|
|
19734
|
-
}
|
|
19735
|
-
const fromPageToken = getValueByPath(fromObject, ['pageToken']);
|
|
19736
|
-
if (parentObject !== undefined && fromPageToken != null) {
|
|
19737
|
-
setValueByPath(parentObject, ['_query', 'pageToken'], fromPageToken);
|
|
19738
|
-
}
|
|
19739
|
-
const fromFilter = getValueByPath(fromObject, ['filter']);
|
|
19740
|
-
if (parentObject !== undefined && fromFilter != null) {
|
|
19741
|
-
setValueByPath(parentObject, ['_query', 'filter'], fromFilter);
|
|
19742
|
-
}
|
|
19743
|
-
return toObject;
|
|
19744
|
-
}
|
|
19745
19818
|
function listTuningJobsConfigToVertex(fromObject, parentObject, _rootObject) {
|
|
19746
19819
|
const toObject = {};
|
|
19747
19820
|
const fromPageSize = getValueByPath(fromObject, ['pageSize']);
|
|
@@ -19758,14 +19831,6 @@ function listTuningJobsConfigToVertex(fromObject, parentObject, _rootObject) {
|
|
|
19758
19831
|
}
|
|
19759
19832
|
return toObject;
|
|
19760
19833
|
}
|
|
19761
|
-
function listTuningJobsParametersToMldev(fromObject, rootObject) {
|
|
19762
|
-
const toObject = {};
|
|
19763
|
-
const fromConfig = getValueByPath(fromObject, ['config']);
|
|
19764
|
-
if (fromConfig != null) {
|
|
19765
|
-
listTuningJobsConfigToMldev(fromConfig, toObject);
|
|
19766
|
-
}
|
|
19767
|
-
return toObject;
|
|
19768
|
-
}
|
|
19769
19834
|
function listTuningJobsParametersToVertex(fromObject, rootObject) {
|
|
19770
19835
|
const toObject = {};
|
|
19771
19836
|
const fromConfig = getValueByPath(fromObject, ['config']);
|
|
@@ -19774,32 +19839,6 @@ function listTuningJobsParametersToVertex(fromObject, rootObject) {
|
|
|
19774
19839
|
}
|
|
19775
19840
|
return toObject;
|
|
19776
19841
|
}
|
|
19777
|
-
function listTuningJobsResponseFromMldev(fromObject, rootObject) {
|
|
19778
|
-
const toObject = {};
|
|
19779
|
-
const fromSdkHttpResponse = getValueByPath(fromObject, [
|
|
19780
|
-
'sdkHttpResponse',
|
|
19781
|
-
]);
|
|
19782
|
-
if (fromSdkHttpResponse != null) {
|
|
19783
|
-
setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
|
|
19784
|
-
}
|
|
19785
|
-
const fromNextPageToken = getValueByPath(fromObject, [
|
|
19786
|
-
'nextPageToken',
|
|
19787
|
-
]);
|
|
19788
|
-
if (fromNextPageToken != null) {
|
|
19789
|
-
setValueByPath(toObject, ['nextPageToken'], fromNextPageToken);
|
|
19790
|
-
}
|
|
19791
|
-
const fromTuningJobs = getValueByPath(fromObject, ['tunedModels']);
|
|
19792
|
-
if (fromTuningJobs != null) {
|
|
19793
|
-
let transformedList = fromTuningJobs;
|
|
19794
|
-
if (Array.isArray(transformedList)) {
|
|
19795
|
-
transformedList = transformedList.map((item) => {
|
|
19796
|
-
return tuningJobFromMldev(item);
|
|
19797
|
-
});
|
|
19798
|
-
}
|
|
19799
|
-
setValueByPath(toObject, ['tuningJobs'], transformedList);
|
|
19800
|
-
}
|
|
19801
|
-
return toObject;
|
|
19802
|
-
}
|
|
19803
19842
|
function listTuningJobsResponseFromVertex(fromObject, rootObject) {
|
|
19804
19843
|
const toObject = {};
|
|
19805
19844
|
const fromSdkHttpResponse = getValueByPath(fromObject, [
|
|
@@ -19917,7 +19956,7 @@ function tuningDatasetToVertex(fromObject, parentObject, rootObject) {
|
|
|
19917
19956
|
}
|
|
19918
19957
|
}
|
|
19919
19958
|
if (getValueByPath(fromObject, ['examples']) !== undefined) {
|
|
19920
|
-
throw new Error('examples parameter is not supported in Vertex AI.');
|
|
19959
|
+
throw new Error('examples parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).');
|
|
19921
19960
|
}
|
|
19922
19961
|
return toObject;
|
|
19923
19962
|
}
|
|
@@ -20333,7 +20372,7 @@ class Tunings extends BaseModule {
|
|
|
20333
20372
|
}
|
|
20334
20373
|
}
|
|
20335
20374
|
async listInternal(params) {
|
|
20336
|
-
var _a, _b
|
|
20375
|
+
var _a, _b;
|
|
20337
20376
|
let response;
|
|
20338
20377
|
let path = '';
|
|
20339
20378
|
let queryParams = {};
|
|
@@ -20369,35 +20408,7 @@ class Tunings extends BaseModule {
|
|
|
20369
20408
|
});
|
|
20370
20409
|
}
|
|
20371
20410
|
else {
|
|
20372
|
-
|
|
20373
|
-
path = formatMap('tunedModels', body['_url']);
|
|
20374
|
-
queryParams = body['_query'];
|
|
20375
|
-
delete body['_url'];
|
|
20376
|
-
delete body['_query'];
|
|
20377
|
-
response = this.apiClient
|
|
20378
|
-
.request({
|
|
20379
|
-
path: path,
|
|
20380
|
-
queryParams: queryParams,
|
|
20381
|
-
body: JSON.stringify(body),
|
|
20382
|
-
httpMethod: 'GET',
|
|
20383
|
-
httpOptions: (_c = params.config) === null || _c === void 0 ? void 0 : _c.httpOptions,
|
|
20384
|
-
abortSignal: (_d = params.config) === null || _d === void 0 ? void 0 : _d.abortSignal,
|
|
20385
|
-
})
|
|
20386
|
-
.then((httpResponse) => {
|
|
20387
|
-
return httpResponse.json().then((jsonResponse) => {
|
|
20388
|
-
const response = jsonResponse;
|
|
20389
|
-
response.sdkHttpResponse = {
|
|
20390
|
-
headers: httpResponse.headers,
|
|
20391
|
-
};
|
|
20392
|
-
return response;
|
|
20393
|
-
});
|
|
20394
|
-
});
|
|
20395
|
-
return response.then((apiResponse) => {
|
|
20396
|
-
const resp = listTuningJobsResponseFromMldev(apiResponse);
|
|
20397
|
-
const typedResp = new ListTuningJobsResponse();
|
|
20398
|
-
Object.assign(typedResp, resp);
|
|
20399
|
-
return typedResp;
|
|
20400
|
-
});
|
|
20411
|
+
throw new Error('This method is only supported by the Gemini Enterprise Agent Platform (previously known as Vertex AI).');
|
|
20401
20412
|
}
|
|
20402
20413
|
}
|
|
20403
20414
|
/**
|
|
@@ -20514,7 +20525,7 @@ class Tunings extends BaseModule {
|
|
|
20514
20525
|
});
|
|
20515
20526
|
}
|
|
20516
20527
|
else {
|
|
20517
|
-
throw new Error('This method is only supported by the Vertex AI.');
|
|
20528
|
+
throw new Error('This method is only supported by the Gemini Enterprise Agent Platform (previously known as Vertex AI).');
|
|
20518
20529
|
}
|
|
20519
20530
|
}
|
|
20520
20531
|
async tuneMldevInternal(params) {
|
|
@@ -20870,5 +20881,5 @@ class GoogleGenAI {
|
|
|
20870
20881
|
}
|
|
20871
20882
|
}
|
|
20872
20883
|
|
|
20873
|
-
export { ActivityHandling, AdapterSize, AggregationMetric, ApiError, ApiSpec, AuthType, Batches, Behavior, BlockedReason, Caches, CancelTuningJobResponse, Chat, Chats, ComputeTokensResponse, ContentReferenceImage, ControlReferenceImage, ControlReferenceType, CountTokensResponse, CreateFileResponse, DeleteCachedContentResponse, DeleteFileResponse, DeleteModelResponse, DocumentState, DynamicRetrievalConfigMode, EditImageResponse, EditMode, EmbedContentResponse, EmbeddingApiType, EndSensitivity, Environment, EvaluateDatasetResponse, FeatureSelectionPreference, FileSource, FileState, Files, FinishReason, FunctionCallingConfigMode, FunctionResponse, FunctionResponseBlob, FunctionResponseFileData, FunctionResponsePart, FunctionResponseScheduling, GenerateContentResponse, GenerateContentResponsePromptFeedback, GenerateContentResponseUsageMetadata, GenerateImagesResponse, GenerateVideosOperation, GenerateVideosResponse, GoogleGenAI, HarmBlockMethod, HarmBlockThreshold, HarmCategory, HarmProbability, HarmSeverity, HttpElementLocation, HttpResponse, ImagePromptLanguage, ImportFileOperation, ImportFileResponse, InlinedEmbedContentResponse, InlinedResponse, JobState, Language, ListBatchJobsResponse, ListCachedContentsResponse, ListDocumentsResponse, ListFileSearchStoresResponse, ListFilesResponse, ListModelsResponse, ListTuningJobsResponse, Live, LiveClientToolResponse, LiveMusicPlaybackControl, LiveMusicServerMessage, LiveSendToolResponseParameters, LiveServerMessage, MaskReferenceImage, MaskReferenceMode, MediaModality, MediaResolution, Modality, ModelStage, Models, MusicGenerationMode, Operations, Outcome, PagedItem, Pager, PairwiseChoice, PartMediaResolutionLevel, PersonGeneration, PhishBlockThreshold, ProminentPeople, RawReferenceImage, RecontextImageResponse, RegisterFilesResponse, ReplayResponse, ResourceScope, SafetyFilterLevel, Scale, SegmentImageResponse, SegmentMode, ServiceTier, Session, SingleEmbedContentResponse, StartSensitivity, StyleReferenceImage, SubjectReferenceImage, SubjectReferenceType, ThinkingLevel, Tokens, ToolResponse, ToolType, TrafficType, TuningJobState, TuningMethod, TuningMode, TuningTask, TurnCompleteReason, TurnCoverage, Type, UploadToFileSearchStoreOperation, UploadToFileSearchStoreResponse, UploadToFileSearchStoreResumableResponse, UpscaleImageResponse, UrlRetrievalStatus, VadSignalType, VideoCompressionQuality, VideoGenerationMaskMode, VideoGenerationReferenceType, VoiceActivityType, createFunctionResponsePartFromBase64, createFunctionResponsePartFromUri, createModelContent, createPartFromBase64, createPartFromCodeExecutionResult, createPartFromExecutableCode, createPartFromFunctionCall, createPartFromFunctionResponse, createPartFromText, createPartFromUri, createUserContent, mcpToTool, setDefaultBaseUrls };
|
|
20884
|
+
export { ActivityHandling, AdapterSize, AggregationMetric, ApiError, ApiSpec, AuthType, Batches, Behavior, BlockedReason, Caches, CancelTuningJobResponse, Chat, Chats, ComputeTokensResponse, ContentReferenceImage, ControlReferenceImage, ControlReferenceType, CountTokensResponse, CreateFileResponse, DeleteCachedContentResponse, DeleteFileResponse, DeleteModelResponse, DocumentState, DynamicRetrievalConfigMode, EditImageResponse, EditMode, EmbedContentResponse, EmbeddingApiType, EndSensitivity, Environment, EvaluateDatasetResponse, FeatureSelectionPreference, FileSource, FileState, Files, FinishReason, FunctionCallingConfigMode, FunctionResponse, FunctionResponseBlob, FunctionResponseFileData, FunctionResponsePart, FunctionResponseScheduling, GenerateContentResponse, GenerateContentResponsePromptFeedback, GenerateContentResponseUsageMetadata, GenerateImagesResponse, GenerateVideosOperation, GenerateVideosResponse, GoogleGenAI, HarmBlockMethod, HarmBlockThreshold, HarmCategory, HarmProbability, HarmSeverity, HttpElementLocation, HttpResponse, ImagePromptLanguage, ImageResizeMode, ImportFileOperation, ImportFileResponse, InlinedEmbedContentResponse, InlinedResponse, JobState, Language, ListBatchJobsResponse, ListCachedContentsResponse, ListDocumentsResponse, ListFileSearchStoresResponse, ListFilesResponse, ListModelsResponse, ListTuningJobsResponse, Live, LiveClientToolResponse, LiveMusicPlaybackControl, LiveMusicServerMessage, LiveSendToolResponseParameters, LiveServerMessage, MaskReferenceImage, MaskReferenceMode, MediaModality, MediaResolution, Modality, ModelStage, Models, MusicGenerationMode, Operations, Outcome, PagedItem, Pager, PairwiseChoice, PartMediaResolutionLevel, PersonGeneration, PhishBlockThreshold, ProminentPeople, RawReferenceImage, RecontextImageResponse, RegisterFilesResponse, ReplayResponse, ResourceScope, SafetyFilterLevel, Scale, SegmentImageResponse, SegmentMode, ServiceTier, Session, SingleEmbedContentResponse, StartSensitivity, StyleReferenceImage, SubjectReferenceImage, SubjectReferenceType, ThinkingLevel, Tokens, ToolResponse, ToolType, TrafficType, TuningJobState, TuningMethod, TuningMode, TuningTask, TurnCompleteReason, TurnCoverage, Type, UploadToFileSearchStoreOperation, UploadToFileSearchStoreResponse, UploadToFileSearchStoreResumableResponse, UpscaleImageResponse, UrlRetrievalStatus, VadSignalType, VideoCompressionQuality, VideoGenerationMaskMode, VideoGenerationReferenceType, VoiceActivityType, createFunctionResponsePartFromBase64, createFunctionResponsePartFromUri, createModelContent, createPartFromBase64, createPartFromCodeExecutionResult, createPartFromExecutableCode, createPartFromFunctionCall, createPartFromFunctionResponse, createPartFromText, createPartFromUri, createUserContent, mcpToTool, setDefaultBaseUrls };
|
|
20874
20885
|
//# sourceMappingURL=index.mjs.map
|