@google/genai 1.11.0 → 1.12.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 +18 -0
- package/dist/index.cjs +171 -19
- package/dist/index.mjs +171 -19
- package/dist/index.mjs.map +1 -1
- package/dist/node/index.cjs +171 -19
- package/dist/node/index.mjs +171 -19
- package/dist/node/index.mjs.map +1 -1
- package/dist/node/node.d.ts +18 -0
- package/dist/web/index.mjs +171 -19
- package/dist/web/index.mjs.map +1 -1
- package/dist/web/web.d.ts +18 -0
- package/package.json +4 -4
package/dist/node/node.d.ts
CHANGED
|
@@ -1041,6 +1041,8 @@ export declare interface ComputeTokensParameters {
|
|
|
1041
1041
|
|
|
1042
1042
|
/** Response for computing tokens. */
|
|
1043
1043
|
export declare class ComputeTokensResponse {
|
|
1044
|
+
/** Used to retain the full HTTP response. */
|
|
1045
|
+
sdkHttpResponse?: HttpResponse;
|
|
1044
1046
|
/** Lists of tokens info from the input. A ComputeTokensRequest could have multiple instances with a prompt in each instance. We also need to return lists of tokens info for the request with multiple instances. */
|
|
1045
1047
|
tokensInfo?: TokensInfo[];
|
|
1046
1048
|
}
|
|
@@ -1168,6 +1170,8 @@ export declare interface CountTokensParameters {
|
|
|
1168
1170
|
|
|
1169
1171
|
/** Response for counting tokens. */
|
|
1170
1172
|
export declare class CountTokensResponse {
|
|
1173
|
+
/** Used to retain the full HTTP response. */
|
|
1174
|
+
sdkHttpResponse?: HttpResponse;
|
|
1171
1175
|
/** Total number of tokens. */
|
|
1172
1176
|
totalTokens?: number;
|
|
1173
1177
|
/** Number of tokens in the cached part of the prompt (the cached content). */
|
|
@@ -1771,6 +1775,8 @@ export declare interface EditImageParameters {
|
|
|
1771
1775
|
|
|
1772
1776
|
/** Response for the request to edit an image. */
|
|
1773
1777
|
export declare class EditImageResponse {
|
|
1778
|
+
/** Used to retain the full HTTP response. */
|
|
1779
|
+
sdkHttpResponse?: HttpResponse;
|
|
1774
1780
|
/** Generated images. */
|
|
1775
1781
|
generatedImages?: GeneratedImage[];
|
|
1776
1782
|
}
|
|
@@ -1844,6 +1850,8 @@ export declare interface EmbedContentParameters {
|
|
|
1844
1850
|
|
|
1845
1851
|
/** Response for the embed_content method. */
|
|
1846
1852
|
export declare class EmbedContentResponse {
|
|
1853
|
+
/** Used to retain the full HTTP response. */
|
|
1854
|
+
sdkHttpResponse?: HttpResponse;
|
|
1847
1855
|
/** The embeddings for each request, in the same order as provided in
|
|
1848
1856
|
the batch request.
|
|
1849
1857
|
*/
|
|
@@ -2779,6 +2787,8 @@ export declare interface GenerateImagesParameters {
|
|
|
2779
2787
|
|
|
2780
2788
|
/** The output images response. */
|
|
2781
2789
|
export declare class GenerateImagesResponse {
|
|
2790
|
+
/** Used to retain the full HTTP response. */
|
|
2791
|
+
sdkHttpResponse?: HttpResponse;
|
|
2782
2792
|
/** List of generated images.
|
|
2783
2793
|
*/
|
|
2784
2794
|
generatedImages?: GeneratedImage[];
|
|
@@ -2841,6 +2851,8 @@ export declare class GenerateVideosOperation implements Operation<GenerateVideos
|
|
|
2841
2851
|
error?: Record<string, unknown>;
|
|
2842
2852
|
/** The response if the operation is successful. */
|
|
2843
2853
|
response?: GenerateVideosResponse;
|
|
2854
|
+
/** The full HTTP response. */
|
|
2855
|
+
sdkHttpResponse?: HttpResponse;
|
|
2844
2856
|
/**
|
|
2845
2857
|
* Instantiates an Operation of the same type as the one being called with the fields set from the API response.
|
|
2846
2858
|
* @internal
|
|
@@ -6425,6 +6437,8 @@ export declare interface TuningExample {
|
|
|
6425
6437
|
|
|
6426
6438
|
/** A tuning job. */
|
|
6427
6439
|
export declare interface TuningJob {
|
|
6440
|
+
/** Used to retain the full HTTP response. */
|
|
6441
|
+
sdkHttpResponse?: HttpResponse;
|
|
6428
6442
|
/** Output only. Identifier. Resource name of a TuningJob. Format: `projects/{project}/locations/{location}/tuningJobs/{tuning_job}` */
|
|
6429
6443
|
name?: string;
|
|
6430
6444
|
/** Output only. The detailed state of the job. */
|
|
@@ -6473,6 +6487,8 @@ export declare interface TuningJob {
|
|
|
6473
6487
|
|
|
6474
6488
|
/** A long-running operation. */
|
|
6475
6489
|
export declare interface TuningOperation {
|
|
6490
|
+
/** Used to retain the full HTTP response. */
|
|
6491
|
+
sdkHttpResponse?: HttpResponse;
|
|
6476
6492
|
/** The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should be a resource name ending with `operations/{unique_id}`. */
|
|
6477
6493
|
name?: string;
|
|
6478
6494
|
/** Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any. */
|
|
@@ -7082,6 +7098,8 @@ export declare interface UpscaleImageParameters {
|
|
|
7082
7098
|
}
|
|
7083
7099
|
|
|
7084
7100
|
export declare class UpscaleImageResponse {
|
|
7101
|
+
/** Used to retain the full HTTP response. */
|
|
7102
|
+
sdkHttpResponse?: HttpResponse;
|
|
7085
7103
|
/** Generated images. */
|
|
7086
7104
|
generatedImages?: GeneratedImage[];
|
|
7087
7105
|
}
|
package/dist/web/index.mjs
CHANGED
|
@@ -1748,8 +1748,8 @@ class GenerateVideosOperation {
|
|
|
1748
1748
|
},
|
|
1749
1749
|
};
|
|
1750
1750
|
});
|
|
1751
|
-
operationResponse.raiMediaFilteredCount =
|
|
1752
|
-
operationResponse.raiMediaFilteredReasons =
|
|
1751
|
+
operationResponse.raiMediaFilteredCount = generatedVideoResponse === null || generatedVideoResponse === void 0 ? void 0 : generatedVideoResponse['raiMediaFilteredCount'];
|
|
1752
|
+
operationResponse.raiMediaFilteredReasons = generatedVideoResponse === null || generatedVideoResponse === void 0 ? void 0 : generatedVideoResponse['raiMediaFilteredReasons'];
|
|
1753
1753
|
operation.response = operationResponse;
|
|
1754
1754
|
}
|
|
1755
1755
|
}
|
|
@@ -11955,6 +11955,12 @@ function embedContentMetadataFromMldev() {
|
|
|
11955
11955
|
}
|
|
11956
11956
|
function embedContentResponseFromMldev(fromObject) {
|
|
11957
11957
|
const toObject = {};
|
|
11958
|
+
const fromSdkHttpResponse = getValueByPath(fromObject, [
|
|
11959
|
+
'sdkHttpResponse',
|
|
11960
|
+
]);
|
|
11961
|
+
if (fromSdkHttpResponse != null) {
|
|
11962
|
+
setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
|
|
11963
|
+
}
|
|
11958
11964
|
const fromEmbeddings = getValueByPath(fromObject, ['embeddings']);
|
|
11959
11965
|
if (fromEmbeddings != null) {
|
|
11960
11966
|
let transformedList = fromEmbeddings;
|
|
@@ -12027,6 +12033,12 @@ function generatedImageFromMldev(fromObject) {
|
|
|
12027
12033
|
}
|
|
12028
12034
|
function generateImagesResponseFromMldev(fromObject) {
|
|
12029
12035
|
const toObject = {};
|
|
12036
|
+
const fromSdkHttpResponse = getValueByPath(fromObject, [
|
|
12037
|
+
'sdkHttpResponse',
|
|
12038
|
+
]);
|
|
12039
|
+
if (fromSdkHttpResponse != null) {
|
|
12040
|
+
setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
|
|
12041
|
+
}
|
|
12030
12042
|
const fromGeneratedImages = getValueByPath(fromObject, [
|
|
12031
12043
|
'predictions',
|
|
12032
12044
|
]);
|
|
@@ -12137,6 +12149,12 @@ function deleteModelResponseFromMldev() {
|
|
|
12137
12149
|
}
|
|
12138
12150
|
function countTokensResponseFromMldev(fromObject) {
|
|
12139
12151
|
const toObject = {};
|
|
12152
|
+
const fromSdkHttpResponse = getValueByPath(fromObject, [
|
|
12153
|
+
'sdkHttpResponse',
|
|
12154
|
+
]);
|
|
12155
|
+
if (fromSdkHttpResponse != null) {
|
|
12156
|
+
setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
|
|
12157
|
+
}
|
|
12140
12158
|
const fromTotalTokens = getValueByPath(fromObject, ['totalTokens']);
|
|
12141
12159
|
if (fromTotalTokens != null) {
|
|
12142
12160
|
setValueByPath(toObject, ['totalTokens'], fromTotalTokens);
|
|
@@ -12523,6 +12541,12 @@ function embedContentMetadataFromVertex(fromObject) {
|
|
|
12523
12541
|
}
|
|
12524
12542
|
function embedContentResponseFromVertex(fromObject) {
|
|
12525
12543
|
const toObject = {};
|
|
12544
|
+
const fromSdkHttpResponse = getValueByPath(fromObject, [
|
|
12545
|
+
'sdkHttpResponse',
|
|
12546
|
+
]);
|
|
12547
|
+
if (fromSdkHttpResponse != null) {
|
|
12548
|
+
setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
|
|
12549
|
+
}
|
|
12526
12550
|
const fromEmbeddings = getValueByPath(fromObject, [
|
|
12527
12551
|
'predictions[]',
|
|
12528
12552
|
'embeddings',
|
|
@@ -12606,6 +12630,12 @@ function generatedImageFromVertex(fromObject) {
|
|
|
12606
12630
|
}
|
|
12607
12631
|
function generateImagesResponseFromVertex(fromObject) {
|
|
12608
12632
|
const toObject = {};
|
|
12633
|
+
const fromSdkHttpResponse = getValueByPath(fromObject, [
|
|
12634
|
+
'sdkHttpResponse',
|
|
12635
|
+
]);
|
|
12636
|
+
if (fromSdkHttpResponse != null) {
|
|
12637
|
+
setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
|
|
12638
|
+
}
|
|
12609
12639
|
const fromGeneratedImages = getValueByPath(fromObject, [
|
|
12610
12640
|
'predictions',
|
|
12611
12641
|
]);
|
|
@@ -12628,6 +12658,12 @@ function generateImagesResponseFromVertex(fromObject) {
|
|
|
12628
12658
|
}
|
|
12629
12659
|
function editImageResponseFromVertex(fromObject) {
|
|
12630
12660
|
const toObject = {};
|
|
12661
|
+
const fromSdkHttpResponse = getValueByPath(fromObject, [
|
|
12662
|
+
'sdkHttpResponse',
|
|
12663
|
+
]);
|
|
12664
|
+
if (fromSdkHttpResponse != null) {
|
|
12665
|
+
setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
|
|
12666
|
+
}
|
|
12631
12667
|
const fromGeneratedImages = getValueByPath(fromObject, [
|
|
12632
12668
|
'predictions',
|
|
12633
12669
|
]);
|
|
@@ -12644,6 +12680,12 @@ function editImageResponseFromVertex(fromObject) {
|
|
|
12644
12680
|
}
|
|
12645
12681
|
function upscaleImageResponseFromVertex(fromObject) {
|
|
12646
12682
|
const toObject = {};
|
|
12683
|
+
const fromSdkHttpResponse = getValueByPath(fromObject, [
|
|
12684
|
+
'sdkHttpResponse',
|
|
12685
|
+
]);
|
|
12686
|
+
if (fromSdkHttpResponse != null) {
|
|
12687
|
+
setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
|
|
12688
|
+
}
|
|
12647
12689
|
const fromGeneratedImages = getValueByPath(fromObject, [
|
|
12648
12690
|
'predictions',
|
|
12649
12691
|
]);
|
|
@@ -12793,6 +12835,12 @@ function deleteModelResponseFromVertex() {
|
|
|
12793
12835
|
}
|
|
12794
12836
|
function countTokensResponseFromVertex(fromObject) {
|
|
12795
12837
|
const toObject = {};
|
|
12838
|
+
const fromSdkHttpResponse = getValueByPath(fromObject, [
|
|
12839
|
+
'sdkHttpResponse',
|
|
12840
|
+
]);
|
|
12841
|
+
if (fromSdkHttpResponse != null) {
|
|
12842
|
+
setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
|
|
12843
|
+
}
|
|
12796
12844
|
const fromTotalTokens = getValueByPath(fromObject, ['totalTokens']);
|
|
12797
12845
|
if (fromTotalTokens != null) {
|
|
12798
12846
|
setValueByPath(toObject, ['totalTokens'], fromTotalTokens);
|
|
@@ -12801,6 +12849,12 @@ function countTokensResponseFromVertex(fromObject) {
|
|
|
12801
12849
|
}
|
|
12802
12850
|
function computeTokensResponseFromVertex(fromObject) {
|
|
12803
12851
|
const toObject = {};
|
|
12852
|
+
const fromSdkHttpResponse = getValueByPath(fromObject, [
|
|
12853
|
+
'sdkHttpResponse',
|
|
12854
|
+
]);
|
|
12855
|
+
if (fromSdkHttpResponse != null) {
|
|
12856
|
+
setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
|
|
12857
|
+
}
|
|
12804
12858
|
const fromTokensInfo = getValueByPath(fromObject, ['tokensInfo']);
|
|
12805
12859
|
if (fromTokensInfo != null) {
|
|
12806
12860
|
setValueByPath(toObject, ['tokensInfo'], fromTokensInfo);
|
|
@@ -12893,7 +12947,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
|
|
|
12893
12947
|
const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
|
|
12894
12948
|
const USER_AGENT_HEADER = 'User-Agent';
|
|
12895
12949
|
const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
|
|
12896
|
-
const SDK_VERSION = '1.
|
|
12950
|
+
const SDK_VERSION = '1.12.0'; // x-release-please-version
|
|
12897
12951
|
const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
|
|
12898
12952
|
const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
|
|
12899
12953
|
const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';
|
|
@@ -13979,13 +14033,13 @@ class Live {
|
|
|
13979
14033
|
const websocketBaseUrl = this.apiClient.getWebsocketBaseUrl();
|
|
13980
14034
|
const apiVersion = this.apiClient.getApiVersion();
|
|
13981
14035
|
let url;
|
|
13982
|
-
const
|
|
14036
|
+
const clientHeaders = this.apiClient.getHeaders();
|
|
13983
14037
|
if (params.config &&
|
|
13984
14038
|
params.config.tools &&
|
|
13985
14039
|
hasMcpToolUsage(params.config.tools)) {
|
|
13986
|
-
setMcpUsageHeader(
|
|
14040
|
+
setMcpUsageHeader(clientHeaders);
|
|
13987
14041
|
}
|
|
13988
|
-
const headers = mapToHeaders(
|
|
14042
|
+
const headers = mapToHeaders(clientHeaders);
|
|
13989
14043
|
if (this.apiClient.isVertexAI()) {
|
|
13990
14044
|
url = `${websocketBaseUrl}/ws/google.cloud.aiplatform.${apiVersion}.LlmBidiService/BidiGenerateContent`;
|
|
13991
14045
|
await this.auth.addAuthHeaders(headers);
|
|
@@ -14552,11 +14606,13 @@ class Models extends BaseModule {
|
|
|
14552
14606
|
response = {
|
|
14553
14607
|
generatedImages: generatedImages,
|
|
14554
14608
|
positivePromptSafetyAttributes: positivePromptSafetyAttributes,
|
|
14609
|
+
sdkHttpResponse: apiResponse.sdkHttpResponse,
|
|
14555
14610
|
};
|
|
14556
14611
|
}
|
|
14557
14612
|
else {
|
|
14558
14613
|
response = {
|
|
14559
14614
|
generatedImages: generatedImages,
|
|
14615
|
+
sdkHttpResponse: apiResponse.sdkHttpResponse,
|
|
14560
14616
|
};
|
|
14561
14617
|
}
|
|
14562
14618
|
return response;
|
|
@@ -15042,7 +15098,13 @@ class Models extends BaseModule {
|
|
|
15042
15098
|
abortSignal: (_b = params.config) === null || _b === void 0 ? void 0 : _b.abortSignal,
|
|
15043
15099
|
})
|
|
15044
15100
|
.then((httpResponse) => {
|
|
15045
|
-
return httpResponse.json()
|
|
15101
|
+
return httpResponse.json().then((jsonResponse) => {
|
|
15102
|
+
const response = jsonResponse;
|
|
15103
|
+
response.sdkHttpResponse = {
|
|
15104
|
+
headers: httpResponse.headers,
|
|
15105
|
+
};
|
|
15106
|
+
return response;
|
|
15107
|
+
});
|
|
15046
15108
|
});
|
|
15047
15109
|
return response.then((apiResponse) => {
|
|
15048
15110
|
const resp = embedContentResponseFromVertex(apiResponse);
|
|
@@ -15068,7 +15130,13 @@ class Models extends BaseModule {
|
|
|
15068
15130
|
abortSignal: (_d = params.config) === null || _d === void 0 ? void 0 : _d.abortSignal,
|
|
15069
15131
|
})
|
|
15070
15132
|
.then((httpResponse) => {
|
|
15071
|
-
return httpResponse.json()
|
|
15133
|
+
return httpResponse.json().then((jsonResponse) => {
|
|
15134
|
+
const response = jsonResponse;
|
|
15135
|
+
response.sdkHttpResponse = {
|
|
15136
|
+
headers: httpResponse.headers,
|
|
15137
|
+
};
|
|
15138
|
+
return response;
|
|
15139
|
+
});
|
|
15072
15140
|
});
|
|
15073
15141
|
return response.then((apiResponse) => {
|
|
15074
15142
|
const resp = embedContentResponseFromMldev(apiResponse);
|
|
@@ -15119,7 +15187,13 @@ class Models extends BaseModule {
|
|
|
15119
15187
|
abortSignal: (_b = params.config) === null || _b === void 0 ? void 0 : _b.abortSignal,
|
|
15120
15188
|
})
|
|
15121
15189
|
.then((httpResponse) => {
|
|
15122
|
-
return httpResponse.json()
|
|
15190
|
+
return httpResponse.json().then((jsonResponse) => {
|
|
15191
|
+
const response = jsonResponse;
|
|
15192
|
+
response.sdkHttpResponse = {
|
|
15193
|
+
headers: httpResponse.headers,
|
|
15194
|
+
};
|
|
15195
|
+
return response;
|
|
15196
|
+
});
|
|
15123
15197
|
});
|
|
15124
15198
|
return response.then((apiResponse) => {
|
|
15125
15199
|
const resp = generateImagesResponseFromVertex(apiResponse);
|
|
@@ -15145,7 +15219,13 @@ class Models extends BaseModule {
|
|
|
15145
15219
|
abortSignal: (_d = params.config) === null || _d === void 0 ? void 0 : _d.abortSignal,
|
|
15146
15220
|
})
|
|
15147
15221
|
.then((httpResponse) => {
|
|
15148
|
-
return httpResponse.json()
|
|
15222
|
+
return httpResponse.json().then((jsonResponse) => {
|
|
15223
|
+
const response = jsonResponse;
|
|
15224
|
+
response.sdkHttpResponse = {
|
|
15225
|
+
headers: httpResponse.headers,
|
|
15226
|
+
};
|
|
15227
|
+
return response;
|
|
15228
|
+
});
|
|
15149
15229
|
});
|
|
15150
15230
|
return response.then((apiResponse) => {
|
|
15151
15231
|
const resp = generateImagesResponseFromMldev(apiResponse);
|
|
@@ -15177,7 +15257,13 @@ class Models extends BaseModule {
|
|
|
15177
15257
|
abortSignal: (_b = params.config) === null || _b === void 0 ? void 0 : _b.abortSignal,
|
|
15178
15258
|
})
|
|
15179
15259
|
.then((httpResponse) => {
|
|
15180
|
-
return httpResponse.json()
|
|
15260
|
+
return httpResponse.json().then((jsonResponse) => {
|
|
15261
|
+
const response = jsonResponse;
|
|
15262
|
+
response.sdkHttpResponse = {
|
|
15263
|
+
headers: httpResponse.headers,
|
|
15264
|
+
};
|
|
15265
|
+
return response;
|
|
15266
|
+
});
|
|
15181
15267
|
});
|
|
15182
15268
|
return response.then((apiResponse) => {
|
|
15183
15269
|
const resp = editImageResponseFromVertex(apiResponse);
|
|
@@ -15212,7 +15298,13 @@ class Models extends BaseModule {
|
|
|
15212
15298
|
abortSignal: (_b = params.config) === null || _b === void 0 ? void 0 : _b.abortSignal,
|
|
15213
15299
|
})
|
|
15214
15300
|
.then((httpResponse) => {
|
|
15215
|
-
return httpResponse.json()
|
|
15301
|
+
return httpResponse.json().then((jsonResponse) => {
|
|
15302
|
+
const response = jsonResponse;
|
|
15303
|
+
response.sdkHttpResponse = {
|
|
15304
|
+
headers: httpResponse.headers,
|
|
15305
|
+
};
|
|
15306
|
+
return response;
|
|
15307
|
+
});
|
|
15216
15308
|
});
|
|
15217
15309
|
return response.then((apiResponse) => {
|
|
15218
15310
|
const resp = upscaleImageResponseFromVertex(apiResponse);
|
|
@@ -15535,7 +15627,13 @@ class Models extends BaseModule {
|
|
|
15535
15627
|
abortSignal: (_b = params.config) === null || _b === void 0 ? void 0 : _b.abortSignal,
|
|
15536
15628
|
})
|
|
15537
15629
|
.then((httpResponse) => {
|
|
15538
|
-
return httpResponse.json()
|
|
15630
|
+
return httpResponse.json().then((jsonResponse) => {
|
|
15631
|
+
const response = jsonResponse;
|
|
15632
|
+
response.sdkHttpResponse = {
|
|
15633
|
+
headers: httpResponse.headers,
|
|
15634
|
+
};
|
|
15635
|
+
return response;
|
|
15636
|
+
});
|
|
15539
15637
|
});
|
|
15540
15638
|
return response.then((apiResponse) => {
|
|
15541
15639
|
const resp = countTokensResponseFromVertex(apiResponse);
|
|
@@ -15561,7 +15659,13 @@ class Models extends BaseModule {
|
|
|
15561
15659
|
abortSignal: (_d = params.config) === null || _d === void 0 ? void 0 : _d.abortSignal,
|
|
15562
15660
|
})
|
|
15563
15661
|
.then((httpResponse) => {
|
|
15564
|
-
return httpResponse.json()
|
|
15662
|
+
return httpResponse.json().then((jsonResponse) => {
|
|
15663
|
+
const response = jsonResponse;
|
|
15664
|
+
response.sdkHttpResponse = {
|
|
15665
|
+
headers: httpResponse.headers,
|
|
15666
|
+
};
|
|
15667
|
+
return response;
|
|
15668
|
+
});
|
|
15565
15669
|
});
|
|
15566
15670
|
return response.then((apiResponse) => {
|
|
15567
15671
|
const resp = countTokensResponseFromMldev(apiResponse);
|
|
@@ -15611,7 +15715,13 @@ class Models extends BaseModule {
|
|
|
15611
15715
|
abortSignal: (_b = params.config) === null || _b === void 0 ? void 0 : _b.abortSignal,
|
|
15612
15716
|
})
|
|
15613
15717
|
.then((httpResponse) => {
|
|
15614
|
-
return httpResponse.json()
|
|
15718
|
+
return httpResponse.json().then((jsonResponse) => {
|
|
15719
|
+
const response = jsonResponse;
|
|
15720
|
+
response.sdkHttpResponse = {
|
|
15721
|
+
headers: httpResponse.headers,
|
|
15722
|
+
};
|
|
15723
|
+
return response;
|
|
15724
|
+
});
|
|
15615
15725
|
});
|
|
15616
15726
|
return response.then((apiResponse) => {
|
|
15617
15727
|
const resp = computeTokensResponseFromVertex(apiResponse);
|
|
@@ -17063,6 +17173,12 @@ function tunedModelFromMldev(fromObject) {
|
|
|
17063
17173
|
}
|
|
17064
17174
|
function tuningJobFromMldev(fromObject) {
|
|
17065
17175
|
const toObject = {};
|
|
17176
|
+
const fromSdkHttpResponse = getValueByPath(fromObject, [
|
|
17177
|
+
'sdkHttpResponse',
|
|
17178
|
+
]);
|
|
17179
|
+
if (fromSdkHttpResponse != null) {
|
|
17180
|
+
setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
|
|
17181
|
+
}
|
|
17066
17182
|
const fromName = getValueByPath(fromObject, ['name']);
|
|
17067
17183
|
if (fromName != null) {
|
|
17068
17184
|
setValueByPath(toObject, ['name'], fromName);
|
|
@@ -17173,6 +17289,12 @@ function listTuningJobsResponseFromMldev(fromObject) {
|
|
|
17173
17289
|
}
|
|
17174
17290
|
function tuningOperationFromMldev(fromObject) {
|
|
17175
17291
|
const toObject = {};
|
|
17292
|
+
const fromSdkHttpResponse = getValueByPath(fromObject, [
|
|
17293
|
+
'sdkHttpResponse',
|
|
17294
|
+
]);
|
|
17295
|
+
if (fromSdkHttpResponse != null) {
|
|
17296
|
+
setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
|
|
17297
|
+
}
|
|
17176
17298
|
const fromName = getValueByPath(fromObject, ['name']);
|
|
17177
17299
|
if (fromName != null) {
|
|
17178
17300
|
setValueByPath(toObject, ['name'], fromName);
|
|
@@ -17235,6 +17357,12 @@ function tunedModelFromVertex(fromObject) {
|
|
|
17235
17357
|
}
|
|
17236
17358
|
function tuningJobFromVertex(fromObject) {
|
|
17237
17359
|
const toObject = {};
|
|
17360
|
+
const fromSdkHttpResponse = getValueByPath(fromObject, [
|
|
17361
|
+
'sdkHttpResponse',
|
|
17362
|
+
]);
|
|
17363
|
+
if (fromSdkHttpResponse != null) {
|
|
17364
|
+
setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
|
|
17365
|
+
}
|
|
17238
17366
|
const fromName = getValueByPath(fromObject, ['name']);
|
|
17239
17367
|
if (fromName != null) {
|
|
17240
17368
|
setValueByPath(toObject, ['name'], fromName);
|
|
@@ -17453,7 +17581,13 @@ class Tunings extends BaseModule {
|
|
|
17453
17581
|
abortSignal: (_b = params.config) === null || _b === void 0 ? void 0 : _b.abortSignal,
|
|
17454
17582
|
})
|
|
17455
17583
|
.then((httpResponse) => {
|
|
17456
|
-
return httpResponse.json()
|
|
17584
|
+
return httpResponse.json().then((jsonResponse) => {
|
|
17585
|
+
const response = jsonResponse;
|
|
17586
|
+
response.sdkHttpResponse = {
|
|
17587
|
+
headers: httpResponse.headers,
|
|
17588
|
+
};
|
|
17589
|
+
return response;
|
|
17590
|
+
});
|
|
17457
17591
|
});
|
|
17458
17592
|
return response.then((apiResponse) => {
|
|
17459
17593
|
const resp = tuningJobFromVertex(apiResponse);
|
|
@@ -17477,7 +17611,13 @@ class Tunings extends BaseModule {
|
|
|
17477
17611
|
abortSignal: (_d = params.config) === null || _d === void 0 ? void 0 : _d.abortSignal,
|
|
17478
17612
|
})
|
|
17479
17613
|
.then((httpResponse) => {
|
|
17480
|
-
return httpResponse.json()
|
|
17614
|
+
return httpResponse.json().then((jsonResponse) => {
|
|
17615
|
+
const response = jsonResponse;
|
|
17616
|
+
response.sdkHttpResponse = {
|
|
17617
|
+
headers: httpResponse.headers,
|
|
17618
|
+
};
|
|
17619
|
+
return response;
|
|
17620
|
+
});
|
|
17481
17621
|
});
|
|
17482
17622
|
return response.then((apiResponse) => {
|
|
17483
17623
|
const resp = tuningJobFromMldev(apiResponse);
|
|
@@ -17577,7 +17717,13 @@ class Tunings extends BaseModule {
|
|
|
17577
17717
|
abortSignal: (_b = params.config) === null || _b === void 0 ? void 0 : _b.abortSignal,
|
|
17578
17718
|
})
|
|
17579
17719
|
.then((httpResponse) => {
|
|
17580
|
-
return httpResponse.json()
|
|
17720
|
+
return httpResponse.json().then((jsonResponse) => {
|
|
17721
|
+
const response = jsonResponse;
|
|
17722
|
+
response.sdkHttpResponse = {
|
|
17723
|
+
headers: httpResponse.headers,
|
|
17724
|
+
};
|
|
17725
|
+
return response;
|
|
17726
|
+
});
|
|
17581
17727
|
});
|
|
17582
17728
|
return response.then((apiResponse) => {
|
|
17583
17729
|
const resp = tuningJobFromVertex(apiResponse);
|
|
@@ -17613,7 +17759,13 @@ class Tunings extends BaseModule {
|
|
|
17613
17759
|
abortSignal: (_b = params.config) === null || _b === void 0 ? void 0 : _b.abortSignal,
|
|
17614
17760
|
})
|
|
17615
17761
|
.then((httpResponse) => {
|
|
17616
|
-
return httpResponse.json()
|
|
17762
|
+
return httpResponse.json().then((jsonResponse) => {
|
|
17763
|
+
const response = jsonResponse;
|
|
17764
|
+
response.sdkHttpResponse = {
|
|
17765
|
+
headers: httpResponse.headers,
|
|
17766
|
+
};
|
|
17767
|
+
return response;
|
|
17768
|
+
});
|
|
17617
17769
|
});
|
|
17618
17770
|
return response.then((apiResponse) => {
|
|
17619
17771
|
const resp = tuningOperationFromMldev(apiResponse);
|