@google/genai 1.0.0 → 1.1.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.
@@ -252,6 +252,42 @@ exports.Language = void 0;
252
252
  */
253
253
  Language["PYTHON"] = "PYTHON";
254
254
  })(exports.Language || (exports.Language = {}));
255
+ /** Optional. The type of the data. */
256
+ exports.Type = void 0;
257
+ (function (Type) {
258
+ /**
259
+ * Not specified, should not be used.
260
+ */
261
+ Type["TYPE_UNSPECIFIED"] = "TYPE_UNSPECIFIED";
262
+ /**
263
+ * OpenAPI string type
264
+ */
265
+ Type["STRING"] = "STRING";
266
+ /**
267
+ * OpenAPI number type
268
+ */
269
+ Type["NUMBER"] = "NUMBER";
270
+ /**
271
+ * OpenAPI integer type
272
+ */
273
+ Type["INTEGER"] = "INTEGER";
274
+ /**
275
+ * OpenAPI boolean type
276
+ */
277
+ Type["BOOLEAN"] = "BOOLEAN";
278
+ /**
279
+ * OpenAPI array type
280
+ */
281
+ Type["ARRAY"] = "ARRAY";
282
+ /**
283
+ * OpenAPI object type
284
+ */
285
+ Type["OBJECT"] = "OBJECT";
286
+ /**
287
+ * Null type
288
+ */
289
+ Type["NULL"] = "NULL";
290
+ })(exports.Type || (exports.Type = {}));
255
291
  /** Required. Harm category. */
256
292
  exports.HarmCategory = void 0;
257
293
  (function (HarmCategory) {
@@ -276,7 +312,7 @@ exports.HarmCategory = void 0;
276
312
  */
277
313
  HarmCategory["HARM_CATEGORY_SEXUALLY_EXPLICIT"] = "HARM_CATEGORY_SEXUALLY_EXPLICIT";
278
314
  /**
279
- * The harm category is civic integrity.
315
+ * Deprecated: Election filter is not longer supported. The harm category is civic integrity.
280
316
  */
281
317
  HarmCategory["HARM_CATEGORY_CIVIC_INTEGRITY"] = "HARM_CATEGORY_CIVIC_INTEGRITY";
282
318
  })(exports.HarmCategory || (exports.HarmCategory = {}));
@@ -324,38 +360,6 @@ exports.HarmBlockThreshold = void 0;
324
360
  */
325
361
  HarmBlockThreshold["OFF"] = "OFF";
326
362
  })(exports.HarmBlockThreshold || (exports.HarmBlockThreshold = {}));
327
- /** Optional. The type of the data. */
328
- exports.Type = void 0;
329
- (function (Type) {
330
- /**
331
- * Not specified, should not be used.
332
- */
333
- Type["TYPE_UNSPECIFIED"] = "TYPE_UNSPECIFIED";
334
- /**
335
- * OpenAPI string type
336
- */
337
- Type["STRING"] = "STRING";
338
- /**
339
- * OpenAPI number type
340
- */
341
- Type["NUMBER"] = "NUMBER";
342
- /**
343
- * OpenAPI integer type
344
- */
345
- Type["INTEGER"] = "INTEGER";
346
- /**
347
- * OpenAPI boolean type
348
- */
349
- Type["BOOLEAN"] = "BOOLEAN";
350
- /**
351
- * OpenAPI array type
352
- */
353
- Type["ARRAY"] = "ARRAY";
354
- /**
355
- * OpenAPI object type
356
- */
357
- Type["OBJECT"] = "OBJECT";
358
- })(exports.Type || (exports.Type = {}));
359
363
  /** The mode of the predictor to be used in dynamic retrieval. */
360
364
  exports.Mode = void 0;
