@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/genai.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
|
|
@@ -6413,6 +6425,8 @@ export declare interface TuningExample {
|
|
|
6413
6425
|
|
|
6414
6426
|
/** A tuning job. */
|
|
6415
6427
|
export declare interface TuningJob {
|
|
6428
|
+
/** Used to retain the full HTTP response. */
|
|
6429
|
+
sdkHttpResponse?: HttpResponse;
|
|
6416
6430
|
/** Output only. Identifier. Resource name of a TuningJob. Format: `projects/{project}/locations/{location}/tuningJobs/{tuning_job}` */
|
|
6417
6431
|
name?: string;
|
|
6418
6432
|
/** Output only. The detailed state of the job. */
|
|
@@ -6461,6 +6475,8 @@ export declare interface TuningJob {
|
|
|
6461
6475
|
|
|
6462
6476
|
/** A long-running operation. */
|
|
6463
6477
|
export declare interface TuningOperation {
|
|
6478
|
+
/** Used to retain the full HTTP response. */
|
|
6479
|
+
sdkHttpResponse?: HttpResponse;
|
|
6464
6480
|
/** 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}`. */
|
|
6465
6481
|
name?: string;
|
|
6466
6482
|
/** 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. */
|
|
@@ -7070,6 +7086,8 @@ export declare interface UpscaleImageParameters {
|
|
|
7070
7086
|
}
|
|
7071
7087
|
|
|
7072
7088
|
export declare class UpscaleImageResponse {
|
|
7089
|
+
/** Used to retain the full HTTP response. */
|
|
7090
|
+
sdkHttpResponse?: HttpResponse;
|
|
7073
7091
|
/** Generated images. */
|
|
7074
7092
|
generatedImages?: GeneratedImage[];
|
|
7075
7093
|
}
|
package/dist/index.cjs
CHANGED
|
@@ -1720,8 +1720,8 @@ class GenerateVideosOperation {
|
|
|
1720
1720
|
},
|
|
1721
1721
|
};
|
|
1722
1722
|
});
|
|
1723
|
-
operationResponse.raiMediaFilteredCount =
|
|
1724
|
-
operationResponse.raiMediaFilteredReasons =
|
|
1723
|
+
operationResponse.raiMediaFilteredCount = generatedVideoResponse === null || generatedVideoResponse === void 0 ? void 0 : generatedVideoResponse['raiMediaFilteredCount'];
|
|
1724
|
+
operationResponse.raiMediaFilteredReasons = generatedVideoResponse === null || generatedVideoResponse === void 0 ? void 0 : generatedVideoResponse['raiMediaFilteredReasons'];
|
|
1725
1725
|
operation.response = operationResponse;
|
|
1726
1726
|
}
|
|
1727
1727
|
}
|
|
@@ -6392,7 +6392,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
|
|
|
6392
6392
|
const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
|
|
6393
6393
|
const USER_AGENT_HEADER = 'User-Agent';
|
|
6394
6394
|
const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
|
|
6395
|
-
const SDK_VERSION = '1.
|
|
6395
|
+
const SDK_VERSION = '1.12.0'; // x-release-please-version
|
|
6396
6396
|
const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
|
|
6397
6397
|
const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
|
|
6398
6398
|
const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';
|
|
@@ -12624,6 +12624,12 @@ function embedContentMetadataFromMldev() {
|
|
|
12624
12624
|
}
|
|
12625
12625
|
function embedContentResponseFromMldev(fromObject) {
|
|
12626
12626
|
const toObject = {};
|
|
12627
|
+
const fromSdkHttpResponse = getValueByPath(fromObject, [
|
|
12628
|
+
'sdkHttpResponse',
|
|
12629
|
+
]);
|
|
12630
|
+
if (fromSdkHttpResponse != null) {
|
|
12631
|
+
setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
|
|
12632
|
+
}
|
|
12627
12633
|
const fromEmbeddings = getValueByPath(fromObject, ['embeddings']);
|
|
12628
12634
|
if (fromEmbeddings != null) {
|
|
12629
12635
|
let transformedList = fromEmbeddings;
|
|
@@ -12696,6 +12702,12 @@ function generatedImageFromMldev(fromObject) {
|
|
|
12696
12702
|
}
|
|
12697
12703
|
function generateImagesResponseFromMldev(fromObject) {
|
|
12698
12704
|
const toObject = {};
|
|
12705
|
+
const fromSdkHttpResponse = getValueByPath(fromObject, [
|
|
12706
|
+
'sdkHttpResponse',
|
|
12707
|
+
]);
|
|
12708
|
+
if (fromSdkHttpResponse != null) {
|
|
12709
|
+
setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
|
|
12710
|
+
}
|
|
12699
12711
|
const fromGeneratedImages = getValueByPath(fromObject, [
|
|
12700
12712
|
'predictions',
|
|
12701
12713
|
]);
|
|
@@ -12806,6 +12818,12 @@ function deleteModelResponseFromMldev() {
|
|
|
12806
12818
|
}
|
|
12807
12819
|
function countTokensResponseFromMldev(fromObject) {
|
|
12808
12820
|
const toObject = {};
|
|
12821
|
+
const fromSdkHttpResponse = getValueByPath(fromObject, [
|
|
12822
|
+
'sdkHttpResponse',
|
|
12823
|
+
]);
|
|
12824
|
+
if (fromSdkHttpResponse != null) {
|
|
12825
|
+
setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
|
|
12826
|
+
}
|
|
12809
12827
|
const fromTotalTokens = getValueByPath(fromObject, ['totalTokens']);
|
|
12810
12828
|
if (fromTotalTokens != null) {
|
|
12811
12829
|
setValueByPath(toObject, ['totalTokens'], fromTotalTokens);
|
|
@@ -13192,6 +13210,12 @@ function embedContentMetadataFromVertex(fromObject) {
|
|
|
13192
13210
|
}
|
|
13193
13211
|
function embedContentResponseFromVertex(fromObject) {
|
|
13194
13212
|
const toObject = {};
|
|
13213
|
+
const fromSdkHttpResponse = getValueByPath(fromObject, [
|
|
13214
|
+
'sdkHttpResponse',
|
|
13215
|
+
]);
|
|
13216
|
+
if (fromSdkHttpResponse != null) {
|
|
13217
|
+
setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
|
|
13218
|
+
}
|
|
13195
13219
|
const fromEmbeddings = getValueByPath(fromObject, [
|
|
13196
13220
|
'predictions[]',
|
|
13197
13221
|
'embeddings',
|
|
@@ -13275,6 +13299,12 @@ function generatedImageFromVertex(fromObject) {
|
|
|
13275
13299
|
}
|
|
13276
13300
|
function generateImagesResponseFromVertex(fromObject) {
|
|
13277
13301
|
const toObject = {};
|
|
13302
|
+
const fromSdkHttpResponse = getValueByPath(fromObject, [
|
|
13303
|
+
'sdkHttpResponse',
|
|
13304
|
+
]);
|
|
13305
|
+
if (fromSdkHttpResponse != null) {
|
|
13306
|
+
setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
|
|
13307
|
+
}
|
|
13278
13308
|
const fromGeneratedImages = getValueByPath(fromObject, [
|
|
13279
13309
|
'predictions',
|
|
13280
13310
|
]);
|
|
@@ -13297,6 +13327,12 @@ function generateImagesResponseFromVertex(fromObject) {
|
|
|
13297
13327
|
}
|
|
13298
13328
|
function editImageResponseFromVertex(fromObject) {
|
|
13299
13329
|
const toObject = {};
|
|
13330
|
+
const fromSdkHttpResponse = getValueByPath(fromObject, [
|
|
13331
|
+
'sdkHttpResponse',
|
|
13332
|
+
]);
|
|
13333
|
+
if (fromSdkHttpResponse != null) {
|
|
13334
|
+
setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
|
|
13335
|
+
}
|
|
13300
13336
|
const fromGeneratedImages = getValueByPath(fromObject, [
|
|
13301
13337
|
'predictions',
|
|
13302
13338
|
]);
|
|
@@ -13313,6 +13349,12 @@ function editImageResponseFromVertex(fromObject) {
|
|
|
13313
13349
|
}
|
|
13314
13350
|
function upscaleImageResponseFromVertex(fromObject) {
|
|
13315
13351
|
const toObject = {};
|
|
13352
|
+
const fromSdkHttpResponse = getValueByPath(fromObject, [
|
|
13353
|
+
'sdkHttpResponse',
|
|
13354
|
+
]);
|
|
13355
|
+
if (fromSdkHttpResponse != null) {
|
|
13356
|
+
setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
|
|
13357
|
+
}
|
|
13316
13358
|
const fromGeneratedImages = getValueByPath(fromObject, [
|
|
13317
13359
|
'predictions',
|
|
13318
13360
|
]);
|
|
@@ -13462,6 +13504,12 @@ function deleteModelResponseFromVertex() {
|
|
|
13462
13504
|
}
|
|
13463
13505
|
function countTokensResponseFromVertex(fromObject) {
|
|
13464
13506
|
const toObject = {};
|
|
13507
|
+
const fromSdkHttpResponse = getValueByPath(fromObject, [
|
|
13508
|
+
'sdkHttpResponse',
|
|
13509
|
+
]);
|
|
13510
|
+
if (fromSdkHttpResponse != null) {
|
|
13511
|
+
setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
|
|
13512
|
+
}
|
|
13465
13513
|
const fromTotalTokens = getValueByPath(fromObject, ['totalTokens']);
|
|
13466
13514
|
if (fromTotalTokens != null) {
|
|
13467
13515
|
setValueByPath(toObject, ['totalTokens'], fromTotalTokens);
|
|
@@ -13470,6 +13518,12 @@ function countTokensResponseFromVertex(fromObject) {
|
|
|
13470
13518
|
}
|
|
13471
13519
|
function computeTokensResponseFromVertex(fromObject) {
|
|
13472
13520
|
const toObject = {};
|
|
13521
|
+
const fromSdkHttpResponse = getValueByPath(fromObject, [
|
|
13522
|
+
'sdkHttpResponse',
|
|
13523
|
+
]);
|
|
13524
|
+
if (fromSdkHttpResponse != null) {
|
|
13525
|
+
setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
|
|
13526
|
+
}
|
|
13473
13527
|
const fromTokensInfo = getValueByPath(fromObject, ['tokensInfo']);
|
|
13474
13528
|
if (fromTokensInfo != null) {
|
|
13475
13529
|
setValueByPath(toObject, ['tokensInfo'], fromTokensInfo);
|
|
@@ -14074,13 +14128,13 @@ class Live {
|
|
|
14074
14128
|
const websocketBaseUrl = this.apiClient.getWebsocketBaseUrl();
|
|
14075
14129
|
const apiVersion = this.apiClient.getApiVersion();
|
|
14076
14130
|
let url;
|
|
14077
|
-
const
|
|
14131
|
+
const clientHeaders = this.apiClient.getHeaders();
|
|
14078
14132
|
if (params.config &&
|
|
14079
14133
|
params.config.tools &&
|
|
14080
14134
|
hasMcpToolUsage(params.config.tools)) {
|
|
14081
|
-
setMcpUsageHeader(
|
|
14135
|
+
setMcpUsageHeader(clientHeaders);
|
|
14082
14136
|
}
|
|
14083
|
-
const headers = mapToHeaders(
|
|
14137
|
+
const headers = mapToHeaders(clientHeaders);
|
|
14084
14138
|
if (this.apiClient.isVertexAI()) {
|
|
14085
14139
|
url = `${websocketBaseUrl}/ws/google.cloud.aiplatform.${apiVersion}.LlmBidiService/BidiGenerateContent`;
|
|
14086
14140
|
await this.auth.addAuthHeaders(headers);
|
|
@@ -14647,11 +14701,13 @@ class Models extends BaseModule {
|
|
|
14647
14701
|
response = {
|
|
14648
14702
|
generatedImages: generatedImages,
|
|
14649
14703
|
positivePromptSafetyAttributes: positivePromptSafetyAttributes,
|
|
14704
|
+
sdkHttpResponse: apiResponse.sdkHttpResponse,
|
|
14650
14705
|
};
|
|
14651
14706
|
}
|
|
14652
14707
|
else {
|
|
14653
14708
|
response = {
|
|
14654
14709
|
generatedImages: generatedImages,
|
|
14710
|
+
sdkHttpResponse: apiResponse.sdkHttpResponse,
|
|
14655
14711
|
};
|
|
14656
14712
|
}
|
|
14657
14713
|
return response;
|
|
@@ -15137,7 +15193,13 @@ class Models extends BaseModule {
|
|
|
15137
15193
|
abortSignal: (_b = params.config) === null || _b === void 0 ? void 0 : _b.abortSignal,
|
|
15138
15194
|
})
|
|
15139
15195
|
.then((httpResponse) => {
|
|
15140
|
-
return httpResponse.json()
|
|
15196
|
+
return httpResponse.json().then((jsonResponse) => {
|
|
15197
|
+
const response = jsonResponse;
|
|
15198
|
+
response.sdkHttpResponse = {
|
|
15199
|
+
headers: httpResponse.headers,
|
|
15200
|
+
};
|
|
15201
|
+
return response;
|
|
15202
|
+
});
|
|
15141
15203
|
});
|
|
15142
15204
|
return response.then((apiResponse) => {
|
|
15143
15205
|
const resp = embedContentResponseFromVertex(apiResponse);
|
|
@@ -15163,7 +15225,13 @@ class Models extends BaseModule {
|
|
|
15163
15225
|
abortSignal: (_d = params.config) === null || _d === void 0 ? void 0 : _d.abortSignal,
|
|
15164
15226
|
})
|
|
15165
15227
|
.then((httpResponse) => {
|
|
15166
|
-
return httpResponse.json()
|
|
15228
|
+
return httpResponse.json().then((jsonResponse) => {
|
|
15229
|
+
const response = jsonResponse;
|
|
15230
|
+
response.sdkHttpResponse = {
|
|
15231
|
+
headers: httpResponse.headers,
|
|
15232
|
+
};
|
|
15233
|
+
return response;
|
|
15234
|
+
});
|
|
15167
15235
|
});
|
|
15168
15236
|
return response.then((apiResponse) => {
|
|
15169
15237
|
const resp = embedContentResponseFromMldev(apiResponse);
|
|
@@ -15214,7 +15282,13 @@ class Models extends BaseModule {
|
|
|
15214
15282
|
abortSignal: (_b = params.config) === null || _b === void 0 ? void 0 : _b.abortSignal,
|
|
15215
15283
|
})
|
|
15216
15284
|
.then((httpResponse) => {
|
|
15217
|
-
return httpResponse.json()
|
|
15285
|
+
return httpResponse.json().then((jsonResponse) => {
|
|
15286
|
+
const response = jsonResponse;
|
|
15287
|
+
response.sdkHttpResponse = {
|
|
15288
|
+
headers: httpResponse.headers,
|
|
15289
|
+
};
|
|
15290
|
+
return response;
|
|
15291
|
+
});
|
|
15218
15292
|
});
|
|
15219
15293
|
return response.then((apiResponse) => {
|
|
15220
15294
|
const resp = generateImagesResponseFromVertex(apiResponse);
|
|
@@ -15240,7 +15314,13 @@ class Models extends BaseModule {
|
|
|
15240
15314
|
abortSignal: (_d = params.config) === null || _d === void 0 ? void 0 : _d.abortSignal,
|
|
15241
15315
|
})
|
|
15242
15316
|
.then((httpResponse) => {
|
|
15243
|
-
return httpResponse.json()
|
|
15317
|
+
return httpResponse.json().then((jsonResponse) => {
|
|
15318
|
+
const response = jsonResponse;
|
|
15319
|
+
response.sdkHttpResponse = {
|
|
15320
|
+
headers: httpResponse.headers,
|
|
15321
|
+
};
|
|
15322
|
+
return response;
|
|
15323
|
+
});
|
|
15244
15324
|
});
|
|
15245
15325
|
return response.then((apiResponse) => {
|
|
15246
15326
|
const resp = generateImagesResponseFromMldev(apiResponse);
|
|
@@ -15272,7 +15352,13 @@ class Models extends BaseModule {
|
|
|
15272
15352
|
abortSignal: (_b = params.config) === null || _b === void 0 ? void 0 : _b.abortSignal,
|
|
15273
15353
|
})
|
|
15274
15354
|
.then((httpResponse) => {
|
|
15275
|
-
return httpResponse.json()
|
|
15355
|
+
return httpResponse.json().then((jsonResponse) => {
|
|
15356
|
+
const response = jsonResponse;
|
|
15357
|
+
response.sdkHttpResponse = {
|
|
15358
|
+
headers: httpResponse.headers,
|
|
15359
|
+
};
|
|
15360
|
+
return response;
|
|
15361
|
+
});
|
|
15276
15362
|
});
|
|
15277
15363
|
return response.then((apiResponse) => {
|
|
15278
15364
|
const resp = editImageResponseFromVertex(apiResponse);
|
|
@@ -15307,7 +15393,13 @@ class Models extends BaseModule {
|
|
|
15307
15393
|
abortSignal: (_b = params.config) === null || _b === void 0 ? void 0 : _b.abortSignal,
|
|
15308
15394
|
})
|
|
15309
15395
|
.then((httpResponse) => {
|
|
15310
|
-
return httpResponse.json()
|
|
15396
|
+
return httpResponse.json().then((jsonResponse) => {
|
|
15397
|
+
const response = jsonResponse;
|
|
15398
|
+
response.sdkHttpResponse = {
|
|
15399
|
+
headers: httpResponse.headers,
|
|
15400
|
+
};
|
|
15401
|
+
return response;
|
|
15402
|
+
});
|
|
15311
15403
|
});
|
|
15312
15404
|
return response.then((apiResponse) => {
|
|
15313
15405
|
const resp = upscaleImageResponseFromVertex(apiResponse);
|
|
@@ -15630,7 +15722,13 @@ class Models extends BaseModule {
|
|
|
15630
15722
|
abortSignal: (_b = params.config) === null || _b === void 0 ? void 0 : _b.abortSignal,
|
|
15631
15723
|
})
|
|
15632
15724
|
.then((httpResponse) => {
|
|
15633
|
-
return httpResponse.json()
|
|
15725
|
+
return httpResponse.json().then((jsonResponse) => {
|
|
15726
|
+
const response = jsonResponse;
|
|
15727
|
+
response.sdkHttpResponse = {
|
|
15728
|
+
headers: httpResponse.headers,
|
|
15729
|
+
};
|
|
15730
|
+
return response;
|
|
15731
|
+
});
|
|
15634
15732
|
});
|
|
15635
15733
|
return response.then((apiResponse) => {
|
|
15636
15734
|
const resp = countTokensResponseFromVertex(apiResponse);
|
|
@@ -15656,7 +15754,13 @@ class Models extends BaseModule {
|
|
|
15656
15754
|
abortSignal: (_d = params.config) === null || _d === void 0 ? void 0 : _d.abortSignal,
|
|
15657
15755
|
})
|
|
15658
15756
|
.then((httpResponse) => {
|
|
15659
|
-
return httpResponse.json()
|
|
15757
|
+
return httpResponse.json().then((jsonResponse) => {
|
|
15758
|
+
const response = jsonResponse;
|
|
15759
|
+
response.sdkHttpResponse = {
|
|
15760
|
+
headers: httpResponse.headers,
|
|
15761
|
+
};
|
|
15762
|
+
return response;
|
|
15763
|
+
});
|
|
15660
15764
|
});
|
|
15661
15765
|
return response.then((apiResponse) => {
|
|
15662
15766
|
const resp = countTokensResponseFromMldev(apiResponse);
|
|
@@ -15706,7 +15810,13 @@ class Models extends BaseModule {
|
|
|
15706
15810
|
abortSignal: (_b = params.config) === null || _b === void 0 ? void 0 : _b.abortSignal,
|
|
15707
15811
|
})
|
|
15708
15812
|
.then((httpResponse) => {
|
|
15709
|
-
return httpResponse.json()
|
|
15813
|
+
return httpResponse.json().then((jsonResponse) => {
|
|
15814
|
+
const response = jsonResponse;
|
|
15815
|
+
response.sdkHttpResponse = {
|
|
15816
|
+
headers: httpResponse.headers,
|
|
15817
|
+
};
|
|
15818
|
+
return response;
|
|
15819
|
+
});
|
|
15710
15820
|
});
|
|
15711
15821
|
return response.then((apiResponse) => {
|
|
15712
15822
|
const resp = computeTokensResponseFromVertex(apiResponse);
|
|
@@ -17158,6 +17268,12 @@ function tunedModelFromMldev(fromObject) {
|
|
|
17158
17268
|
}
|
|
17159
17269
|
function tuningJobFromMldev(fromObject) {
|
|
17160
17270
|
const toObject = {};
|
|
17271
|
+
const fromSdkHttpResponse = getValueByPath(fromObject, [
|
|
17272
|
+
'sdkHttpResponse',
|
|
17273
|
+
]);
|
|
17274
|
+
if (fromSdkHttpResponse != null) {
|
|
17275
|
+
setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
|
|
17276
|
+
}
|
|
17161
17277
|
const fromName = getValueByPath(fromObject, ['name']);
|
|
17162
17278
|
if (fromName != null) {
|
|
17163
17279
|
setValueByPath(toObject, ['name'], fromName);
|
|
@@ -17268,6 +17384,12 @@ function listTuningJobsResponseFromMldev(fromObject) {
|
|
|
17268
17384
|
}
|
|
17269
17385
|
function tuningOperationFromMldev(fromObject) {
|
|
17270
17386
|
const toObject = {};
|
|
17387
|
+
const fromSdkHttpResponse = getValueByPath(fromObject, [
|
|
17388
|
+
'sdkHttpResponse',
|
|
17389
|
+
]);
|
|
17390
|
+
if (fromSdkHttpResponse != null) {
|
|
17391
|
+
setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
|
|
17392
|
+
}
|
|
17271
17393
|
const fromName = getValueByPath(fromObject, ['name']);
|
|
17272
17394
|
if (fromName != null) {
|
|
17273
17395
|
setValueByPath(toObject, ['name'], fromName);
|
|
@@ -17330,6 +17452,12 @@ function tunedModelFromVertex(fromObject) {
|
|
|
17330
17452
|
}
|
|
17331
17453
|
function tuningJobFromVertex(fromObject) {
|
|
17332
17454
|
const toObject = {};
|
|
17455
|
+
const fromSdkHttpResponse = getValueByPath(fromObject, [
|
|
17456
|
+
'sdkHttpResponse',
|
|
17457
|
+
]);
|
|
17458
|
+
if (fromSdkHttpResponse != null) {
|
|
17459
|
+
setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
|
|
17460
|
+
}
|
|
17333
17461
|
const fromName = getValueByPath(fromObject, ['name']);
|
|
17334
17462
|
if (fromName != null) {
|
|
17335
17463
|
setValueByPath(toObject, ['name'], fromName);
|
|
@@ -17548,7 +17676,13 @@ class Tunings extends BaseModule {
|
|
|
17548
17676
|
abortSignal: (_b = params.config) === null || _b === void 0 ? void 0 : _b.abortSignal,
|
|
17549
17677
|
})
|
|
17550
17678
|
.then((httpResponse) => {
|
|
17551
|
-
return httpResponse.json()
|
|
17679
|
+
return httpResponse.json().then((jsonResponse) => {
|
|
17680
|
+
const response = jsonResponse;
|
|
17681
|
+
response.sdkHttpResponse = {
|
|
17682
|
+
headers: httpResponse.headers,
|
|
17683
|
+
};
|
|
17684
|
+
return response;
|
|
17685
|
+
});
|
|
17552
17686
|
});
|
|
17553
17687
|
return response.then((apiResponse) => {
|
|
17554
17688
|
const resp = tuningJobFromVertex(apiResponse);
|
|
@@ -17572,7 +17706,13 @@ class Tunings extends BaseModule {
|
|
|
17572
17706
|
abortSignal: (_d = params.config) === null || _d === void 0 ? void 0 : _d.abortSignal,
|
|
17573
17707
|
})
|
|
17574
17708
|
.then((httpResponse) => {
|
|
17575
|
-
return httpResponse.json()
|
|
17709
|
+
return httpResponse.json().then((jsonResponse) => {
|
|
17710
|
+
const response = jsonResponse;
|
|
17711
|
+
response.sdkHttpResponse = {
|
|
17712
|
+
headers: httpResponse.headers,
|
|
17713
|
+
};
|
|
17714
|
+
return response;
|
|
17715
|
+
});
|
|
17576
17716
|
});
|
|
17577
17717
|
return response.then((apiResponse) => {
|
|
17578
17718
|
const resp = tuningJobFromMldev(apiResponse);
|
|
@@ -17672,7 +17812,13 @@ class Tunings extends BaseModule {
|
|
|
17672
17812
|
abortSignal: (_b = params.config) === null || _b === void 0 ? void 0 : _b.abortSignal,
|
|
17673
17813
|
})
|
|
17674
17814
|
.then((httpResponse) => {
|
|
17675
|
-
return httpResponse.json()
|
|
17815
|
+
return httpResponse.json().then((jsonResponse) => {
|
|
17816
|
+
const response = jsonResponse;
|
|
17817
|
+
response.sdkHttpResponse = {
|
|
17818
|
+
headers: httpResponse.headers,
|
|
17819
|
+
};
|
|
17820
|
+
return response;
|
|
17821
|
+
});
|
|
17676
17822
|
});
|
|
17677
17823
|
return response.then((apiResponse) => {
|
|
17678
17824
|
const resp = tuningJobFromVertex(apiResponse);
|
|
@@ -17708,7 +17854,13 @@ class Tunings extends BaseModule {
|
|
|
17708
17854
|
abortSignal: (_b = params.config) === null || _b === void 0 ? void 0 : _b.abortSignal,
|
|
17709
17855
|
})
|
|
17710
17856
|
.then((httpResponse) => {
|
|
17711
|
-
return httpResponse.json()
|
|
17857
|
+
return httpResponse.json().then((jsonResponse) => {
|
|
17858
|
+
const response = jsonResponse;
|
|
17859
|
+
response.sdkHttpResponse = {
|
|
17860
|
+
headers: httpResponse.headers,
|
|
17861
|
+
};
|
|
17862
|
+
return response;
|
|
17863
|
+
});
|
|
17712
17864
|
});
|
|
17713
17865
|
return response.then((apiResponse) => {
|
|
17714
17866
|
const resp = tuningOperationFromMldev(apiResponse);
|