@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/web/index.mjs
CHANGED
|
@@ -444,6 +444,14 @@ var UrlRetrievalStatus;
|
|
|
444
444
|
* Url retrieval is failed due to error.
|
|
445
445
|
*/
|
|
446
446
|
UrlRetrievalStatus["URL_RETRIEVAL_STATUS_ERROR"] = "URL_RETRIEVAL_STATUS_ERROR";
|
|
447
|
+
/**
|
|
448
|
+
* Url retrieval is failed because the content is behind paywall.
|
|
449
|
+
*/
|
|
450
|
+
UrlRetrievalStatus["URL_RETRIEVAL_STATUS_PAYWALL"] = "URL_RETRIEVAL_STATUS_PAYWALL";
|
|
451
|
+
/**
|
|
452
|
+
* Url retrieval is failed because the content is unsafe.
|
|
453
|
+
*/
|
|
454
|
+
UrlRetrievalStatus["URL_RETRIEVAL_STATUS_UNSAFE"] = "URL_RETRIEVAL_STATUS_UNSAFE";
|
|
447
455
|
})(UrlRetrievalStatus || (UrlRetrievalStatus = {}));
|
|
448
456
|
/** Output only. The reason why the model stopped generating tokens.
|
|
449
457
|
|
|
@@ -1070,6 +1078,29 @@ var Scale;
|
|
|
1070
1078
|
*/
|
|
1071
1079
|
Scale["B_MAJOR_A_FLAT_MINOR"] = "B_MAJOR_A_FLAT_MINOR";
|
|
1072
1080
|
})(Scale || (Scale = {}));
|
|
1081
|
+
/** The mode of music generation. */
|
|
1082
|
+
var MusicGenerationMode;
|
|
1083
|
+
(function (MusicGenerationMode) {
|
|
1084
|
+
/**
|
|
1085
|
+
* Rely on the server default generation mode.
|
|
1086
|
+
*/
|
|
1087
|
+
MusicGenerationMode["MUSIC_GENERATION_MODE_UNSPECIFIED"] = "MUSIC_GENERATION_MODE_UNSPECIFIED";
|
|
1088
|
+
/**
|
|
1089
|
+
* Steer text prompts to regions of latent space with higher quality
|
|
1090
|
+
music.
|
|
1091
|
+
*/
|
|
1092
|
+
MusicGenerationMode["QUALITY"] = "QUALITY";
|
|
1093
|
+
/**
|
|
1094
|
+
* Steer text prompts to regions of latent space with a larger
|
|
1095
|
+
diversity of music.
|
|
1096
|
+
*/
|
|
1097
|
+
MusicGenerationMode["DIVERSITY"] = "DIVERSITY";
|
|
1098
|
+
/**
|
|
1099
|
+
* Steer text prompts to regions of latent space more likely to
|
|
1100
|
+
generate music with vocals.
|
|
1101
|
+
*/
|
|
1102
|
+
MusicGenerationMode["VOCALIZATION"] = "VOCALIZATION";
|
|
1103
|
+
})(MusicGenerationMode || (MusicGenerationMode = {}));
|
|
1073
1104
|
/** The playback control signal to apply to the music generation. */
|
|
1074
1105
|
var LiveMusicPlaybackControl;
|
|
1075
1106
|
(function (LiveMusicPlaybackControl) {
|
|
@@ -1493,6 +1524,9 @@ class EditImageResponse {
|
|
|
1493
1524
|
}
|
|
1494
1525
|
class UpscaleImageResponse {
|
|
1495
1526
|
}
|
|
1527
|
+
/** The output images response. */
|
|
1528
|
+
class RecontextImageResponse {
|
|
1529
|
+
}
|
|
1496
1530
|
class ListModelsResponse {
|
|
1497
1531
|
}
|
|
1498
1532
|
class DeleteModelResponse {
|
|
@@ -1748,8 +1782,8 @@ class GenerateVideosOperation {
|
|
|
1748
1782
|
},
|
|
1749
1783
|
};
|
|
1750
1784
|
});
|
|
1751
|
-
operationResponse.raiMediaFilteredCount =
|
|
1752
|
-
operationResponse.raiMediaFilteredReasons =
|
|
1785
|
+
operationResponse.raiMediaFilteredCount = generatedVideoResponse === null || generatedVideoResponse === void 0 ? void 0 : generatedVideoResponse['raiMediaFilteredCount'];
|
|
1786
|
+
operationResponse.raiMediaFilteredReasons = generatedVideoResponse === null || generatedVideoResponse === void 0 ? void 0 : generatedVideoResponse['raiMediaFilteredReasons'];
|
|
1753
1787
|
operation.response = operationResponse;
|
|
1754
1788
|
}
|
|
1755
1789
|
}
|
|
@@ -3698,6 +3732,10 @@ function generateContentResponseFromMldev$1(fromObject) {
|
|
|
3698
3732
|
if (fromPromptFeedback != null) {
|
|
3699
3733
|
setValueByPath(toObject, ['promptFeedback'], fromPromptFeedback);
|
|
3700
3734
|
}
|
|
3735
|
+
const fromResponseId = getValueByPath(fromObject, ['responseId']);
|
|
3736
|
+
if (fromResponseId != null) {
|
|
3737
|
+
setValueByPath(toObject, ['responseId'], fromResponseId);
|
|
3738
|
+
}
|
|
3701
3739
|
const fromUsageMetadata = getValueByPath(fromObject, [
|
|
3702
3740
|
'usageMetadata',
|
|
3703
3741
|
]);
|
|
@@ -3831,6 +3869,12 @@ function listBatchJobsResponseFromMldev(fromObject) {
|
|
|
3831
3869
|
}
|
|
3832
3870
|
function deleteResourceJobFromMldev(fromObject) {
|
|
3833
3871
|
const toObject = {};
|
|
3872
|
+
const fromSdkHttpResponse = getValueByPath(fromObject, [
|
|
3873
|
+
'sdkHttpResponse',
|
|
3874
|
+
]);
|
|
3875
|
+
if (fromSdkHttpResponse != null) {
|
|
3876
|
+
setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
|
|
3877
|
+
}
|
|
3834
3878
|
const fromName = getValueByPath(fromObject, ['name']);
|
|
3835
3879
|
if (fromName != null) {
|
|
3836
3880
|
setValueByPath(toObject, ['name'], fromName);
|
|
@@ -3980,6 +4024,12 @@ function listBatchJobsResponseFromVertex(fromObject) {
|
|
|
3980
4024
|
}
|
|
3981
4025
|
function deleteResourceJobFromVertex(fromObject) {
|
|
3982
4026
|
const toObject = {};
|
|
4027
|
+
const fromSdkHttpResponse = getValueByPath(fromObject, [
|
|
4028
|
+
'sdkHttpResponse',
|
|
4029
|
+
]);
|
|
4030
|
+
if (fromSdkHttpResponse != null) {
|
|
4031
|
+
setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
|
|
4032
|
+
}
|
|
3983
4033
|
const fromName = getValueByPath(fromObject, ['name']);
|
|
3984
4034
|
if (fromName != null) {
|
|
3985
4035
|
setValueByPath(toObject, ['name'], fromName);
|
|
@@ -4525,7 +4575,13 @@ class Batches extends BaseModule {
|
|
|
4525
4575
|
abortSignal: (_b = params.config) === null || _b === void 0 ? void 0 : _b.abortSignal,
|
|
4526
4576
|
})
|
|
4527
4577
|
.then((httpResponse) => {
|
|
4528
|
-
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
|
+
});
|
|
4529
4585
|
});
|
|
4530
4586
|
return response.then((apiResponse) => {
|
|
4531
4587
|
const resp = deleteResourceJobFromVertex(apiResponse);
|
|
@@ -4549,7 +4605,13 @@ class Batches extends BaseModule {
|
|
|
4549
4605
|
abortSignal: (_d = params.config) === null || _d === void 0 ? void 0 : _d.abortSignal,
|
|
4550
4606
|
})
|
|
4551
4607
|
.then((httpResponse) => {
|
|
4552
|
-
return httpResponse.json()
|
|
4608
|
+
return httpResponse.json().then((jsonResponse) => {
|
|
4609
|
+
const response = jsonResponse;
|
|
4610
|
+
response.sdkHttpResponse = {
|
|
4611
|
+
headers: httpResponse.headers,
|
|
4612
|
+
};
|
|
4613
|
+
return response;
|
|
4614
|
+
});
|
|
4553
4615
|
});
|
|
4554
4616
|
return response.then((apiResponse) => {
|
|
4555
4617
|
const resp = deleteResourceJobFromMldev(apiResponse);
|
|
@@ -7610,6 +7672,12 @@ function liveMusicGenerationConfigToMldev(fromObject) {
|
|
|
7610
7672
|
if (fromOnlyBassAndDrums != null) {
|
|
7611
7673
|
setValueByPath(toObject, ['onlyBassAndDrums'], fromOnlyBassAndDrums);
|
|
7612
7674
|
}
|
|
7675
|
+
const fromMusicGenerationMode = getValueByPath(fromObject, [
|
|
7676
|
+
'musicGenerationMode',
|
|
7677
|
+
]);
|
|
7678
|
+
if (fromMusicGenerationMode != null) {
|
|
7679
|
+
setValueByPath(toObject, ['musicGenerationMode'], fromMusicGenerationMode);
|
|
7680
|
+
}
|
|
7613
7681
|
return toObject;
|
|
7614
7682
|
}
|
|
7615
7683
|
function liveMusicSetConfigParametersToMldev(fromObject) {
|
|
@@ -8768,6 +8836,12 @@ function liveMusicGenerationConfigFromMldev(fromObject) {
|
|
|
8768
8836
|
if (fromOnlyBassAndDrums != null) {
|
|
8769
8837
|
setValueByPath(toObject, ['onlyBassAndDrums'], fromOnlyBassAndDrums);
|
|
8770
8838
|
}
|
|
8839
|
+
const fromMusicGenerationMode = getValueByPath(fromObject, [
|
|
8840
|
+
'musicGenerationMode',
|
|
8841
|
+
]);
|
|
8842
|
+
if (fromMusicGenerationMode != null) {
|
|
8843
|
+
setValueByPath(toObject, ['musicGenerationMode'], fromMusicGenerationMode);
|
|
8844
|
+
}
|
|
8771
8845
|
return toObject;
|
|
8772
8846
|
}
|
|
8773
8847
|
function liveMusicSourceMetadataFromMldev(fromObject) {
|
|
@@ -10034,8 +10108,9 @@ function generateImagesConfigToMldev(fromObject, parentObject) {
|
|
|
10034
10108
|
if (getValueByPath(fromObject, ['addWatermark']) !== undefined) {
|
|
10035
10109
|
throw new Error('addWatermark parameter is not supported in Gemini API.');
|
|
10036
10110
|
}
|
|
10037
|
-
|
|
10038
|
-
|
|
10111
|
+
const fromImageSize = getValueByPath(fromObject, ['imageSize']);
|
|
10112
|
+
if (parentObject !== undefined && fromImageSize != null) {
|
|
10113
|
+
setValueByPath(parentObject, ['parameters', 'sampleImageSize'], fromImageSize);
|
|
10039
10114
|
}
|
|
10040
10115
|
if (getValueByPath(fromObject, ['enhancePrompt']) !== undefined) {
|
|
10041
10116
|
throw new Error('enhancePrompt parameter is not supported in Gemini API.');
|
|
@@ -11437,6 +11512,106 @@ function upscaleImageAPIParametersInternalToVertex(apiClient, fromObject) {
|
|
|
11437
11512
|
}
|
|
11438
11513
|
return toObject;
|
|
11439
11514
|
}
|
|
11515
|
+
function productImageToVertex(fromObject) {
|
|
11516
|
+
const toObject = {};
|
|
11517
|
+
const fromProductImage = getValueByPath(fromObject, ['productImage']);
|
|
11518
|
+
if (fromProductImage != null) {
|
|
11519
|
+
setValueByPath(toObject, ['image'], imageToVertex(fromProductImage));
|
|
11520
|
+
}
|
|
11521
|
+
return toObject;
|
|
11522
|
+
}
|
|
11523
|
+
function recontextImageSourceToVertex(fromObject, parentObject) {
|
|
11524
|
+
const toObject = {};
|
|
11525
|
+
const fromPrompt = getValueByPath(fromObject, ['prompt']);
|
|
11526
|
+
if (parentObject !== undefined && fromPrompt != null) {
|
|
11527
|
+
setValueByPath(parentObject, ['instances[0]', 'prompt'], fromPrompt);
|
|
11528
|
+
}
|
|
11529
|
+
const fromPersonImage = getValueByPath(fromObject, ['personImage']);
|
|
11530
|
+
if (parentObject !== undefined && fromPersonImage != null) {
|
|
11531
|
+
setValueByPath(parentObject, ['instances[0]', 'personImage', 'image'], imageToVertex(fromPersonImage));
|
|
11532
|
+
}
|
|
11533
|
+
const fromProductImages = getValueByPath(fromObject, [
|
|
11534
|
+
'productImages',
|
|
11535
|
+
]);
|
|
11536
|
+
if (parentObject !== undefined && fromProductImages != null) {
|
|
11537
|
+
let transformedList = fromProductImages;
|
|
11538
|
+
if (Array.isArray(transformedList)) {
|
|
11539
|
+
transformedList = transformedList.map((item) => {
|
|
11540
|
+
return productImageToVertex(item);
|
|
11541
|
+
});
|
|
11542
|
+
}
|
|
11543
|
+
setValueByPath(parentObject, ['instances[0]', 'productImages'], transformedList);
|
|
11544
|
+
}
|
|
11545
|
+
return toObject;
|
|
11546
|
+
}
|
|
11547
|
+
function recontextImageConfigToVertex(fromObject, parentObject) {
|
|
11548
|
+
const toObject = {};
|
|
11549
|
+
const fromNumberOfImages = getValueByPath(fromObject, [
|
|
11550
|
+
'numberOfImages',
|
|
11551
|
+
]);
|
|
11552
|
+
if (parentObject !== undefined && fromNumberOfImages != null) {
|
|
11553
|
+
setValueByPath(parentObject, ['parameters', 'sampleCount'], fromNumberOfImages);
|
|
11554
|
+
}
|
|
11555
|
+
const fromBaseSteps = getValueByPath(fromObject, ['baseSteps']);
|
|
11556
|
+
if (parentObject !== undefined && fromBaseSteps != null) {
|
|
11557
|
+
setValueByPath(parentObject, ['parameters', 'editConfig', 'baseSteps'], fromBaseSteps);
|
|
11558
|
+
}
|
|
11559
|
+
const fromOutputGcsUri = getValueByPath(fromObject, ['outputGcsUri']);
|
|
11560
|
+
if (parentObject !== undefined && fromOutputGcsUri != null) {
|
|
11561
|
+
setValueByPath(parentObject, ['parameters', 'storageUri'], fromOutputGcsUri);
|
|
11562
|
+
}
|
|
11563
|
+
const fromSeed = getValueByPath(fromObject, ['seed']);
|
|
11564
|
+
if (parentObject !== undefined && fromSeed != null) {
|
|
11565
|
+
setValueByPath(parentObject, ['parameters', 'seed'], fromSeed);
|
|
11566
|
+
}
|
|
11567
|
+
const fromSafetyFilterLevel = getValueByPath(fromObject, [
|
|
11568
|
+
'safetyFilterLevel',
|
|
11569
|
+
]);
|
|
11570
|
+
if (parentObject !== undefined && fromSafetyFilterLevel != null) {
|
|
11571
|
+
setValueByPath(parentObject, ['parameters', 'safetySetting'], fromSafetyFilterLevel);
|
|
11572
|
+
}
|
|
11573
|
+
const fromPersonGeneration = getValueByPath(fromObject, [
|
|
11574
|
+
'personGeneration',
|
|
11575
|
+
]);
|
|
11576
|
+
if (parentObject !== undefined && fromPersonGeneration != null) {
|
|
11577
|
+
setValueByPath(parentObject, ['parameters', 'personGeneration'], fromPersonGeneration);
|
|
11578
|
+
}
|
|
11579
|
+
const fromOutputMimeType = getValueByPath(fromObject, [
|
|
11580
|
+
'outputMimeType',
|
|
11581
|
+
]);
|
|
11582
|
+
if (parentObject !== undefined && fromOutputMimeType != null) {
|
|
11583
|
+
setValueByPath(parentObject, ['parameters', 'outputOptions', 'mimeType'], fromOutputMimeType);
|
|
11584
|
+
}
|
|
11585
|
+
const fromOutputCompressionQuality = getValueByPath(fromObject, [
|
|
11586
|
+
'outputCompressionQuality',
|
|
11587
|
+
]);
|
|
11588
|
+
if (parentObject !== undefined && fromOutputCompressionQuality != null) {
|
|
11589
|
+
setValueByPath(parentObject, ['parameters', 'outputOptions', 'compressionQuality'], fromOutputCompressionQuality);
|
|
11590
|
+
}
|
|
11591
|
+
const fromEnhancePrompt = getValueByPath(fromObject, [
|
|
11592
|
+
'enhancePrompt',
|
|
11593
|
+
]);
|
|
11594
|
+
if (parentObject !== undefined && fromEnhancePrompt != null) {
|
|
11595
|
+
setValueByPath(parentObject, ['parameters', 'enhancePrompt'], fromEnhancePrompt);
|
|
11596
|
+
}
|
|
11597
|
+
return toObject;
|
|
11598
|
+
}
|
|
11599
|
+
function recontextImageParametersToVertex(apiClient, fromObject) {
|
|
11600
|
+
const toObject = {};
|
|
11601
|
+
const fromModel = getValueByPath(fromObject, ['model']);
|
|
11602
|
+
if (fromModel != null) {
|
|
11603
|
+
setValueByPath(toObject, ['_url', 'model'], tModel(apiClient, fromModel));
|
|
11604
|
+
}
|
|
11605
|
+
const fromSource = getValueByPath(fromObject, ['source']);
|
|
11606
|
+
if (fromSource != null) {
|
|
11607
|
+
setValueByPath(toObject, ['config'], recontextImageSourceToVertex(fromSource, toObject));
|
|
11608
|
+
}
|
|
11609
|
+
const fromConfig = getValueByPath(fromObject, ['config']);
|
|
11610
|
+
if (fromConfig != null) {
|
|
11611
|
+
setValueByPath(toObject, ['config'], recontextImageConfigToVertex(fromConfig, toObject));
|
|
11612
|
+
}
|
|
11613
|
+
return toObject;
|
|
11614
|
+
}
|
|
11440
11615
|
function getModelParametersToVertex(apiClient, fromObject) {
|
|
11441
11616
|
const toObject = {};
|
|
11442
11617
|
const fromModel = getValueByPath(fromObject, ['model']);
|
|
@@ -11933,6 +12108,10 @@ function generateContentResponseFromMldev(fromObject) {
|
|
|
11933
12108
|
if (fromPromptFeedback != null) {
|
|
11934
12109
|
setValueByPath(toObject, ['promptFeedback'], fromPromptFeedback);
|
|
11935
12110
|
}
|
|
12111
|
+
const fromResponseId = getValueByPath(fromObject, ['responseId']);
|
|
12112
|
+
if (fromResponseId != null) {
|
|
12113
|
+
setValueByPath(toObject, ['responseId'], fromResponseId);
|
|
12114
|
+
}
|
|
11936
12115
|
const fromUsageMetadata = getValueByPath(fromObject, [
|
|
11937
12116
|
'usageMetadata',
|
|
11938
12117
|
]);
|
|
@@ -11955,6 +12134,12 @@ function embedContentMetadataFromMldev() {
|
|
|
11955
12134
|
}
|
|
11956
12135
|
function embedContentResponseFromMldev(fromObject) {
|
|
11957
12136
|
const toObject = {};
|
|
12137
|
+
const fromSdkHttpResponse = getValueByPath(fromObject, [
|
|
12138
|
+
'sdkHttpResponse',
|
|
12139
|
+
]);
|
|
12140
|
+
if (fromSdkHttpResponse != null) {
|
|
12141
|
+
setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
|
|
12142
|
+
}
|
|
11958
12143
|
const fromEmbeddings = getValueByPath(fromObject, ['embeddings']);
|
|
11959
12144
|
if (fromEmbeddings != null) {
|
|
11960
12145
|
let transformedList = fromEmbeddings;
|
|
@@ -12027,6 +12212,12 @@ function generatedImageFromMldev(fromObject) {
|
|
|
12027
12212
|
}
|
|
12028
12213
|
function generateImagesResponseFromMldev(fromObject) {
|
|
12029
12214
|
const toObject = {};
|
|
12215
|
+
const fromSdkHttpResponse = getValueByPath(fromObject, [
|
|
12216
|
+
'sdkHttpResponse',
|
|
12217
|
+
]);
|
|
12218
|
+
if (fromSdkHttpResponse != null) {
|
|
12219
|
+
setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
|
|
12220
|
+
}
|
|
12030
12221
|
const fromGeneratedImages = getValueByPath(fromObject, [
|
|
12031
12222
|
'predictions',
|
|
12032
12223
|
]);
|
|
@@ -12137,6 +12328,12 @@ function deleteModelResponseFromMldev() {
|
|
|
12137
12328
|
}
|
|
12138
12329
|
function countTokensResponseFromMldev(fromObject) {
|
|
12139
12330
|
const toObject = {};
|
|
12331
|
+
const fromSdkHttpResponse = getValueByPath(fromObject, [
|
|
12332
|
+
'sdkHttpResponse',
|
|
12333
|
+
]);
|
|
12334
|
+
if (fromSdkHttpResponse != null) {
|
|
12335
|
+
setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
|
|
12336
|
+
}
|
|
12140
12337
|
const fromTotalTokens = getValueByPath(fromObject, ['totalTokens']);
|
|
12141
12338
|
if (fromTotalTokens != null) {
|
|
12142
12339
|
setValueByPath(toObject, ['totalTokens'], fromTotalTokens);
|
|
@@ -12465,10 +12662,6 @@ function generateContentResponseFromVertex(fromObject) {
|
|
|
12465
12662
|
if (fromCreateTime != null) {
|
|
12466
12663
|
setValueByPath(toObject, ['createTime'], fromCreateTime);
|
|
12467
12664
|
}
|
|
12468
|
-
const fromResponseId = getValueByPath(fromObject, ['responseId']);
|
|
12469
|
-
if (fromResponseId != null) {
|
|
12470
|
-
setValueByPath(toObject, ['responseId'], fromResponseId);
|
|
12471
|
-
}
|
|
12472
12665
|
const fromModelVersion = getValueByPath(fromObject, ['modelVersion']);
|
|
12473
12666
|
if (fromModelVersion != null) {
|
|
12474
12667
|
setValueByPath(toObject, ['modelVersion'], fromModelVersion);
|
|
@@ -12479,6 +12672,10 @@ function generateContentResponseFromVertex(fromObject) {
|
|
|
12479
12672
|
if (fromPromptFeedback != null) {
|
|
12480
12673
|
setValueByPath(toObject, ['promptFeedback'], fromPromptFeedback);
|
|
12481
12674
|
}
|
|
12675
|
+
const fromResponseId = getValueByPath(fromObject, ['responseId']);
|
|
12676
|
+
if (fromResponseId != null) {
|
|
12677
|
+
setValueByPath(toObject, ['responseId'], fromResponseId);
|
|
12678
|
+
}
|
|
12482
12679
|
const fromUsageMetadata = getValueByPath(fromObject, [
|
|
12483
12680
|
'usageMetadata',
|
|
12484
12681
|
]);
|
|
@@ -12523,6 +12720,12 @@ function embedContentMetadataFromVertex(fromObject) {
|
|
|
12523
12720
|
}
|
|
12524
12721
|
function embedContentResponseFromVertex(fromObject) {
|
|
12525
12722
|
const toObject = {};
|
|
12723
|
+
const fromSdkHttpResponse = getValueByPath(fromObject, [
|
|
12724
|
+
'sdkHttpResponse',
|
|
12725
|
+
]);
|
|
12726
|
+
if (fromSdkHttpResponse != null) {
|
|
12727
|
+
setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
|
|
12728
|
+
}
|
|
12526
12729
|
const fromEmbeddings = getValueByPath(fromObject, [
|
|
12527
12730
|
'predictions[]',
|
|
12528
12731
|
'embeddings',
|
|
@@ -12606,6 +12809,12 @@ function generatedImageFromVertex(fromObject) {
|
|
|
12606
12809
|
}
|
|
12607
12810
|
function generateImagesResponseFromVertex(fromObject) {
|
|
12608
12811
|
const toObject = {};
|
|
12812
|
+
const fromSdkHttpResponse = getValueByPath(fromObject, [
|
|
12813
|
+
'sdkHttpResponse',
|
|
12814
|
+
]);
|
|
12815
|
+
if (fromSdkHttpResponse != null) {
|
|
12816
|
+
setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
|
|
12817
|
+
}
|
|
12609
12818
|
const fromGeneratedImages = getValueByPath(fromObject, [
|
|
12610
12819
|
'predictions',
|
|
12611
12820
|
]);
|
|
@@ -12628,6 +12837,12 @@ function generateImagesResponseFromVertex(fromObject) {
|
|
|
12628
12837
|
}
|
|
12629
12838
|
function editImageResponseFromVertex(fromObject) {
|
|
12630
12839
|
const toObject = {};
|
|
12840
|
+
const fromSdkHttpResponse = getValueByPath(fromObject, [
|
|
12841
|
+
'sdkHttpResponse',
|
|
12842
|
+
]);
|
|
12843
|
+
if (fromSdkHttpResponse != null) {
|
|
12844
|
+
setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
|
|
12845
|
+
}
|
|
12631
12846
|
const fromGeneratedImages = getValueByPath(fromObject, [
|
|
12632
12847
|
'predictions',
|
|
12633
12848
|
]);
|
|
@@ -12643,6 +12858,28 @@ function editImageResponseFromVertex(fromObject) {
|
|
|
12643
12858
|
return toObject;
|
|
12644
12859
|
}
|
|
12645
12860
|
function upscaleImageResponseFromVertex(fromObject) {
|
|
12861
|
+
const toObject = {};
|
|
12862
|
+
const fromSdkHttpResponse = getValueByPath(fromObject, [
|
|
12863
|
+
'sdkHttpResponse',
|
|
12864
|
+
]);
|
|
12865
|
+
if (fromSdkHttpResponse != null) {
|
|
12866
|
+
setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
|
|
12867
|
+
}
|
|
12868
|
+
const fromGeneratedImages = getValueByPath(fromObject, [
|
|
12869
|
+
'predictions',
|
|
12870
|
+
]);
|
|
12871
|
+
if (fromGeneratedImages != null) {
|
|
12872
|
+
let transformedList = fromGeneratedImages;
|
|
12873
|
+
if (Array.isArray(transformedList)) {
|
|
12874
|
+
transformedList = transformedList.map((item) => {
|
|
12875
|
+
return generatedImageFromVertex(item);
|
|
12876
|
+
});
|
|
12877
|
+
}
|
|
12878
|
+
setValueByPath(toObject, ['generatedImages'], transformedList);
|
|
12879
|
+
}
|
|
12880
|
+
return toObject;
|
|
12881
|
+
}
|
|
12882
|
+
function recontextImageResponseFromVertex(fromObject) {
|
|
12646
12883
|
const toObject = {};
|
|
12647
12884
|
const fromGeneratedImages = getValueByPath(fromObject, [
|
|
12648
12885
|
'predictions',
|
|
@@ -12793,6 +13030,12 @@ function deleteModelResponseFromVertex() {
|
|
|
12793
13030
|
}
|
|
12794
13031
|
function countTokensResponseFromVertex(fromObject) {
|
|
12795
13032
|
const toObject = {};
|
|
13033
|
+
const fromSdkHttpResponse = getValueByPath(fromObject, [
|
|
13034
|
+
'sdkHttpResponse',
|
|
13035
|
+
]);
|
|
13036
|
+
if (fromSdkHttpResponse != null) {
|
|
13037
|
+
setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
|
|
13038
|
+
}
|
|
12796
13039
|
const fromTotalTokens = getValueByPath(fromObject, ['totalTokens']);
|
|
12797
13040
|
if (fromTotalTokens != null) {
|
|
12798
13041
|
setValueByPath(toObject, ['totalTokens'], fromTotalTokens);
|
|
@@ -12801,6 +13044,12 @@ function countTokensResponseFromVertex(fromObject) {
|
|
|
12801
13044
|
}
|
|
12802
13045
|
function computeTokensResponseFromVertex(fromObject) {
|
|
12803
13046
|
const toObject = {};
|
|
13047
|
+
const fromSdkHttpResponse = getValueByPath(fromObject, [
|
|
13048
|
+
'sdkHttpResponse',
|
|
13049
|
+
]);
|
|
13050
|
+
if (fromSdkHttpResponse != null) {
|
|
13051
|
+
setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
|
|
13052
|
+
}
|
|
12804
13053
|
const fromTokensInfo = getValueByPath(fromObject, ['tokensInfo']);
|
|
12805
13054
|
if (fromTokensInfo != null) {
|
|
12806
13055
|
setValueByPath(toObject, ['tokensInfo'], fromTokensInfo);
|
|
@@ -12893,7 +13142,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
|
|
|
12893
13142
|
const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
|
|
12894
13143
|
const USER_AGENT_HEADER = 'User-Agent';
|
|
12895
13144
|
const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
|
|
12896
|
-
const SDK_VERSION = '1.
|
|
13145
|
+
const SDK_VERSION = '1.13.0'; // x-release-please-version
|
|
12897
13146
|
const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
|
|
12898
13147
|
const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
|
|
12899
13148
|
const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';
|
|
@@ -13979,13 +14228,13 @@ class Live {
|
|
|
13979
14228
|
const websocketBaseUrl = this.apiClient.getWebsocketBaseUrl();
|
|
13980
14229
|
const apiVersion = this.apiClient.getApiVersion();
|
|
13981
14230
|
let url;
|
|
13982
|
-
const
|
|
14231
|
+
const clientHeaders = this.apiClient.getHeaders();
|
|
13983
14232
|
if (params.config &&
|
|
13984
14233
|
params.config.tools &&
|
|
13985
14234
|
hasMcpToolUsage(params.config.tools)) {
|
|
13986
|
-
setMcpUsageHeader(
|
|
14235
|
+
setMcpUsageHeader(clientHeaders);
|
|
13987
14236
|
}
|
|
13988
|
-
const headers = mapToHeaders(
|
|
14237
|
+
const headers = mapToHeaders(clientHeaders);
|
|
13989
14238
|
if (this.apiClient.isVertexAI()) {
|
|
13990
14239
|
url = `${websocketBaseUrl}/ws/google.cloud.aiplatform.${apiVersion}.LlmBidiService/BidiGenerateContent`;
|
|
13991
14240
|
await this.auth.addAuthHeaders(headers);
|
|
@@ -14552,11 +14801,13 @@ class Models extends BaseModule {
|
|
|
14552
14801
|
response = {
|
|
14553
14802
|
generatedImages: generatedImages,
|
|
14554
14803
|
positivePromptSafetyAttributes: positivePromptSafetyAttributes,
|
|
14804
|
+
sdkHttpResponse: apiResponse.sdkHttpResponse,
|
|
14555
14805
|
};
|
|
14556
14806
|
}
|
|
14557
14807
|
else {
|
|
14558
14808
|
response = {
|
|
14559
14809
|
generatedImages: generatedImages,
|
|
14810
|
+
sdkHttpResponse: apiResponse.sdkHttpResponse,
|
|
14560
14811
|
};
|
|
14561
14812
|
}
|
|
14562
14813
|
return response;
|
|
@@ -15042,7 +15293,13 @@ class Models extends BaseModule {
|
|
|
15042
15293
|
abortSignal: (_b = params.config) === null || _b === void 0 ? void 0 : _b.abortSignal,
|
|
15043
15294
|
})
|
|
15044
15295
|
.then((httpResponse) => {
|
|
15045
|
-
return httpResponse.json()
|
|
15296
|
+
return httpResponse.json().then((jsonResponse) => {
|
|
15297
|
+
const response = jsonResponse;
|
|
15298
|
+
response.sdkHttpResponse = {
|
|
15299
|
+
headers: httpResponse.headers,
|
|
15300
|
+
};
|
|
15301
|
+
return response;
|
|
15302
|
+
});
|
|
15046
15303
|
});
|
|
15047
15304
|
return response.then((apiResponse) => {
|
|
15048
15305
|
const resp = embedContentResponseFromVertex(apiResponse);
|
|
@@ -15068,7 +15325,13 @@ class Models extends BaseModule {
|
|
|
15068
15325
|
abortSignal: (_d = params.config) === null || _d === void 0 ? void 0 : _d.abortSignal,
|
|
15069
15326
|
})
|
|
15070
15327
|
.then((httpResponse) => {
|
|
15071
|
-
return httpResponse.json()
|
|
15328
|
+
return httpResponse.json().then((jsonResponse) => {
|
|
15329
|
+
const response = jsonResponse;
|
|
15330
|
+
response.sdkHttpResponse = {
|
|
15331
|
+
headers: httpResponse.headers,
|
|
15332
|
+
};
|
|
15333
|
+
return response;
|
|
15334
|
+
});
|
|
15072
15335
|
});
|
|
15073
15336
|
return response.then((apiResponse) => {
|
|
15074
15337
|
const resp = embedContentResponseFromMldev(apiResponse);
|
|
@@ -15119,7 +15382,13 @@ class Models extends BaseModule {
|
|
|
15119
15382
|
abortSignal: (_b = params.config) === null || _b === void 0 ? void 0 : _b.abortSignal,
|
|
15120
15383
|
})
|
|
15121
15384
|
.then((httpResponse) => {
|
|
15122
|
-
return httpResponse.json()
|
|
15385
|
+
return httpResponse.json().then((jsonResponse) => {
|
|
15386
|
+
const response = jsonResponse;
|
|
15387
|
+
response.sdkHttpResponse = {
|
|
15388
|
+
headers: httpResponse.headers,
|
|
15389
|
+
};
|
|
15390
|
+
return response;
|
|
15391
|
+
});
|
|
15123
15392
|
});
|
|
15124
15393
|
return response.then((apiResponse) => {
|
|
15125
15394
|
const resp = generateImagesResponseFromVertex(apiResponse);
|
|
@@ -15145,7 +15414,13 @@ class Models extends BaseModule {
|
|
|
15145
15414
|
abortSignal: (_d = params.config) === null || _d === void 0 ? void 0 : _d.abortSignal,
|
|
15146
15415
|
})
|
|
15147
15416
|
.then((httpResponse) => {
|
|
15148
|
-
return httpResponse.json()
|
|
15417
|
+
return httpResponse.json().then((jsonResponse) => {
|
|
15418
|
+
const response = jsonResponse;
|
|
15419
|
+
response.sdkHttpResponse = {
|
|
15420
|
+
headers: httpResponse.headers,
|
|
15421
|
+
};
|
|
15422
|
+
return response;
|
|
15423
|
+
});
|
|
15149
15424
|
});
|
|
15150
15425
|
return response.then((apiResponse) => {
|
|
15151
15426
|
const resp = generateImagesResponseFromMldev(apiResponse);
|
|
@@ -15177,7 +15452,13 @@ class Models extends BaseModule {
|
|
|
15177
15452
|
abortSignal: (_b = params.config) === null || _b === void 0 ? void 0 : _b.abortSignal,
|
|
15178
15453
|
})
|
|
15179
15454
|
.then((httpResponse) => {
|
|
15180
|
-
return httpResponse.json()
|
|
15455
|
+
return httpResponse.json().then((jsonResponse) => {
|
|
15456
|
+
const response = jsonResponse;
|
|
15457
|
+
response.sdkHttpResponse = {
|
|
15458
|
+
headers: httpResponse.headers,
|
|
15459
|
+
};
|
|
15460
|
+
return response;
|
|
15461
|
+
});
|
|
15181
15462
|
});
|
|
15182
15463
|
return response.then((apiResponse) => {
|
|
15183
15464
|
const resp = editImageResponseFromVertex(apiResponse);
|
|
@@ -15212,7 +15493,13 @@ class Models extends BaseModule {
|
|
|
15212
15493
|
abortSignal: (_b = params.config) === null || _b === void 0 ? void 0 : _b.abortSignal,
|
|
15213
15494
|
})
|
|
15214
15495
|
.then((httpResponse) => {
|
|
15215
|
-
return httpResponse.json()
|
|
15496
|
+
return httpResponse.json().then((jsonResponse) => {
|
|
15497
|
+
const response = jsonResponse;
|
|
15498
|
+
response.sdkHttpResponse = {
|
|
15499
|
+
headers: httpResponse.headers,
|
|
15500
|
+
};
|
|
15501
|
+
return response;
|
|
15502
|
+
});
|
|
15216
15503
|
});
|
|
15217
15504
|
return response.then((apiResponse) => {
|
|
15218
15505
|
const resp = upscaleImageResponseFromVertex(apiResponse);
|
|
@@ -15225,6 +15512,79 @@ class Models extends BaseModule {
|
|
|
15225
15512
|
throw new Error('This method is only supported by the Vertex AI.');
|
|
15226
15513
|
}
|
|
15227
15514
|
}
|
|
15515
|
+
/**
|
|
15516
|
+
* Recontextualizes an image.
|
|
15517
|
+
*
|
|
15518
|
+
* There are two types of recontextualization currently supported:
|
|
15519
|
+
* 1) Imagen Product Recontext - Generate images of products in new scenes
|
|
15520
|
+
* and contexts.
|
|
15521
|
+
* 2) Virtual Try-On: Generate images of persons modeling fashion products.
|
|
15522
|
+
*
|
|
15523
|
+
* @param params - The parameters for recontextualizing an image.
|
|
15524
|
+
* @return The response from the API.
|
|
15525
|
+
*
|
|
15526
|
+
* @example
|
|
15527
|
+
* ```ts
|
|
15528
|
+
* const response1 = await ai.models.recontextImage({
|
|
15529
|
+
* model: 'imagen-product-recontext-preview-06-30',
|
|
15530
|
+
* source: {
|
|
15531
|
+
* prompt: 'In a modern kitchen setting.',
|
|
15532
|
+
* productImages: [productImage],
|
|
15533
|
+
* },
|
|
15534
|
+
* config: {
|
|
15535
|
+
* numberOfImages: 1,
|
|
15536
|
+
* },
|
|
15537
|
+
* });
|
|
15538
|
+
* console.log(response1?.generatedImages?.[0]?.image?.imageBytes);
|
|
15539
|
+
*
|
|
15540
|
+
* const response2 = await ai.models.recontextImage({
|
|
15541
|
+
* model: 'virtual-try-on-preview-08-04',
|
|
15542
|
+
* source: {
|
|
15543
|
+
* personImage: personImage,
|
|
15544
|
+
* productImages: [productImage],
|
|
15545
|
+
* },
|
|
15546
|
+
* config: {
|
|
15547
|
+
* numberOfImages: 1,
|
|
15548
|
+
* },
|
|
15549
|
+
* });
|
|
15550
|
+
* console.log(response2?.generatedImages?.[0]?.image?.imageBytes);
|
|
15551
|
+
* ```
|
|
15552
|
+
*/
|
|
15553
|
+
async recontextImage(params) {
|
|
15554
|
+
var _a, _b;
|
|
15555
|
+
let response;
|
|
15556
|
+
let path = '';
|
|
15557
|
+
let queryParams = {};
|
|
15558
|
+
if (this.apiClient.isVertexAI()) {
|
|
15559
|
+
const body = recontextImageParametersToVertex(this.apiClient, params);
|
|
15560
|
+
path = formatMap('{model}:predict', body['_url']);
|
|
15561
|
+
queryParams = body['_query'];
|
|
15562
|
+
delete body['config'];
|
|
15563
|
+
delete body['_url'];
|
|
15564
|
+
delete body['_query'];
|
|
15565
|
+
response = this.apiClient
|
|
15566
|
+
.request({
|
|
15567
|
+
path: path,
|
|
15568
|
+
queryParams: queryParams,
|
|
15569
|
+
body: JSON.stringify(body),
|
|
15570
|
+
httpMethod: 'POST',
|
|
15571
|
+
httpOptions: (_a = params.config) === null || _a === void 0 ? void 0 : _a.httpOptions,
|
|
15572
|
+
abortSignal: (_b = params.config) === null || _b === void 0 ? void 0 : _b.abortSignal,
|
|
15573
|
+
})
|
|
15574
|
+
.then((httpResponse) => {
|
|
15575
|
+
return httpResponse.json();
|
|
15576
|
+
});
|
|
15577
|
+
return response.then((apiResponse) => {
|
|
15578
|
+
const resp = recontextImageResponseFromVertex(apiResponse);
|
|
15579
|
+
const typedResp = new RecontextImageResponse();
|
|
15580
|
+
Object.assign(typedResp, resp);
|
|
15581
|
+
return typedResp;
|
|
15582
|
+
});
|
|
15583
|
+
}
|
|
15584
|
+
else {
|
|
15585
|
+
throw new Error('This method is only supported by the Vertex AI.');
|
|
15586
|
+
}
|
|
15587
|
+
}
|
|
15228
15588
|
/**
|
|
15229
15589
|
* Fetches information about a model by name.
|
|
15230
15590
|
*
|
|
@@ -15535,7 +15895,13 @@ class Models extends BaseModule {
|
|
|
15535
15895
|
abortSignal: (_b = params.config) === null || _b === void 0 ? void 0 : _b.abortSignal,
|
|
15536
15896
|
})
|
|
15537
15897
|
.then((httpResponse) => {
|
|
15538
|
-
return httpResponse.json()
|
|
15898
|
+
return httpResponse.json().then((jsonResponse) => {
|
|
15899
|
+
const response = jsonResponse;
|
|
15900
|
+
response.sdkHttpResponse = {
|
|
15901
|
+
headers: httpResponse.headers,
|
|
15902
|
+
};
|
|
15903
|
+
return response;
|
|
15904
|
+
});
|
|
15539
15905
|
});
|
|
15540
15906
|
return response.then((apiResponse) => {
|
|
15541
15907
|
const resp = countTokensResponseFromVertex(apiResponse);
|
|
@@ -15561,7 +15927,13 @@ class Models extends BaseModule {
|
|
|
15561
15927
|
abortSignal: (_d = params.config) === null || _d === void 0 ? void 0 : _d.abortSignal,
|
|
15562
15928
|
})
|
|
15563
15929
|
.then((httpResponse) => {
|
|
15564
|
-
return httpResponse.json()
|
|
15930
|
+
return httpResponse.json().then((jsonResponse) => {
|
|
15931
|
+
const response = jsonResponse;
|
|
15932
|
+
response.sdkHttpResponse = {
|
|
15933
|
+
headers: httpResponse.headers,
|
|
15934
|
+
};
|
|
15935
|
+
return response;
|
|
15936
|
+
});
|
|
15565
15937
|
});
|
|
15566
15938
|
return response.then((apiResponse) => {
|
|
15567
15939
|
const resp = countTokensResponseFromMldev(apiResponse);
|
|
@@ -15611,7 +15983,13 @@ class Models extends BaseModule {
|
|
|
15611
15983
|
abortSignal: (_b = params.config) === null || _b === void 0 ? void 0 : _b.abortSignal,
|
|
15612
15984
|
})
|
|
15613
15985
|
.then((httpResponse) => {
|
|
15614
|
-
return httpResponse.json()
|
|
15986
|
+
return httpResponse.json().then((jsonResponse) => {
|
|
15987
|
+
const response = jsonResponse;
|
|
15988
|
+
response.sdkHttpResponse = {
|
|
15989
|
+
headers: httpResponse.headers,
|
|
15990
|
+
};
|
|
15991
|
+
return response;
|
|
15992
|
+
});
|
|
15615
15993
|
});
|
|
15616
15994
|
return response.then((apiResponse) => {
|
|
15617
15995
|
const resp = computeTokensResponseFromVertex(apiResponse);
|
|
@@ -17063,6 +17441,12 @@ function tunedModelFromMldev(fromObject) {
|
|
|
17063
17441
|
}
|
|
17064
17442
|
function tuningJobFromMldev(fromObject) {
|
|
17065
17443
|
const toObject = {};
|
|
17444
|
+
const fromSdkHttpResponse = getValueByPath(fromObject, [
|
|
17445
|
+
'sdkHttpResponse',
|
|
17446
|
+
]);
|
|
17447
|
+
if (fromSdkHttpResponse != null) {
|
|
17448
|
+
setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
|
|
17449
|
+
}
|
|
17066
17450
|
const fromName = getValueByPath(fromObject, ['name']);
|
|
17067
17451
|
if (fromName != null) {
|
|
17068
17452
|
setValueByPath(toObject, ['name'], fromName);
|
|
@@ -17173,6 +17557,12 @@ function listTuningJobsResponseFromMldev(fromObject) {
|
|
|
17173
17557
|
}
|
|
17174
17558
|
function tuningOperationFromMldev(fromObject) {
|
|
17175
17559
|
const toObject = {};
|
|
17560
|
+
const fromSdkHttpResponse = getValueByPath(fromObject, [
|
|
17561
|
+
'sdkHttpResponse',
|
|
17562
|
+
]);
|
|
17563
|
+
if (fromSdkHttpResponse != null) {
|
|
17564
|
+
setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
|
|
17565
|
+
}
|
|
17176
17566
|
const fromName = getValueByPath(fromObject, ['name']);
|
|
17177
17567
|
if (fromName != null) {
|
|
17178
17568
|
setValueByPath(toObject, ['name'], fromName);
|
|
@@ -17235,6 +17625,12 @@ function tunedModelFromVertex(fromObject) {
|
|
|
17235
17625
|
}
|
|
17236
17626
|
function tuningJobFromVertex(fromObject) {
|
|
17237
17627
|
const toObject = {};
|
|
17628
|
+
const fromSdkHttpResponse = getValueByPath(fromObject, [
|
|
17629
|
+
'sdkHttpResponse',
|
|
17630
|
+
]);
|
|
17631
|
+
if (fromSdkHttpResponse != null) {
|
|
17632
|
+
setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
|
|
17633
|
+
}
|
|
17238
17634
|
const fromName = getValueByPath(fromObject, ['name']);
|
|
17239
17635
|
if (fromName != null) {
|
|
17240
17636
|
setValueByPath(toObject, ['name'], fromName);
|
|
@@ -17453,7 +17849,13 @@ class Tunings extends BaseModule {
|
|
|
17453
17849
|
abortSignal: (_b = params.config) === null || _b === void 0 ? void 0 : _b.abortSignal,
|
|
17454
17850
|
})
|
|
17455
17851
|
.then((httpResponse) => {
|
|
17456
|
-
return httpResponse.json()
|
|
17852
|
+
return httpResponse.json().then((jsonResponse) => {
|
|
17853
|
+
const response = jsonResponse;
|
|
17854
|
+
response.sdkHttpResponse = {
|
|
17855
|
+
headers: httpResponse.headers,
|
|
17856
|
+
};
|
|
17857
|
+
return response;
|
|
17858
|
+
});
|
|
17457
17859
|
});
|
|
17458
17860
|
return response.then((apiResponse) => {
|
|
17459
17861
|
const resp = tuningJobFromVertex(apiResponse);
|
|
@@ -17477,7 +17879,13 @@ class Tunings extends BaseModule {
|
|
|
17477
17879
|
abortSignal: (_d = params.config) === null || _d === void 0 ? void 0 : _d.abortSignal,
|
|
17478
17880
|
})
|
|
17479
17881
|
.then((httpResponse) => {
|
|
17480
|
-
return httpResponse.json()
|
|
17882
|
+
return httpResponse.json().then((jsonResponse) => {
|
|
17883
|
+
const response = jsonResponse;
|
|
17884
|
+
response.sdkHttpResponse = {
|
|
17885
|
+
headers: httpResponse.headers,
|
|
17886
|
+
};
|
|
17887
|
+
return response;
|
|
17888
|
+
});
|
|
17481
17889
|
});
|
|
17482
17890
|
return response.then((apiResponse) => {
|
|
17483
17891
|
const resp = tuningJobFromMldev(apiResponse);
|
|
@@ -17577,7 +17985,13 @@ class Tunings extends BaseModule {
|
|
|
17577
17985
|
abortSignal: (_b = params.config) === null || _b === void 0 ? void 0 : _b.abortSignal,
|
|
17578
17986
|
})
|
|
17579
17987
|
.then((httpResponse) => {
|
|
17580
|
-
return httpResponse.json()
|
|
17988
|
+
return httpResponse.json().then((jsonResponse) => {
|
|
17989
|
+
const response = jsonResponse;
|
|
17990
|
+
response.sdkHttpResponse = {
|
|
17991
|
+
headers: httpResponse.headers,
|
|
17992
|
+
};
|
|
17993
|
+
return response;
|
|
17994
|
+
});
|
|
17581
17995
|
});
|
|
17582
17996
|
return response.then((apiResponse) => {
|
|
17583
17997
|
const resp = tuningJobFromVertex(apiResponse);
|
|
@@ -17613,7 +18027,13 @@ class Tunings extends BaseModule {
|
|
|
17613
18027
|
abortSignal: (_b = params.config) === null || _b === void 0 ? void 0 : _b.abortSignal,
|
|
17614
18028
|
})
|
|
17615
18029
|
.then((httpResponse) => {
|
|
17616
|
-
return httpResponse.json()
|
|
18030
|
+
return httpResponse.json().then((jsonResponse) => {
|
|
18031
|
+
const response = jsonResponse;
|
|
18032
|
+
response.sdkHttpResponse = {
|
|
18033
|
+
headers: httpResponse.headers,
|
|
18034
|
+
};
|
|
18035
|
+
return response;
|
|
18036
|
+
});
|
|
17617
18037
|
});
|
|
17618
18038
|
return response.then((apiResponse) => {
|
|
17619
18039
|
const resp = tuningOperationFromMldev(apiResponse);
|
|
@@ -17871,5 +18291,5 @@ class GoogleGenAI {
|
|
|
17871
18291
|
}
|
|
17872
18292
|
}
|
|
17873
18293
|
|
|
17874
|
-
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 };
|
|
18294
|
+
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 };
|
|
17875
18295
|
//# sourceMappingURL=index.mjs.map
|