361
365
  (function (Mode) {
@@ -2495,6 +2499,21 @@ function blobToMldev$2(apiClient, fromObject) {
2495
2499
  }
2496
2500
  return toObject;
2497
2501
  }
2502
+ function fileDataToMldev$2(apiClient, fromObject) {
2503
+ const toObject = {};
2504
+ if (getValueByPath(fromObject, ['displayName']) !== undefined) {
2505
+ throw new Error('displayName parameter is not supported in Gemini API.');
2506
+ }
2507
+ const fromFileUri = getValueByPath(fromObject, ['fileUri']);
2508
+ if (fromFileUri != null) {
2509
+ setValueByPath(toObject, ['fileUri'], fromFileUri);
2510
+ }
2511
+ const fromMimeType = getValueByPath(fromObject, ['mimeType']);
2512
+ if (fromMimeType != null) {
2513
+ setValueByPath(toObject, ['mimeType'], fromMimeType);
2514
+ }
2515
+ return toObject;
2516
+ }
2498
2517
  function partToMldev$2(apiClient, fromObject) {
2499
2518
  const toObject = {};
2500
2519
  const fromVideoMetadata = getValueByPath(fromObject, [
@@ -2511,6 +2530,10 @@ function partToMldev$2(apiClient, fromObject) {
2511
2530
  if (fromInlineData != null) {
2512
2531
  setValueByPath(toObject, ['inlineData'], blobToMldev$2(apiClient, fromInlineData));
2513
2532
  }
2533
+ const fromFileData = getValueByPath(fromObject, ['fileData']);
2534
+ if (fromFileData != null) {
2535
+ setValueByPath(toObject, ['fileData'], fileDataToMldev$2(apiClient, fromFileData));
2536
+ }
2514
2537
  const fromCodeExecutionResult = getValueByPath(fromObject, [
2515
2538
  'codeExecutionResult',
2516
2539
  ]);
@@ -2523,10 +2546,6 @@ function partToMldev$2(apiClient, fromObject) {
2523
2546
  if (fromExecutableCode != null) {
2524
2547
  setValueByPath(toObject, ['executableCode'], fromExecutableCode);
2525
2548
  }
2526
- const fromFileData = getValueByPath(fromObject, ['fileData']);
2527
- if (fromFileData != null) {
2528
- setValueByPath(toObject, ['fileData'], fromFileData);
2529
- }
2530
2549
  const fromFunctionCall = getValueByPath(fromObject, ['functionCall']);
2531
2550
  if (fromFunctionCall != null) {
2532
2551
  setValueByPath(toObject, ['functionCall'], fromFunctionCall);
@@ -2712,6 +2731,10 @@ function retrievalConfigToMldev$1(apiClient, fromObject) {
2712
2731
  if (fromLatLng != null) {
2713
2732
  setValueByPath(toObject, ['latLng'], latLngToMldev$1(apiClient, fromLatLng));
2714
2733
  }
2734
+ const fromLanguageCode = getValueByPath(fromObject, ['languageCode']);
2735
+ if (fromLanguageCode != null) {
2736
+ setValueByPath(toObject, ['languageCode'], fromLanguageCode);
2737
+ }
2715
2738
  return toObject;
2716
2739
  }
2717
2740
  function toolConfigToMldev$1(apiClient, fromObject) {
@@ -2891,6 +2914,22 @@ function blobToVertex$2(apiClient, fromObject) {
2891
2914
  }
2892
2915
  return toObject;
2893
2916
  }
2917
+ function fileDataToVertex$2(apiClient, fromObject) {
2918
+ const toObject = {};
2919
+ const fromDisplayName = getValueByPath(fromObject, ['displayName']);
2920
+ if (fromDisplayName != null) {
2921
+ setValueByPath(toObject, ['displayName'], fromDisplayName);
2922
+ }
2923
+ const fromFileUri = getValueByPath(fromObject, ['fileUri']);
2924
+ if (fromFileUri != null) {
2925
+ setValueByPath(toObject, ['fileUri'], fromFileUri);
2926
+ }
2927
+ const fromMimeType = getValueByPath(fromObject, ['mimeType']);
2928
+ if (fromMimeType != null) {
2929
+ setValueByPath(toObject, ['mimeType'], fromMimeType);
2930
+ }
2931
+ return toObject;
2932
+ }
2894
2933
  function partToVertex$2(apiClient, fromObject) {
2895
2934
  const toObject = {};
2896
2935
  const fromVideoMetadata = getValueByPath(fromObject, [
@@ -2907,6 +2946,10 @@ function partToVertex$2(apiClient, fromObject) {
2907
2946
  if (fromInlineData != null) {
2908
2947
  setValueByPath(toObject, ['inlineData'], blobToVertex$2(apiClient, fromInlineData));
2909
2948
  }
2949
+ const fromFileData = getValueByPath(fromObject, ['fileData']);
2950
+ if (fromFileData != null) {
2951
+ setValueByPath(toObject, ['fileData'], fileDataToVertex$2(apiClient, fromFileData));
2952
+ }
2910
2953
  const fromCodeExecutionResult = getValueByPath(fromObject, [
2911
2954
  'codeExecutionResult',
2912
2955
  ]);
@@ -2919,10 +2962,6 @@ function partToVertex$2(apiClient, fromObject) {
2919
2962
  if (fromExecutableCode != null) {
2920
2963
  setValueByPath(toObject, ['executableCode'], fromExecutableCode);
2921
2964
  }
2922
- const fromFileData = getValueByPath(fromObject, ['fileData']);
2923
- if (fromFileData != null) {
2924
- setValueByPath(toObject, ['fileData'], fromFileData);
2925
- }
2926
2965
  const fromFunctionCall = getValueByPath(fromObject, ['functionCall']);
2927
2966
  if (fromFunctionCall != null) {
2928
2967
  setValueByPath(toObject, ['functionCall'], fromFunctionCall);
@@ -3159,6 +3198,10 @@ function retrievalConfigToVertex$1(apiClient, fromObject) {
3159
3198
  if (fromLatLng != null) {
3160
3199
  setValueByPath(toObject, ['latLng'], latLngToVertex$1(apiClient, fromLatLng));
3161
3200
  }
3201
+ const fromLanguageCode = getValueByPath(fromObject, ['languageCode']);
3202
+ if (fromLanguageCode != null) {
3203
+ setValueByPath(toObject, ['languageCode'], fromLanguageCode);
3204
+ }
3162
3205
  return toObject;
3163
3206
  }
3164
3207
  function toolConfigToVertex$1(apiClient, fromObject) {
@@ -4227,7 +4270,10 @@ class Chat {
4227
4270
  this.recordHistory(inputContent, modelOutput, automaticFunctionCallingHistory);
4228
4271
  return;
4229
4272
  })();
4230
- await this.sendPromise;
4273
+ await this.sendPromise.catch(() => {
4274
+ // Resets sendPromise to avoid subsequent calls failing
4275
+ this.sendPromise = Promise.resolve();
4276
+ });
4231
4277
  return responsePromise;
4232
4278
  }
4233
4279
  /**
@@ -5042,6 +5088,37 @@ function blobToVertex$1(apiClient, fromObject) {
5042
5088
  }
5043
5089
  return toObject;
5044
5090
  }
5091
+ function fileDataToMldev$1(apiClient, fromObject) {
5092
+ const toObject = {};
5093
+ if (getValueByPath(fromObject, ['displayName']) !== undefined) {
5094
+ throw new Error('displayName parameter is not supported in Gemini API.');
5095
+ }
5096
+ const fromFileUri = getValueByPath(fromObject, ['fileUri']);
5097
+ if (fromFileUri != null) {
5098
+ setValueByPath(toObject, ['fileUri'], fromFileUri);
5099
+ }
5100
+ const fromMimeType = getValueByPath(fromObject, ['mimeType']);
5101
+ if (fromMimeType != null) {
5102
+ setValueByPath(toObject, ['mimeType'], fromMimeType);
5103
+ }
5104
+ return toObject;
5105
+ }
5106
+ function fileDataToVertex$1(apiClient, fromObject) {
5107
+ const toObject = {};
5108
+ const fromDisplayName = getValueByPath(fromObject, ['displayName']);
5109
+ if (fromDisplayName != null) {
5110
+ setValueByPath(toObject, ['displayName'], fromDisplayName);
5111
+ }
5112
+ const fromFileUri = getValueByPath(fromObject, ['fileUri']);
5113
+ if (fromFileUri != null) {
5114
+ setValueByPath(toObject, ['fileUri'], fromFileUri);
5115
+ }
5116
+ const fromMimeType = getValueByPath(fromObject, ['mimeType']);
5117
+ if (fromMimeType != null) {
5118
+ setValueByPath(toObject, ['mimeType'], fromMimeType);
5119
+ }
5120
+ return toObject;
5121
+ }
5045
5122
  function partToMldev$1(apiClient, fromObject) {
5046
5123
  const toObject = {};
5047
5124
  const fromVideoMetadata = getValueByPath(fromObject, [
@@ -5058,6 +5135,10 @@ function partToMldev$1(apiClient, fromObject) {
5058
5135
  if (fromInlineData != null) {
5059
5136
  setValueByPath(toObject, ['inlineData'], blobToMldev$1(apiClient, fromInlineData));
5060
5137
  }
5138
+ const fromFileData = getValueByPath(fromObject, ['fileData']);
5139
+ if (fromFileData != null) {
5140
+ setValueByPath(toObject, ['fileData'], fileDataToMldev$1(apiClient, fromFileData));
5141
+ }
5061
5142
  const fromCodeExecutionResult = getValueByPath(fromObject, [
5062
5143
  'codeExecutionResult',
5063
5144
  ]);
@@ -5070,10 +5151,6 @@ function partToMldev$1(apiClient, fromObject) {
5070
5151
  if (fromExecutableCode != null) {
5071
5152
  setValueByPath(toObject, ['executableCode'], fromExecutableCode);
5072
5153
  }
5073
- const fromFileData = getValueByPath(fromObject, ['fileData']);
5074
- if (fromFileData != null) {
5075
- setValueByPath(toObject, ['fileData'], fromFileData);
5076
- }
5077
5154
  const fromFunctionCall = getValueByPath(fromObject, ['functionCall']);
5078
5155
  if (fromFunctionCall != null) {
5079
5156
  setValueByPath(toObject, ['functionCall'], fromFunctionCall);
@@ -5106,6 +5183,10 @@ function partToVertex$1(apiClient, fromObject) {
5106
5183
  if (fromInlineData != null) {
5107
5184
  setValueByPath(toObject, ['inlineData'], blobToVertex$1(apiClient, fromInlineData));
5108
5185
  }
5186
+ const fromFileData = getValueByPath(fromObject, ['fileData']);
5187
+ if (fromFileData != null) {
5188
+ setValueByPath(toObject, ['fileData'], fileDataToVertex$1(apiClient, fromFileData));
5189
+ }
5109
5190
  const fromCodeExecutionResult = getValueByPath(fromObject, [
5110
5191
  'codeExecutionResult',
5111
5192
  ]);
@@ -5118,10 +5199,6 @@ function partToVertex$1(apiClient, fromObject) {
5118
5199
  if (fromExecutableCode != null) {
5119
5200
  setValueByPath(toObject, ['executableCode'], fromExecutableCode);
5120
5201
  }
5121
- const fromFileData = getValueByPath(fromObject, ['fileData']);
5122
- if (fromFileData != null) {
5123
- setValueByPath(toObject, ['fileData'], fromFileData);
5124
- }
5125
5202
  const fromFunctionCall = getValueByPath(fromObject, ['functionCall']);
5126
5203
  if (fromFunctionCall != null) {
5127
5204
  setValueByPath(toObject, ['functionCall'], fromFunctionCall);
@@ -6195,6 +6272,34 @@ function blobFromVertex$1(apiClient, fromObject) {
6195
6272
  }
6196
6273
  return toObject;
6197
6274
  }
6275
+ function fileDataFromMldev$1(apiClient, fromObject) {
6276
+ const toObject = {};
6277
+ const fromFileUri = getValueByPath(fromObject, ['fileUri']);
6278
+ if (fromFileUri != null) {
6279
+ setValueByPath(toObject, ['fileUri'], fromFileUri);
6280
+ }
6281
+ const fromMimeType = getValueByPath(fromObject, ['mimeType']);
6282
+ if (fromMimeType != null) {
6283
+ setValueByPath(toObject, ['mimeType'], fromMimeType);
6284
+ }
6285
+ return toObject;
6286
+ }
6287
+ function fileDataFromVertex$1(apiClient, fromObject) {
6288
+ const toObject = {};
6289
+ const fromDisplayName = getValueByPath(fromObject, ['displayName']);
6290
+ if (fromDisplayName != null) {
6291
+ setValueByPath(toObject, ['displayName'], fromDisplayName);
6292
+ }
6293
+ const fromFileUri = getValueByPath(fromObject, ['fileUri']);
6294
+ if (fromFileUri != null) {
6295
+ setValueByPath(toObject, ['fileUri'], fromFileUri);
6296
+ }
6297
+ const fromMimeType = getValueByPath(fromObject, ['mimeType']);
6298
+ if (fromMimeType != null) {
6299
+ setValueByPath(toObject, ['mimeType'], fromMimeType);
6300
+ }
6301
+ return toObject;
6302
+ }
6198
6303
  function partFromMldev$1(apiClient, fromObject) {
6199
6304
  const toObject = {};
6200
6305
  const fromVideoMetadata = getValueByPath(fromObject, [
@@ -6211,6 +6316,10 @@ function partFromMldev$1(apiClient, fromObject) {
6211
6316
  if (fromInlineData != null) {
6212
6317
  setValueByPath(toObject, ['inlineData'], blobFromMldev$1(apiClient, fromInlineData));
6213
6318
  }
6319
+ const fromFileData = getValueByPath(fromObject, ['fileData']);
6320
+ if (fromFileData != null) {
6321
+ setValueByPath(toObject, ['fileData'], fileDataFromMldev$1(apiClient, fromFileData));
6322
+ }
6214
6323
  const fromCodeExecutionResult = getValueByPath(fromObject, [
6215
6324
  'codeExecutionResult',
6216
6325
  ]);
@@ -6223,10 +6332,6 @@ function partFromMldev$1(apiClient, fromObject) {
6223
6332
  if (fromExecutableCode != null) {
6224
6333
  setValueByPath(toObject, ['executableCode'], fromExecutableCode);
6225
6334
  }
6226
- const fromFileData = getValueByPath(fromObject, ['fileData']);
6227
- if (fromFileData != null) {
6228
- setValueByPath(toObject, ['fileData'], fromFileData);
6229
- }
6230
6335
  const fromFunctionCall = getValueByPath(fromObject, ['functionCall']);
6231
6336
  if (fromFunctionCall != null) {
6232
6337
  setValueByPath(toObject, ['functionCall'], fromFunctionCall);
@@ -6259,6 +6364,10 @@ function partFromVertex$1(apiClient, fromObject) {
6259
6364
  if (fromInlineData != null) {
6260
6365
  setValueByPath(toObject, ['inlineData'], blobFromVertex$1(apiClient, fromInlineData));
6261
6366
  }
6367
+ const fromFileData = getValueByPath(fromObject, ['fileData']);
6368
+ if (fromFileData != null) {
6369
+ setValueByPath(toObject, ['fileData'], fileDataFromVertex$1(apiClient, fromFileData));
6370
+ }
6262
6371
  const fromCodeExecutionResult = getValueByPath(fromObject, [
6263
6372
  'codeExecutionResult',
6264
6373
  ]);
@@ -6271,10 +6380,6 @@ function partFromVertex$1(apiClient, fromObject) {
6271
6380
  if (fromExecutableCode != null) {
6272
6381
  setValueByPath(toObject, ['executableCode'], fromExecutableCode);
6273
6382
  }
6274
- const fromFileData = getValueByPath(fromObject, ['fileData']);
6275
- if (fromFileData != null) {
6276
- setValueByPath(toObject, ['fileData'], fromFileData);
6277
- }
6278
6383
  const fromFunctionCall = getValueByPath(fromObject, ['functionCall']);
6279
6384
  if (fromFunctionCall != null) {
6280
6385
  setValueByPath(toObject, ['functionCall'], fromFunctionCall);
@@ -7090,6 +7195,21 @@ function blobToMldev(apiClient, fromObject) {
7090
7195
  }
7091
7196
  return toObject;
7092
7197
  }
7198
+ function fileDataToMldev(apiClient, fromObject) {
7199
+ const toObject = {};
7200
+ if (getValueByPath(fromObject, ['displayName']) !== undefined) {
7201
+ throw new Error('displayName parameter is not supported in Gemini API.');
7202
+ }
7203
+ const fromFileUri = getValueByPath(fromObject, ['fileUri']);
7204
+ if (fromFileUri != null) {
7205
+ setValueByPath(toObject, ['fileUri'], fromFileUri);
7206
+ }
7207
+ const fromMimeType = getValueByPath(fromObject, ['mimeType']);
7208
+ if (fromMimeType != null) {
7209
+ setValueByPath(toObject, ['mimeType'], fromMimeType);
7210
+ }
7211
+ return toObject;
7212
+ }
7093
7213
  function partToMldev(apiClient, fromObject) {
7094
7214
  const toObject = {};
7095
7215
  const fromVideoMetadata = getValueByPath(fromObject, [
@@ -7106,6 +7226,10 @@ function partToMldev(apiClient, fromObject) {
7106
7226
  if (fromInlineData != null) {
7107
7227
  setValueByPath(toObject, ['inlineData'], blobToMldev(apiClient, fromInlineData));
7108
7228
  }
7229
+ const fromFileData = getValueByPath(fromObject, ['fileData']);
7230
+ if (fromFileData != null) {
7231
+ setValueByPath(toObject, ['fileData'], fileDataToMldev(apiClient, fromFileData));
7232
+ }
7109
7233
  const fromCodeExecutionResult = getValueByPath(fromObject, [
7110
7234
  'codeExecutionResult',
7111
7235
  ]);
@@ -7118,10 +7242,6 @@ function partToMldev(apiClient, fromObject) {
7118
7242
  if (fromExecutableCode != null) {
7119
7243
  setValueByPath(toObject, ['executableCode'], fromExecutableCode);
7120
7244
  }
7121
- const fromFileData = getValueByPath(fromObject, ['fileData']);
7122
- if (fromFileData != null) {
7123
- setValueByPath(toObject, ['fileData'], fromFileData);
7124
- }
7125
7245
  const fromFunctionCall = getValueByPath(fromObject, ['functionCall']);
7126
7246
  if (fromFunctionCall != null) {
7127
7247
  setValueByPath(toObject, ['functionCall'], fromFunctionCall);
@@ -7156,6 +7276,104 @@ function contentToMldev(apiClient, fromObject) {
7156
7276
  }
7157
7277
  return toObject;
7158
7278
  }
7279
+ function schemaToMldev(apiClient, fromObject) {
7280
+ const toObject = {};
7281
+ const fromAnyOf = getValueByPath(fromObject, ['anyOf']);
7282
+ if (fromAnyOf != null) {
7283
+ setValueByPath(toObject, ['anyOf'], fromAnyOf);
7284
+ }
7285
+ const fromDefault = getValueByPath(fromObject, ['default']);
7286
+ if (fromDefault != null) {
7287
+ setValueByPath(toObject, ['default'], fromDefault);
7288
+ }
7289
+ const fromDescription = getValueByPath(fromObject, ['description']);
7290
+ if (fromDescription != null) {
7291
+ setValueByPath(toObject, ['description'], fromDescription);
7292
+ }
7293
+ const fromEnum = getValueByPath(fromObject, ['enum']);
7294
+ if (fromEnum != null) {
7295
+ setValueByPath(toObject, ['enum'], fromEnum);
7296
+ }
7297
+ const fromExample = getValueByPath(fromObject, ['example']);
7298
+ if (fromExample != null) {
7299
+ setValueByPath(toObject, ['example'], fromExample);
7300
+ }
7301
+ const fromFormat = getValueByPath(fromObject, ['format']);
7302
+ if (fromFormat != null) {
7303
+ setValueByPath(toObject, ['format'], fromFormat);
7304
+ }
7305
+ const fromItems = getValueByPath(fromObject, ['items']);
7306
+ if (fromItems != null) {
7307
+ setValueByPath(toObject, ['items'], fromItems);
7308
+ }
7309
+ const fromMaxItems = getValueByPath(fromObject, ['maxItems']);
7310
+ if (fromMaxItems != null) {
7311
+ setValueByPath(toObject, ['maxItems'], fromMaxItems);
7312
+ }
7313
+ const fromMaxLength = getValueByPath(fromObject, ['maxLength']);
7314
+ if (fromMaxLength != null) {
7315
+ setValueByPath(toObject, ['maxLength'], fromMaxLength);
7316
+ }
7317
+ const fromMaxProperties = getValueByPath(fromObject, [
7318
+ 'maxProperties',
7319
+ ]);
7320
+ if (fromMaxProperties != null) {
7321
+ setValueByPath(toObject, ['maxProperties'], fromMaxProperties);
7322
+ }
7323
+ const fromMaximum = getValueByPath(fromObject, ['maximum']);
7324
+ if (fromMaximum != null) {
7325
+ setValueByPath(toObject, ['maximum'], fromMaximum);
7326
+ }
7327
+ const fromMinItems = getValueByPath(fromObject, ['minItems']);
7328
+ if (fromMinItems != null) {
7329
+ setValueByPath(toObject, ['minItems'], fromMinItems);
7330
+ }
7331
+ const fromMinLength = getValueByPath(fromObject, ['minLength']);
7332
+ if (fromMinLength != null) {
7333
+ setValueByPath(toObject, ['minLength'], fromMinLength);
7334
+ }
7335
+ const fromMinProperties = getValueByPath(fromObject, [
7336
+ 'minProperties',
7337
+ ]);
7338
+ if (fromMinProperties != null) {
7339
+ setValueByPath(toObject, ['minProperties'], fromMinProperties);
7340
+ }
7341
+ const fromMinimum = getValueByPath(fromObject, ['minimum']);
7342
+ if (fromMinimum != null) {
7343
+ setValueByPath(toObject, ['minimum'], fromMinimum);
7344
+ }
7345
+ const fromNullable = getValueByPath(fromObject, ['nullable']);
7346
+ if (fromNullable != null) {
7347
+ setValueByPath(toObject, ['nullable'], fromNullable);
7348
+ }
7349
+ const fromPattern = getValueByPath(fromObject, ['pattern']);
7350
+ if (fromPattern != null) {
7351
+ setValueByPath(toObject, ['pattern'], fromPattern);
7352
+ }
7353
+ const fromProperties = getValueByPath(fromObject, ['properties']);
7354
+ if (fromProperties != null) {
7355
+ setValueByPath(toObject, ['properties'], fromProperties);
7356
+ }
7357
+ const fromPropertyOrdering = getValueByPath(fromObject, [
7358
+ 'propertyOrdering',
7359
+ ]);
7360
+ if (fromPropertyOrdering != null) {
7361
+ setValueByPath(toObject, ['propertyOrdering'], fromPropertyOrdering);
7362
+ }
7363
+ const fromRequired = getValueByPath(fromObject, ['required']);
7364
+ if (fromRequired != null) {
7365
+ setValueByPath(toObject, ['required'], fromRequired);
7366
+ }
7367
+ const fromTitle = getValueByPath(fromObject, ['title']);
7368
+ if (fromTitle != null) {
7369
+ setValueByPath(toObject, ['title'], fromTitle);
7370
+ }
7371
+ const fromType = getValueByPath(fromObject, ['type']);
7372
+ if (fromType != null) {
7373
+ setValueByPath(toObject, ['type'], fromType);
7374
+ }
7375
+ return toObject;
7376
+ }
7159
7377
  function safetySettingToMldev(apiClient, fromObject) {
7160
7378
  const toObject = {};
7161
7379
  if (getValueByPath(fromObject, ['method']) !== undefined) {
@@ -7322,6 +7540,10 @@ function retrievalConfigToMldev(apiClient, fromObject) {
7322
7540
  if (fromLatLng != null) {
7323
7541
  setValueByPath(toObject, ['latLng'], latLngToMldev(apiClient, fromLatLng));
7324
7542
  }
7543
+ const fromLanguageCode = getValueByPath(fromObject, ['languageCode']);
7544
+ if (fromLanguageCode != null) {
7545
+ setValueByPath(toObject, ['languageCode'], fromLanguageCode);
7546
+ }
7325
7547
  return toObject;
7326
7548
  }
7327
7549
  function toolConfigToMldev(apiClient, fromObject) {
@@ -7494,7 +7716,7 @@ function generateContentConfigToMldev(apiClient, fromObject, parentObject) {
7494
7716
  'responseSchema',
7495
7717
  ]);
7496
7718
  if (fromResponseSchema != null) {
7497
- setValueByPath(toObject, ['responseSchema'], tSchema(apiClient, fromResponseSchema));
7719
+ setValueByPath(toObject, ['responseSchema'], schemaToMldev(apiClient, tSchema(apiClient, fromResponseSchema)));
7498
7720
  }
7499
7721
  if (getValueByPath(fromObject, ['routingConfig']) !== undefined) {
7500
7722
  throw new Error('routingConfig parameter is not supported in Gemini API.');
@@ -7955,6 +8177,22 @@ function blobToVertex(apiClient, fromObject) {
7955
8177
  }
7956
8178
  return toObject;
7957
8179
  }
8180
+ function fileDataToVertex(apiClient, fromObject) {
8181
+ const toObject = {};
8182
+ const fromDisplayName = getValueByPath(fromObject, ['displayName']);
8183
+ if (fromDisplayName != null) {
8184
+ setValueByPath(toObject, ['displayName'], fromDisplayName);
8185
+ }
8186
+ const fromFileUri = getValueByPath(fromObject, ['fileUri']);
8187
+ if (fromFileUri != null) {
8188
+ setValueByPath(toObject, ['fileUri'], fromFileUri);
8189
+ }
8190
+ const fromMimeType = getValueByPath(fromObject, ['mimeType']);
8191
+ if (fromMimeType != null) {
8192
+ setValueByPath(toObject, ['mimeType'], fromMimeType);
8193
+ }
8194
+ return toObject;
8195
+ }
7958
8196
  function partToVertex(apiClient, fromObject) {
7959
8197
  const toObject = {};
7960
8198
  const fromVideoMetadata = getValueByPath(fromObject, [
@@ -7971,6 +8209,10 @@ function partToVertex(apiClient, fromObject) {
7971
8209
  if (fromInlineData != null) {
7972
8210
  setValueByPath(toObject, ['inlineData'], blobToVertex(apiClient, fromInlineData));
7973
8211
  }
8212
+ const fromFileData = getValueByPath(fromObject, ['fileData']);
8213
+ if (fromFileData != null) {
8214
+ setValueByPath(toObject, ['fileData'], fileDataToVertex(apiClient, fromFileData));
8215
+ }
7974
8216
  const fromCodeExecutionResult = getValueByPath(fromObject, [
7975
8217
  'codeExecutionResult',
7976
8218
  ]);
@@ -7983,10 +8225,6 @@ function partToVertex(apiClient, fromObject) {
7983
8225
  if (fromExecutableCode != null) {
7984
8226
  setValueByPath(toObject, ['executableCode'], fromExecutableCode);
7985
8227
  }
7986
- const fromFileData = getValueByPath(fromObject, ['fileData']);
7987
- if (fromFileData != null) {
7988
- setValueByPath(toObject, ['fileData'], fromFileData);
7989
- }
7990
8228
  const fromFunctionCall = getValueByPath(fromObject, ['functionCall']);
7991
8229
  if (fromFunctionCall != null) {
7992
8230
  setValueByPath(toObject, ['functionCall'], fromFunctionCall);
@@ -8021,6 +8259,104 @@ function contentToVertex(apiClient, fromObject) {
8021
8259
  }
8022
8260
  return toObject;
8023
8261
  }
8262
+ function schemaToVertex(apiClient, fromObject) {
8263
+ const toObject = {};
8264
+ const fromAnyOf = getValueByPath(fromObject, ['anyOf']);
8265
+ if (fromAnyOf != null) {
8266
+ setValueByPath(toObject, ['anyOf'], fromAnyOf);
8267
+ }
8268
+ const fromDefault = getValueByPath(fromObject, ['default']);
8269
+ if (fromDefault != null) {
8270
+ setValueByPath(toObject, ['default'], fromDefault);
8271
+ }
8272
+ const fromDescription = getValueByPath(fromObject, ['description']);
8273
+ if (fromDescription != null) {
8274
+ setValueByPath(toObject, ['description'], fromDescription);
8275
+ }
8276
+ const fromEnum = getValueByPath(fromObject, ['enum']);
8277
+ if (fromEnum != null) {
8278
+ setValueByPath(toObject, ['enum'], fromEnum);
8279
+ }
8280
+ const fromExample = getValueByPath(fromObject, ['example']);
8281
+ if (fromExample != null) {
8282
+ setValueByPath(toObject, ['example'], fromExample);
8283
+ }
8284
+ const fromFormat = getValueByPath(fromObject, ['format']);
8285
+ if (fromFormat != null) {
8286
+ setValueByPath(toObject, ['format'], fromFormat);
8287
+ }
8288
+ const fromItems = getValueByPath(fromObject, ['items']);
8289
+ if (fromItems != null) {
8290
+ setValueByPath(toObject, ['items'], fromItems);
8291
+ }
8292
+ const fromMaxItems = getValueByPath(fromObject, ['maxItems']);
8293
+ if (fromMaxItems != null) {
8294
+ setValueByPath(toObject, ['maxItems'], fromMaxItems);
8295
+ }
8296
+ const fromMaxLength = getValueByPath(fromObject, ['maxLength']);
8297
+ if (fromMaxLength != null) {
8298
+ setValueByPath(toObject, ['maxLength'], fromMaxLength);
8299
+ }
8300
+ const fromMaxProperties = getValueByPath(fromObject, [
8301
+ 'maxProperties',
8302
+ ]);
8303
+ if (fromMaxProperties != null) {
8304
+ setValueByPath(toObject, ['maxProperties'], fromMaxProperties);
8305
+ }
8306
+ const fromMaximum = getValueByPath(fromObject, ['maximum']);
8307
+ if (fromMaximum != null) {
8308
+ setValueByPath(toObject, ['maximum'], fromMaximum);
8309
+ }
8310
+ const fromMinItems = getValueByPath(fromObject, ['minItems']);
8311
+ if (fromMinItems != null) {
8312
+ setValueByPath(toObject, ['minItems'], fromMinItems);
8313
+ }
8314
+ const fromMinLength = getValueByPath(fromObject, ['minLength']);
8315
+ if (fromMinLength != null) {
8316
+ setValueByPath(toObject, ['minLength'], fromMinLength);
8317
+ }
8318
+ const fromMinProperties = getValueByPath(fromObject, [
8319
+ 'minProperties',
8320
+ ]);
8321
+ if (fromMinProperties != null) {
8322
+ setValueByPath(toObject, ['minProperties'], fromMinProperties);
8323
+ }
8324
+ const fromMinimum = getValueByPath(fromObject, ['minimum']);
8325
+ if (fromMinimum != null) {
8326
+ setValueByPath(toObject, ['minimum'], fromMinimum);
8327
+ }
8328
+ const fromNullable = getValueByPath(fromObject, ['nullable']);
8329
+ if (fromNullable != null) {
8330
+ setValueByPath(toObject, ['nullable'], fromNullable);
8331
+ }
8332
+ const fromPattern = getValueByPath(fromObject, ['pattern']);
8333
+ if (fromPattern != null) {
8334
+ setValueByPath(toObject, ['pattern'], fromPattern);
8335
+ }
8336
+ const fromProperties = getValueByPath(fromObject, ['properties']);
8337
+ if (fromProperties != null) {
8338
+ setValueByPath(toObject, ['properties'], fromProperties);
8339
+ }
8340
+ const fromPropertyOrdering = getValueByPath(fromObject, [
8341
+ 'propertyOrdering',
8342
+ ]);
8343
+ if (fromPropertyOrdering != null) {
8344
+ setValueByPath(toObject, ['propertyOrdering'], fromPropertyOrdering);
8345
+ }
8346
+ const fromRequired = getValueByPath(fromObject, ['required']);
8347
+ if (fromRequired != null) {
8348
+ setValueByPath(toObject, ['required'], fromRequired);
8349
+ }
8350
+ const fromTitle = getValueByPath(fromObject, ['title']);
8351
+ if (fromTitle != null) {
8352
+ setValueByPath(toObject, ['title'], fromTitle);
8353
+ }
8354
+ const fromType = getValueByPath(fromObject, ['type']);
8355
+ if (fromType != null) {
8356
+ setValueByPath(toObject, ['type'], fromType);
8357
+ }
8358
+ return toObject;
8359
+ }
8024
8360
  function modelSelectionConfigToVertex(apiClient, fromObject) {
8025
8361
  const toObject = {};
8026
8362
  const fromFeatureSelectionPreference = getValueByPath(fromObject, [
@@ -8249,6 +8585,10 @@ function retrievalConfigToVertex(apiClient, fromObject) {
8249
8585
  if (fromLatLng != null) {
8250
8586
  setValueByPath(toObject, ['latLng'], latLngToVertex(apiClient, fromLatLng));
8251
8587
  }
8588
+ const fromLanguageCode = getValueByPath(fromObject, ['languageCode']);
8589
+ if (fromLanguageCode != null) {
8590
+ setValueByPath(toObject, ['languageCode'], fromLanguageCode);
8591
+ }
8252
8592
  return toObject;
8253
8593
  }
8254
8594
  function toolConfigToVertex(apiClient, fromObject) {
@@ -8390,7 +8730,7 @@ function generateContentConfigToVertex(apiClient, fromObject, parentObject) {
8390
8730
  'responseSchema',
8391
8731
  ]);
8392
8732
  if (fromResponseSchema != null) {
8393
- setValueByPath(toObject, ['responseSchema'], tSchema(apiClient, fromResponseSchema));
8733
+ setValueByPath(toObject, ['responseSchema'], schemaToVertex(apiClient, tSchema(apiClient, fromResponseSchema)));
8394
8734
  }
8395
8735
  const fromRoutingConfig = getValueByPath(fromObject, [
8396
8736
  'routingConfig',
@@ -9172,6 +9512,18 @@ function blobFromMldev(apiClient, fromObject) {
9172
9512
  }
9173
9513
  return toObject;
9174
9514
  }
9515
+ function fileDataFromMldev(apiClient, fromObject) {
9516
+ const toObject = {};
9517
+ const fromFileUri = getValueByPath(fromObject, ['fileUri']);
9518
+ if (fromFileUri != null) {
9519
+ setValueByPath(toObject, ['fileUri'], fromFileUri);
9520
+ }
9521
+ const fromMimeType = getValueByPath(fromObject, ['mimeType']);
9522
+ if (fromMimeType != null) {
9523
+ setValueByPath(toObject, ['mimeType'], fromMimeType);
9524
+ }
9525
+ return toObject;
9526
+ }
9175
9527
  function partFromMldev(apiClient, fromObject) {
9176
9528
  const toObject = {};
9177
9529
  const fromVideoMetadata = getValueByPath(fromObject, [
@@ -9188,6 +9540,10 @@ function partFromMldev(apiClient, fromObject) {
9188
9540
  if (fromInlineData != null) {
9189
9541
  setValueByPath(toObject, ['inlineData'], blobFromMldev(apiClient, fromInlineData));
9190
9542
  }
9543
+ const fromFileData = getValueByPath(fromObject, ['fileData']);
9544
+ if (fromFileData != null) {
9545
+ setValueByPath(toObject, ['fileData'], fileDataFromMldev(apiClient, fromFileData));
9546
+ }
9191
9547
  const fromCodeExecutionResult = getValueByPath(fromObject, [
9192
9548
  'codeExecutionResult',
9193
9549
  ]);
@@ -9200,10 +9556,6 @@ function partFromMldev(apiClient, fromObject) {
9200
9556
  if (fromExecutableCode != null) {
9201
9557
  setValueByPath(toObject, ['executableCode'], fromExecutableCode);
9202
9558
  }
9203
- const fromFileData = getValueByPath(fromObject, ['fileData']);
9204
- if (fromFileData != null) {
9205
- setValueByPath(toObject, ['fileData'], fromFileData);
9206
- }
9207
9559
  const fromFunctionCall = getValueByPath(fromObject, ['functionCall']);
9208
9560
  if (fromFunctionCall != null) {
9209
9561
  setValueByPath(toObject, ['functionCall'], fromFunctionCall);
@@ -9674,6 +10026,22 @@ function blobFromVertex(apiClient, fromObject) {
9674
10026
  }
9675
10027
  return toObject;
9676
10028
  }
10029
+ function fileDataFromVertex(apiClient, fromObject) {
10030
+ const toObject = {};
10031
+ const fromDisplayName = getValueByPath(fromObject, ['displayName']);
10032
+ if (fromDisplayName != null) {
10033
+ setValueByPath(toObject, ['displayName'], fromDisplayName);
10034
+ }
10035
+ const fromFileUri = getValueByPath(fromObject, ['fileUri']);
10036
+ if (fromFileUri != null) {
10037
+ setValueByPath(toObject, ['fileUri'], fromFileUri);
10038
+ }
10039
+ const fromMimeType = getValueByPath(fromObject, ['mimeType']);
10040
+ if (fromMimeType != null) {
10041
+ setValueByPath(toObject, ['mimeType'], fromMimeType);
10042
+ }
10043
+ return toObject;
10044
+ }
9677
10045
  function partFromVertex(apiClient, fromObject) {
9678
10046
  const toObject = {};
9679
10047
  const fromVideoMetadata = getValueByPath(fromObject, [
@@ -9690,6 +10058,10 @@ function partFromVertex(apiClient, fromObject) {
9690
10058
  if (fromInlineData != null) {
9691
10059
  setValueByPath(toObject, ['inlineData'], blobFromVertex(apiClient, fromInlineData));
9692
10060
  }
10061
+ const fromFileData = getValueByPath(fromObject, ['fileData']);
10062
+ if (fromFileData != null) {
10063
+ setValueByPath(toObject, ['fileData'], fileDataFromVertex(apiClient, fromFileData));
10064
+ }
9693
10065
  const fromCodeExecutionResult = getValueByPath(fromObject, [
9694
10066
  'codeExecutionResult',
9695
10067
  ]);
@@ -9702,10 +10074,6 @@ function partFromVertex(apiClient, fromObject) {
9702
10074
  if (fromExecutableCode != null) {
9703
10075
  setValueByPath(toObject, ['executableCode'], fromExecutableCode);
9704
10076
  }
9705
- const fromFileData = getValueByPath(fromObject, ['fileData']);
9706
- if (fromFileData != null) {
9707
- setValueByPath(toObject, ['fileData'], fromFileData);
9708
- }
9709
10077
  const fromFunctionCall = getValueByPath(fromObject, ['functionCall']);
9710
10078
  if (fromFunctionCall != null) {
9711
10079
  setValueByPath(toObject, ['functionCall'], fromFunctionCall);
@@ -10236,7 +10604,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
10236
10604
  const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
10237
10605
  const USER_AGENT_HEADER = 'User-Agent';
10238
10606
  const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
10239
- const SDK_VERSION = '1.0.0'; // x-release-please-version
10607
+ const SDK_VERSION = '1.1.0'; // x-release-please-version
10240
10608
  const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
10241
10609
  const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
10242
10610
  const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';
@@ -13722,6 +14090,12 @@ function tuningJobFromMldev(apiClient, fromObject) {
13722
14090
  if (fromPipelineJob != null) {
13723
14091
  setValueByPath(toObject, ['pipelineJob'], fromPipelineJob);
13724
14092
  }
14093
+ const fromServiceAccount = getValueByPath(fromObject, [
14094
+ 'serviceAccount',
14095
+ ]);
14096
+ if (fromServiceAccount != null) {
14097
+ setValueByPath(toObject, ['serviceAccount'], fromServiceAccount);
14098
+ }
13725
14099
  const fromTunedModelDisplayName = getValueByPath(fromObject, [
13726
14100
  'tunedModelDisplayName',
13727
14101
  ]);
@@ -13896,6 +14270,12 @@ function tuningJobFromVertex(apiClient, fromObject) {
13896
14270
  if (fromPipelineJob != null) {
13897
14271
  setValueByPath(toObject, ['pipelineJob'], fromPipelineJob);
13898
14272
  }
14273
+ const fromServiceAccount = getValueByPath(fromObject, [
14274
+ 'serviceAccount',
14275
+ ]);
14276
+ if (fromServiceAccount != null) {
14277
+ setValueByPath(toObject, ['serviceAccount'], fromServiceAccount);
14278
+ }
13899
14279
  const fromTunedModelDisplayName = getValueByPath(fromObject, [
13900
14280
  'tunedModelDisplayName',
13901
14281
  ]);
@@ -14611,4 +14991,4 @@ exports.createPartFromUri = createPartFromUri;
14611
14991
  exports.createUserContent = createUserContent;
14612
14992
  exports.mcpToTool = mcpToTool;
14613
14993
  exports.setDefaultBaseUrls = setDefaultBaseUrls;
14614
- //# sourceMappingURL=index.js.map
14994
+ //# sourceMappingURL=index.cjs.map