@google/genai 1.11.0 → 1.13.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 +170 -4
- package/dist/index.cjs +448 -27
- package/dist/index.mjs +448 -28
- package/dist/index.mjs.map +1 -1
- package/dist/node/index.cjs +448 -27
- package/dist/node/index.mjs +448 -28
- package/dist/node/index.mjs.map +1 -1
- package/dist/node/node.d.ts +170 -4
- package/dist/web/index.mjs +448 -28
- package/dist/web/index.mjs.map +1 -1
- package/dist/web/web.d.ts +170 -4
- package/package.json +17 -8
package/dist/index.mjs
CHANGED
|
@@ -414,6 +414,14 @@ var UrlRetrievalStatus;
|
|
|
414
414
|
* Url retrieval is failed due to error.
|
|
415
415
|
*/
|
|
416
416
|
UrlRetrievalStatus["URL_RETRIEVAL_STATUS_ERROR"] = "URL_RETRIEVAL_STATUS_ERROR";
|
|
417
|
+
/**
|
|
418
|
+
* Url retrieval is failed because the content is behind paywall.
|
|
419
|
+
*/
|
|
420
|
+
UrlRetrievalStatus["URL_RETRIEVAL_STATUS_PAYWALL"] = "URL_RETRIEVAL_STATUS_PAYWALL";
|
|
421
|
+
/**
|
|
422
|
+
* Url retrieval is failed because the content is unsafe.
|
|
423
|
+
*/
|
|
424
|
+
UrlRetrievalStatus["URL_RETRIEVAL_STATUS_UNSAFE"] = "URL_RETRIEVAL_STATUS_UNSAFE";
|
|
417
425
|
})(UrlRetrievalStatus || (UrlRetrievalStatus = {}));
|
|
418
426
|
/** Output only. The reason why the model stopped generating tokens.
|
|
419
427
|
|
|
@@ -1040,6 +1048,29 @@ var Scale;
|
|
|
1040
1048
|
*/
|
|
1041
1049
|
Scale["B_MAJOR_A_FLAT_MINOR"] = "B_MAJOR_A_FLAT_MINOR";
|
|
1042
1050
|
})(Scale || (Scale = {}));
|
|
1051
|
+
/** The mode of music generation. */
|
|
1052
|
+
var MusicGenerationMode;
|
|
1053
|
+
(function (MusicGenerationMode) {
|
|
1054
|
+
/**
|
|
1055
|
+
* Rely on the server default generation mode.
|
|
1056
|
+
*/
|
|
1057
|
+
MusicGenerationMode["MUSIC_GENERATION_MODE_UNSPECIFIED"] = "MUSIC_GENERATION_MODE_UNSPECIFIED";
|
|
1058
|
+
/**
|
|
1059
|
+
* Steer text prompts to regions of latent space with higher quality
|
|
1060
|
+
music.
|
|
1061
|
+
*/
|
|
1062
|
+
MusicGenerationMode["QUALITY"] = "QUALITY";
|
|
1063
|
+
/**
|
|
1064
|
+
* Steer text prompts to regions of latent space with a larger
|
|
1065
|
+
diversity of music.
|
|
1066
|
+
*/
|
|
1067
|
+
MusicGenerationMode["DIVERSITY"] = "DIVERSITY";
|
|
1068
|
+
/**
|
|
1069
|
+
* Steer text prompts to regions of latent space more likely to
|
|
1070
|
+
generate music with vocals.
|
|
1071
|
+
*/
|
|
1072
|
+
MusicGenerationMode["VOCALIZATION"] = "VOCALIZATION";
|
|
1073
|
+
})(MusicGenerationMode || (MusicGenerationMode = {}));
|
|
1043
1074
|
/** The playback control signal to apply to the music generation. */
|
|
1044
1075
|
var LiveMusicPlaybackControl;
|
|
1045
1076
|
(function (LiveMusicPlaybackControl) {
|
|
@@ -1463,6 +1494,9 @@ class EditImageResponse {
|
|
|
1463
1494
|
}
|
|
1464
1495
|
class UpscaleImageResponse {
|
|
1465
1496
|
}
|
|
1497
|
+
/** The output images response. */
|
|
1498
|
+
class RecontextImageResponse {
|
|
1499
|
+
}
|
|
1466
1500
|
class ListModelsResponse {
|
|
1467
1501
|
}
|
|
1468
1502
|
class DeleteModelResponse {
|
|
@@ -1718,8 +1752,8 @@ class GenerateVideosOperation {
|
|
|
1718
1752
|
},
|
|
1719
1753
|
};
|
|
1720
1754
|
});
|
|
1721
|
-
operationResponse.raiMediaFilteredCount =
|
|
1722
|
-
operationResponse.raiMediaFilteredReasons =
|
|
1755
|
+
operationResponse.raiMediaFilteredCount = generatedVideoResponse === null || generatedVideoResponse === void 0 ? void 0 : generatedVideoResponse['raiMediaFilteredCount'];
|
|
1756
|
+
operationResponse.raiMediaFilteredReasons = generatedVideoResponse === null || generatedVideoResponse === void 0 ? void 0 : generatedVideoResponse['raiMediaFilteredReasons'];
|
|
1723
1757
|
operation.response = operationResponse;
|
|
1724
1758
|
}
|
|
1725
1759
|
}
|
|
@@ -3668,6 +3702,10 @@ function generateContentResponseFromMldev$1(fromObject) {
|
|
|
3668
3702
|
if (fromPromptFeedback != null) {
|
|
3669
3703
|
setValueByPath(toObject, ['promptFeedback'], fromPromptFeedback);
|
|
3670
3704
|
}
|
|
3705
|
+
const fromResponseId = getValueByPath(fromObject, ['responseId']);
|
|
3706
|
+
if (fromResponseId != null) {
|
|
3707
|
+
setValueByPath(toObject, ['responseId'], fromResponseId);
|
|
3708
|
+
}
|
|
3671
3709
|
const fromUsageMetadata = getValueByPath(fromObject, [
|
|
3672
3710
|
'usageMetadata',
|
|
3673
3711
|
]);
|
|
@@ -3801,6 +3839,12 @@ function listBatchJobsResponseFromMldev(fromObject) {
|
|
|
3801
3839
|
}
|
|
3802
3840
|
function deleteResourceJobFromMldev(fromObject) {
|
|
3803
3841
|
const toObject = {};
|
|
3842
|
+
const fromSdkHttpResponse = getValueByPath(fromObject, [
|
|
3843
|
+
'sdkHttpResponse',
|
|
3844
|
+
]);
|
|
3845
|
+
if (fromSdkHttpResponse != null) {
|
|
3846
|
+
setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
|
|
3847
|
+
}
|
|
3804
3848
|
const fromName = getValueByPath(fromObject, ['name']);
|
|
3805
3849
|
if (fromName != null) {
|
|
3806
3850
|
setValueByPath(toObject, ['name'], fromName);
|
|
@@ -3950,6 +3994,12 @@ function listBatchJobsResponseFromVertex(fromObject) {
|
|
|
3950
3994
|
}
|
|
3951
3995
|
function deleteResourceJobFromVertex(fromObject) {
|
|
3952
3996
|
const toObject = {};
|
|
3997
|
+
const fromSdkHttpResponse = getValueByPath(fromObject, [
|
|
3998
|
+
'sdkHttpResponse',
|
|
3999
|
+
]);
|
|
4000
|
+
if (fromSdkHttpResponse != null) {
|
|
4001
|
+
setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
|
|
4002
|
+
}
|
|
3953
4003
|
const fromName = getValueByPath(fromObject, ['name']);
|
|
3954
4004
|
if (fromName != null) {
|
|
3955
4005
|
setValueByPath(toObject, ['name'], fromName);
|
|
@@ -4495,7 +4545,13 @@ class Batches extends BaseModule {
|
|
|
4495
4545
|
abortSignal: (_b = params.config) === null || _b === void 0 ? void 0 : _b.abortSignal,
|
|
4496
4546
|
})
|
|
4497
4547
|
.then((httpResponse) => {
|
|
4498
|
-
return httpResponse.json()
|
|
4548
|
+
return httpResponse.json().then((jsonResponse) => {
|
|
4549
|
+
const response = jsonResponse;
|
|
4550
|
+
response.sdkHttpResponse = {
|
|
4551
|
+
headers: httpResponse.headers,
|
|
4552
|
+
};
|
|
4553
|
+
return response;
|
|
4554
|
+
});
|
|
4499
4555
|
});
|
|
4500
4556
|
return response.then((apiResponse) => {
|
|
4501
4557
|
const resp = deleteResourceJobFromVertex(apiResponse);
|
|
@@ -4519,7 +4575,13 @@ class Batches extends BaseModule {
|
|
|
4519
4575
|
abortSignal: (_d = params.config) === null || _d === void 0 ? void 0 : _d.abortSignal,
|
|
4520
4576
|
})
|
|
4521
4577
|
.then((httpResponse) => {
|
|
4522
|
-
return httpResponse.json()
|
|
4578
|
+
return httpResponse.json().then((jsonResponse) => {
|
|
4579
|
+
const response = jsonResponse;
|
|
4580
|
+
response.sdkHttpResponse = {
|
|
4581
|
+
headers: httpResponse.headers,
|
|
4582
|
+
};
|
|
4583
|
+
return response;
|
|
4584
|
+
});
|
|
4523
4585
|
});
|
|
4524
4586
|
return response.then((apiResponse) => {
|
|
4525
4587
|
const resp = deleteResourceJobFromMldev(apiResponse);
|
|
@@ -6390,7 +6452,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
|
|
|
6390
6452
|
const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
|
|
6391
6453
|
const USER_AGENT_HEADER = 'User-Agent';
|
|
6392
6454
|
const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
|
|
6393
|
-
const SDK_VERSION = '1.
|
|
6455
|
+
const SDK_VERSION = '1.13.0'; // x-release-please-version
|
|
6394
6456
|
const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
|
|
6395
6457
|
const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
|
|
6396
6458
|
const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';
|
|
@@ -8277,6 +8339,12 @@ function liveMusicGenerationConfigToMldev(fromObject) {
|
|
|
8277
8339
|
if (fromOnlyBassAndDrums != null) {
|
|
8278
8340
|
setValueByPath(toObject, ['onlyBassAndDrums'], fromOnlyBassAndDrums);
|
|
8279
8341
|
}
|
|
8342
|
+
const fromMusicGenerationMode = getValueByPath(fromObject, [
|
|
8343
|
+
'musicGenerationMode',
|
|
8344
|
+
]);
|
|
8345
|
+
if (fromMusicGenerationMode != null) {
|
|
8346
|
+
setValueByPath(toObject, ['musicGenerationMode'], fromMusicGenerationMode);
|
|
8347
|
+
}
|
|
8280
8348
|
return toObject;
|
|
8281
8349
|
}
|
|
8282
8350
|
function liveMusicSetConfigParametersToMldev(fromObject) {
|
|
@@ -9435,6 +9503,12 @@ function liveMusicGenerationConfigFromMldev(fromObject) {
|
|
|
9435
9503
|
if (fromOnlyBassAndDrums != null) {
|
|
9436
9504
|
setValueByPath(toObject, ['onlyBassAndDrums'], fromOnlyBassAndDrums);
|
|
9437
9505
|
}
|
|
9506
|
+
const fromMusicGenerationMode = getValueByPath(fromObject, [
|
|
9507
|
+
'musicGenerationMode',
|
|
9508
|
+
]);
|
|
9509
|
+
if (fromMusicGenerationMode != null) {
|
|
9510
|
+
setValueByPath(toObject, ['musicGenerationMode'], fromMusicGenerationMode);
|
|
9511
|
+
}
|
|
9438
9512
|
return toObject;
|
|
9439
9513
|
}
|
|
9440
9514
|
function liveMusicSourceMetadataFromMldev(fromObject) {
|
|
@@ -10701,8 +10775,9 @@ function generateImagesConfigToMldev(fromObject, parentObject) {
|
|
|
10701
10775
|
if (getValueByPath(fromObject, ['addWatermark']) !== undefined) {
|
|
10702
10776
|
throw new Error('addWatermark parameter is not supported in Gemini API.');
|
|
10703
10777
|
}
|
|
10704
|
-
|
|
10705
|
-
|
|
10778
|
+
const fromImageSize = getValueByPath(fromObject, ['imageSize']);
|
|
10779
|
+
if (parentObject !== undefined && fromImageSize != null) {
|
|
10780
|
+
setValueByPath(parentObject, ['parameters', 'sampleImageSize'], fromImageSize);
|
|
10706
10781
|
}
|
|
10707
10782
|
if (getValueByPath(fromObject, ['enhancePrompt']) !== undefined) {
|
|
10708
10783
|
throw new Error('enhancePrompt parameter is not supported in Gemini API.');
|
|
@@ -12104,6 +12179,106 @@ function upscaleImageAPIParametersInternalToVertex(apiClient, fromObject) {
|
|
|
12104
12179
|
}
|
|
12105
12180
|
return toObject;
|
|
12106
12181
|
}
|
|
12182
|
+
function productImageToVertex(fromObject) {
|
|
12183
|
+
const toObject = {};
|
|
12184
|
+
const fromProductImage = getValueByPath(fromObject, ['productImage']);
|
|
12185
|
+
if (fromProductImage != null) {
|
|
12186
|
+
setValueByPath(toObject, ['image'], imageToVertex(fromProductImage));
|
|
12187
|
+
}
|
|
12188
|
+
return toObject;
|
|
12189
|
+
}
|
|
12190
|
+
function recontextImageSourceToVertex(fromObject, parentObject) {
|
|
12191
|
+
const toObject = {};
|
|
12192
|
+
const fromPrompt = getValueByPath(fromObject, ['prompt']);
|
|
12193
|
+
if (parentObject !== undefined && fromPrompt != null) {
|
|
12194
|
+
setValueByPath(parentObject, ['instances[0]', 'prompt'], fromPrompt);
|
|
12195
|
+
}
|
|
12196
|
+
const fromPersonImage = getValueByPath(fromObject, ['personImage']);
|
|
12197
|
+
if (parentObject !== undefined && fromPersonImage != null) {
|
|
12198
|
+
setValueByPath(parentObject, ['instances[0]', 'personImage', 'image'], imageToVertex(fromPersonImage));
|
|
12199
|
+
}
|
|
12200
|
+
const fromProductImages = getValueByPath(fromObject, [
|
|
12201
|
+
'productImages',
|
|
12202
|
+
]);
|
|
12203
|
+
if (parentObject !== undefined && fromProductImages != null) {
|
|
12204
|
+
let transformedList = fromProductImages;
|
|
12205
|
+
if (Array.isArray(transformedList)) {
|
|
12206
|
+
transformedList = transformedList.map((item) => {
|
|
12207
|
+
return productImageToVertex(item);
|
|
12208
|
+
});
|
|
12209
|
+
}
|
|
12210
|
+
setValueByPath(parentObject, ['instances[0]', 'productImages'], transformedList);
|
|
12211
|
+
}
|
|
12212
|
+
return toObject;
|
|
12213
|
+
}
|
|
12214
|
+
function recontextImageConfigToVertex(fromObject, parentObject) {
|
|
12215
|
+
const toObject = {};
|
|
12216
|
+
const fromNumberOfImages = getValueByPath(fromObject, [
|
|
12217
|
+
'numberOfImages',
|
|
12218
|
+
]);
|
|
12219
|
+
if (parentObject !== undefined && fromNumberOfImages != null) {
|
|
12220
|
+
setValueByPath(parentObject, ['parameters', 'sampleCount'], fromNumberOfImages);
|
|
12221
|
+
}
|
|
12222
|
+
const fromBaseSteps = getValueByPath(fromObject, ['baseSteps']);
|
|
12223
|
+
if (parentObject !== undefined && fromBaseSteps != null) {
|
|
12224
|
+
setValueByPath(parentObject, ['parameters', 'editConfig', 'baseSteps'], fromBaseSteps);
|
|
12225
|
+
}
|
|
12226
|
+
const fromOutputGcsUri = getValueByPath(fromObject, ['outputGcsUri']);
|
|
12227
|
+
if (parentObject !== undefined && fromOutputGcsUri != null) {
|
|
12228
|
+
setValueByPath(parentObject, ['parameters', 'storageUri'], fromOutputGcsUri);
|
|
12229
|
+
}
|
|
12230
|
+
const fromSeed = getValueByPath(fromObject, ['seed']);
|
|
12231
|
+
if (parentObject !== undefined && fromSeed != null) {
|
|
12232
|
+
setValueByPath(parentObject, ['parameters', 'seed'], fromSeed);
|
|
12233
|
+
}
|
|
12234
|
+
const fromSafetyFilterLevel = getValueByPath(fromObject, [
|
|
12235
|
+
'safetyFilterLevel',
|
|
12236
|
+
]);
|
|
12237
|
+
if (parentObject !== undefined && fromSafetyFilterLevel != null) {
|
|
12238
|
+
setValueByPath(parentObject, ['parameters', 'safetySetting'], fromSafetyFilterLevel);
|
|
12239
|
+
}
|
|
12240
|
+
const fromPersonGeneration = getValueByPath(fromObject, [
|
|
12241
|
+
'personGeneration',
|
|
12242
|
+
]);
|
|
12243
|
+
if (parentObject !== undefined && fromPersonGeneration != null) {
|
|
12244
|
+
setValueByPath(parentObject, ['parameters', 'personGeneration'], fromPersonGeneration);
|
|
12245
|
+
}
|
|
12246
|
+
const fromOutputMimeType = getValueByPath(fromObject, [
|
|
12247
|
+
'outputMimeType',
|
|
12248
|
+
]);
|
|
12249
|
+
if (parentObject !== undefined && fromOutputMimeType != null) {
|
|
12250
|
+
setValueByPath(parentObject, ['parameters', 'outputOptions', 'mimeType'], fromOutputMimeType);
|
|
12251
|
+
}
|
|
12252
|
+
const fromOutputCompressionQuality = getValueByPath(fromObject, [
|
|
12253
|
+
'outputCompressionQuality',
|
|
12254
|
+
]);
|
|
12255
|
+
if (parentObject !== undefined && fromOutputCompressionQuality != null) {
|
|
12256
|
+
setValueByPath(parentObject, ['parameters', 'outputOptions', 'compressionQuality'], fromOutputCompressionQuality);
|
|
12257
|
+
}
|
|
12258
|
+
const fromEnhancePrompt = getValueByPath(fromObject, [
|
|
12259
|
+
'enhancePrompt',
|
|
12260
|
+
]);
|
|
12261
|
+
if (parentObject !== undefined && fromEnhancePrompt != null) {
|
|
12262
|
+
setValueByPath(parentObject, ['parameters', 'enhancePrompt'], fromEnhancePrompt);
|
|
12263
|
+
}
|
|
12264
|
+
return toObject;
|
|
12265
|
+
}
|
|
12266
|
+
function recontextImageParametersToVertex(apiClient, fromObject) {
|
|
12267
|
+
const toObject = {};
|
|
12268
|
+
const fromModel = getValueByPath(fromObject, ['model']);
|
|
12269
|
+
if (fromModel != null) {
|
|
12270
|
+
setValueByPath(toObject, ['_url', 'model'], tModel(apiClient, fromModel));
|
|
12271
|
+
}
|
|
12272
|
+
const fromSource = getValueByPath(fromObject, ['source']);
|
|
12273
|
+
if (fromSource != null) {
|
|
12274
|
+
setValueByPath(toObject, ['config'], recontextImageSourceToVertex(fromSource, toObject));
|
|
12275
|
+
}
|
|
12276
|
+
const fromConfig = getValueByPath(fromObject, ['config']);
|
|
12277
|
+
if (fromConfig != null) {
|
|
12278
|
+
setValueByPath(toObject, ['config'], recontextImageConfigToVertex(fromConfig, toObject));
|
|
12279
|
+
}
|
|
12280
|
+
return toObject;
|
|
12281
|
+
}
|
|
12107
12282
|
function getModelParametersToVertex(apiClient, fromObject) {
|
|
12108
12283
|
const toObject = {};
|
|
12109
12284
|
const fromModel = getValueByPath(fromObject, ['model']);
|
|
@@ -12600,6 +12775,10 @@ function generateContentResponseFromMldev(fromObject) {
|
|
|
12600
12775
|
if (fromPromptFeedback != null) {
|
|
12601
12776
|
setValueByPath(toObject, ['promptFeedback'], fromPromptFeedback);
|
|
12602
12777
|
}
|
|
12778
|
+
const fromResponseId = getValueByPath(fromObject, ['responseId']);
|
|
12779
|
+
if (fromResponseId != null) {
|
|
12780
|
+
setValueByPath(toObject, ['responseId'], fromResponseId);
|
|
12781
|
+
}
|
|
12603
12782
|
const fromUsageMetadata = getValueByPath(fromObject, [
|
|
12604
12783
|
'usageMetadata',
|
|
12605
12784
|
]);
|
|
@@ -12622,6 +12801,12 @@ function embedContentMetadataFromMldev() {
|
|
|
12622
12801
|
}
|
|
12623
12802
|
function embedContentResponseFromMldev(fromObject) {
|
|
12624
12803
|
const toObject = {};
|
|
12804
|
+
const fromSdkHttpResponse = getValueByPath(fromObject, [
|
|
12805
|
+
'sdkHttpResponse',
|
|
12806
|
+
]);
|
|
12807
|
+
if (fromSdkHttpResponse != null) {
|
|
12808
|
+
setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
|
|
12809
|
+
}
|
|
12625
12810
|
const fromEmbeddings = getValueByPath(fromObject, ['embeddings']);
|
|
12626
12811
|
if (fromEmbeddings != null) {
|
|
12627
12812
|
let transformedList = fromEmbeddings;
|
|
@@ -12694,6 +12879,12 @@ function generatedImageFromMldev(fromObject) {
|
|
|
12694
12879
|
}
|
|
12695
12880
|
function generateImagesResponseFromMldev(fromObject) {
|
|
12696
12881
|
const toObject = {};
|
|
12882
|
+
const fromSdkHttpResponse = getValueByPath(fromObject, [
|
|
12883
|
+
'sdkHttpResponse',
|
|
12884
|
+
]);
|
|
12885
|
+
if (fromSdkHttpResponse != null) {
|
|
12886
|
+
setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
|
|
12887
|
+
}
|
|
12697
12888
|
const fromGeneratedImages = getValueByPath(fromObject, [
|
|
12698
12889
|
'predictions',
|
|
12699
12890
|
]);
|
|
@@ -12804,6 +12995,12 @@ function deleteModelResponseFromMldev() {
|
|
|
12804
12995
|
}
|
|
12805
12996
|
function countTokensResponseFromMldev(fromObject) {
|
|
12806
12997
|
const toObject = {};
|
|
12998
|
+
const fromSdkHttpResponse = getValueByPath(fromObject, [
|
|
12999
|
+
'sdkHttpResponse',
|
|
13000
|
+
]);
|
|
13001
|
+
if (fromSdkHttpResponse != null) {
|
|
13002
|
+
setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
|
|
13003
|
+
}
|
|
12807
13004
|
const fromTotalTokens = getValueByPath(fromObject, ['totalTokens']);
|
|
12808
13005
|
if (fromTotalTokens != null) {
|
|
12809
13006
|
setValueByPath(toObject, ['totalTokens'], fromTotalTokens);
|
|
@@ -13132,10 +13329,6 @@ function generateContentResponseFromVertex(fromObject) {
|
|
|
13132
13329
|
if (fromCreateTime != null) {
|
|
13133
13330
|
setValueByPath(toObject, ['createTime'], fromCreateTime);
|
|
13134
13331
|
}
|
|
13135
|
-
const fromResponseId = getValueByPath(fromObject, ['responseId']);
|
|
13136
|
-
if (fromResponseId != null) {
|
|
13137
|
-
setValueByPath(toObject, ['responseId'], fromResponseId);
|
|
13138
|
-
}
|
|
13139
13332
|
const fromModelVersion = getValueByPath(fromObject, ['modelVersion']);
|
|
13140
13333
|
if (fromModelVersion != null) {
|
|
13141
13334
|
setValueByPath(toObject, ['modelVersion'], fromModelVersion);
|
|
@@ -13146,6 +13339,10 @@ function generateContentResponseFromVertex(fromObject) {
|
|
|
13146
13339
|
if (fromPromptFeedback != null) {
|
|
13147
13340
|
setValueByPath(toObject, ['promptFeedback'], fromPromptFeedback);
|
|
13148
13341
|
}
|
|
13342
|
+
const fromResponseId = getValueByPath(fromObject, ['responseId']);
|
|
13343
|
+
if (fromResponseId != null) {
|
|
13344
|
+
setValueByPath(toObject, ['responseId'], fromResponseId);
|
|
13345
|
+
}
|
|
13149
13346
|
const fromUsageMetadata = getValueByPath(fromObject, [
|
|
13150
13347
|
'usageMetadata',
|
|
13151
13348
|
]);
|
|
@@ -13190,6 +13387,12 @@ function embedContentMetadataFromVertex(fromObject) {
|
|
|
13190
13387
|
}
|
|
13191
13388
|
function embedContentResponseFromVertex(fromObject) {
|
|
13192
13389
|
const toObject = {};
|
|
13390
|
+
const fromSdkHttpResponse = getValueByPath(fromObject, [
|
|
13391
|
+
'sdkHttpResponse',
|
|
13392
|
+
]);
|
|
13393
|
+
if (fromSdkHttpResponse != null) {
|
|
13394
|
+
setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
|
|
13395
|
+
}
|
|
13193
13396
|
const fromEmbeddings = getValueByPath(fromObject, [
|
|
13194
13397
|
'predictions[]',
|
|
13195
13398
|
'embeddings',
|
|
@@ -13273,6 +13476,12 @@ function generatedImageFromVertex(fromObject) {
|
|
|
13273
13476
|
}
|
|
13274
13477
|
function generateImagesResponseFromVertex(fromObject) {
|
|
13275
13478
|
const toObject = {};
|
|
13479
|
+
const fromSdkHttpResponse = getValueByPath(fromObject, [
|
|
13480
|
+
'sdkHttpResponse',
|
|
13481
|
+
]);
|
|
13482
|
+
if (fromSdkHttpResponse != null) {
|
|
13483
|
+
setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
|
|
13484
|
+
}
|
|
13276
13485
|
const fromGeneratedImages = getValueByPath(fromObject, [
|
|
13277
13486
|
'predictions',
|
|
13278
13487
|
]);
|
|
@@ -13295,6 +13504,12 @@ function generateImagesResponseFromVertex(fromObject) {
|
|
|
13295
13504
|
}
|
|
13296
13505
|
function editImageResponseFromVertex(fromObject) {
|
|
13297
13506
|
const toObject = {};
|
|
13507
|
+
const fromSdkHttpResponse = getValueByPath(fromObject, [
|
|
13508
|
+
'sdkHttpResponse',
|
|
13509
|
+
]);
|
|
13510
|
+
if (fromSdkHttpResponse != null) {
|
|
13511
|
+
setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
|
|
13512
|
+
}
|
|
13298
13513
|
const fromGeneratedImages = getValueByPath(fromObject, [
|
|
13299
13514
|
'predictions',
|
|
13300
13515
|
]);
|
|
@@ -13310,6 +13525,28 @@ function editImageResponseFromVertex(fromObject) {
|
|
|
13310
13525
|
return toObject;
|
|
13311
13526
|
}
|
|
13312
13527
|
function upscaleImageResponseFromVertex(fromObject) {
|
|
13528
|
+
const toObject = {};
|
|
13529
|
+
const fromSdkHttpResponse = getValueByPath(fromObject, [
|
|
13530
|
+
'sdkHttpResponse',
|
|
13531
|
+
]);
|
|
13532
|
+
if (fromSdkHttpResponse != null) {
|
|
13533
|
+
setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
|
|
13534
|
+
}
|
|
13535
|
+
const fromGeneratedImages = getValueByPath(fromObject, [
|
|
13536
|
+
'predictions',
|
|
13537
|
+
]);
|
|
13538
|
+
if (fromGeneratedImages != null) {
|
|
13539
|
+
let transformedList = fromGeneratedImages;
|
|
13540
|
+
if (Array.isArray(transformedList)) {
|
|
13541
|
+
transformedList = transformedList.map((item) => {
|
|
13542
|
+
return generatedImageFromVertex(item);
|
|
13543
|
+
});
|
|
13544
|
+
}
|
|
13545
|
+
setValueByPath(toObject, ['generatedImages'], transformedList);
|
|
13546
|
+
}
|
|
13547
|
+
return toObject;
|
|
13548
|
+
}
|
|
13549
|
+
function recontextImageResponseFromVertex(fromObject) {
|
|
13313
13550
|
const toObject = {};
|
|
13314
13551
|
const fromGeneratedImages = getValueByPath(fromObject, [
|
|
13315
13552
|
'predictions',
|
|
@@ -13460,6 +13697,12 @@ function deleteModelResponseFromVertex() {
|
|
|
13460
13697
|
}
|
|
13461
13698
|
function countTokensResponseFromVertex(fromObject) {
|
|
13462
13699
|
const toObject = {};
|
|
13700
|
+
const fromSdkHttpResponse = getValueByPath(fromObject, [
|
|
13701
|
+
'sdkHttpResponse',
|
|
13702
|
+
]);
|
|
13703
|
+
if (fromSdkHttpResponse != null) {
|
|
13704
|
+
setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
|
|
13705
|
+
}
|
|
13463
13706
|
const fromTotalTokens = getValueByPath(fromObject, ['totalTokens']);
|
|
13464
13707
|
if (fromTotalTokens != null) {
|
|
13465
13708
|
setValueByPath(toObject, ['totalTokens'], fromTotalTokens);
|
|
@@ -13468,6 +13711,12 @@ function countTokensResponseFromVertex(fromObject) {
|
|
|
13468
13711
|
}
|
|
13469
13712
|
function computeTokensResponseFromVertex(fromObject) {
|
|
13470
13713
|
const toObject = {};
|
|
13714
|
+
const fromSdkHttpResponse = getValueByPath(fromObject, [
|
|
13715
|
+
'sdkHttpResponse',
|
|
13716
|
+
]);
|
|
13717
|
+
if (fromSdkHttpResponse != null) {
|
|
13718
|
+
setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
|
|
13719
|
+
}
|
|
13471
13720
|
const fromTokensInfo = getValueByPath(fromObject, ['tokensInfo']);
|
|
13472
13721
|
if (fromTokensInfo != null) {
|
|
13473
13722
|
setValueByPath(toObject, ['tokensInfo'], fromTokensInfo);
|
|
@@ -14072,13 +14321,13 @@ class Live {
|
|
|
14072
14321
|
const websocketBaseUrl = this.apiClient.getWebsocketBaseUrl();
|
|
14073
14322
|
const apiVersion = this.apiClient.getApiVersion();
|
|
14074
14323
|
let url;
|
|
14075
|
-
const
|
|
14324
|
+
const clientHeaders = this.apiClient.getHeaders();
|
|
14076
14325
|
if (params.config &&
|
|
14077
14326
|
params.config.tools &&
|
|
14078
14327
|
hasMcpToolUsage(params.config.tools)) {
|
|
14079
|
-
setMcpUsageHeader(
|
|
14328
|
+
setMcpUsageHeader(clientHeaders);
|
|
14080
14329
|
}
|
|
14081
|
-
const headers = mapToHeaders(
|
|
14330
|
+
const headers = mapToHeaders(clientHeaders);
|
|
14082
14331
|
if (this.apiClient.isVertexAI()) {
|
|
14083
14332
|
url = `${websocketBaseUrl}/ws/google.cloud.aiplatform.${apiVersion}.LlmBidiService/BidiGenerateContent`;
|
|
14084
14333
|
await this.auth.addAuthHeaders(headers);
|
|
@@ -14645,11 +14894,13 @@ class Models extends BaseModule {
|
|
|
14645
14894
|
response = {
|
|
14646
14895
|
generatedImages: generatedImages,
|
|
14647
14896
|
positivePromptSafetyAttributes: positivePromptSafetyAttributes,
|
|
14897
|
+
sdkHttpResponse: apiResponse.sdkHttpResponse,
|
|
14648
14898
|
};
|
|
14649
14899
|
}
|
|
14650
14900
|
else {
|
|
14651
14901
|
response = {
|
|
14652
14902
|
generatedImages: generatedImages,
|
|
14903
|
+
sdkHttpResponse: apiResponse.sdkHttpResponse,
|
|
14653
14904
|
};
|
|
14654
14905
|
}
|
|
14655
14906
|
return response;
|
|
@@ -15135,7 +15386,13 @@ class Models extends BaseModule {
|
|
|
15135
15386
|
abortSignal: (_b = params.config) === null || _b === void 0 ? void 0 : _b.abortSignal,
|
|
15136
15387
|
})
|
|
15137
15388
|
.then((httpResponse) => {
|
|
15138
|
-
return httpResponse.json()
|
|
15389
|
+
return httpResponse.json().then((jsonResponse) => {
|
|
15390
|
+
const response = jsonResponse;
|
|
15391
|
+
response.sdkHttpResponse = {
|
|
15392
|
+
headers: httpResponse.headers,
|
|
15393
|
+
};
|
|
15394
|
+
return response;
|
|
15395
|
+
});
|
|
15139
15396
|
});
|
|
15140
15397
|
return response.then((apiResponse) => {
|
|
15141
15398
|
const resp = embedContentResponseFromVertex(apiResponse);
|
|
@@ -15161,7 +15418,13 @@ class Models extends BaseModule {
|
|
|
15161
15418
|
abortSignal: (_d = params.config) === null || _d === void 0 ? void 0 : _d.abortSignal,
|
|
15162
15419
|
})
|
|
15163
15420
|
.then((httpResponse) => {
|
|
15164
|
-
return httpResponse.json()
|
|
15421
|
+
return httpResponse.json().then((jsonResponse) => {
|
|
15422
|
+
const response = jsonResponse;
|
|
15423
|
+
response.sdkHttpResponse = {
|
|
15424
|
+
headers: httpResponse.headers,
|
|
15425
|
+
};
|
|
15426
|
+
return response;
|
|
15427
|
+
});
|
|
15165
15428
|
});
|
|
15166
15429
|
return response.then((apiResponse) => {
|
|
15167
15430
|
const resp = embedContentResponseFromMldev(apiResponse);
|
|
@@ -15212,7 +15475,13 @@ class Models extends BaseModule {
|
|
|
15212
15475
|
abortSignal: (_b = params.config) === null || _b === void 0 ? void 0 : _b.abortSignal,
|
|
15213
15476
|
})
|
|
15214
15477
|
.then((httpResponse) => {
|
|
15215
|
-
return httpResponse.json()
|
|
15478
|
+
return httpResponse.json().then((jsonResponse) => {
|
|
15479
|
+
const response = jsonResponse;
|
|
15480
|
+
response.sdkHttpResponse = {
|
|
15481
|
+
headers: httpResponse.headers,
|
|
15482
|
+
};
|
|
15483
|
+
return response;
|
|
15484
|
+
});
|
|
15216
15485
|
});
|
|
15217
15486
|
return response.then((apiResponse) => {
|
|
15218
15487
|
const resp = generateImagesResponseFromVertex(apiResponse);
|
|
@@ -15238,7 +15507,13 @@ class Models extends BaseModule {
|
|
|
15238
15507
|
abortSignal: (_d = params.config) === null || _d === void 0 ? void 0 : _d.abortSignal,
|
|
15239
15508
|
})
|
|
15240
15509
|
.then((httpResponse) => {
|
|
15241
|
-
return httpResponse.json()
|
|
15510
|
+
return httpResponse.json().then((jsonResponse) => {
|
|
15511
|
+
const response = jsonResponse;
|
|
15512
|
+
response.sdkHttpResponse = {
|
|
15513
|
+
headers: httpResponse.headers,
|
|
15514
|
+
};
|
|
15515
|
+
return response;
|
|
15516
|
+
});
|
|
15242
15517
|
});
|
|
15243
15518
|
return response.then((apiResponse) => {
|
|
15244
15519
|
const resp = generateImagesResponseFromMldev(apiResponse);
|
|
@@ -15270,7 +15545,13 @@ class Models extends BaseModule {
|
|
|
15270
15545
|
abortSignal: (_b = params.config) === null || _b === void 0 ? void 0 : _b.abortSignal,
|
|
15271
15546
|
})
|
|
15272
15547
|
.then((httpResponse) => {
|
|
15273
|
-
return httpResponse.json()
|
|
15548
|
+
return httpResponse.json().then((jsonResponse) => {
|
|
15549
|
+
const response = jsonResponse;
|
|
15550
|
+
response.sdkHttpResponse = {
|
|
15551
|
+
headers: httpResponse.headers,
|
|
15552
|
+
};
|
|
15553
|
+
return response;
|
|
15554
|
+
});
|
|
15274
15555
|
});
|
|
15275
15556
|
return response.then((apiResponse) => {
|
|
15276
15557
|
const resp = editImageResponseFromVertex(apiResponse);
|
|
@@ -15305,7 +15586,13 @@ class Models extends BaseModule {
|
|
|
15305
15586
|
abortSignal: (_b = params.config) === null || _b === void 0 ? void 0 : _b.abortSignal,
|
|
15306
15587
|
})
|
|
15307
15588
|
.then((httpResponse) => {
|
|
15308
|
-
return httpResponse.json()
|
|
15589
|
+
return httpResponse.json().then((jsonResponse) => {
|
|
15590
|
+
const response = jsonResponse;
|
|
15591
|
+
response.sdkHttpResponse = {
|
|
15592
|
+
headers: httpResponse.headers,
|
|
15593
|
+
};
|
|
15594
|
+
return response;
|
|
15595
|
+
});
|
|
15309
15596
|
});
|
|
15310
15597
|
return response.then((apiResponse) => {
|
|
15311
15598
|
const resp = upscaleImageResponseFromVertex(apiResponse);
|
|
@@ -15318,6 +15605,79 @@ class Models extends BaseModule {
|
|
|
15318
15605
|
throw new Error('This method is only supported by the Vertex AI.');
|
|
15319
15606
|
}
|
|
15320
15607
|
}
|
|
15608
|
+
/**
|
|
15609
|
+
* Recontextualizes an image.
|
|
15610
|
+
*
|
|
15611
|
+
* There are two types of recontextualization currently supported:
|
|
15612
|
+
* 1) Imagen Product Recontext - Generate images of products in new scenes
|
|
15613
|
+
* and contexts.
|
|
15614
|
+
* 2) Virtual Try-On: Generate images of persons modeling fashion products.
|
|
15615
|
+
*
|
|
15616
|
+
* @param params - The parameters for recontextualizing an image.
|
|
15617
|
+
* @return The response from the API.
|
|
15618
|
+
*
|
|
15619
|
+
* @example
|
|
15620
|
+
* ```ts
|
|
15621
|
+
* const response1 = await ai.models.recontextImage({
|
|
15622
|
+
* model: 'imagen-product-recontext-preview-06-30',
|
|
15623
|
+
* source: {
|
|
15624
|
+
* prompt: 'In a modern kitchen setting.',
|
|
15625
|
+
* productImages: [productImage],
|
|
15626
|
+
* },
|
|
15627
|
+
* config: {
|
|
15628
|
+
* numberOfImages: 1,
|
|
15629
|
+
* },
|
|
15630
|
+
* });
|
|
15631
|
+
* console.log(response1?.generatedImages?.[0]?.image?.imageBytes);
|
|
15632
|
+
*
|
|
15633
|
+
* const response2 = await ai.models.recontextImage({
|
|
15634
|
+
* model: 'virtual-try-on-preview-08-04',
|
|
15635
|
+
* source: {
|
|
15636
|
+
* personImage: personImage,
|
|
15637
|
+
* productImages: [productImage],
|
|
15638
|
+
* },
|
|
15639
|
+
* config: {
|
|
15640
|
+
* numberOfImages: 1,
|
|
15641
|
+
* },
|
|
15642
|
+
* });
|
|
15643
|
+
* console.log(response2?.generatedImages?.[0]?.image?.imageBytes);
|
|
15644
|
+
* ```
|
|
15645
|
+
*/
|
|
15646
|
+
async recontextImage(params) {
|
|
15647
|
+
var _a, _b;
|
|
15648
|
+
let response;
|
|
15649
|
+
let path = '';
|
|
15650
|
+
let queryParams = {};
|
|
15651
|
+
if (this.apiClient.isVertexAI()) {
|
|
15652
|
+
const body = recontextImageParametersToVertex(this.apiClient, params);
|
|
15653
|
+
path = formatMap('{model}:predict', body['_url']);
|
|
15654
|
+
queryParams = body['_query'];
|
|
15655
|
+
delete body['config'];
|
|
15656
|
+
delete body['_url'];
|
|
15657
|
+
delete body['_query'];
|
|
15658
|
+
response = this.apiClient
|
|
15659
|
+
.request({
|
|
15660
|
+
path: path,
|
|
15661
|
+
queryParams: queryParams,
|
|
15662
|
+
body: JSON.stringify(body),
|
|
15663
|
+
httpMethod: 'POST',
|
|
15664
|
+
httpOptions: (_a = params.config) === null || _a === void 0 ? void 0 : _a.httpOptions,
|
|
15665
|
+
abortSignal: (_b = params.config) === null || _b === void 0 ? void 0 : _b.abortSignal,
|
|
15666
|
+
})
|
|
15667
|
+
.then((httpResponse) => {
|
|
15668
|
+
return httpResponse.json();
|
|
15669
|
+
});
|
|
15670
|
+
return response.then((apiResponse) => {
|
|
15671
|
+
const resp = recontextImageResponseFromVertex(apiResponse);
|
|
15672
|
+
const typedResp = new RecontextImageResponse();
|
|
15673
|
+
Object.assign(typedResp, resp);
|
|
15674
|
+
return typedResp;
|
|
15675
|
+
});
|
|
15676
|
+
}
|
|
15677
|
+
else {
|
|
15678
|
+
throw new Error('This method is only supported by the Vertex AI.');
|
|
15679
|
+
}
|
|
15680
|
+
}
|
|
15321
15681
|
/**
|
|
15322
15682
|
* Fetches information about a model by name.
|
|
15323
15683
|
*
|
|
@@ -15628,7 +15988,13 @@ class Models extends BaseModule {
|
|
|
15628
15988
|
abortSignal: (_b = params.config) === null || _b === void 0 ? void 0 : _b.abortSignal,
|
|
15629
15989
|
})
|
|
15630
15990
|
.then((httpResponse) => {
|
|
15631
|
-
return httpResponse.json()
|
|
15991
|
+
return httpResponse.json().then((jsonResponse) => {
|
|
15992
|
+
const response = jsonResponse;
|
|
15993
|
+
response.sdkHttpResponse = {
|
|
15994
|
+
headers: httpResponse.headers,
|
|
15995
|
+
};
|
|
15996
|
+
return response;
|
|
15997
|
+
});
|
|
15632
15998
|
});
|
|
15633
15999
|
return response.then((apiResponse) => {
|
|
15634
16000
|
const resp = countTokensResponseFromVertex(apiResponse);
|
|
@@ -15654,7 +16020,13 @@ class Models extends BaseModule {
|
|
|
15654
16020
|
abortSignal: (_d = params.config) === null || _d === void 0 ? void 0 : _d.abortSignal,
|
|
15655
16021
|
})
|
|
15656
16022
|
.then((httpResponse) => {
|
|
15657
|
-
return httpResponse.json()
|
|
16023
|
+
return httpResponse.json().then((jsonResponse) => {
|
|
16024
|
+
const response = jsonResponse;
|
|
16025
|
+
response.sdkHttpResponse = {
|
|
16026
|
+
headers: httpResponse.headers,
|
|
16027
|
+
};
|
|
16028
|
+
return response;
|
|
16029
|
+
});
|
|
15658
16030
|
});
|
|
15659
16031
|
return response.then((apiResponse) => {
|
|
15660
16032
|
const resp = countTokensResponseFromMldev(apiResponse);
|
|
@@ -15704,7 +16076,13 @@ class Models extends BaseModule {
|
|
|
15704
16076
|
abortSignal: (_b = params.config) === null || _b === void 0 ? void 0 : _b.abortSignal,
|
|
15705
16077
|
})
|
|
15706
16078
|
.then((httpResponse) => {
|
|
15707
|
-
return httpResponse.json()
|
|
16079
|
+
return httpResponse.json().then((jsonResponse) => {
|
|
16080
|
+
const response = jsonResponse;
|
|
16081
|
+
response.sdkHttpResponse = {
|
|
16082
|
+
headers: httpResponse.headers,
|
|
16083
|
+
};
|
|
16084
|
+
return response;
|
|
16085
|
+
});
|
|
15708
16086
|
});
|
|
15709
16087
|
return response.then((apiResponse) => {
|
|
15710
16088
|
const resp = computeTokensResponseFromVertex(apiResponse);
|
|
@@ -17156,6 +17534,12 @@ function tunedModelFromMldev(fromObject) {
|
|
|
17156
17534
|
}
|
|
17157
17535
|
function tuningJobFromMldev(fromObject) {
|
|
17158
17536
|
const toObject = {};
|
|
17537
|
+
const fromSdkHttpResponse = getValueByPath(fromObject, [
|
|
17538
|
+
'sdkHttpResponse',
|
|
17539
|
+
]);
|
|
17540
|
+
if (fromSdkHttpResponse != null) {
|
|
17541
|
+
setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
|
|
17542
|
+
}
|
|
17159
17543
|
const fromName = getValueByPath(fromObject, ['name']);
|
|
17160
17544
|
if (fromName != null) {
|
|
17161
17545
|
setValueByPath(toObject, ['name'], fromName);
|
|
@@ -17266,6 +17650,12 @@ function listTuningJobsResponseFromMldev(fromObject) {
|
|
|
17266
17650
|
}
|
|
17267
17651
|
function tuningOperationFromMldev(fromObject) {
|
|
17268
17652
|
const toObject = {};
|
|
17653
|
+
const fromSdkHttpResponse = getValueByPath(fromObject, [
|
|
17654
|
+
'sdkHttpResponse',
|
|
17655
|
+
]);
|
|
17656
|
+
if (fromSdkHttpResponse != null) {
|
|
17657
|
+
setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
|
|
17658
|
+
}
|
|
17269
17659
|
const fromName = getValueByPath(fromObject, ['name']);
|
|
17270
17660
|
if (fromName != null) {
|
|
17271
17661
|
setValueByPath(toObject, ['name'], fromName);
|
|
@@ -17328,6 +17718,12 @@ function tunedModelFromVertex(fromObject) {
|
|
|
17328
17718
|
}
|
|
17329
17719
|
function tuningJobFromVertex(fromObject) {
|
|
17330
17720
|
const toObject = {};
|
|
17721
|
+
const fromSdkHttpResponse = getValueByPath(fromObject, [
|
|
17722
|
+
'sdkHttpResponse',
|
|
17723
|
+
]);
|
|
17724
|
+
if (fromSdkHttpResponse != null) {
|
|
17725
|
+
setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
|
|
17726
|
+
}
|
|
17331
17727
|
const fromName = getValueByPath(fromObject, ['name']);
|
|
17332
17728
|
if (fromName != null) {
|
|
17333
17729
|
setValueByPath(toObject, ['name'], fromName);
|
|
@@ -17546,7 +17942,13 @@ class Tunings extends BaseModule {
|
|
|
17546
17942
|
abortSignal: (_b = params.config) === null || _b === void 0 ? void 0 : _b.abortSignal,
|
|
17547
17943
|
})
|
|
17548
17944
|
.then((httpResponse) => {
|
|
17549
|
-
return httpResponse.json()
|
|
17945
|
+
return httpResponse.json().then((jsonResponse) => {
|
|
17946
|
+
const response = jsonResponse;
|
|
17947
|
+
response.sdkHttpResponse = {
|
|
17948
|
+
headers: httpResponse.headers,
|
|
17949
|
+
};
|
|
17950
|
+
return response;
|
|
17951
|
+
});
|
|
17550
17952
|
});
|
|
17551
17953
|
return response.then((apiResponse) => {
|
|
17552
17954
|
const resp = tuningJobFromVertex(apiResponse);
|
|
@@ -17570,7 +17972,13 @@ class Tunings extends BaseModule {
|
|
|
17570
17972
|
abortSignal: (_d = params.config) === null || _d === void 0 ? void 0 : _d.abortSignal,
|
|
17571
17973
|
})
|
|
17572
17974
|
.then((httpResponse) => {
|
|
17573
|
-
return httpResponse.json()
|
|
17975
|
+
return httpResponse.json().then((jsonResponse) => {
|
|
17976
|
+
const response = jsonResponse;
|
|
17977
|
+
response.sdkHttpResponse = {
|
|
17978
|
+
headers: httpResponse.headers,
|
|
17979
|
+
};
|
|
17980
|
+
return response;
|
|
17981
|
+
});
|
|
17574
17982
|
});
|
|
17575
17983
|
return response.then((apiResponse) => {
|
|
17576
17984
|
const resp = tuningJobFromMldev(apiResponse);
|
|
@@ -17670,7 +18078,13 @@ class Tunings extends BaseModule {
|
|
|
17670
18078
|
abortSignal: (_b = params.config) === null || _b === void 0 ? void 0 : _b.abortSignal,
|
|
17671
18079
|
})
|
|
17672
18080
|
.then((httpResponse) => {
|
|
17673
|
-
return httpResponse.json()
|
|
18081
|
+
return httpResponse.json().then((jsonResponse) => {
|
|
18082
|
+
const response = jsonResponse;
|
|
18083
|
+
response.sdkHttpResponse = {
|
|
18084
|
+
headers: httpResponse.headers,
|
|
18085
|
+
};
|
|
18086
|
+
return response;
|
|
18087
|
+
});
|
|
17674
18088
|
});
|
|
17675
18089
|
return response.then((apiResponse) => {
|
|
17676
18090
|
const resp = tuningJobFromVertex(apiResponse);
|
|
@@ -17706,7 +18120,13 @@ class Tunings extends BaseModule {
|
|
|
17706
18120
|
abortSignal: (_b = params.config) === null || _b === void 0 ? void 0 : _b.abortSignal,
|
|
17707
18121
|
})
|
|
17708
18122
|
.then((httpResponse) => {
|
|
17709
|
-
return httpResponse.json()
|
|
18123
|
+
return httpResponse.json().then((jsonResponse) => {
|
|
18124
|
+
const response = jsonResponse;
|
|
18125
|
+
response.sdkHttpResponse = {
|
|
18126
|
+
headers: httpResponse.headers,
|
|
18127
|
+
};
|
|
18128
|
+
return response;
|
|
18129
|
+
});
|
|
17710
18130
|
});
|
|
17711
18131
|
return response.then((apiResponse) => {
|
|
17712
18132
|
const resp = tuningOperationFromMldev(apiResponse);
|
|
@@ -17811,5 +18231,5 @@ class GoogleGenAI {
|
|
|
17811
18231
|
}
|
|
17812
18232
|
}
|
|
17813
18233
|
|
|
17814
|
-
export { ActivityHandling, AdapterSize, ApiError, ApiSpec, AuthType, Batches, Behavior, BlockedReason, Caches, Chat, Chats, ComputeTokensResponse, ControlReferenceImage, ControlReferenceType, CountTokensResponse, CreateFileResponse, DeleteCachedContentResponse, DeleteFileResponse, DeleteModelResponse, DynamicRetrievalConfigMode, EditImageResponse, EditMode, EmbedContentResponse, EndSensitivity, Environment, FeatureSelectionPreference, FileSource, FileState, Files, FinishReason, FunctionCallingConfigMode, FunctionResponse, FunctionResponseScheduling, GenerateContentResponse, GenerateContentResponsePromptFeedback, GenerateContentResponseUsageMetadata, GenerateImagesResponse, GenerateVideosOperation, GenerateVideosResponse, GoogleGenAI, HarmBlockMethod, HarmBlockThreshold, HarmCategory, HarmProbability, HarmSeverity, HttpResponse, ImagePromptLanguage, InlinedResponse, JobState, Language, ListBatchJobsResponse, ListCachedContentsResponse, ListFilesResponse, ListModelsResponse, ListTuningJobsResponse, Live, LiveClientToolResponse, LiveMusicPlaybackControl, LiveMusicServerMessage, LiveSendToolResponseParameters, LiveServerMessage, MaskReferenceImage, MaskReferenceMode, MediaModality, MediaResolution, Modality, Mode, Models, Operations, Outcome, PagedItem, Pager, PersonGeneration, RawReferenceImage, ReplayResponse, SafetyFilterLevel, Scale, Session, StartSensitivity, StyleReferenceImage, SubjectReferenceImage, SubjectReferenceType, Tokens, TrafficType, TurnCoverage, Type, UpscaleImageResponse, UrlRetrievalStatus, VideoCompressionQuality, createModelContent, createPartFromBase64, createPartFromCodeExecutionResult, createPartFromExecutableCode, createPartFromFunctionCall, createPartFromFunctionResponse, createPartFromText, createPartFromUri, createUserContent, mcpToTool, setDefaultBaseUrls };
|
|
18234
|
+
export { ActivityHandling, AdapterSize, ApiError, ApiSpec, AuthType, Batches, Behavior, BlockedReason, Caches, Chat, Chats, ComputeTokensResponse, ControlReferenceImage, ControlReferenceType, CountTokensResponse, CreateFileResponse, DeleteCachedContentResponse, DeleteFileResponse, DeleteModelResponse, DynamicRetrievalConfigMode, EditImageResponse, EditMode, EmbedContentResponse, EndSensitivity, Environment, FeatureSelectionPreference, FileSource, FileState, Files, FinishReason, FunctionCallingConfigMode, FunctionResponse, FunctionResponseScheduling, GenerateContentResponse, GenerateContentResponsePromptFeedback, GenerateContentResponseUsageMetadata, GenerateImagesResponse, GenerateVideosOperation, GenerateVideosResponse, GoogleGenAI, HarmBlockMethod, HarmBlockThreshold, HarmCategory, HarmProbability, HarmSeverity, HttpResponse, ImagePromptLanguage, InlinedResponse, JobState, Language, ListBatchJobsResponse, ListCachedContentsResponse, ListFilesResponse, ListModelsResponse, ListTuningJobsResponse, Live, LiveClientToolResponse, LiveMusicPlaybackControl, LiveMusicServerMessage, LiveSendToolResponseParameters, LiveServerMessage, MaskReferenceImage, MaskReferenceMode, MediaModality, MediaResolution, Modality, Mode, Models, MusicGenerationMode, Operations, Outcome, PagedItem, Pager, PersonGeneration, RawReferenceImage, RecontextImageResponse, ReplayResponse, SafetyFilterLevel, Scale, Session, StartSensitivity, StyleReferenceImage, SubjectReferenceImage, SubjectReferenceType, Tokens, TrafficType, TurnCoverage, Type, UpscaleImageResponse, UrlRetrievalStatus, VideoCompressionQuality, createModelContent, createPartFromBase64, createPartFromCodeExecutionResult, createPartFromExecutableCode, createPartFromFunctionCall, createPartFromFunctionResponse, createPartFromText, createPartFromUri, createUserContent, mcpToTool, setDefaultBaseUrls };
|
|
17815
18235
|
//# sourceMappingURL=index.mjs.map
|