@google/genai 1.23.0 → 1.24.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.
@@ -3804,6 +3804,17 @@ function getBatchJobParametersToVertex(apiClient, fromObject) {
3804
3804
  }
3805
3805
  return toObject;
3806
3806
  }
3807
+ function googleMapsToMldev$4(fromObject) {
3808
+ const toObject = {};
3809
+ if (getValueByPath(fromObject, ['authConfig']) !== undefined) {
3810
+ throw new Error('authConfig parameter is not supported in Gemini API.');
3811
+ }
3812
+ const fromEnableWidget = getValueByPath(fromObject, ['enableWidget']);
3813
+ if (fromEnableWidget != null) {
3814
+ setValueByPath(toObject, ['enableWidget'], fromEnableWidget);
3815
+ }
3816
+ return toObject;
3817
+ }
3807
3818
  function googleSearchToMldev$4(fromObject) {
3808
3819
  const toObject = {};
3809
3820
  const fromTimeRangeFilter = getValueByPath(fromObject, [
@@ -3833,6 +3844,10 @@ function inlinedRequestToMldev(apiClient, fromObject) {
3833
3844
  }
3834
3845
  setValueByPath(toObject, ['request', 'contents'], transformedList);
3835
3846
  }
3847
+ const fromMetadata = getValueByPath(fromObject, ['metadata']);
3848
+ if (fromMetadata != null) {
3849
+ setValueByPath(toObject, ['metadata'], fromMetadata);
3850
+ }
3836
3851
  const fromConfig = getValueByPath(fromObject, ['config']);
3837
3852
  if (fromConfig != null) {
3838
3853
  setValueByPath(toObject, ['request', 'generationConfig'], generateContentConfigToMldev$1(apiClient, fromConfig, getValueByPath(toObject, ['request'], {})));
@@ -4051,8 +4066,9 @@ function toolToMldev$4(fromObject) {
4051
4066
  if (getValueByPath(fromObject, ['enterpriseWebSearch']) !== undefined) {
4052
4067
  throw new Error('enterpriseWebSearch parameter is not supported in Gemini API.');
4053
4068
  }
4054
- if (getValueByPath(fromObject, ['googleMaps']) !== undefined) {
4055
- throw new Error('googleMaps parameter is not supported in Gemini API.');
4069
+ const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
4070
+ if (fromGoogleMaps != null) {
4071
+ setValueByPath(toObject, ['googleMaps'], googleMapsToMldev$4(fromGoogleMaps));
4056
4072
  }
4057
4073
  const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
4058
4074
  if (fromUrlContext != null) {
@@ -5075,6 +5091,17 @@ function getCachedContentParametersToVertex(apiClient, fromObject) {
5075
5091
  }
5076
5092
  return toObject;
5077
5093
  }
5094
+ function googleMapsToMldev$3(fromObject) {
5095
+ const toObject = {};
5096
+ if (getValueByPath(fromObject, ['authConfig']) !== undefined) {
5097
+ throw new Error('authConfig parameter is not supported in Gemini API.');
5098
+ }
5099
+ const fromEnableWidget = getValueByPath(fromObject, ['enableWidget']);
5100
+ if (fromEnableWidget != null) {
5101
+ setValueByPath(toObject, ['enableWidget'], fromEnableWidget);
5102
+ }
5103
+ return toObject;
5104
+ }
5078
5105
  function googleSearchToMldev$3(fromObject) {
5079
5106
  const toObject = {};
5080
5107
  const fromTimeRangeFilter = getValueByPath(fromObject, [
@@ -5268,8 +5295,9 @@ function toolToMldev$3(fromObject) {
5268
5295
  if (getValueByPath(fromObject, ['enterpriseWebSearch']) !== undefined) {
5269
5296
  throw new Error('enterpriseWebSearch parameter is not supported in Gemini API.');
5270
5297
  }
5271
- if (getValueByPath(fromObject, ['googleMaps']) !== undefined) {
5272
- throw new Error('googleMaps parameter is not supported in Gemini API.');
5298
+ const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
5299
+ if (fromGoogleMaps != null) {
5300
+ setValueByPath(toObject, ['googleMaps'], googleMapsToMldev$3(fromGoogleMaps));
5273
5301
  }
5274
5302
  const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
5275
5303
  if (fromUrlContext != null) {
@@ -6752,6 +6780,17 @@ function generationConfigToVertex$1(fromObject) {
6752
6780
  }
6753
6781
  return toObject;
6754
6782
  }
6783
+ function googleMapsToMldev$2(fromObject) {
6784
+ const toObject = {};
6785
+ if (getValueByPath(fromObject, ['authConfig']) !== undefined) {
6786
+ throw new Error('authConfig parameter is not supported in Gemini API.');
6787
+ }
6788
+ const fromEnableWidget = getValueByPath(fromObject, ['enableWidget']);
6789
+ if (fromEnableWidget != null) {
6790
+ setValueByPath(toObject, ['enableWidget'], fromEnableWidget);
6791
+ }
6792
+ return toObject;
6793
+ }
6755
6794
  function googleSearchToMldev$2(fromObject) {
6756
6795
  const toObject = {};
6757
6796
  const fromTimeRangeFilter = getValueByPath(fromObject, [
@@ -7271,8 +7310,9 @@ function toolToMldev$2(fromObject) {
7271
7310
  if (getValueByPath(fromObject, ['enterpriseWebSearch']) !== undefined) {
7272
7311
  throw new Error('enterpriseWebSearch parameter is not supported in Gemini API.');
7273
7312
  }
7274
- if (getValueByPath(fromObject, ['googleMaps']) !== undefined) {
7275
- throw new Error('googleMaps parameter is not supported in Gemini API.');
7313
+ const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
7314
+ if (fromGoogleMaps != null) {
7315
+ setValueByPath(toObject, ['googleMaps'], googleMapsToMldev$2(fromGoogleMaps));
7276
7316
  }
7277
7317
  const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
7278
7318
  if (fromUrlContext != null) {
@@ -9415,6 +9455,17 @@ function getModelParametersToVertex(apiClient, fromObject) {
9415
9455
  }
9416
9456
  return toObject;
9417
9457
  }
9458
+ function googleMapsToMldev$1(fromObject) {
9459
+ const toObject = {};
9460
+ if (getValueByPath(fromObject, ['authConfig']) !== undefined) {
9461
+ throw new Error('authConfig parameter is not supported in Gemini API.');
9462
+ }
9463
+ const fromEnableWidget = getValueByPath(fromObject, ['enableWidget']);
9464
+ if (fromEnableWidget != null) {
9465
+ setValueByPath(toObject, ['enableWidget'], fromEnableWidget);
9466
+ }
9467
+ return toObject;
9468
+ }
9418
9469
  function googleSearchToMldev$1(fromObject) {
9419
9470
  const toObject = {};
9420
9471
  const fromTimeRangeFilter = getValueByPath(fromObject, [
@@ -10129,8 +10180,9 @@ function toolToMldev$1(fromObject) {
10129
10180
  if (getValueByPath(fromObject, ['enterpriseWebSearch']) !== undefined) {
10130
10181
  throw new Error('enterpriseWebSearch parameter is not supported in Gemini API.');
10131
10182
  }
10132
- if (getValueByPath(fromObject, ['googleMaps']) !== undefined) {
10133
- throw new Error('googleMaps parameter is not supported in Gemini API.');
10183
+ const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
10184
+ if (fromGoogleMaps != null) {
10185
+ setValueByPath(toObject, ['googleMaps'], googleMapsToMldev$1(fromGoogleMaps));
10134
10186
  }
10135
10187
  const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
10136
10188
  if (fromUrlContext != null) {
@@ -10512,7 +10564,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
10512
10564
  const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
10513
10565
  const USER_AGENT_HEADER = 'User-Agent';
10514
10566
  const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
10515
- const SDK_VERSION = '1.23.0'; // x-release-please-version
10567
+ const SDK_VERSION = '1.24.0'; // x-release-please-version
10516
10568
  const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
10517
10569
  const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
10518
10570
  const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';
@@ -13718,6 +13770,17 @@ function fileDataToMldev(fromObject) {
13718
13770
  }
13719
13771
  return toObject;
13720
13772
  }
13773
+ function googleMapsToMldev(fromObject) {
13774
+ const toObject = {};
13775
+ if (getValueByPath(fromObject, ['authConfig']) !== undefined) {
13776
+ throw new Error('authConfig parameter is not supported in Gemini API.');
13777
+ }
13778
+ const fromEnableWidget = getValueByPath(fromObject, ['enableWidget']);
13779
+ if (fromEnableWidget != null) {
13780
+ setValueByPath(toObject, ['enableWidget'], fromEnableWidget);
13781
+ }
13782
+ return toObject;
13783
+ }
13721
13784
  function googleSearchToMldev(fromObject) {
13722
13785
  const toObject = {};
13723
13786
  const fromTimeRangeFilter = getValueByPath(fromObject, [
@@ -13948,8 +14011,9 @@ function toolToMldev(fromObject) {
13948
14011
  if (getValueByPath(fromObject, ['enterpriseWebSearch']) !== undefined) {
13949
14012
  throw new Error('enterpriseWebSearch parameter is not supported in Gemini API.');
13950
14013
  }
13951
- if (getValueByPath(fromObject, ['googleMaps']) !== undefined) {
13952
- throw new Error('googleMaps parameter is not supported in Gemini API.');
14014
+ const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
14015
+ if (fromGoogleMaps != null) {
14016
+ setValueByPath(toObject, ['googleMaps'], googleMapsToMldev(fromGoogleMaps));
13953
14017
  }
13954
14018
  const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
13955
14019
  if (fromUrlContext != null) {
@@ -3782,6 +3782,17 @@ function getBatchJobParametersToVertex(apiClient, fromObject) {
3782
3782
  }
3783
3783
  return toObject;
3784
3784
  }
3785
+ function googleMapsToMldev$4(fromObject) {
3786
+ const toObject = {};
3787
+ if (getValueByPath(fromObject, ['authConfig']) !== undefined) {
3788
+ throw new Error('authConfig parameter is not supported in Gemini API.');
3789
+ }
3790
+ const fromEnableWidget = getValueByPath(fromObject, ['enableWidget']);
3791
+ if (fromEnableWidget != null) {
3792
+ setValueByPath(toObject, ['enableWidget'], fromEnableWidget);
3793
+ }
3794
+ return toObject;
3795
+ }
3785
3796
  function googleSearchToMldev$4(fromObject) {
3786
3797
  const toObject = {};
3787
3798
  const fromTimeRangeFilter = getValueByPath(fromObject, [
@@ -3811,6 +3822,10 @@ function inlinedRequestToMldev(apiClient, fromObject) {
3811
3822
  }
3812
3823
  setValueByPath(toObject, ['request', 'contents'], transformedList);
3813
3824
  }
3825
+ const fromMetadata = getValueByPath(fromObject, ['metadata']);
3826
+ if (fromMetadata != null) {
3827
+ setValueByPath(toObject, ['metadata'], fromMetadata);
3828
+ }
3814
3829
  const fromConfig = getValueByPath(fromObject, ['config']);
3815
3830
  if (fromConfig != null) {
3816
3831
  setValueByPath(toObject, ['request', 'generationConfig'], generateContentConfigToMldev$1(apiClient, fromConfig, getValueByPath(toObject, ['request'], {})));
@@ -4029,8 +4044,9 @@ function toolToMldev$4(fromObject) {
4029
4044
  if (getValueByPath(fromObject, ['enterpriseWebSearch']) !== undefined) {
4030
4045
  throw new Error('enterpriseWebSearch parameter is not supported in Gemini API.');
4031
4046
  }
4032
- if (getValueByPath(fromObject, ['googleMaps']) !== undefined) {
4033
- throw new Error('googleMaps parameter is not supported in Gemini API.');
4047
+ const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
4048
+ if (fromGoogleMaps != null) {
4049
+ setValueByPath(toObject, ['googleMaps'], googleMapsToMldev$4(fromGoogleMaps));
4034
4050
  }
4035
4051
  const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
4036
4052
  if (fromUrlContext != null) {
@@ -5053,6 +5069,17 @@ function getCachedContentParametersToVertex(apiClient, fromObject) {
5053
5069
  }
5054
5070
  return toObject;
5055
5071
  }
5072
+ function googleMapsToMldev$3(fromObject) {
5073
+ const toObject = {};
5074
+ if (getValueByPath(fromObject, ['authConfig']) !== undefined) {
5075
+ throw new Error('authConfig parameter is not supported in Gemini API.');
5076
+ }
5077
+ const fromEnableWidget = getValueByPath(fromObject, ['enableWidget']);
5078
+ if (fromEnableWidget != null) {
5079
+ setValueByPath(toObject, ['enableWidget'], fromEnableWidget);
5080
+ }
5081
+ return toObject;
5082
+ }
5056
5083
  function googleSearchToMldev$3(fromObject) {
5057
5084
  const toObject = {};
5058
5085
  const fromTimeRangeFilter = getValueByPath(fromObject, [
@@ -5246,8 +5273,9 @@ function toolToMldev$3(fromObject) {
5246
5273
  if (getValueByPath(fromObject, ['enterpriseWebSearch']) !== undefined) {
5247
5274
  throw new Error('enterpriseWebSearch parameter is not supported in Gemini API.');
5248
5275
  }
5249
- if (getValueByPath(fromObject, ['googleMaps']) !== undefined) {
5250
- throw new Error('googleMaps parameter is not supported in Gemini API.');
5276
+ const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
5277
+ if (fromGoogleMaps != null) {
5278
+ setValueByPath(toObject, ['googleMaps'], googleMapsToMldev$3(fromGoogleMaps));
5251
5279
  }
5252
5280
  const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
5253
5281
  if (fromUrlContext != null) {
@@ -6730,6 +6758,17 @@ function generationConfigToVertex$1(fromObject) {
6730
6758
  }
6731
6759
  return toObject;
6732
6760
  }
6761
+ function googleMapsToMldev$2(fromObject) {
6762
+ const toObject = {};
6763
+ if (getValueByPath(fromObject, ['authConfig']) !== undefined) {
6764
+ throw new Error('authConfig parameter is not supported in Gemini API.');
6765
+ }
6766
+ const fromEnableWidget = getValueByPath(fromObject, ['enableWidget']);
6767
+ if (fromEnableWidget != null) {
6768
+ setValueByPath(toObject, ['enableWidget'], fromEnableWidget);
6769
+ }
6770
+ return toObject;
6771
+ }
6733
6772
  function googleSearchToMldev$2(fromObject) {
6734
6773
  const toObject = {};
6735
6774
  const fromTimeRangeFilter = getValueByPath(fromObject, [
@@ -7249,8 +7288,9 @@ function toolToMldev$2(fromObject) {
7249
7288
  if (getValueByPath(fromObject, ['enterpriseWebSearch']) !== undefined) {
7250
7289
  throw new Error('enterpriseWebSearch parameter is not supported in Gemini API.');
7251
7290
  }
7252
- if (getValueByPath(fromObject, ['googleMaps']) !== undefined) {
7253
- throw new Error('googleMaps parameter is not supported in Gemini API.');
7291
+ const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
7292
+ if (fromGoogleMaps != null) {
7293
+ setValueByPath(toObject, ['googleMaps'], googleMapsToMldev$2(fromGoogleMaps));
7254
7294
  }
7255
7295
  const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
7256
7296
  if (fromUrlContext != null) {
@@ -9393,6 +9433,17 @@ function getModelParametersToVertex(apiClient, fromObject) {
9393
9433
  }
9394
9434
  return toObject;
9395
9435
  }
9436
+ function googleMapsToMldev$1(fromObject) {
9437
+ const toObject = {};
9438
+ if (getValueByPath(fromObject, ['authConfig']) !== undefined) {
9439
+ throw new Error('authConfig parameter is not supported in Gemini API.');
9440
+ }
9441
+ const fromEnableWidget = getValueByPath(fromObject, ['enableWidget']);
9442
+ if (fromEnableWidget != null) {
9443
+ setValueByPath(toObject, ['enableWidget'], fromEnableWidget);
9444
+ }
9445
+ return toObject;
9446
+ }
9396
9447
  function googleSearchToMldev$1(fromObject) {
9397
9448
  const toObject = {};
9398
9449
  const fromTimeRangeFilter = getValueByPath(fromObject, [
@@ -10107,8 +10158,9 @@ function toolToMldev$1(fromObject) {
10107
10158
  if (getValueByPath(fromObject, ['enterpriseWebSearch']) !== undefined) {
10108
10159
  throw new Error('enterpriseWebSearch parameter is not supported in Gemini API.');
10109
10160
  }
10110
- if (getValueByPath(fromObject, ['googleMaps']) !== undefined) {
10111
- throw new Error('googleMaps parameter is not supported in Gemini API.');
10161
+ const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
10162
+ if (fromGoogleMaps != null) {
10163
+ setValueByPath(toObject, ['googleMaps'], googleMapsToMldev$1(fromGoogleMaps));
10112
10164
  }
10113
10165
  const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
10114
10166
  if (fromUrlContext != null) {
@@ -10490,7 +10542,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
10490
10542
  const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
10491
10543
  const USER_AGENT_HEADER = 'User-Agent';
10492
10544
  const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
10493
- const SDK_VERSION = '1.23.0'; // x-release-please-version
10545
+ const SDK_VERSION = '1.24.0'; // x-release-please-version
10494
10546
  const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
10495
10547
  const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
10496
10548
  const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';
@@ -13696,6 +13748,17 @@ function fileDataToMldev(fromObject) {
13696
13748
  }
13697
13749
  return toObject;
13698
13750
  }
13751
+ function googleMapsToMldev(fromObject) {
13752
+ const toObject = {};
13753
+ if (getValueByPath(fromObject, ['authConfig']) !== undefined) {
13754
+ throw new Error('authConfig parameter is not supported in Gemini API.');
13755
+ }
13756
+ const fromEnableWidget = getValueByPath(fromObject, ['enableWidget']);
13757
+ if (fromEnableWidget != null) {
13758
+ setValueByPath(toObject, ['enableWidget'], fromEnableWidget);
13759
+ }
13760
+ return toObject;
13761
+ }
13699
13762
  function googleSearchToMldev(fromObject) {
13700
13763
  const toObject = {};
13701
13764
  const fromTimeRangeFilter = getValueByPath(fromObject, [
@@ -13926,8 +13989,9 @@ function toolToMldev(fromObject) {
13926
13989
  if (getValueByPath(fromObject, ['enterpriseWebSearch']) !== undefined) {
13927
13990
  throw new Error('enterpriseWebSearch parameter is not supported in Gemini API.');
13928
13991
  }
13929
- if (getValueByPath(fromObject, ['googleMaps']) !== undefined) {
13930
- throw new Error('googleMaps parameter is not supported in Gemini API.');
13992
+ const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
13993
+ if (fromGoogleMaps != null) {
13994
+ setValueByPath(toObject, ['googleMaps'], googleMapsToMldev(fromGoogleMaps));
13931
13995
  }
13932
13996
  const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
13933
13997
  if (fromUrlContext != null) {