@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/node/index.mjs
CHANGED
|
@@ -450,6 +450,14 @@ var UrlRetrievalStatus;
|
|
|
450
450
|
* Url retrieval is failed due to error.
|
|
451
451
|
*/
|
|
452
452
|
UrlRetrievalStatus["URL_RETRIEVAL_STATUS_ERROR"] = "URL_RETRIEVAL_STATUS_ERROR";
|
|
453
|
+
/**
|
|
454
|
+
* Url retrieval is failed because the content is behind paywall.
|
|
455
|
+
*/
|
|
456
|
+
UrlRetrievalStatus["URL_RETRIEVAL_STATUS_PAYWALL"] = "URL_RETRIEVAL_STATUS_PAYWALL";
|
|
457
|
+
/**
|
|
458
|
+
* Url retrieval is failed because the content is unsafe.
|
|
459
|
+
*/
|
|
460
|
+
UrlRetrievalStatus["URL_RETRIEVAL_STATUS_UNSAFE"] = "URL_RETRIEVAL_STATUS_UNSAFE";
|
|
453
461
|
})(UrlRetrievalStatus || (UrlRetrievalStatus = {}));
|
|
454
462
|
/** Output only. The reason why the model stopped generating tokens.
|
|
455
463
|
|
|
@@ -1076,6 +1084,29 @@ var Scale;
|
|
|
1076
1084
|
*/
|
|
1077
1085
|
Scale["B_MAJOR_A_FLAT_MINOR"] = "B_MAJOR_A_FLAT_MINOR";
|
|
1078
1086
|
})(Scale || (Scale = {}));
|
|
1087
|
+
/** The mode of music generation. */
|
|
1088
|
+
var MusicGenerationMode;
|
|
1089
|
+
(function (MusicGenerationMode) {
|
|
1090
|
+
/**
|
|
1091
|
+
* Rely on the server default generation mode.
|
|
1092
|
+
*/
|
|
1093
|
+
MusicGenerationMode["MUSIC_GENERATION_MODE_UNSPECIFIED"] = "MUSIC_GENERATION_MODE_UNSPECIFIED";
|
|
1094
|
+
/**
|
|
1095
|
+
* Steer text prompts to regions of latent space with higher quality
|
|
1096
|
+
music.
|
|
1097
|
+
*/
|
|
1098
|
+
MusicGenerationMode["QUALITY"] = "QUALITY";
|
|
1099
|
+
/**
|
|
1100
|
+
* Steer text prompts to regions of latent space with a larger
|
|
1101
|
+
diversity of music.
|
|
1102
|
+
*/
|
|
1103
|
+
MusicGenerationMode["DIVERSITY"] = "DIVERSITY";
|
|
1104
|
+
/**
|
|
1105
|
+
* Steer text prompts to regions of latent space more likely to
|
|
1106
|
+
generate music with vocals.
|
|
1107
|
+
*/
|
|
1108
|
+
MusicGenerationMode["VOCALIZATION"] = "VOCALIZATION";
|
|
1109
|
+
})(MusicGenerationMode || (MusicGenerationMode = {}));
|
|
1079
1110
|
/** The playback control signal to apply to the music generation. */
|
|
1080
1111
|
var LiveMusicPlaybackControl;
|
|
1081
1112
|
(function (LiveMusicPlaybackControl) {
|
|
@@ -1499,6 +1530,9 @@ class EditImageResponse {
|
|
|
1499
1530
|
}
|
|
1500
1531
|
class UpscaleImageResponse {
|
|
1501
1532
|
}
|
|
1533
|
+
/** The output images response. */
|
|
1534
|
+
class RecontextImageResponse {
|
|
1535
|
+
}
|
|
1502
1536
|
class ListModelsResponse {
|
|
1503
1537
|
}
|
|
1504
1538
|
class DeleteModelResponse {
|
|
@@ -1754,8 +1788,8 @@ class GenerateVideosOperation {
|
|
|
1754
1788
|
},
|
|
1755
1789
|
};
|
|
1756
1790
|
});
|
|
1757
|
-
operationResponse.raiMediaFilteredCount =
|
|
1758
|
-
operationResponse.raiMediaFilteredReasons =
|
|
1791
|
+
operationResponse.raiMediaFilteredCount = generatedVideoResponse === null || generatedVideoResponse === void 0 ? void 0 : generatedVideoResponse['raiMediaFilteredCount'];
|
|
1792
|
+
operationResponse.raiMediaFilteredReasons = generatedVideoResponse === null || generatedVideoResponse === void 0 ? void 0 : generatedVideoResponse['raiMediaFilteredReasons'];
|
|
1759
1793
|
operation.response = operationResponse;
|
|
1760
1794
|
}
|
|
1761
1795
|
}
|
|
@@ -3704,6 +3738,10 @@ function generateContentResponseFromMldev$1(fromObject) {
|
|
|
3704
3738
|
if (fromPromptFeedback != null) {
|
|
3705
3739
|
setValueByPath(toObject, ['promptFeedback'], fromPromptFeedback);
|
|
3706
3740
|
}
|
|
3741
|
+
const fromResponseId = getValueByPath(fromObject, ['responseId']);
|
|
3742
|
+
if (fromResponseId != null) {
|
|
3743
|
+
setValueByPath(toObject, ['responseId'], fromResponseId);
|
|
3744
|
+
}
|
|
3707
3745
|
const fromUsageMetadata = getValueByPath(fromObject, [
|
|
3708
3746
|
'usageMetadata',
|
|
3709
3747
|
]);
|
|
@@ -3837,6 +3875,12 @@ function listBatchJobsResponseFromMldev(fromObject) {
|
|
|
3837
3875
|
}
|
|
3838
3876
|
function deleteResourceJobFromMldev(fromObject) {
|
|
3839
3877
|
const toObject = {};
|
|
3878
|
+
const fromSdkHttpResponse = getValueByPath(fromObject, [
|
|
3879
|
+
'sdkHttpResponse',
|
|
3880
|
+
]);
|
|
3881
|
+
if (fromSdkHttpResponse != null) {
|
|
3882
|
+
setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
|
|
3883
|
+
}
|
|
3840
3884
|
const fromName = getValueByPath(fromObject, ['name']);
|
|
3841
3885
|
if (fromName != null) {
|
|
3842
3886
|
setValueByPath(toObject, ['name'], fromName);
|
|
@@ -3986,6 +4030,12 @@ function listBatchJobsResponseFromVertex(fromObject) {
|
|
|
3986
4030
|
}
|
|
3987
4031
|
function deleteResourceJobFromVertex(fromObject) {
|
|
3988
4032
|
const toObject = {};
|
|
4033
|
+
const fromSdkHttpResponse = getValueByPath(fromObject, [
|
|
4034
|
+
'sdkHttpResponse',
|
|
4035
|
+
]);
|
|
4036
|
+
if (fromSdkHttpResponse != null) {
|
|
4037
|
+
setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
|
|
4038
|
+
}
|
|
3989
4039
|
const fromName = getValueByPath(fromObject, ['name']);
|
|
3990
4040
|
if (fromName != null) {
|
|
3991
4041
|
setValueByPath(toObject, ['name'], fromName);
|
|
@@ -4531,7 +4581,13 @@ class Batches extends BaseModule {
|
|
|
4531
4581
|
abortSignal: (_b = params.config) === null || _b === void 0 ? void 0 : _b.abortSignal,
|
|
4532
4582
|
})
|
|
4533
4583
|
.then((httpResponse) => {
|
|
4534
|
-
return httpResponse.json()
|
|
4584
|
+
return httpResponse.json().then((jsonResponse) => {
|
|
4585
|
+
const response = jsonResponse;
|
|
4586
|
+
response.sdkHttpResponse = {
|
|
4587
|
+
headers: httpResponse.headers,
|
|
4588
|
+
};
|
|
4589
|
+
return response;
|
|
4590
|
+
});
|
|
4535
4591
|
});
|
|
4536
4592
|
return response.then((apiResponse) => {
|
|
4537
4593
|
const resp = deleteResourceJobFromVertex(apiResponse);
|
|
@@ -4555,7 +4611,13 @@ class Batches extends BaseModule {
|
|
|
4555
4611
|
abortSignal: (_d = params.config) === null || _d === void 0 ? void 0 : _d.abortSignal,
|
|
4556
4612
|
})
|
|
4557
4613
|
.then((httpResponse) => {
|
|
4558
|
-
return httpResponse.json()
|
|
4614
|
+
return httpResponse.json().then((jsonResponse) => {
|
|
4615
|
+
const response = jsonResponse;
|
|
4616
|
+
response.sdkHttpResponse = {
|
|
4617
|
+
headers: httpResponse.headers,
|
|
4618
|
+
};
|
|
4619
|
+
return response;
|
|
4620
|
+
});
|
|
4559
4621
|
});
|
|
4560
4622
|
return response.then((apiResponse) => {
|
|
4561
4623
|
const resp = deleteResourceJobFromMldev(apiResponse);
|
|
@@ -7616,6 +7678,12 @@ function liveMusicGenerationConfigToMldev(fromObject) {
|
|
|
7616
7678
|
if (fromOnlyBassAndDrums != null) {
|
|
7617
7679
|
setValueByPath(toObject, ['onlyBassAndDrums'], fromOnlyBassAndDrums);
|
|
7618
7680
|
}
|
|
7681
|
+
const fromMusicGenerationMode = getValueByPath(fromObject, [
|
|
7682
|
+
'musicGenerationMode',
|
|
7683
|
+
]);
|
|
7684
|
+
if (fromMusicGenerationMode != null) {
|
|
7685
|
+
setValueByPath(toObject, ['musicGenerationMode'], fromMusicGenerationMode);
|
|
7686
|
+
}
|
|
7619
7687
|
return toObject;
|
|
7620
7688
|
}
|
|
7621
7689
|
function liveMusicSetConfigParametersToMldev(fromObject) {
|
|
@@ -8774,6 +8842,12 @@ function liveMusicGenerationConfigFromMldev(fromObject) {
|
|
|
8774
8842
|
if (fromOnlyBassAndDrums != null) {
|
|
8775
8843
|
setValueByPath(toObject, ['onlyBassAndDrums'], fromOnlyBassAndDrums);
|
|
8776
8844
|
}
|
|
8845
|
+
const fromMusicGenerationMode = getValueByPath(fromObject, [
|
|
8846
|
+
'musicGenerationMode',
|
|
8847
|
+
]);
|
|
8848
|
+
if (fromMusicGenerationMode != null) {
|
|
8849
|
+
setValueByPath(toObject, ['musicGenerationMode'], fromMusicGenerationMode);
|
|
8850
|
+
}
|
|
8777
8851
|
return toObject;
|
|
8778
8852
|
}
|
|
8779
8853
|
function liveMusicSourceMetadataFromMldev(fromObject) {
|
|
@@ -10040,8 +10114,9 @@ function generateImagesConfigToMldev(fromObject, parentObject) {
|
|
|
10040
10114
|
if (getValueByPath(fromObject, ['addWatermark']) !== undefined) {
|
|
10041
10115
|
throw new Error('addWatermark parameter is not supported in Gemini API.');
|
|
10042
10116
|
}
|
|
10043
|
-
|
|
10044
|
-
|
|
10117
|
+
const fromImageSize = getValueByPath(fromObject, ['imageSize']);
|
|
10118
|
+
if (parentObject !== undefined && fromImageSize != null) {
|
|
10119
|
+
setValueByPath(parentObject, ['parameters', 'sampleImageSize'], fromImageSize);
|
|
10045
10120
|
}
|
|
10046
10121
|
if (getValueByPath(fromObject, ['enhancePrompt']) !== undefined) {
|
|
10047
10122
|
throw new Error('enhancePrompt parameter is not supported in Gemini API.');
|
|
@@ -11443,6 +11518,106 @@ function upscaleImageAPIParametersInternalToVertex(apiClient, fromObject) {
|
|
|
11443
11518
|
}
|
|
11444
11519
|
return toObject;
|
|
11445
11520
|
}
|
|
11521
|
+
function productImageToVertex(fromObject) {
|
|
11522
|
+
const toObject = {};
|
|
11523
|
+
const fromProductImage = getValueByPath(fromObject, ['productImage']);
|
|
11524
|
+
if (fromProductImage != null) {
|
|
11525
|
+
setValueByPath(toObject, ['image'], imageToVertex(fromProductImage));
|
|
11526
|
+
}
|
|
11527
|
+
return toObject;
|
|
11528
|
+
}
|
|
11529
|
+
function recontextImageSourceToVertex(fromObject, parentObject) {
|
|
11530
|
+
const toObject = {};
|
|
11531
|
+
const fromPrompt = getValueByPath(fromObject, ['prompt']);
|
|
11532
|
+
if (parentObject !== undefined && fromPrompt != null) {
|
|
11533
|
+
setValueByPath(parentObject, ['instances[0]', 'prompt'], fromPrompt);
|
|
11534
|
+
}
|
|
11535
|
+
const fromPersonImage = getValueByPath(fromObject, ['personImage']);
|
|
11536
|
+
if (parentObject !== undefined && fromPersonImage != null) {
|
|
11537
|
+
setValueByPath(parentObject, ['instances[0]', 'personImage', 'image'], imageToVertex(fromPersonImage));
|
|
11538
|
+
}
|
|
11539
|
+
const fromProductImages = getValueByPath(fromObject, [
|
|
11540
|
+
'productImages',
|
|
11541
|
+
]);
|
|
11542
|
+
if (parentObject !== undefined && fromProductImages != null) {
|
|
11543
|
+
let transformedList = fromProductImages;
|
|
11544
|
+
if (Array.isArray(transformedList)) {
|
|
11545
|
+
transformedList = transformedList.map((item) => {
|
|
11546
|
+
return productImageToVertex(item);
|
|
11547
|
+
});
|
|
11548
|
+
}
|
|
11549
|
+
setValueByPath(parentObject, ['instances[0]', 'productImages'], transformedList);
|
|
11550
|
+
}
|
|
11551
|
+
return toObject;
|
|
11552
|
+
}
|
|
11553
|
+
function recontextImageConfigToVertex(fromObject, parentObject) {
|
|
11554
|
+
const toObject = {};
|
|
11555
|
+
const fromNumberOfImages = getValueByPath(fromObject, [
|
|
11556
|
+
'numberOfImages',
|
|
11557
|
+
]);
|
|
11558
|
+
if (parentObject !== undefined && fromNumberOfImages != null) {
|
|
11559
|
+
setValueByPath(parentObject, ['parameters', 'sampleCount'], fromNumberOfImages);
|
|
11560
|
+
}
|
|
11561
|
+
const fromBaseSteps = getValueByPath(fromObject, ['baseSteps']);
|
|
11562
|
+
if (parentObject !== undefined && fromBaseSteps != null) {
|
|
11563
|
+
setValueByPath(parentObject, ['parameters', 'editConfig', 'baseSteps'], fromBaseSteps);
|
|
11564
|
+
}
|
|
11565
|
+
const fromOutputGcsUri = getValueByPath(fromObject, ['outputGcsUri']);
|
|
11566
|
+
if (parentObject !== undefined && fromOutputGcsUri != null) {
|
|
11567
|
+
setValueByPath(parentObject, ['parameters', 'storageUri'], fromOutputGcsUri);
|
|
11568
|
+
}
|
|
11569
|
+
const fromSeed = getValueByPath(fromObject, ['seed']);
|
|
11570
|
+
if (parentObject !== undefined && fromSeed != null) {
|
|
11571
|
+
setValueByPath(parentObject, ['parameters', 'seed'], fromSeed);
|
|
11572
|
+
}
|
|
11573
|
+
const fromSafetyFilterLevel = getValueByPath(fromObject, [
|
|
11574
|
+
'safetyFilterLevel',
|
|
11575
|
+
]);
|
|
11576
|
+
if (parentObject !== undefined && fromSafetyFilterLevel != null) {
|
|
11577
|
+
setValueByPath(parentObject, ['parameters', 'safetySetting'], fromSafetyFilterLevel);
|
|
11578
|
+
}
|
|
11579
|
+
const fromPersonGeneration = getValueByPath(fromObject, [
|
|
11580
|
+
'personGeneration',
|
|
11581
|
+
]);
|
|
11582
|
+
if (parentObject !== undefined && fromPersonGeneration != null) {
|
|
11583
|
+
setValueByPath(parentObject, ['parameters', 'personGeneration'], fromPersonGeneration);
|
|
11584
|
+
}
|
|
11585
|
+
const fromOutputMimeType = getValueByPath(fromObject, [
|
|
11586
|
+
'outputMimeType',
|
|
11587
|
+
]);
|
|
11588
|
+
if (parentObject !== undefined && fromOutputMimeType != null) {
|
|
11589
|
+
setValueByPath(parentObject, ['parameters', 'outputOptions', 'mimeType'], fromOutputMimeType);
|
|
11590
|
+
}
|
|
11591
|
+
const fromOutputCompressionQuality = getValueByPath(fromObject, [
|
|
11592
|
+
'outputCompressionQuality',
|
|
11593
|
+
]);
|
|
11594
|
+
if (parentObject !== undefined && fromOutputCompressionQuality != null) {
|
|
11595
|
+
setValueByPath(parentObject, ['parameters', 'outputOptions', 'compressionQuality'], fromOutputCompressionQuality);
|
|
11596
|
+
}
|
|
11597
|
+
const fromEnhancePrompt = getValueByPath(fromObject, [
|
|
11598
|
+
'enhancePrompt',
|
|
11599
|
+
]);
|
|
11600
|
+
if (parentObject !== undefined && fromEnhancePrompt != null) {
|
|
11601
|
+
setValueByPath(parentObject, ['parameters', 'enhancePrompt'], fromEnhancePrompt);
|
|
11602
|
+
}
|
|
11603
|
+
return toObject;
|
|
11604
|
+
}
|
|
11605
|
+
function recontextImageParametersToVertex(apiClient, fromObject) {
|
|
11606
|
+
const toObject = {};
|
|
11607
|
+
const fromModel = getValueByPath(fromObject, ['model']);
|
|
11608
|
+
if (fromModel != null) {
|
|
11609
|
+
setValueByPath(toObject, ['_url', 'model'], tModel(apiClient, fromModel));
|
|
11610
|
+
}
|
|
11611
|
+
const fromSource = getValueByPath(fromObject, ['source']);
|
|
11612
|
+
if (fromSource != null) {
|
|
11613
|
+
setValueByPath(toObject, ['config'], recontextImageSourceToVertex(fromSource, toObject));
|
|
11614
|
+
}
|
|
11615
|
+
const fromConfig = getValueByPath(fromObject, ['config']);
|
|
11616
|
+
if (fromConfig != null) {
|
|
11617
|
+
setValueByPath(toObject, ['config'], recontextImageConfigToVertex(fromConfig, toObject));
|
|
11618
|
+
}
|
|
11619
|
+
return toObject;
|
|
11620
|
+
}
|
|
11446
11621
|
function getModelParametersToVertex(apiClient, fromObject) {
|
|
11447
11622
|
const toObject = {};
|
|
11448
11623
|
const fromModel = getValueByPath(fromObject, ['model']);
|
|
@@ -11939,6 +12114,10 @@ function generateContentResponseFromMldev(fromObject) {
|
|
|
11939
12114
|
if (fromPromptFeedback != null) {
|
|
11940
12115
|
setValueByPath(toObject, ['promptFeedback'], fromPromptFeedback);
|
|
11941
12116
|
}
|
|
12117
|
+
const fromResponseId = getValueByPath(fromObject, ['responseId']);
|
|
12118
|
+
if (fromResponseId != null) {
|
|
12119
|
+
setValueByPath(toObject, ['responseId'], fromResponseId);
|
|
12120
|
+
}
|
|
11942
12121
|
const fromUsageMetadata = getValueByPath(fromObject, [
|
|
11943
12122
|
'usageMetadata',
|
|
11944
12123
|
]);
|
|
@@ -11961,6 +12140,12 @@ function embedContentMetadataFromMldev() {
|
|
|
11961
12140
|
}
|
|
11962
12141
|
function embedContentResponseFromMldev(fromObject) {
|
|
11963
12142
|
const toObject = {};
|
|
12143
|
+
const fromSdkHttpResponse = getValueByPath(fromObject, [
|
|
12144
|
+
'sdkHttpResponse',
|
|
12145
|
+
]);
|
|
12146
|
+
if (fromSdkHttpResponse != null) {
|
|
12147
|
+
setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
|
|
12148
|
+
}
|
|
11964
12149
|
const fromEmbeddings = getValueByPath(fromObject, ['embeddings']);
|
|
11965
12150
|
if (fromEmbeddings != null) {
|
|
11966
12151
|
let transformedList = fromEmbeddings;
|
|
@@ -12033,6 +12218,12 @@ function generatedImageFromMldev(fromObject) {
|
|
|
12033
12218
|
}
|
|
12034
12219
|
function generateImagesResponseFromMldev(fromObject) {
|
|
12035
12220
|
const toObject = {};
|
|
12221
|
+
const fromSdkHttpResponse = getValueByPath(fromObject, [
|
|
12222
|
+
'sdkHttpResponse',
|
|
12223
|
+
]);
|
|
12224
|
+
if (fromSdkHttpResponse != null) {
|
|
12225
|
+
setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
|
|
12226
|
+
}
|
|
12036
12227
|
const fromGeneratedImages = getValueByPath(fromObject, [
|
|
12037
12228
|
'predictions',
|
|
12038
12229
|
]);
|
|
@@ -12143,6 +12334,12 @@ function deleteModelResponseFromMldev() {
|
|
|
12143
12334
|
}
|
|
12144
12335
|
function countTokensResponseFromMldev(fromObject) {
|
|
12145
12336
|
const toObject = {};
|
|
12337
|
+
const fromSdkHttpResponse = getValueByPath(fromObject, [
|
|
12338
|
+
'sdkHttpResponse',
|
|
12339
|
+
]);
|
|
12340
|
+
if (fromSdkHttpResponse != null) {
|
|
12341
|
+
setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
|
|
12342
|
+
}
|
|
12146
12343
|
const fromTotalTokens = getValueByPath(fromObject, ['totalTokens']);
|
|
12147
12344
|
if (fromTotalTokens != null) {
|
|
12148
12345
|
setValueByPath(toObject, ['totalTokens'], fromTotalTokens);
|
|
@@ -12471,10 +12668,6 @@ function generateContentResponseFromVertex(fromObject) {
|
|
|
12471
12668
|
if (fromCreateTime != null) {
|
|
12472
12669
|
setValueByPath(toObject, ['createTime'], fromCreateTime);
|
|
12473
12670
|
}
|
|
12474
|
-
const fromResponseId = getValueByPath(fromObject, ['responseId']);
|
|
12475
|
-
if (fromResponseId != null) {
|
|
12476
|
-
setValueByPath(toObject, ['responseId'], fromResponseId);
|
|
12477
|
-
}
|
|
12478
12671
|
const fromModelVersion = getValueByPath(fromObject, ['modelVersion']);
|
|
12479
12672
|
if (fromModelVersion != null) {
|
|
12480
12673
|
setValueByPath(toObject, ['modelVersion'], fromModelVersion);
|
|
@@ -12485,6 +12678,10 @@ function generateContentResponseFromVertex(fromObject) {
|
|
|
12485
12678
|
if (fromPromptFeedback != null) {
|
|
12486
12679
|
setValueByPath(toObject, ['promptFeedback'], fromPromptFeedback);
|
|
12487
12680
|
}
|
|
12681
|
+
const fromResponseId = getValueByPath(fromObject, ['responseId']);
|
|
12682
|
+
if (fromResponseId != null) {
|
|
12683
|
+
setValueByPath(toObject, ['responseId'], fromResponseId);
|
|
12684
|
+
}
|
|
12488
12685
|
const fromUsageMetadata = getValueByPath(fromObject, [
|
|
12489
12686
|
'usageMetadata',
|
|
12490
12687
|
]);
|
|
@@ -12529,6 +12726,12 @@ function embedContentMetadataFromVertex(fromObject) {
|
|
|
12529
12726
|
}
|
|
12530
12727
|
function embedContentResponseFromVertex(fromObject) {
|
|
12531
12728
|
const toObject = {};
|
|
12729
|
+
const fromSdkHttpResponse = getValueByPath(fromObject, [
|
|
12730
|
+
'sdkHttpResponse',
|
|
12731
|
+
]);
|
|
12732
|
+
if (fromSdkHttpResponse != null) {
|
|
12733
|
+
setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
|
|
12734
|
+
}
|
|
12532
12735
|
const fromEmbeddings = getValueByPath(fromObject, [
|
|
12533
12736
|
'predictions[]',
|
|
12534
12737
|
'embeddings',
|
|
@@ -12612,6 +12815,12 @@ function generatedImageFromVertex(fromObject) {
|
|
|
12612
12815
|
}
|
|
12613
12816
|
function generateImagesResponseFromVertex(fromObject) {
|
|
12614
12817
|
const toObject = {};
|
|
12818
|
+
const fromSdkHttpResponse = getValueByPath(fromObject, [
|
|
12819
|
+
'sdkHttpResponse',
|
|
12820
|
+
]);
|
|
12821
|
+
if (fromSdkHttpResponse != null) {
|
|
12822
|
+
setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
|
|
12823
|
+
}
|
|
12615
12824
|
const fromGeneratedImages = getValueByPath(fromObject, [
|
|
12616
12825
|
'predictions',
|
|
12617
12826
|
]);
|
|
@@ -12634,6 +12843,12 @@ function generateImagesResponseFromVertex(fromObject) {
|
|
|
12634
12843
|
}
|
|
12635
12844
|
function editImageResponseFromVertex(fromObject) {
|
|
12636
12845
|
const toObject = {};
|
|
12846
|
+
const fromSdkHttpResponse = getValueByPath(fromObject, [
|
|
12847
|
+
'sdkHttpResponse',
|
|
12848
|
+
]);
|
|
12849
|
+
if (fromSdkHttpResponse != null) {
|
|
12850
|
+
setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
|
|
12851
|
+
}
|
|
12637
12852
|
const fromGeneratedImages = getValueByPath(fromObject, [
|
|
12638
12853
|
'predictions',
|
|
12639
12854
|
]);
|
|
@@ -12649,6 +12864,28 @@ function editImageResponseFromVertex(fromObject) {
|
|
|
12649
12864
|
return toObject;
|
|
12650
12865
|
}
|
|
12651
12866
|
function upscaleImageResponseFromVertex(fromObject) {
|
|
12867
|
+
const toObject = {};
|
|
12868
|
+
const fromSdkHttpResponse = getValueByPath(fromObject, [
|
|
12869
|
+
'sdkHttpResponse',
|
|
12870
|
+
]);
|
|
12871
|
+
if (fromSdkHttpResponse != null) {
|
|
12872
|
+
setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
|
|
12873
|
+
}
|
|
12874
|
+
const fromGeneratedImages = getValueByPath(fromObject, [
|
|
12875
|
+
'predictions',
|
|
12876
|
+
]);
|
|
12877
|
+
if (fromGeneratedImages != null) {
|
|
12878
|
+
let transformedList = fromGeneratedImages;
|
|
12879
|
+
if (Array.isArray(transformedList)) {
|
|
12880
|
+
transformedList = transformedList.map((item) => {
|
|
12881
|
+
return generatedImageFromVertex(item);
|
|
12882
|
+
});
|
|
12883
|
+
}
|
|
12884
|
+
setValueByPath(toObject, ['generatedImages'], transformedList);
|
|
12885
|
+
}
|
|
12886
|
+
return toObject;
|
|
12887
|
+
}
|
|
12888
|
+
function recontextImageResponseFromVertex(fromObject) {
|
|
12652
12889
|
const toObject = {};
|
|
12653
12890
|
const fromGeneratedImages = getValueByPath(fromObject, [
|
|
12654
12891
|
'predictions',
|
|
@@ -12799,6 +13036,12 @@ function deleteModelResponseFromVertex() {
|
|
|
12799
13036
|
}
|
|
12800
13037
|
function countTokensResponseFromVertex(fromObject) {
|
|
12801
13038
|
const toObject = {};
|
|
13039
|
+
const fromSdkHttpResponse = getValueByPath(fromObject, [
|
|
13040
|
+
'sdkHttpResponse',
|
|
13041
|
+
]);
|
|
13042
|
+
if (fromSdkHttpResponse != null) {
|
|
13043
|
+
setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
|
|
13044
|
+
}
|
|
12802
13045
|
const fromTotalTokens = getValueByPath(fromObject, ['totalTokens']);
|
|
12803
13046
|
if (fromTotalTokens != null) {
|
|
12804
13047
|
setValueByPath(toObject, ['totalTokens'], fromTotalTokens);
|
|
@@ -12807,6 +13050,12 @@ function countTokensResponseFromVertex(fromObject) {
|
|
|
12807
13050
|
}
|
|
12808
13051
|
function computeTokensResponseFromVertex(fromObject) {
|
|
12809
13052
|
const toObject = {};
|
|
13053
|
+
const fromSdkHttpResponse = getValueByPath(fromObject, [
|
|
13054
|
+
'sdkHttpResponse',
|
|
13055
|
+
]);
|
|
13056
|
+
if (fromSdkHttpResponse != null) {
|
|
13057
|
+
setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
|
|
13058
|
+
}
|
|
12810
13059
|
const fromTokensInfo = getValueByPath(fromObject, ['tokensInfo']);
|
|
12811
13060
|
if (fromTokensInfo != null) {
|
|
12812
13061
|
setValueByPath(toObject, ['tokensInfo'], fromTokensInfo);
|
|
@@ -12899,7 +13148,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
|
|
|
12899
13148
|
const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
|
|
12900
13149
|
const USER_AGENT_HEADER = 'User-Agent';
|
|
12901
13150
|
const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
|
|
12902
|
-
const SDK_VERSION = '1.
|
|
13151
|
+
const SDK_VERSION = '1.13.0'; // x-release-please-version
|
|
12903
13152
|
const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
|
|
12904
13153
|
const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
|
|
12905
13154
|
const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';
|
|
@@ -13985,13 +14234,13 @@ class Live {
|
|
|
13985
14234
|
const websocketBaseUrl = this.apiClient.getWebsocketBaseUrl();
|
|
13986
14235
|
const apiVersion = this.apiClient.getApiVersion();
|
|
13987
14236
|
let url;
|
|
13988
|
-
const
|
|
14237
|
+
const clientHeaders = this.apiClient.getHeaders();
|
|
13989
14238
|
if (params.config &&
|
|
13990
14239
|
params.config.tools &&
|
|
13991
14240
|
hasMcpToolUsage(params.config.tools)) {
|
|
13992
|
-
setMcpUsageHeader(
|
|
14241
|
+
setMcpUsageHeader(clientHeaders);
|
|
13993
14242
|
}
|
|
13994
|
-
const headers = mapToHeaders(
|
|
14243
|
+
const headers = mapToHeaders(clientHeaders);
|
|
13995
14244
|
if (this.apiClient.isVertexAI()) {
|
|
13996
14245
|
url = `${websocketBaseUrl}/ws/google.cloud.aiplatform.${apiVersion}.LlmBidiService/BidiGenerateContent`;
|
|
13997
14246
|
await this.auth.addAuthHeaders(headers);
|
|
@@ -14558,11 +14807,13 @@ class Models extends BaseModule {
|
|
|
14558
14807
|
response = {
|
|
14559
14808
|
generatedImages: generatedImages,
|
|
14560
14809
|
positivePromptSafetyAttributes: positivePromptSafetyAttributes,
|
|
14810
|
+
sdkHttpResponse: apiResponse.sdkHttpResponse,
|
|
14561
14811
|
};
|
|
14562
14812
|
}
|
|
14563
14813
|
else {
|
|
14564
14814
|
response = {
|
|
14565
14815
|
generatedImages: generatedImages,
|
|
14816
|
+
sdkHttpResponse: apiResponse.sdkHttpResponse,
|
|
14566
14817
|
};
|
|
14567
14818
|
}
|
|
14568
14819
|
return response;
|
|
@@ -15048,7 +15299,13 @@ class Models extends BaseModule {
|
|
|
15048
15299
|
abortSignal: (_b = params.config) === null || _b === void 0 ? void 0 : _b.abortSignal,
|
|
15049
15300
|
})
|
|
15050
15301
|
.then((httpResponse) => {
|
|
15051
|
-
return httpResponse.json()
|
|
15302
|
+
return httpResponse.json().then((jsonResponse) => {
|
|
15303
|
+
const response = jsonResponse;
|
|
15304
|
+
response.sdkHttpResponse = {
|
|
15305
|
+
headers: httpResponse.headers,
|
|
15306
|
+
};
|
|
15307
|
+
return response;
|
|
15308
|
+
});
|
|
15052
15309
|
});
|
|
15053
15310
|
return response.then((apiResponse) => {
|
|
15054
15311
|
const resp = embedContentResponseFromVertex(apiResponse);
|
|
@@ -15074,7 +15331,13 @@ class Models extends BaseModule {
|
|
|
15074
15331
|
abortSignal: (_d = params.config) === null || _d === void 0 ? void 0 : _d.abortSignal,
|
|
15075
15332
|
})
|
|
15076
15333
|
.then((httpResponse) => {
|
|
15077
|
-
return httpResponse.json()
|
|
15334
|
+
return httpResponse.json().then((jsonResponse) => {
|
|
15335
|
+
const response = jsonResponse;
|
|
15336
|
+
response.sdkHttpResponse = {
|
|
15337
|
+
headers: httpResponse.headers,
|
|
15338
|
+
};
|
|
15339
|
+
return response;
|
|
15340
|
+
});
|
|
15078
15341
|
});
|
|
15079
15342
|
return response.then((apiResponse) => {
|
|
15080
15343
|
const resp = embedContentResponseFromMldev(apiResponse);
|
|
@@ -15125,7 +15388,13 @@ class Models extends BaseModule {
|
|
|
15125
15388
|
abortSignal: (_b = params.config) === null || _b === void 0 ? void 0 : _b.abortSignal,
|
|
15126
15389
|
})
|
|
15127
15390
|
.then((httpResponse) => {
|
|
15128
|
-
return httpResponse.json()
|
|
15391
|
+
return httpResponse.json().then((jsonResponse) => {
|
|
15392
|
+
const response = jsonResponse;
|
|
15393
|
+
response.sdkHttpResponse = {
|
|
15394
|
+
headers: httpResponse.headers,
|
|
15395
|
+
};
|
|
15396
|
+
return response;
|
|
15397
|
+
});
|
|
15129
15398
|
});
|
|
15130
15399
|
return response.then((apiResponse) => {
|
|
15131
15400
|
const resp = generateImagesResponseFromVertex(apiResponse);
|
|
@@ -15151,7 +15420,13 @@ class Models extends BaseModule {
|
|
|
15151
15420
|
abortSignal: (_d = params.config) === null || _d === void 0 ? void 0 : _d.abortSignal,
|
|
15152
15421
|
})
|
|
15153
15422
|
.then((httpResponse) => {
|
|
15154
|
-
return httpResponse.json()
|
|
15423
|
+
return httpResponse.json().then((jsonResponse) => {
|
|
15424
|
+
const response = jsonResponse;
|
|
15425
|
+
response.sdkHttpResponse = {
|
|
15426
|
+
headers: httpResponse.headers,
|
|
15427
|
+
};
|
|
15428
|
+
return response;
|
|
15429
|
+
});
|
|
15155
15430
|
});
|
|
15156
15431
|
return response.then((apiResponse) => {
|
|
15157
15432
|
const resp = generateImagesResponseFromMldev(apiResponse);
|
|
@@ -15183,7 +15458,13 @@ class Models extends BaseModule {
|
|
|
15183
15458
|
abortSignal: (_b = params.config) === null || _b === void 0 ? void 0 : _b.abortSignal,
|
|
15184
15459
|
})
|
|
15185
15460
|
.then((httpResponse) => {
|
|
15186
|
-
return httpResponse.json()
|
|
15461
|
+
return httpResponse.json().then((jsonResponse) => {
|
|
15462
|
+
const response = jsonResponse;
|
|
15463
|
+
response.sdkHttpResponse = {
|
|
15464
|
+
headers: httpResponse.headers,
|
|
15465
|
+
};
|
|
15466
|
+
return response;
|
|
15467
|
+
});
|
|
15187
15468
|
});
|
|
15188
15469
|
return response.then((apiResponse) => {
|
|
15189
15470
|
const resp = editImageResponseFromVertex(apiResponse);
|
|
@@ -15218,7 +15499,13 @@ class Models extends BaseModule {
|
|
|
15218
15499
|
abortSignal: (_b = params.config) === null || _b === void 0 ? void 0 : _b.abortSignal,
|
|
15219
15500
|
})
|
|
15220
15501
|
.then((httpResponse) => {
|
|
15221
|
-
return httpResponse.json()
|
|
15502
|
+
return httpResponse.json().then((jsonResponse) => {
|
|
15503
|
+
const response = jsonResponse;
|
|
15504
|
+
response.sdkHttpResponse = {
|
|
15505
|
+
headers: httpResponse.headers,
|
|
15506
|
+
};
|
|
15507
|
+
return response;
|
|
15508
|
+
});
|
|
15222
15509
|
});
|
|
15223
15510
|
return response.then((apiResponse) => {
|
|
15224
15511
|
const resp = upscaleImageResponseFromVertex(apiResponse);
|
|
@@ -15231,6 +15518,79 @@ class Models extends BaseModule {
|
|
|
15231
15518
|
throw new Error('This method is only supported by the Vertex AI.');
|
|
15232
15519
|
}
|
|
15233
15520
|
}
|
|
15521
|
+
/**
|
|
15522
|
+
* Recontextualizes an image.
|
|
15523
|
+
*
|
|
15524
|
+
* There are two types of recontextualization currently supported:
|
|
15525
|
+
* 1) Imagen Product Recontext - Generate images of products in new scenes
|
|
15526
|
+
* and contexts.
|
|
15527
|
+
* 2) Virtual Try-On: Generate images of persons modeling fashion products.
|
|
15528
|
+
*
|
|
15529
|
+
* @param params - The parameters for recontextualizing an image.
|
|
15530
|
+
* @return The response from the API.
|
|
15531
|
+
*
|
|
15532
|
+
* @example
|
|
15533
|
+
* ```ts
|
|
15534
|
+
* const response1 = await ai.models.recontextImage({
|
|
15535
|
+
* model: 'imagen-product-recontext-preview-06-30',
|
|
15536
|
+
* source: {
|
|
15537
|
+
* prompt: 'In a modern kitchen setting.',
|
|
15538
|
+
* productImages: [productImage],
|
|
15539
|
+
* },
|
|
15540
|
+
* config: {
|
|
15541
|
+
* numberOfImages: 1,
|
|
15542
|
+
* },
|
|
15543
|
+
* });
|
|
15544
|
+
* console.log(response1?.generatedImages?.[0]?.image?.imageBytes);
|
|
15545
|
+
*
|
|
15546
|
+
* const response2 = await ai.models.recontextImage({
|
|
15547
|
+
* model: 'virtual-try-on-preview-08-04',
|
|
15548
|
+
* source: {
|
|
15549
|
+
* personImage: personImage,
|
|
15550
|
+
* productImages: [productImage],
|
|
15551
|
+
* },
|
|
15552
|
+
* config: {
|
|
15553
|
+
* numberOfImages: 1,
|
|
15554
|
+
* },
|
|
15555
|
+
* });
|
|
15556
|
+
* console.log(response2?.generatedImages?.[0]?.image?.imageBytes);
|
|
15557
|
+
* ```
|
|
15558
|
+
*/
|
|
15559
|
+
async recontextImage(params) {
|
|
15560
|
+
var _a, _b;
|
|
15561
|
+
let response;
|
|
15562
|
+
let path = '';
|
|
15563
|
+
let queryParams = {};
|
|
15564
|
+
if (this.apiClient.isVertexAI()) {
|
|
15565
|
+
const body = recontextImageParametersToVertex(this.apiClient, params);
|
|
15566
|
+
path = formatMap('{model}:predict', body['_url']);
|
|
15567
|
+
queryParams = body['_query'];
|
|
15568
|
+
delete body['config'];
|
|
15569
|
+
delete body['_url'];
|
|
15570
|
+
delete body['_query'];
|
|
15571
|
+
response = this.apiClient
|
|
15572
|
+
.request({
|
|
15573
|
+
path: path,
|
|
15574
|
+
queryParams: queryParams,
|
|
15575
|
+
body: JSON.stringify(body),
|
|
15576
|
+
httpMethod: 'POST',
|
|
15577
|
+
httpOptions: (_a = params.config) === null || _a === void 0 ? void 0 : _a.httpOptions,
|
|
15578
|
+
abortSignal: (_b = params.config) === null || _b === void 0 ? void 0 : _b.abortSignal,
|
|
15579
|
+
})
|
|
15580
|
+
.then((httpResponse) => {
|
|
15581
|
+
return httpResponse.json();
|
|
15582
|
+
});
|
|
15583
|
+
return response.then((apiResponse) => {
|
|
15584
|
+
const resp = recontextImageResponseFromVertex(apiResponse);
|
|
15585
|
+
const typedResp = new RecontextImageResponse();
|
|
15586
|
+
Object.assign(typedResp, resp);
|
|
15587
|
+
return typedResp;
|
|
15588
|
+
});
|
|
15589
|
+
}
|
|
15590
|
+
else {
|
|
15591
|
+
throw new Error('This method is only supported by the Vertex AI.');
|
|
15592
|
+
}
|
|
15593
|
+
}
|
|
15234
15594
|
/**
|
|
15235
15595
|
* Fetches information about a model by name.
|
|
15236
15596
|
*
|
|
@@ -15541,7 +15901,13 @@ class Models extends BaseModule {
|
|
|
15541
15901
|
abortSignal: (_b = params.config) === null || _b === void 0 ? void 0 : _b.abortSignal,
|
|
15542
15902
|
})
|
|
15543
15903
|
.then((httpResponse) => {
|
|
15544
|
-
return httpResponse.json()
|
|
15904
|
+
return httpResponse.json().then((jsonResponse) => {
|
|
15905
|
+
const response = jsonResponse;
|
|
15906
|
+
response.sdkHttpResponse = {
|
|
15907
|
+
headers: httpResponse.headers,
|
|
15908
|
+
};
|
|
15909
|
+
return response;
|
|
15910
|
+
});
|
|
15545
15911
|
});
|
|
15546
15912
|
return response.then((apiResponse) => {
|
|
15547
15913
|
const resp = countTokensResponseFromVertex(apiResponse);
|
|
@@ -15567,7 +15933,13 @@ class Models extends BaseModule {
|
|
|
15567
15933
|
abortSignal: (_d = params.config) === null || _d === void 0 ? void 0 : _d.abortSignal,
|
|
15568
15934
|
})
|
|
15569
15935
|
.then((httpResponse) => {
|
|
15570
|
-
return httpResponse.json()
|
|
15936
|
+
return httpResponse.json().then((jsonResponse) => {
|
|
15937
|
+
const response = jsonResponse;
|
|
15938
|
+
response.sdkHttpResponse = {
|
|
15939
|
+
headers: httpResponse.headers,
|
|
15940
|
+
};
|
|
15941
|
+
return response;
|
|
15942
|
+
});
|
|
15571
15943
|
});
|
|
15572
15944
|
return response.then((apiResponse) => {
|
|
15573
15945
|
const resp = countTokensResponseFromMldev(apiResponse);
|
|
@@ -15617,7 +15989,13 @@ class Models extends BaseModule {
|
|
|
15617
15989
|
abortSignal: (_b = params.config) === null || _b === void 0 ? void 0 : _b.abortSignal,
|
|
15618
15990
|
})
|
|
15619
15991
|
.then((httpResponse) => {
|
|
15620
|
-
return httpResponse.json()
|
|
15992
|
+
return httpResponse.json().then((jsonResponse) => {
|
|
15993
|
+
const response = jsonResponse;
|
|
15994
|
+
response.sdkHttpResponse = {
|
|
15995
|
+
headers: httpResponse.headers,
|
|
15996
|
+
};
|
|
15997
|
+
return response;
|
|
15998
|
+
});
|
|
15621
15999
|
});
|
|
15622
16000
|
return response.then((apiResponse) => {
|
|
15623
16001
|
const resp = computeTokensResponseFromVertex(apiResponse);
|
|
@@ -17243,6 +17621,12 @@ function tunedModelFromMldev(fromObject) {
|
|
|
17243
17621
|
}
|
|
17244
17622
|
function tuningJobFromMldev(fromObject) {
|
|
17245
17623
|
const toObject = {};
|
|
17624
|
+
const fromSdkHttpResponse = getValueByPath(fromObject, [
|
|
17625
|
+
'sdkHttpResponse',
|
|
17626
|
+
]);
|
|
17627
|
+
if (fromSdkHttpResponse != null) {
|
|
17628
|
+
setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
|
|
17629
|
+
}
|
|
17246
17630
|
const fromName = getValueByPath(fromObject, ['name']);
|
|
17247
17631
|
if (fromName != null) {
|
|
17248
17632
|
setValueByPath(toObject, ['name'], fromName);
|
|
@@ -17353,6 +17737,12 @@ function listTuningJobsResponseFromMldev(fromObject) {
|
|
|
17353
17737
|
}
|
|
17354
17738
|
function tuningOperationFromMldev(fromObject) {
|
|
17355
17739
|
const toObject = {};
|
|
17740
|
+
const fromSdkHttpResponse = getValueByPath(fromObject, [
|
|
17741
|
+
'sdkHttpResponse',
|
|
17742
|
+
]);
|
|
17743
|
+
if (fromSdkHttpResponse != null) {
|
|
17744
|
+
setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
|
|
17745
|
+
}
|
|
17356
17746
|
const fromName = getValueByPath(fromObject, ['name']);
|
|
17357
17747
|
if (fromName != null) {
|
|
17358
17748
|
setValueByPath(toObject, ['name'], fromName);
|
|
@@ -17415,6 +17805,12 @@ function tunedModelFromVertex(fromObject) {
|
|
|
17415
17805
|
}
|
|
17416
17806
|
function tuningJobFromVertex(fromObject) {
|
|
17417
17807
|
const toObject = {};
|
|
17808
|
+
const fromSdkHttpResponse = getValueByPath(fromObject, [
|
|
17809
|
+
'sdkHttpResponse',
|
|
17810
|
+
]);
|
|
17811
|
+
if (fromSdkHttpResponse != null) {
|
|
17812
|
+
setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
|
|
17813
|
+
}
|
|
17418
17814
|
const fromName = getValueByPath(fromObject, ['name']);
|
|
17419
17815
|
if (fromName != null) {
|
|
17420
17816
|
setValueByPath(toObject, ['name'], fromName);
|
|
@@ -17633,7 +18029,13 @@ class Tunings extends BaseModule {
|
|
|
17633
18029
|
abortSignal: (_b = params.config) === null || _b === void 0 ? void 0 : _b.abortSignal,
|
|
17634
18030
|
})
|
|
17635
18031
|
.then((httpResponse) => {
|
|
17636
|
-
return httpResponse.json()
|
|
18032
|
+
return httpResponse.json().then((jsonResponse) => {
|
|
18033
|
+
const response = jsonResponse;
|
|
18034
|
+
response.sdkHttpResponse = {
|
|
18035
|
+
headers: httpResponse.headers,
|
|
18036
|
+
};
|
|
18037
|
+
return response;
|
|
18038
|
+
});
|
|
17637
18039
|
});
|
|
17638
18040
|
return response.then((apiResponse) => {
|
|
17639
18041
|
const resp = tuningJobFromVertex(apiResponse);
|
|
@@ -17657,7 +18059,13 @@ class Tunings extends BaseModule {
|
|
|
17657
18059
|
abortSignal: (_d = params.config) === null || _d === void 0 ? void 0 : _d.abortSignal,
|
|
17658
18060
|
})
|
|
17659
18061
|
.then((httpResponse) => {
|
|
17660
|
-
return httpResponse.json()
|
|
18062
|
+
return httpResponse.json().then((jsonResponse) => {
|
|
18063
|
+
const response = jsonResponse;
|
|
18064
|
+
response.sdkHttpResponse = {
|
|
18065
|
+
headers: httpResponse.headers,
|
|
18066
|
+
};
|
|
18067
|
+
return response;
|
|
18068
|
+
});
|
|
17661
18069
|
});
|
|
17662
18070
|
return response.then((apiResponse) => {
|
|
17663
18071
|
const resp = tuningJobFromMldev(apiResponse);
|
|
@@ -17757,7 +18165,13 @@ class Tunings extends BaseModule {
|
|
|
17757
18165
|
abortSignal: (_b = params.config) === null || _b === void 0 ? void 0 : _b.abortSignal,
|
|
17758
18166
|
})
|
|
17759
18167
|
.then((httpResponse) => {
|
|
17760
|
-
return httpResponse.json()
|
|
18168
|
+
return httpResponse.json().then((jsonResponse) => {
|
|
18169
|
+
const response = jsonResponse;
|
|
18170
|
+
response.sdkHttpResponse = {
|
|
18171
|
+
headers: httpResponse.headers,
|
|
18172
|
+
};
|
|
18173
|
+
return response;
|
|
18174
|
+
});
|
|
17761
18175
|
});
|
|
17762
18176
|
return response.then((apiResponse) => {
|
|
17763
18177
|
const resp = tuningJobFromVertex(apiResponse);
|
|
@@ -17793,7 +18207,13 @@ class Tunings extends BaseModule {
|
|
|
17793
18207
|
abortSignal: (_b = params.config) === null || _b === void 0 ? void 0 : _b.abortSignal,
|
|
17794
18208
|
})
|
|
17795
18209
|
.then((httpResponse) => {
|
|
17796
|
-
return httpResponse.json()
|
|
18210
|
+
return httpResponse.json().then((jsonResponse) => {
|
|
18211
|
+
const response = jsonResponse;
|
|
18212
|
+
response.sdkHttpResponse = {
|
|
18213
|
+
headers: httpResponse.headers,
|
|
18214
|
+
};
|
|
18215
|
+
return response;
|
|
18216
|
+
});
|
|
17797
18217
|
});
|
|
17798
18218
|
return response.then((apiResponse) => {
|
|
17799
18219
|
const resp = tuningOperationFromMldev(apiResponse);
|
|
@@ -18209,5 +18629,5 @@ function getApiKeyFromEnv() {
|
|
|
18209
18629
|
return envGoogleApiKey || envGeminiApiKey;
|
|
18210
18630
|
}
|
|
18211
18631
|
|
|
18212
|
-
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 };
|
|
18632
|
+
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 };
|
|
18213
18633
|
//# sourceMappingURL=index.mjs.map
|