@google/genai 1.1.0 → 1.3.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/index.cjs CHANGED
@@ -164,7 +164,6 @@ function getValueByPath(data, keys) {
164
164
  * Copyright 2025 Google LLC
165
165
  * SPDX-License-Identifier: Apache-2.0
166
166
  */
167
- // Code generated by the Google Gen AI SDK generator DO NOT EDIT.
168
167
  /** Required. Outcome of the code execution. */
169
168
  exports.Outcome = void 0;
170
169
  (function (Outcome) {
@@ -400,6 +399,10 @@ exports.FinishReason = void 0;
400
399
  * Token generation stopped because generated images have safety violations.
401
400
  */
402
401
  FinishReason["IMAGE_SAFETY"] = "IMAGE_SAFETY";
402
+ /**
403
+ * The tool call generated by the model is invalid.
404
+ */
405
+ FinishReason["UNEXPECTED_TOOL_CALL"] = "UNEXPECTED_TOOL_CALL";
403
406
  })(exports.FinishReason || (exports.FinishReason = {}));
404
407
  /** Output only. Harm probability levels in the content. */
405
408
  exports.HarmProbability = void 0;
@@ -505,7 +508,7 @@ exports.Modality = void 0;
505
508
  */
506
509
  Modality["IMAGE"] = "IMAGE";
507
510
  /**
508
- * Indicates the model should return images.
511
+ * Indicates the model should return audio.
509
512
  */
510
513
  Modality["AUDIO"] = "AUDIO";
511
514
  })(exports.Modality || (exports.Modality = {}));
@@ -929,24 +932,6 @@ exports.Scale = void 0;
929
932
  */
930
933
  Scale["B_MAJOR_A_FLAT_MINOR"] = "B_MAJOR_A_FLAT_MINOR";
931
934
  })(exports.Scale || (exports.Scale = {}));
932
- /** The mode of music generation. */
933
- exports.MusicGenerationMode = void 0;
934
- (function (MusicGenerationMode) {
935
- /**
936
- * This value is unused.
937
- */
938
- MusicGenerationMode["MUSIC_GENERATION_MODE_UNSPECIFIED"] = "MUSIC_GENERATION_MODE_UNSPECIFIED";
939
- /**
940
- * Steer text prompts to regions of latent space with higher quality
941
- music.
942
- */
943
- MusicGenerationMode["QUALITY"] = "QUALITY";
944
- /**
945
- * Steer text prompts to regions of latent space with a larger diversity
946
- of music.
947
- */
948
- MusicGenerationMode["DIVERSITY"] = "DIVERSITY";
949
- })(exports.MusicGenerationMode || (exports.MusicGenerationMode = {}));
950
935
  /** The playback control signal to apply to the music generation. */
951
936
  exports.LiveMusicPlaybackControl = void 0;
952
937
  (function (LiveMusicPlaybackControl) {
@@ -1411,7 +1396,6 @@ class ReplayResponse {
1411
1396
  */
1412
1397
  class RawReferenceImage {
1413
1398
  /** Internal method to convert to ReferenceImageAPIInternal. */
1414
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1415
1399
  toReferenceImageAPI() {
1416
1400
  const referenceImageAPI = {
1417
1401
  referenceType: 'REFERENCE_TYPE_RAW',
@@ -1433,7 +1417,6 @@ class RawReferenceImage {
1433
1417
  */
1434
1418
  class MaskReferenceImage {
1435
1419
  /** Internal method to convert to ReferenceImageAPIInternal. */
1436
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1437
1420
  toReferenceImageAPI() {
1438
1421
  const referenceImageAPI = {
1439
1422
  referenceType: 'REFERENCE_TYPE_MASK',
@@ -1456,7 +1439,6 @@ class MaskReferenceImage {
1456
1439
  */
1457
1440
  class ControlReferenceImage {
1458
1441
  /** Internal method to convert to ReferenceImageAPIInternal. */
1459
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1460
1442
  toReferenceImageAPI() {
1461
1443
  const referenceImageAPI = {
1462
1444
  referenceType: 'REFERENCE_TYPE_CONTROL',
@@ -1477,7 +1459,6 @@ class ControlReferenceImage {
1477
1459
  */
1478
1460
  class StyleReferenceImage {
1479
1461
  /** Internal method to convert to ReferenceImageAPIInternal. */
1480
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1481
1462
  toReferenceImageAPI() {
1482
1463
  const referenceImageAPI = {
1483
1464
  referenceType: 'REFERENCE_TYPE_STYLE',
@@ -1498,7 +1479,6 @@ class StyleReferenceImage {
1498
1479
  */
1499
1480
  class SubjectReferenceImage {
1500
1481
  /* Internal method to convert to ReferenceImageAPIInternal. */
1501
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1502
1482
  toReferenceImageAPI() {
1503
1483
  const referenceImageAPI = {
1504
1484
  referenceType: 'REFERENCE_TYPE_SUBJECT',
@@ -2413,7 +2393,7 @@ function filterToJsonSchema(schema) {
2413
2393
  * Copyright 2025 Google LLC
2414
2394
  * SPDX-License-Identifier: Apache-2.0
2415
2395
  */
2416
- function videoMetadataToMldev$2(apiClient, fromObject) {
2396
+ function videoMetadataToMldev$3(apiClient, fromObject) {
2417
2397
  const toObject = {};
2418
2398
  const fromFps = getValueByPath(fromObject, ['fps']);
2419
2399
  if (fromFps != null) {
@@ -2429,7 +2409,7 @@ function videoMetadataToMldev$2(apiClient, fromObject) {
2429
2409
  }
2430
2410
  return toObject;
2431
2411
  }
2432
- function blobToMldev$2(apiClient, fromObject) {
2412
+ function blobToMldev$3(apiClient, fromObject) {
2433
2413
  const toObject = {};
2434
2414
  if (getValueByPath(fromObject, ['displayName']) !== undefined) {
2435
2415
  throw new Error('displayName parameter is not supported in Gemini API.');
@@ -2444,7 +2424,7 @@ function blobToMldev$2(apiClient, fromObject) {
2444
2424
  }
2445
2425
  return toObject;
2446
2426
  }
2447
- function fileDataToMldev$2(apiClient, fromObject) {
2427
+ function fileDataToMldev$3(apiClient, fromObject) {
2448
2428
  const toObject = {};
2449
2429
  if (getValueByPath(fromObject, ['displayName']) !== undefined) {
2450
2430
  throw new Error('displayName parameter is not supported in Gemini API.');
@@ -2459,13 +2439,13 @@ function fileDataToMldev$2(apiClient, fromObject) {
2459
2439
  }
2460
2440
  return toObject;
2461
2441
  }
2462
- function partToMldev$2(apiClient, fromObject) {
2442
+ function partToMldev$3(apiClient, fromObject) {
2463
2443
  const toObject = {};
2464
2444
  const fromVideoMetadata = getValueByPath(fromObject, [
2465
2445
  'videoMetadata',
2466
2446
  ]);
2467
2447
  if (fromVideoMetadata != null) {
2468
- setValueByPath(toObject, ['videoMetadata'], videoMetadataToMldev$2(apiClient, fromVideoMetadata));
2448
+ setValueByPath(toObject, ['videoMetadata'], videoMetadataToMldev$3(apiClient, fromVideoMetadata));
2469
2449
  }
2470
2450
  const fromThought = getValueByPath(fromObject, ['thought']);
2471
2451
  if (fromThought != null) {
@@ -2473,11 +2453,17 @@ function partToMldev$2(apiClient, fromObject) {
2473
2453
  }
2474
2454
  const fromInlineData = getValueByPath(fromObject, ['inlineData']);
2475
2455
  if (fromInlineData != null) {
2476
- setValueByPath(toObject, ['inlineData'], blobToMldev$2(apiClient, fromInlineData));
2456
+ setValueByPath(toObject, ['inlineData'], blobToMldev$3(apiClient, fromInlineData));
2477
2457
  }
2478
2458
  const fromFileData = getValueByPath(fromObject, ['fileData']);
2479
2459
  if (fromFileData != null) {
2480
- setValueByPath(toObject, ['fileData'], fileDataToMldev$2(apiClient, fromFileData));
2460
+ setValueByPath(toObject, ['fileData'], fileDataToMldev$3(apiClient, fromFileData));
2461
+ }
2462
+ const fromThoughtSignature = getValueByPath(fromObject, [
2463
+ 'thoughtSignature',
2464
+ ]);
2465
+ if (fromThoughtSignature != null) {
2466
+ setValueByPath(toObject, ['thoughtSignature'], fromThoughtSignature);
2481
2467
  }
2482
2468
  const fromCodeExecutionResult = getValueByPath(fromObject, [
2483
2469
  'codeExecutionResult',
@@ -2507,14 +2493,14 @@ function partToMldev$2(apiClient, fromObject) {
2507
2493
  }
2508
2494
  return toObject;
2509
2495
  }
2510
- function contentToMldev$2(apiClient, fromObject) {
2496
+ function contentToMldev$3(apiClient, fromObject) {
2511
2497
  const toObject = {};
2512
2498
  const fromParts = getValueByPath(fromObject, ['parts']);
2513
2499
  if (fromParts != null) {
2514
2500
  let transformedList = fromParts;
2515
2501
  if (Array.isArray(transformedList)) {
2516
2502
  transformedList = transformedList.map((item) => {
2517
- return partToMldev$2(apiClient, item);
2503
+ return partToMldev$3(apiClient, item);
2518
2504
  });
2519
2505
  }
2520
2506
  setValueByPath(toObject, ['parts'], transformedList);
@@ -2525,7 +2511,7 @@ function contentToMldev$2(apiClient, fromObject) {
2525
2511
  }
2526
2512
  return toObject;
2527
2513
  }
2528
- function functionDeclarationToMldev$2(apiClient, fromObject) {
2514
+ function functionDeclarationToMldev$3(apiClient, fromObject) {
2529
2515
  const toObject = {};
2530
2516
  const fromBehavior = getValueByPath(fromObject, ['behavior']);
2531
2517
  if (fromBehavior != null) {
@@ -2549,7 +2535,7 @@ function functionDeclarationToMldev$2(apiClient, fromObject) {
2549
2535
  }
2550
2536
  return toObject;
2551
2537
  }
2552
- function intervalToMldev$2(apiClient, fromObject) {
2538
+ function intervalToMldev$3(apiClient, fromObject) {
2553
2539
  const toObject = {};
2554
2540
  const fromStartTime = getValueByPath(fromObject, ['startTime']);
2555
2541
  if (fromStartTime != null) {
@@ -2561,17 +2547,17 @@ function intervalToMldev$2(apiClient, fromObject) {
2561
2547
  }
2562
2548
  return toObject;
2563
2549
  }
2564
- function googleSearchToMldev$2(apiClient, fromObject) {
2550
+ function googleSearchToMldev$3(apiClient, fromObject) {
2565
2551
  const toObject = {};
2566
2552
  const fromTimeRangeFilter = getValueByPath(fromObject, [
2567
2553
  'timeRangeFilter',
2568
2554
  ]);
2569
2555
  if (fromTimeRangeFilter != null) {
2570
- setValueByPath(toObject, ['timeRangeFilter'], intervalToMldev$2(apiClient, fromTimeRangeFilter));
2556
+ setValueByPath(toObject, ['timeRangeFilter'], intervalToMldev$3(apiClient, fromTimeRangeFilter));
2571
2557
  }
2572
2558
  return toObject;
2573
2559
  }
2574
- function dynamicRetrievalConfigToMldev$2(apiClient, fromObject) {
2560
+ function dynamicRetrievalConfigToMldev$3(apiClient, fromObject) {
2575
2561
  const toObject = {};
2576
2562
  const fromMode = getValueByPath(fromObject, ['mode']);
2577
2563
  if (fromMode != null) {
@@ -2585,21 +2571,21 @@ function dynamicRetrievalConfigToMldev$2(apiClient, fromObject) {
2585
2571
  }
2586
2572
  return toObject;
2587
2573
  }
2588
- function googleSearchRetrievalToMldev$2(apiClient, fromObject) {
2574
+ function googleSearchRetrievalToMldev$3(apiClient, fromObject) {
2589
2575
  const toObject = {};
2590
2576
  const fromDynamicRetrievalConfig = getValueByPath(fromObject, [
2591
2577
  'dynamicRetrievalConfig',
2592
2578
  ]);
2593
2579
  if (fromDynamicRetrievalConfig != null) {
2594
- setValueByPath(toObject, ['dynamicRetrievalConfig'], dynamicRetrievalConfigToMldev$2(apiClient, fromDynamicRetrievalConfig));
2580
+ setValueByPath(toObject, ['dynamicRetrievalConfig'], dynamicRetrievalConfigToMldev$3(apiClient, fromDynamicRetrievalConfig));
2595
2581
  }
2596
2582
  return toObject;
2597
2583
  }
2598
- function urlContextToMldev$2() {
2584
+ function urlContextToMldev$3() {
2599
2585
  const toObject = {};
2600
2586
  return toObject;
2601
2587
  }
2602
- function toolToMldev$2(apiClient, fromObject) {
2588
+ function toolToMldev$3(apiClient, fromObject) {
2603
2589
  const toObject = {};
2604
2590
  const fromFunctionDeclarations = getValueByPath(fromObject, [
2605
2591
  'functionDeclarations',
@@ -2608,7 +2594,7 @@ function toolToMldev$2(apiClient, fromObject) {
2608
2594
  let transformedList = fromFunctionDeclarations;
2609
2595
  if (Array.isArray(transformedList)) {
2610
2596
  transformedList = transformedList.map((item) => {
2611
- return functionDeclarationToMldev$2(apiClient, item);
2597
+ return functionDeclarationToMldev$3(apiClient, item);
2612
2598
  });
2613
2599
  }
2614
2600
  setValueByPath(toObject, ['functionDeclarations'], transformedList);
@@ -2618,13 +2604,13 @@ function toolToMldev$2(apiClient, fromObject) {
2618
2604
  }
2619
2605
  const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
2620
2606
  if (fromGoogleSearch != null) {
2621
- setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$2(apiClient, fromGoogleSearch));
2607
+ setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$3(apiClient, fromGoogleSearch));
2622
2608
  }
2623
2609
  const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
2624
2610
  'googleSearchRetrieval',
2625
2611
  ]);
2626
2612
  if (fromGoogleSearchRetrieval != null) {
2627
- setValueByPath(toObject, ['googleSearchRetrieval'], googleSearchRetrievalToMldev$2(apiClient, fromGoogleSearchRetrieval));
2613
+ setValueByPath(toObject, ['googleSearchRetrieval'], googleSearchRetrievalToMldev$3(apiClient, fromGoogleSearchRetrieval));
2628
2614
  }
2629
2615
  if (getValueByPath(fromObject, ['enterpriseWebSearch']) !== undefined) {
2630
2616
  throw new Error('enterpriseWebSearch parameter is not supported in Gemini API.');
@@ -2634,7 +2620,7 @@ function toolToMldev$2(apiClient, fromObject) {
2634
2620
  }
2635
2621
  const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
2636
2622
  if (fromUrlContext != null) {
2637
- setValueByPath(toObject, ['urlContext'], urlContextToMldev$2());
2623
+ setValueByPath(toObject, ['urlContext'], urlContextToMldev$3());
2638
2624
  }
2639
2625
  const fromCodeExecution = getValueByPath(fromObject, [
2640
2626
  'codeExecution',
@@ -2717,7 +2703,7 @@ function createCachedContentConfigToMldev(apiClient, fromObject, parentObject) {
2717
2703
  let transformedList = tContents(apiClient, fromContents);
2718
2704
  if (Array.isArray(transformedList)) {
2719
2705
  transformedList = transformedList.map((item) => {
2720
- return contentToMldev$2(apiClient, item);
2706
+ return contentToMldev$3(apiClient, item);
2721
2707
  });
2722
2708
  }
2723
2709
  setValueByPath(parentObject, ['contents'], transformedList);
@@ -2726,14 +2712,14 @@ function createCachedContentConfigToMldev(apiClient, fromObject, parentObject) {
2726
2712
  'systemInstruction',
2727
2713
  ]);
2728
2714
  if (parentObject !== undefined && fromSystemInstruction != null) {
2729
- setValueByPath(parentObject, ['systemInstruction'], contentToMldev$2(apiClient, tContent(apiClient, fromSystemInstruction)));
2715
+ setValueByPath(parentObject, ['systemInstruction'], contentToMldev$3(apiClient, tContent(apiClient, fromSystemInstruction)));
2730
2716
  }
2731
2717
  const fromTools = getValueByPath(fromObject, ['tools']);
2732
2718
  if (parentObject !== undefined && fromTools != null) {
2733
2719
  let transformedList = fromTools;
2734
2720
  if (Array.isArray(transformedList)) {
2735
2721
  transformedList = transformedList.map((item) => {
2736
- return toolToMldev$2(apiClient, item);
2722
+ return toolToMldev$3(apiClient, item);
2737
2723
  });
2738
2724
  }
2739
2725
  setValueByPath(parentObject, ['tools'], transformedList);
@@ -2895,6 +2881,12 @@ function partToVertex$2(apiClient, fromObject) {
2895
2881
  if (fromFileData != null) {
2896
2882
  setValueByPath(toObject, ['fileData'], fileDataToVertex$2(apiClient, fromFileData));
2897
2883
  }
2884
+ const fromThoughtSignature = getValueByPath(fromObject, [
2885
+ 'thoughtSignature',
2886
+ ]);
2887
+ if (fromThoughtSignature != null) {
2888
+ setValueByPath(toObject, ['thoughtSignature'], fromThoughtSignature);
2889
+ }
2898
2890
  const fromCodeExecutionResult = getValueByPath(fromObject, [
2899
2891
  'codeExecutionResult',
2900
2892
  ]);
@@ -4356,7 +4348,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
4356
4348
  const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
4357
4349
  const USER_AGENT_HEADER = 'User-Agent';
4358
4350
  const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
4359
- const SDK_VERSION = '1.1.0'; // x-release-please-version
4351
+ const SDK_VERSION = '1.3.0'; // x-release-please-version
4360
4352
  const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
4361
4353
  const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
4362
4354
  const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';
@@ -5520,7 +5512,7 @@ class Files extends BaseModule {
5520
5512
  * Copyright 2025 Google LLC
5521
5513
  * SPDX-License-Identifier: Apache-2.0
5522
5514
  */
5523
- function prebuiltVoiceConfigToMldev$1(apiClient, fromObject) {
5515
+ function prebuiltVoiceConfigToMldev$2(apiClient, fromObject) {
5524
5516
  const toObject = {};
5525
5517
  const fromVoiceName = getValueByPath(fromObject, ['voiceName']);
5526
5518
  if (fromVoiceName != null) {
@@ -5536,13 +5528,13 @@ function prebuiltVoiceConfigToVertex$1(apiClient, fromObject) {
5536
5528
  }
5537
5529
  return toObject;
5538
5530
  }
5539
- function voiceConfigToMldev$1(apiClient, fromObject) {
5531
+ function voiceConfigToMldev$2(apiClient, fromObject) {
5540
5532
  const toObject = {};
5541
5533
  const fromPrebuiltVoiceConfig = getValueByPath(fromObject, [
5542
5534
  'prebuiltVoiceConfig',
5543
5535
  ]);
5544
5536
  if (fromPrebuiltVoiceConfig != null) {
5545
- setValueByPath(toObject, ['prebuiltVoiceConfig'], prebuiltVoiceConfigToMldev$1(apiClient, fromPrebuiltVoiceConfig));
5537
+ setValueByPath(toObject, ['prebuiltVoiceConfig'], prebuiltVoiceConfigToMldev$2(apiClient, fromPrebuiltVoiceConfig));
5546
5538
  }
5547
5539
  return toObject;
5548
5540
  }
@@ -5556,7 +5548,7 @@ function voiceConfigToVertex$1(apiClient, fromObject) {
5556
5548
  }
5557
5549
  return toObject;
5558
5550
  }
5559
- function speakerVoiceConfigToMldev$1(apiClient, fromObject) {
5551
+ function speakerVoiceConfigToMldev$2(apiClient, fromObject) {
5560
5552
  const toObject = {};
5561
5553
  const fromSpeaker = getValueByPath(fromObject, ['speaker']);
5562
5554
  if (fromSpeaker != null) {
@@ -5564,11 +5556,11 @@ function speakerVoiceConfigToMldev$1(apiClient, fromObject) {
5564
5556
  }
5565
5557
  const fromVoiceConfig = getValueByPath(fromObject, ['voiceConfig']);
5566
5558
  if (fromVoiceConfig != null) {
5567
- setValueByPath(toObject, ['voiceConfig'], voiceConfigToMldev$1(apiClient, fromVoiceConfig));
5559
+ setValueByPath(toObject, ['voiceConfig'], voiceConfigToMldev$2(apiClient, fromVoiceConfig));
5568
5560
  }
5569
5561
  return toObject;
5570
5562
  }
5571
- function multiSpeakerVoiceConfigToMldev$1(apiClient, fromObject) {
5563
+ function multiSpeakerVoiceConfigToMldev$2(apiClient, fromObject) {
5572
5564
  const toObject = {};
5573
5565
  const fromSpeakerVoiceConfigs = getValueByPath(fromObject, [
5574
5566
  'speakerVoiceConfigs',
@@ -5577,24 +5569,24 @@ function multiSpeakerVoiceConfigToMldev$1(apiClient, fromObject) {
5577
5569
  let transformedList = fromSpeakerVoiceConfigs;
5578
5570
  if (Array.isArray(transformedList)) {
5579
5571
  transformedList = transformedList.map((item) => {
5580
- return speakerVoiceConfigToMldev$1(apiClient, item);
5572
+ return speakerVoiceConfigToMldev$2(apiClient, item);
5581
5573
  });
5582
5574
  }
5583
5575
  setValueByPath(toObject, ['speakerVoiceConfigs'], transformedList);
5584
5576
  }
5585
5577
  return toObject;
5586
5578
  }
5587
- function speechConfigToMldev$1(apiClient, fromObject) {
5579
+ function speechConfigToMldev$2(apiClient, fromObject) {
5588
5580
  const toObject = {};
5589
5581
  const fromVoiceConfig = getValueByPath(fromObject, ['voiceConfig']);
5590
5582
  if (fromVoiceConfig != null) {
5591
- setValueByPath(toObject, ['voiceConfig'], voiceConfigToMldev$1(apiClient, fromVoiceConfig));
5583
+ setValueByPath(toObject, ['voiceConfig'], voiceConfigToMldev$2(apiClient, fromVoiceConfig));
5592
5584
  }
5593
5585
  const fromMultiSpeakerVoiceConfig = getValueByPath(fromObject, [
5594
5586
  'multiSpeakerVoiceConfig',
5595
5587
  ]);
5596
5588
  if (fromMultiSpeakerVoiceConfig != null) {
5597
- setValueByPath(toObject, ['multiSpeakerVoiceConfig'], multiSpeakerVoiceConfigToMldev$1(apiClient, fromMultiSpeakerVoiceConfig));
5589
+ setValueByPath(toObject, ['multiSpeakerVoiceConfig'], multiSpeakerVoiceConfigToMldev$2(apiClient, fromMultiSpeakerVoiceConfig));
5598
5590
  }
5599
5591
  const fromLanguageCode = getValueByPath(fromObject, ['languageCode']);
5600
5592
  if (fromLanguageCode != null) {
@@ -5617,7 +5609,7 @@ function speechConfigToVertex$1(apiClient, fromObject) {
5617
5609
  }
5618
5610
  return toObject;
5619
5611
  }
5620
- function videoMetadataToMldev$1(apiClient, fromObject) {
5612
+ function videoMetadataToMldev$2(apiClient, fromObject) {
5621
5613
  const toObject = {};
5622
5614
  const fromFps = getValueByPath(fromObject, ['fps']);
5623
5615
  if (fromFps != null) {
@@ -5649,7 +5641,7 @@ function videoMetadataToVertex$1(apiClient, fromObject) {
5649
5641
  }
5650
5642
  return toObject;
5651
5643
  }
5652
- function blobToMldev$1(apiClient, fromObject) {
5644
+ function blobToMldev$2(apiClient, fromObject) {
5653
5645
  const toObject = {};
5654
5646
  if (getValueByPath(fromObject, ['displayName']) !== undefined) {
5655
5647
  throw new Error('displayName parameter is not supported in Gemini API.');
@@ -5680,7 +5672,7 @@ function blobToVertex$1(apiClient, fromObject) {
5680
5672
  }
5681
5673
  return toObject;
5682
5674
  }
5683
- function fileDataToMldev$1(apiClient, fromObject) {
5675
+ function fileDataToMldev$2(apiClient, fromObject) {
5684
5676
  const toObject = {};
5685
5677
  if (getValueByPath(fromObject, ['displayName']) !== undefined) {
5686
5678
  throw new Error('displayName parameter is not supported in Gemini API.');
@@ -5711,13 +5703,13 @@ function fileDataToVertex$1(apiClient, fromObject) {
5711
5703
  }
5712
5704
  return toObject;
5713
5705
  }
5714
- function partToMldev$1(apiClient, fromObject) {
5706
+ function partToMldev$2(apiClient, fromObject) {
5715
5707
  const toObject = {};
5716
5708
  const fromVideoMetadata = getValueByPath(fromObject, [
5717
5709
  'videoMetadata',
5718
5710
  ]);
5719
5711
  if (fromVideoMetadata != null) {
5720
- setValueByPath(toObject, ['videoMetadata'], videoMetadataToMldev$1(apiClient, fromVideoMetadata));
5712
+ setValueByPath(toObject, ['videoMetadata'], videoMetadataToMldev$2(apiClient, fromVideoMetadata));
5721
5713
  }
5722
5714
  const fromThought = getValueByPath(fromObject, ['thought']);
5723
5715
  if (fromThought != null) {
@@ -5725,11 +5717,17 @@ function partToMldev$1(apiClient, fromObject) {
5725
5717
  }
5726
5718
  const fromInlineData = getValueByPath(fromObject, ['inlineData']);
5727
5719
  if (fromInlineData != null) {
5728
- setValueByPath(toObject, ['inlineData'], blobToMldev$1(apiClient, fromInlineData));
5720
+ setValueByPath(toObject, ['inlineData'], blobToMldev$2(apiClient, fromInlineData));
5729
5721
  }
5730
5722
  const fromFileData = getValueByPath(fromObject, ['fileData']);
5731
5723
  if (fromFileData != null) {
5732
- setValueByPath(toObject, ['fileData'], fileDataToMldev$1(apiClient, fromFileData));
5724
+ setValueByPath(toObject, ['fileData'], fileDataToMldev$2(apiClient, fromFileData));
5725
+ }
5726
+ const fromThoughtSignature = getValueByPath(fromObject, [
5727
+ 'thoughtSignature',
5728
+ ]);
5729
+ if (fromThoughtSignature != null) {
5730
+ setValueByPath(toObject, ['thoughtSignature'], fromThoughtSignature);
5733
5731
  }
5734
5732
  const fromCodeExecutionResult = getValueByPath(fromObject, [
5735
5733
  'codeExecutionResult',
@@ -5779,6 +5777,12 @@ function partToVertex$1(apiClient, fromObject) {
5779
5777
  if (fromFileData != null) {
5780
5778
  setValueByPath(toObject, ['fileData'], fileDataToVertex$1(apiClient, fromFileData));
5781
5779
  }
5780
+ const fromThoughtSignature = getValueByPath(fromObject, [
5781
+ 'thoughtSignature',
5782
+ ]);
5783
+ if (fromThoughtSignature != null) {
5784
+ setValueByPath(toObject, ['thoughtSignature'], fromThoughtSignature);
5785
+ }
5782
5786
  const fromCodeExecutionResult = getValueByPath(fromObject, [
5783
5787
  'codeExecutionResult',
5784
5788
  ]);
@@ -5807,14 +5811,14 @@ function partToVertex$1(apiClient, fromObject) {
5807
5811
  }
5808
5812
  return toObject;
5809
5813
  }
5810
- function contentToMldev$1(apiClient, fromObject) {
5814
+ function contentToMldev$2(apiClient, fromObject) {
5811
5815
  const toObject = {};
5812
5816
  const fromParts = getValueByPath(fromObject, ['parts']);
5813
5817
  if (fromParts != null) {
5814
5818
  let transformedList = fromParts;
5815
5819
  if (Array.isArray(transformedList)) {
5816
5820
  transformedList = transformedList.map((item) => {
5817
- return partToMldev$1(apiClient, item);
5821
+ return partToMldev$2(apiClient, item);
5818
5822
  });
5819
5823
  }
5820
5824
  setValueByPath(toObject, ['parts'], transformedList);
@@ -5843,7 +5847,7 @@ function contentToVertex$1(apiClient, fromObject) {
5843
5847
  }
5844
5848
  return toObject;
5845
5849
  }
5846
- function functionDeclarationToMldev$1(apiClient, fromObject) {
5850
+ function functionDeclarationToMldev$2(apiClient, fromObject) {
5847
5851
  const toObject = {};
5848
5852
  const fromBehavior = getValueByPath(fromObject, ['behavior']);
5849
5853
  if (fromBehavior != null) {
@@ -5890,7 +5894,7 @@ function functionDeclarationToVertex$1(apiClient, fromObject) {
5890
5894
  }
5891
5895
  return toObject;
5892
5896
  }
5893
- function intervalToMldev$1(apiClient, fromObject) {
5897
+ function intervalToMldev$2(apiClient, fromObject) {
5894
5898
  const toObject = {};
5895
5899
  const fromStartTime = getValueByPath(fromObject, ['startTime']);
5896
5900
  if (fromStartTime != null) {
@@ -5914,13 +5918,13 @@ function intervalToVertex$1(apiClient, fromObject) {
5914
5918
  }
5915
5919
  return toObject;
5916
5920
  }
5917
- function googleSearchToMldev$1(apiClient, fromObject) {
5921
+ function googleSearchToMldev$2(apiClient, fromObject) {
5918
5922
  const toObject = {};
5919
5923
  const fromTimeRangeFilter = getValueByPath(fromObject, [
5920
5924
  'timeRangeFilter',
5921
5925
  ]);
5922
5926
  if (fromTimeRangeFilter != null) {
5923
- setValueByPath(toObject, ['timeRangeFilter'], intervalToMldev$1(apiClient, fromTimeRangeFilter));
5927
+ setValueByPath(toObject, ['timeRangeFilter'], intervalToMldev$2(apiClient, fromTimeRangeFilter));
5924
5928
  }
5925
5929
  return toObject;
5926
5930
  }
@@ -5934,7 +5938,7 @@ function googleSearchToVertex$1(apiClient, fromObject) {
5934
5938
  }
5935
5939
  return toObject;
5936
5940
  }
5937
- function dynamicRetrievalConfigToMldev$1(apiClient, fromObject) {
5941
+ function dynamicRetrievalConfigToMldev$2(apiClient, fromObject) {
5938
5942
  const toObject = {};
5939
5943
  const fromMode = getValueByPath(fromObject, ['mode']);
5940
5944
  if (fromMode != null) {
@@ -5962,13 +5966,13 @@ function dynamicRetrievalConfigToVertex$1(apiClient, fromObject) {
5962
5966
  }
5963
5967
  return toObject;
5964
5968
  }
5965
- function googleSearchRetrievalToMldev$1(apiClient, fromObject) {
5969
+ function googleSearchRetrievalToMldev$2(apiClient, fromObject) {
5966
5970
  const toObject = {};
5967
5971
  const fromDynamicRetrievalConfig = getValueByPath(fromObject, [
5968
5972
  'dynamicRetrievalConfig',
5969
5973
  ]);
5970
5974
  if (fromDynamicRetrievalConfig != null) {
5971
- setValueByPath(toObject, ['dynamicRetrievalConfig'], dynamicRetrievalConfigToMldev$1(apiClient, fromDynamicRetrievalConfig));
5975
+ setValueByPath(toObject, ['dynamicRetrievalConfig'], dynamicRetrievalConfigToMldev$2(apiClient, fromDynamicRetrievalConfig));
5972
5976
  }
5973
5977
  return toObject;
5974
5978
  }
@@ -6034,11 +6038,11 @@ function googleMapsToVertex$1(apiClient, fromObject) {
6034
6038
  }
6035
6039
  return toObject;
6036
6040
  }
6037
- function urlContextToMldev$1() {
6041
+ function urlContextToMldev$2() {
6038
6042
  const toObject = {};
6039
6043
  return toObject;
6040
6044
  }
6041
- function toolToMldev$1(apiClient, fromObject) {
6045
+ function toolToMldev$2(apiClient, fromObject) {
6042
6046
  const toObject = {};
6043
6047
  const fromFunctionDeclarations = getValueByPath(fromObject, [
6044
6048
  'functionDeclarations',
@@ -6047,7 +6051,7 @@ function toolToMldev$1(apiClient, fromObject) {
6047
6051
  let transformedList = fromFunctionDeclarations;
6048
6052
  if (Array.isArray(transformedList)) {
6049
6053
  transformedList = transformedList.map((item) => {
6050
- return functionDeclarationToMldev$1(apiClient, item);
6054
+ return functionDeclarationToMldev$2(apiClient, item);
6051
6055
  });
6052
6056
  }
6053
6057
  setValueByPath(toObject, ['functionDeclarations'], transformedList);
@@ -6057,13 +6061,13 @@ function toolToMldev$1(apiClient, fromObject) {
6057
6061
  }
6058
6062
  const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
6059
6063
  if (fromGoogleSearch != null) {
6060
- setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$1(apiClient, fromGoogleSearch));
6064
+ setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$2(apiClient, fromGoogleSearch));
6061
6065
  }
6062
6066
  const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
6063
6067
  'googleSearchRetrieval',
6064
6068
  ]);
6065
6069
  if (fromGoogleSearchRetrieval != null) {
6066
- setValueByPath(toObject, ['googleSearchRetrieval'], googleSearchRetrievalToMldev$1(apiClient, fromGoogleSearchRetrieval));
6070
+ setValueByPath(toObject, ['googleSearchRetrieval'], googleSearchRetrievalToMldev$2(apiClient, fromGoogleSearchRetrieval));
6067
6071
  }
6068
6072
  if (getValueByPath(fromObject, ['enterpriseWebSearch']) !== undefined) {
6069
6073
  throw new Error('enterpriseWebSearch parameter is not supported in Gemini API.');
@@ -6073,7 +6077,7 @@ function toolToMldev$1(apiClient, fromObject) {
6073
6077
  }
6074
6078
  const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
6075
6079
  if (fromUrlContext != null) {
6076
- setValueByPath(toObject, ['urlContext'], urlContextToMldev$1());
6080
+ setValueByPath(toObject, ['urlContext'], urlContextToMldev$2());
6077
6081
  }
6078
6082
  const fromCodeExecution = getValueByPath(fromObject, [
6079
6083
  'codeExecution',
@@ -6132,7 +6136,7 @@ function toolToVertex$1(apiClient, fromObject) {
6132
6136
  }
6133
6137
  return toObject;
6134
6138
  }
6135
- function sessionResumptionConfigToMldev(apiClient, fromObject) {
6139
+ function sessionResumptionConfigToMldev$1(apiClient, fromObject) {
6136
6140
  const toObject = {};
6137
6141
  const fromHandle = getValueByPath(fromObject, ['handle']);
6138
6142
  if (fromHandle != null) {
@@ -6155,7 +6159,7 @@ function sessionResumptionConfigToVertex(apiClient, fromObject) {
6155
6159
  }
6156
6160
  return toObject;
6157
6161
  }
6158
- function audioTranscriptionConfigToMldev() {
6162
+ function audioTranscriptionConfigToMldev$1() {
6159
6163
  const toObject = {};
6160
6164
  return toObject;
6161
6165
  }
@@ -6163,7 +6167,7 @@ function audioTranscriptionConfigToVertex() {
6163
6167
  const toObject = {};
6164
6168
  return toObject;
6165
6169
  }
6166
- function automaticActivityDetectionToMldev(apiClient, fromObject) {
6170
+ function automaticActivityDetectionToMldev$1(apiClient, fromObject) {
6167
6171
  const toObject = {};
6168
6172
  const fromDisabled = getValueByPath(fromObject, ['disabled']);
6169
6173
  if (fromDisabled != null) {
@@ -6227,13 +6231,13 @@ function automaticActivityDetectionToVertex(apiClient, fromObject) {
6227
6231
  }
6228
6232
  return toObject;
6229
6233
  }
6230
- function realtimeInputConfigToMldev(apiClient, fromObject) {
6234
+ function realtimeInputConfigToMldev$1(apiClient, fromObject) {
6231
6235
  const toObject = {};
6232
6236
  const fromAutomaticActivityDetection = getValueByPath(fromObject, [
6233
6237
  'automaticActivityDetection',
6234
6238
  ]);
6235
6239
  if (fromAutomaticActivityDetection != null) {
6236
- setValueByPath(toObject, ['automaticActivityDetection'], automaticActivityDetectionToMldev(apiClient, fromAutomaticActivityDetection));
6240
+ setValueByPath(toObject, ['automaticActivityDetection'], automaticActivityDetectionToMldev$1(apiClient, fromAutomaticActivityDetection));
6237
6241
  }
6238
6242
  const fromActivityHandling = getValueByPath(fromObject, [
6239
6243
  'activityHandling',
@@ -6267,7 +6271,7 @@ function realtimeInputConfigToVertex(apiClient, fromObject) {
6267
6271
  }
6268
6272
  return toObject;
6269
6273
  }
6270
- function slidingWindowToMldev(apiClient, fromObject) {
6274
+ function slidingWindowToMldev$1(apiClient, fromObject) {
6271
6275
  const toObject = {};
6272
6276
  const fromTargetTokens = getValueByPath(fromObject, ['targetTokens']);
6273
6277
  if (fromTargetTokens != null) {
@@ -6283,7 +6287,7 @@ function slidingWindowToVertex(apiClient, fromObject) {
6283
6287
  }
6284
6288
  return toObject;
6285
6289
  }
6286
- function contextWindowCompressionConfigToMldev(apiClient, fromObject) {
6290
+ function contextWindowCompressionConfigToMldev$1(apiClient, fromObject) {
6287
6291
  const toObject = {};
6288
6292
  const fromTriggerTokens = getValueByPath(fromObject, [
6289
6293
  'triggerTokens',
@@ -6295,7 +6299,7 @@ function contextWindowCompressionConfigToMldev(apiClient, fromObject) {
6295
6299
  'slidingWindow',
6296
6300
  ]);
6297
6301
  if (fromSlidingWindow != null) {
6298
- setValueByPath(toObject, ['slidingWindow'], slidingWindowToMldev(apiClient, fromSlidingWindow));
6302
+ setValueByPath(toObject, ['slidingWindow'], slidingWindowToMldev$1(apiClient, fromSlidingWindow));
6299
6303
  }
6300
6304
  return toObject;
6301
6305
  }
@@ -6315,7 +6319,7 @@ function contextWindowCompressionConfigToVertex(apiClient, fromObject) {
6315
6319
  }
6316
6320
  return toObject;
6317
6321
  }
6318
- function proactivityConfigToMldev(apiClient, fromObject) {
6322
+ function proactivityConfigToMldev$1(apiClient, fromObject) {
6319
6323
  const toObject = {};
6320
6324
  const fromProactiveAudio = getValueByPath(fromObject, [
6321
6325
  'proactiveAudio',
@@ -6335,7 +6339,7 @@ function proactivityConfigToVertex(apiClient, fromObject) {
6335
6339
  }
6336
6340
  return toObject;
6337
6341
  }
6338
- function liveConnectConfigToMldev(apiClient, fromObject, parentObject) {
6342
+ function liveConnectConfigToMldev$1(apiClient, fromObject, parentObject) {
6339
6343
  const toObject = {};
6340
6344
  const fromGenerationConfig = getValueByPath(fromObject, [
6341
6345
  'generationConfig',
@@ -6379,7 +6383,7 @@ function liveConnectConfigToMldev(apiClient, fromObject, parentObject) {
6379
6383
  }
6380
6384
  const fromSpeechConfig = getValueByPath(fromObject, ['speechConfig']);
6381
6385
  if (parentObject !== undefined && fromSpeechConfig != null) {
6382
- setValueByPath(parentObject, ['setup', 'generationConfig', 'speechConfig'], speechConfigToMldev$1(apiClient, tLiveSpeechConfig(apiClient, fromSpeechConfig)));
6386
+ setValueByPath(parentObject, ['setup', 'generationConfig', 'speechConfig'], speechConfigToMldev$2(apiClient, tLiveSpeechConfig(apiClient, fromSpeechConfig)));
6383
6387
  }
6384
6388
  const fromEnableAffectiveDialog = getValueByPath(fromObject, [
6385
6389
  'enableAffectiveDialog',
@@ -6391,14 +6395,14 @@ function liveConnectConfigToMldev(apiClient, fromObject, parentObject) {
6391
6395
  'systemInstruction',
6392
6396
  ]);
6393
6397
  if (parentObject !== undefined && fromSystemInstruction != null) {
6394
- setValueByPath(parentObject, ['setup', 'systemInstruction'], contentToMldev$1(apiClient, tContent(apiClient, fromSystemInstruction)));
6398
+ setValueByPath(parentObject, ['setup', 'systemInstruction'], contentToMldev$2(apiClient, tContent(apiClient, fromSystemInstruction)));
6395
6399
  }
6396
6400
  const fromTools = getValueByPath(fromObject, ['tools']);
6397
6401
  if (parentObject !== undefined && fromTools != null) {
6398
6402
  let transformedList = tTools(apiClient, fromTools);
6399
6403
  if (Array.isArray(transformedList)) {
6400
6404
  transformedList = transformedList.map((item) => {
6401
- return toolToMldev$1(apiClient, tTool(apiClient, item));
6405
+ return toolToMldev$2(apiClient, tTool(apiClient, item));
6402
6406
  });
6403
6407
  }
6404
6408
  setValueByPath(parentObject, ['setup', 'tools'], transformedList);
@@ -6407,35 +6411,35 @@ function liveConnectConfigToMldev(apiClient, fromObject, parentObject) {
6407
6411
  'sessionResumption',
6408
6412
  ]);
6409
6413
  if (parentObject !== undefined && fromSessionResumption != null) {
6410
- setValueByPath(parentObject, ['setup', 'sessionResumption'], sessionResumptionConfigToMldev(apiClient, fromSessionResumption));
6414
+ setValueByPath(parentObject, ['setup', 'sessionResumption'], sessionResumptionConfigToMldev$1(apiClient, fromSessionResumption));
6411
6415
  }
6412
6416
  const fromInputAudioTranscription = getValueByPath(fromObject, [
6413
6417
  'inputAudioTranscription',
6414
6418
  ]);
6415
6419
  if (parentObject !== undefined && fromInputAudioTranscription != null) {
6416
- setValueByPath(parentObject, ['setup', 'inputAudioTranscription'], audioTranscriptionConfigToMldev());
6420
+ setValueByPath(parentObject, ['setup', 'inputAudioTranscription'], audioTranscriptionConfigToMldev$1());
6417
6421
  }
6418
6422
  const fromOutputAudioTranscription = getValueByPath(fromObject, [
6419
6423
  'outputAudioTranscription',
6420
6424
  ]);
6421
6425
  if (parentObject !== undefined && fromOutputAudioTranscription != null) {
6422
- setValueByPath(parentObject, ['setup', 'outputAudioTranscription'], audioTranscriptionConfigToMldev());
6426
+ setValueByPath(parentObject, ['setup', 'outputAudioTranscription'], audioTranscriptionConfigToMldev$1());
6423
6427
  }
6424
6428
  const fromRealtimeInputConfig = getValueByPath(fromObject, [
6425
6429
  'realtimeInputConfig',
6426
6430
  ]);
6427
6431
  if (parentObject !== undefined && fromRealtimeInputConfig != null) {
6428
- setValueByPath(parentObject, ['setup', 'realtimeInputConfig'], realtimeInputConfigToMldev(apiClient, fromRealtimeInputConfig));
6432
+ setValueByPath(parentObject, ['setup', 'realtimeInputConfig'], realtimeInputConfigToMldev$1(apiClient, fromRealtimeInputConfig));
6429
6433
  }
6430
6434
  const fromContextWindowCompression = getValueByPath(fromObject, [
6431
6435
  'contextWindowCompression',
6432
6436
  ]);
6433
6437
  if (parentObject !== undefined && fromContextWindowCompression != null) {
6434
- setValueByPath(parentObject, ['setup', 'contextWindowCompression'], contextWindowCompressionConfigToMldev(apiClient, fromContextWindowCompression));
6438
+ setValueByPath(parentObject, ['setup', 'contextWindowCompression'], contextWindowCompressionConfigToMldev$1(apiClient, fromContextWindowCompression));
6435
6439
  }
6436
6440
  const fromProactivity = getValueByPath(fromObject, ['proactivity']);
6437
6441
  if (parentObject !== undefined && fromProactivity != null) {
6438
- setValueByPath(parentObject, ['setup', 'proactivity'], proactivityConfigToMldev(apiClient, fromProactivity));
6442
+ setValueByPath(parentObject, ['setup', 'proactivity'], proactivityConfigToMldev$1(apiClient, fromProactivity));
6439
6443
  }
6440
6444
  return toObject;
6441
6445
  }
@@ -6551,7 +6555,7 @@ function liveConnectParametersToMldev(apiClient, fromObject) {
6551
6555
  }
6552
6556
  const fromConfig = getValueByPath(fromObject, ['config']);
6553
6557
  if (fromConfig != null) {
6554
- setValueByPath(toObject, ['config'], liveConnectConfigToMldev(apiClient, fromConfig, toObject));
6558
+ setValueByPath(toObject, ['config'], liveConnectConfigToMldev$1(apiClient, fromConfig, toObject));
6555
6559
  }
6556
6560
  return toObject;
6557
6561
  }
@@ -6728,12 +6732,6 @@ function liveMusicGenerationConfigToMldev(apiClient, fromObject) {
6728
6732
  if (fromOnlyBassAndDrums != null) {
6729
6733
  setValueByPath(toObject, ['onlyBassAndDrums'], fromOnlyBassAndDrums);
6730
6734
  }
6731
- const fromMusicGenerationMode = getValueByPath(fromObject, [
6732
- 'musicGenerationMode',
6733
- ]);
6734
- if (fromMusicGenerationMode != null) {
6735
- setValueByPath(toObject, ['musicGenerationMode'], fromMusicGenerationMode);
6736
- }
6737
6735
  return toObject;
6738
6736
  }
6739
6737
  function liveMusicSetConfigParametersToMldev(apiClient, fromObject) {
@@ -6912,6 +6910,12 @@ function partFromMldev$1(apiClient, fromObject) {
6912
6910
  if (fromFileData != null) {
6913
6911
  setValueByPath(toObject, ['fileData'], fileDataFromMldev$1(apiClient, fromFileData));
6914
6912
  }
6913
+ const fromThoughtSignature = getValueByPath(fromObject, [
6914
+ 'thoughtSignature',
6915
+ ]);
6916
+ if (fromThoughtSignature != null) {
6917
+ setValueByPath(toObject, ['thoughtSignature'], fromThoughtSignature);
6918
+ }
6915
6919
  const fromCodeExecutionResult = getValueByPath(fromObject, [
6916
6920
  'codeExecutionResult',
6917
6921
  ]);
@@ -6960,6 +6964,12 @@ function partFromVertex$1(apiClient, fromObject) {
6960
6964
  if (fromFileData != null) {
6961
6965
  setValueByPath(toObject, ['fileData'], fileDataFromVertex$1(apiClient, fromFileData));
6962
6966
  }
6967
+ const fromThoughtSignature = getValueByPath(fromObject, [
6968
+ 'thoughtSignature',
6969
+ ]);
6970
+ if (fromThoughtSignature != null) {
6971
+ setValueByPath(toObject, ['thoughtSignature'], fromThoughtSignature);
6972
+ }
6963
6973
  const fromCodeExecutionResult = getValueByPath(fromObject, [
6964
6974
  'codeExecutionResult',
6965
6975
  ]);
@@ -7658,12 +7668,6 @@ function liveMusicGenerationConfigFromMldev(apiClient, fromObject) {
7658
7668
  if (fromOnlyBassAndDrums != null) {
7659
7669
  setValueByPath(toObject, ['onlyBassAndDrums'], fromOnlyBassAndDrums);
7660
7670
  }
7661
- const fromMusicGenerationMode = getValueByPath(fromObject, [
7662
- 'musicGenerationMode',
7663
- ]);
7664
- if (fromMusicGenerationMode != null) {
7665
- setValueByPath(toObject, ['musicGenerationMode'], fromMusicGenerationMode);
7666
- }
7667
7671
  return toObject;
7668
7672
  }
7669
7673
  function liveMusicSourceMetadataFromMldev(apiClient, fromObject) {
@@ -7756,7 +7760,7 @@ function liveMusicServerMessageFromMldev(apiClient, fromObject) {
7756
7760
  * Copyright 2025 Google LLC
7757
7761
  * SPDX-License-Identifier: Apache-2.0
7758
7762
  */
7759
- function videoMetadataToMldev(apiClient, fromObject) {
7763
+ function videoMetadataToMldev$1(apiClient, fromObject) {
7760
7764
  const toObject = {};
7761
7765
  const fromFps = getValueByPath(fromObject, ['fps']);
7762
7766
  if (fromFps != null) {
@@ -7772,7 +7776,7 @@ function videoMetadataToMldev(apiClient, fromObject) {
7772
7776
  }
7773
7777
  return toObject;
7774
7778
  }
7775
- function blobToMldev(apiClient, fromObject) {
7779
+ function blobToMldev$1(apiClient, fromObject) {
7776
7780
  const toObject = {};
7777
7781
  if (getValueByPath(fromObject, ['displayName']) !== undefined) {
7778
7782
  throw new Error('displayName parameter is not supported in Gemini API.');
@@ -7787,7 +7791,7 @@ function blobToMldev(apiClient, fromObject) {
7787
7791
  }
7788
7792
  return toObject;
7789
7793
  }
7790
- function fileDataToMldev(apiClient, fromObject) {
7794
+ function fileDataToMldev$1(apiClient, fromObject) {
7791
7795
  const toObject = {};
7792
7796
  if (getValueByPath(fromObject, ['displayName']) !== undefined) {
7793
7797
  throw new Error('displayName parameter is not supported in Gemini API.');
@@ -7802,13 +7806,13 @@ function fileDataToMldev(apiClient, fromObject) {
7802
7806
  }
7803
7807
  return toObject;
7804
7808
  }
7805
- function partToMldev(apiClient, fromObject) {
7809
+ function partToMldev$1(apiClient, fromObject) {
7806
7810
  const toObject = {};
7807
7811
  const fromVideoMetadata = getValueByPath(fromObject, [
7808
7812
  'videoMetadata',
7809
7813
  ]);
7810
7814
  if (fromVideoMetadata != null) {
7811
- setValueByPath(toObject, ['videoMetadata'], videoMetadataToMldev(apiClient, fromVideoMetadata));
7815
+ setValueByPath(toObject, ['videoMetadata'], videoMetadataToMldev$1(apiClient, fromVideoMetadata));
7812
7816
  }
7813
7817
  const fromThought = getValueByPath(fromObject, ['thought']);
7814
7818
  if (fromThought != null) {
@@ -7816,11 +7820,17 @@ function partToMldev(apiClient, fromObject) {
7816
7820
  }
7817
7821
  const fromInlineData = getValueByPath(fromObject, ['inlineData']);
7818
7822
  if (fromInlineData != null) {
7819
- setValueByPath(toObject, ['inlineData'], blobToMldev(apiClient, fromInlineData));
7823
+ setValueByPath(toObject, ['inlineData'], blobToMldev$1(apiClient, fromInlineData));
7820
7824
  }
7821
7825
  const fromFileData = getValueByPath(fromObject, ['fileData']);
7822
7826
  if (fromFileData != null) {
7823
- setValueByPath(toObject, ['fileData'], fileDataToMldev(apiClient, fromFileData));
7827
+ setValueByPath(toObject, ['fileData'], fileDataToMldev$1(apiClient, fromFileData));
7828
+ }
7829
+ const fromThoughtSignature = getValueByPath(fromObject, [
7830
+ 'thoughtSignature',
7831
+ ]);
7832
+ if (fromThoughtSignature != null) {
7833
+ setValueByPath(toObject, ['thoughtSignature'], fromThoughtSignature);
7824
7834
  }
7825
7835
  const fromCodeExecutionResult = getValueByPath(fromObject, [
7826
7836
  'codeExecutionResult',
@@ -7850,14 +7860,14 @@ function partToMldev(apiClient, fromObject) {
7850
7860
  }
7851
7861
  return toObject;
7852
7862
  }
7853
- function contentToMldev(apiClient, fromObject) {
7863
+ function contentToMldev$1(apiClient, fromObject) {
7854
7864
  const toObject = {};
7855
7865
  const fromParts = getValueByPath(fromObject, ['parts']);
7856
7866
  if (fromParts != null) {
7857
7867
  let transformedList = fromParts;
7858
7868
  if (Array.isArray(transformedList)) {
7859
7869
  transformedList = transformedList.map((item) => {
7860
- return partToMldev(apiClient, item);
7870
+ return partToMldev$1(apiClient, item);
7861
7871
  });
7862
7872
  }
7863
7873
  setValueByPath(toObject, ['parts'], transformedList);
@@ -7981,7 +7991,7 @@ function safetySettingToMldev(apiClient, fromObject) {
7981
7991
  }
7982
7992
  return toObject;
7983
7993
  }
7984
- function functionDeclarationToMldev(apiClient, fromObject) {
7994
+ function functionDeclarationToMldev$1(apiClient, fromObject) {
7985
7995
  const toObject = {};
7986
7996
  const fromBehavior = getValueByPath(fromObject, ['behavior']);
7987
7997
  if (fromBehavior != null) {
@@ -8005,7 +8015,7 @@ function functionDeclarationToMldev(apiClient, fromObject) {
8005
8015
  }
8006
8016
  return toObject;
8007
8017
  }
8008
- function intervalToMldev(apiClient, fromObject) {
8018
+ function intervalToMldev$1(apiClient, fromObject) {
8009
8019
  const toObject = {};
8010
8020
  const fromStartTime = getValueByPath(fromObject, ['startTime']);
8011
8021
  if (fromStartTime != null) {
@@ -8017,17 +8027,17 @@ function intervalToMldev(apiClient, fromObject) {
8017
8027
  }
8018
8028
  return toObject;
8019
8029
  }
8020
- function googleSearchToMldev(apiClient, fromObject) {
8030
+ function googleSearchToMldev$1(apiClient, fromObject) {
8021
8031
  const toObject = {};
8022
8032
  const fromTimeRangeFilter = getValueByPath(fromObject, [
8023
8033
  'timeRangeFilter',
8024
8034
  ]);
8025
8035
  if (fromTimeRangeFilter != null) {
8026
- setValueByPath(toObject, ['timeRangeFilter'], intervalToMldev(apiClient, fromTimeRangeFilter));
8036
+ setValueByPath(toObject, ['timeRangeFilter'], intervalToMldev$1(apiClient, fromTimeRangeFilter));
8027
8037
  }
8028
8038
  return toObject;
8029
8039
  }
8030
- function dynamicRetrievalConfigToMldev(apiClient, fromObject) {
8040
+ function dynamicRetrievalConfigToMldev$1(apiClient, fromObject) {
8031
8041
  const toObject = {};
8032
8042
  const fromMode = getValueByPath(fromObject, ['mode']);
8033
8043
  if (fromMode != null) {
@@ -8041,21 +8051,21 @@ function dynamicRetrievalConfigToMldev(apiClient, fromObject) {
8041
8051
  }
8042
8052
  return toObject;
8043
8053
  }
8044
- function googleSearchRetrievalToMldev(apiClient, fromObject) {
8054
+ function googleSearchRetrievalToMldev$1(apiClient, fromObject) {
8045
8055
  const toObject = {};
8046
8056
  const fromDynamicRetrievalConfig = getValueByPath(fromObject, [
8047
8057
  'dynamicRetrievalConfig',
8048
8058
  ]);
8049
8059
  if (fromDynamicRetrievalConfig != null) {
8050
- setValueByPath(toObject, ['dynamicRetrievalConfig'], dynamicRetrievalConfigToMldev(apiClient, fromDynamicRetrievalConfig));
8060
+ setValueByPath(toObject, ['dynamicRetrievalConfig'], dynamicRetrievalConfigToMldev$1(apiClient, fromDynamicRetrievalConfig));
8051
8061
  }
8052
8062
  return toObject;
8053
8063
  }
8054
- function urlContextToMldev() {
8064
+ function urlContextToMldev$1() {
8055
8065
  const toObject = {};
8056
8066
  return toObject;
8057
8067
  }
8058
- function toolToMldev(apiClient, fromObject) {
8068
+ function toolToMldev$1(apiClient, fromObject) {
8059
8069
  const toObject = {};
8060
8070
  const fromFunctionDeclarations = getValueByPath(fromObject, [
8061
8071
  'functionDeclarations',
@@ -8064,7 +8074,7 @@ function toolToMldev(apiClient, fromObject) {
8064
8074
  let transformedList = fromFunctionDeclarations;
8065
8075
  if (Array.isArray(transformedList)) {
8066
8076
  transformedList = transformedList.map((item) => {
8067
- return functionDeclarationToMldev(apiClient, item);
8077
+ return functionDeclarationToMldev$1(apiClient, item);
8068
8078
  });
8069
8079
  }
8070
8080
  setValueByPath(toObject, ['functionDeclarations'], transformedList);
@@ -8074,13 +8084,13 @@ function toolToMldev(apiClient, fromObject) {
8074
8084
  }
8075
8085
  const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
8076
8086
  if (fromGoogleSearch != null) {
8077
- setValueByPath(toObject, ['googleSearch'], googleSearchToMldev(apiClient, fromGoogleSearch));
8087
+ setValueByPath(toObject, ['googleSearch'], googleSearchToMldev$1(apiClient, fromGoogleSearch));
8078
8088
  }
8079
8089
  const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
8080
8090
  'googleSearchRetrieval',
8081
8091
  ]);
8082
8092
  if (fromGoogleSearchRetrieval != null) {
8083
- setValueByPath(toObject, ['googleSearchRetrieval'], googleSearchRetrievalToMldev(apiClient, fromGoogleSearchRetrieval));
8093
+ setValueByPath(toObject, ['googleSearchRetrieval'], googleSearchRetrievalToMldev$1(apiClient, fromGoogleSearchRetrieval));
8084
8094
  }
8085
8095
  if (getValueByPath(fromObject, ['enterpriseWebSearch']) !== undefined) {
8086
8096
  throw new Error('enterpriseWebSearch parameter is not supported in Gemini API.');
@@ -8090,7 +8100,7 @@ function toolToMldev(apiClient, fromObject) {
8090
8100
  }
8091
8101
  const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
8092
8102
  if (fromUrlContext != null) {
8093
- setValueByPath(toObject, ['urlContext'], urlContextToMldev());
8103
+ setValueByPath(toObject, ['urlContext'], urlContextToMldev$1());
8094
8104
  }
8095
8105
  const fromCodeExecution = getValueByPath(fromObject, [
8096
8106
  'codeExecution',
@@ -8154,7 +8164,7 @@ function toolConfigToMldev(apiClient, fromObject) {
8154
8164
  }
8155
8165
  return toObject;
8156
8166
  }
8157
- function prebuiltVoiceConfigToMldev(apiClient, fromObject) {
8167
+ function prebuiltVoiceConfigToMldev$1(apiClient, fromObject) {
8158
8168
  const toObject = {};
8159
8169
  const fromVoiceName = getValueByPath(fromObject, ['voiceName']);
8160
8170
  if (fromVoiceName != null) {
@@ -8162,17 +8172,17 @@ function prebuiltVoiceConfigToMldev(apiClient, fromObject) {
8162
8172
  }
8163
8173
  return toObject;
8164
8174
  }
8165
- function voiceConfigToMldev(apiClient, fromObject) {
8175
+ function voiceConfigToMldev$1(apiClient, fromObject) {
8166
8176
  const toObject = {};
8167
8177
  const fromPrebuiltVoiceConfig = getValueByPath(fromObject, [
8168
8178
  'prebuiltVoiceConfig',
8169
8179
  ]);
8170
8180
  if (fromPrebuiltVoiceConfig != null) {
8171
- setValueByPath(toObject, ['prebuiltVoiceConfig'], prebuiltVoiceConfigToMldev(apiClient, fromPrebuiltVoiceConfig));
8181
+ setValueByPath(toObject, ['prebuiltVoiceConfig'], prebuiltVoiceConfigToMldev$1(apiClient, fromPrebuiltVoiceConfig));
8172
8182
  }
8173
8183
  return toObject;
8174
8184
  }
8175
- function speakerVoiceConfigToMldev(apiClient, fromObject) {
8185
+ function speakerVoiceConfigToMldev$1(apiClient, fromObject) {
8176
8186
  const toObject = {};
8177
8187
  const fromSpeaker = getValueByPath(fromObject, ['speaker']);
8178
8188
  if (fromSpeaker != null) {
@@ -8180,11 +8190,11 @@ function speakerVoiceConfigToMldev(apiClient, fromObject) {
8180
8190
  }
8181
8191
  const fromVoiceConfig = getValueByPath(fromObject, ['voiceConfig']);
8182
8192
  if (fromVoiceConfig != null) {
8183
- setValueByPath(toObject, ['voiceConfig'], voiceConfigToMldev(apiClient, fromVoiceConfig));
8193
+ setValueByPath(toObject, ['voiceConfig'], voiceConfigToMldev$1(apiClient, fromVoiceConfig));
8184
8194
  }
8185
8195
  return toObject;
8186
8196
  }
8187
- function multiSpeakerVoiceConfigToMldev(apiClient, fromObject) {
8197
+ function multiSpeakerVoiceConfigToMldev$1(apiClient, fromObject) {
8188
8198
  const toObject = {};
8189
8199
  const fromSpeakerVoiceConfigs = getValueByPath(fromObject, [
8190
8200
  'speakerVoiceConfigs',
@@ -8193,24 +8203,24 @@ function multiSpeakerVoiceConfigToMldev(apiClient, fromObject) {
8193
8203
  let transformedList = fromSpeakerVoiceConfigs;
8194
8204
  if (Array.isArray(transformedList)) {
8195
8205
  transformedList = transformedList.map((item) => {
8196
- return speakerVoiceConfigToMldev(apiClient, item);
8206
+ return speakerVoiceConfigToMldev$1(apiClient, item);
8197
8207
  });
8198
8208
  }
8199
8209
  setValueByPath(toObject, ['speakerVoiceConfigs'], transformedList);
8200
8210
  }
8201
8211
  return toObject;
8202
8212
  }
8203
- function speechConfigToMldev(apiClient, fromObject) {
8213
+ function speechConfigToMldev$1(apiClient, fromObject) {
8204
8214
  const toObject = {};
8205
8215
  const fromVoiceConfig = getValueByPath(fromObject, ['voiceConfig']);
8206
8216
  if (fromVoiceConfig != null) {
8207
- setValueByPath(toObject, ['voiceConfig'], voiceConfigToMldev(apiClient, fromVoiceConfig));
8217
+ setValueByPath(toObject, ['voiceConfig'], voiceConfigToMldev$1(apiClient, fromVoiceConfig));
8208
8218
  }
8209
8219
  const fromMultiSpeakerVoiceConfig = getValueByPath(fromObject, [
8210
8220
  'multiSpeakerVoiceConfig',
8211
8221
  ]);
8212
8222
  if (fromMultiSpeakerVoiceConfig != null) {
8213
- setValueByPath(toObject, ['multiSpeakerVoiceConfig'], multiSpeakerVoiceConfigToMldev(apiClient, fromMultiSpeakerVoiceConfig));
8223
+ setValueByPath(toObject, ['multiSpeakerVoiceConfig'], multiSpeakerVoiceConfigToMldev$1(apiClient, fromMultiSpeakerVoiceConfig));
8214
8224
  }
8215
8225
  const fromLanguageCode = getValueByPath(fromObject, ['languageCode']);
8216
8226
  if (fromLanguageCode != null) {
@@ -8240,7 +8250,7 @@ function generateContentConfigToMldev(apiClient, fromObject, parentObject) {
8240
8250
  'systemInstruction',
8241
8251
  ]);
8242
8252
  if (parentObject !== undefined && fromSystemInstruction != null) {
8243
- setValueByPath(parentObject, ['systemInstruction'], contentToMldev(apiClient, tContent(apiClient, fromSystemInstruction)));
8253
+ setValueByPath(parentObject, ['systemInstruction'], contentToMldev$1(apiClient, tContent(apiClient, fromSystemInstruction)));
8244
8254
  }
8245
8255
  const fromTemperature = getValueByPath(fromObject, ['temperature']);
8246
8256
  if (fromTemperature != null) {
@@ -8333,7 +8343,7 @@ function generateContentConfigToMldev(apiClient, fromObject, parentObject) {
8333
8343
  let transformedList = tTools(apiClient, fromTools);
8334
8344
  if (Array.isArray(transformedList)) {
8335
8345
  transformedList = transformedList.map((item) => {
8336
- return toolToMldev(apiClient, tTool(apiClient, item));
8346
+ return toolToMldev$1(apiClient, tTool(apiClient, item));
8337
8347
  });
8338
8348
  }
8339
8349
  setValueByPath(parentObject, ['tools'], transformedList);
@@ -8365,7 +8375,7 @@ function generateContentConfigToMldev(apiClient, fromObject, parentObject) {
8365
8375
  }
8366
8376
  const fromSpeechConfig = getValueByPath(fromObject, ['speechConfig']);
8367
8377
  if (fromSpeechConfig != null) {
8368
- setValueByPath(toObject, ['speechConfig'], speechConfigToMldev(apiClient, tSpeechConfig(apiClient, fromSpeechConfig)));
8378
+ setValueByPath(toObject, ['speechConfig'], speechConfigToMldev$1(apiClient, tSpeechConfig(apiClient, fromSpeechConfig)));
8369
8379
  }
8370
8380
  if (getValueByPath(fromObject, ['audioTimestamp']) !== undefined) {
8371
8381
  throw new Error('audioTimestamp parameter is not supported in Gemini API.');
@@ -8389,7 +8399,7 @@ function generateContentParametersToMldev(apiClient, fromObject) {
8389
8399
  let transformedList = tContents(apiClient, fromContents);
8390
8400
  if (Array.isArray(transformedList)) {
8391
8401
  transformedList = transformedList.map((item) => {
8392
- return contentToMldev(apiClient, item);
8402
+ return contentToMldev$1(apiClient, item);
8393
8403
  });
8394
8404
  }
8395
8405
  setValueByPath(toObject, ['contents'], transformedList);
@@ -8641,7 +8651,7 @@ function countTokensParametersToMldev(apiClient, fromObject) {
8641
8651
  let transformedList = tContents(apiClient, fromContents);
8642
8652
  if (Array.isArray(transformedList)) {
8643
8653
  transformedList = transformedList.map((item) => {
8644
- return contentToMldev(apiClient, item);
8654
+ return contentToMldev$1(apiClient, item);
8645
8655
  });
8646
8656
  }
8647
8657
  setValueByPath(toObject, ['contents'], transformedList);
@@ -8715,6 +8725,9 @@ function generateVideosConfigToMldev(apiClient, fromObject, parentObject) {
8715
8725
  if (getValueByPath(fromObject, ['enhancePrompt']) !== undefined) {
8716
8726
  throw new Error('enhancePrompt parameter is not supported in Gemini API.');
8717
8727
  }
8728
+ if (getValueByPath(fromObject, ['generateAudio']) !== undefined) {
8729
+ throw new Error('generateAudio parameter is not supported in Gemini API.');
8730
+ }
8718
8731
  return toObject;
8719
8732
  }
8720
8733
  function generateVideosParametersToMldev(apiClient, fromObject) {
@@ -8805,6 +8818,12 @@ function partToVertex(apiClient, fromObject) {
8805
8818
  if (fromFileData != null) {
8806
8819
  setValueByPath(toObject, ['fileData'], fileDataToVertex(apiClient, fromFileData));
8807
8820
  }
8821
+ const fromThoughtSignature = getValueByPath(fromObject, [
8822
+ 'thoughtSignature',
8823
+ ]);
8824
+ if (fromThoughtSignature != null) {
8825
+ setValueByPath(toObject, ['thoughtSignature'], fromThoughtSignature);
8826
+ }
8808
8827
  const fromCodeExecutionResult = getValueByPath(fromObject, [
8809
8828
  'codeExecutionResult',
8810
8829
  ]);
@@ -10054,6 +10073,12 @@ function generateVideosConfigToVertex(apiClient, fromObject, parentObject) {
10054
10073
  if (parentObject !== undefined && fromEnhancePrompt != null) {
10055
10074
  setValueByPath(parentObject, ['parameters', 'enhancePrompt'], fromEnhancePrompt);
10056
10075
  }
10076
+ const fromGenerateAudio = getValueByPath(fromObject, [
10077
+ 'generateAudio',
10078
+ ]);
10079
+ if (parentObject !== undefined && fromGenerateAudio != null) {
10080
+ setValueByPath(parentObject, ['parameters', 'generateAudio'], fromGenerateAudio);
10081
+ }
10057
10082
  return toObject;
10058
10083
  }
10059
10084
  function generateVideosParametersToVertex(apiClient, fromObject) {
@@ -10136,6 +10161,12 @@ function partFromMldev(apiClient, fromObject) {
10136
10161
  if (fromFileData != null) {
10137
10162
  setValueByPath(toObject, ['fileData'], fileDataFromMldev(apiClient, fromFileData));
10138
10163
  }
10164
+ const fromThoughtSignature = getValueByPath(fromObject, [
10165
+ 'thoughtSignature',
10166
+ ]);
10167
+ if (fromThoughtSignature != null) {
10168
+ setValueByPath(toObject, ['thoughtSignature'], fromThoughtSignature);
10169
+ }
10139
10170
  const fromCodeExecutionResult = getValueByPath(fromObject, [
10140
10171
  'codeExecutionResult',
10141
10172
  ]);
@@ -10654,6 +10685,12 @@ function partFromVertex(apiClient, fromObject) {
10654
10685
  if (fromFileData != null) {
10655
10686
  setValueByPath(toObject, ['fileData'], fileDataFromVertex(apiClient, fromFileData));
10656
10687
  }
10688
+ const fromThoughtSignature = getValueByPath(fromObject, [
10689
+ 'thoughtSignature',
10690
+ ]);
10691
+ if (fromThoughtSignature != null) {
10692
+ setValueByPath(toObject, ['thoughtSignature'], fromThoughtSignature);
10693
+ }
10657
10694
  const fromCodeExecutionResult = getValueByPath(fromObject, [
10658
10695
  'codeExecutionResult',
10659
10696
  ]);
@@ -11210,9 +11247,6 @@ function hasMcpToolUsage(tools) {
11210
11247
  function setMcpUsageHeader(headers) {
11211
11248
  var _a;
11212
11249
  const existingHeader = (_a = headers[GOOGLE_API_CLIENT_HEADER]) !== null && _a !== void 0 ? _a : '';
11213
- if (existingHeader.includes(MCP_LABEL)) {
11214
- return;
11215
- }
11216
11250
  headers[GOOGLE_API_CLIENT_HEADER] = (existingHeader + ` ${MCP_LABEL}`).trimStart();
11217
11251
  }
11218
11252
  // Checks whether the list of tools contains any MCP clients. Will return true
@@ -11229,11 +11263,9 @@ function hasNonMcpTools(params) {
11229
11263
  }
11230
11264
  // Returns true if the object is a MCP CallableTool, otherwise false.
11231
11265
  function isMcpCallableTool(object) {
11232
- // TODO: b/418266406 - Add a more robust check for the MCP CallableTool.
11233
11266
  return (object !== null &&
11234
11267
  typeof object === 'object' &&
11235
- 'tool' in object &&
11236
- 'callTool' in object);
11268
+ object instanceof McpCallableTool);
11237
11269
  }
11238
11270
  // List all tools from the MCP client.
11239
11271
  function listAllTools(mcpClient, maxTools = 100) {
@@ -11713,7 +11745,14 @@ class Live {
11713
11745
  }
11714
11746
  else {
11715
11747
  const apiKey = this.apiClient.getApiKey();
11716
- url = `${websocketBaseUrl}/ws/google.ai.generativelanguage.${apiVersion}.GenerativeService.BidiGenerateContent?key=${apiKey}`;
11748
+ let method = 'BidiGenerateContent';
11749
+ let keyName = 'key';
11750
+ if (apiKey === null || apiKey === void 0 ? void 0 : apiKey.startsWith('auth_tokens/')) {
11751
+ console.warn('Warning: Ephemeral token support is experimental and may change in future versions.');
11752
+ method = 'BidiGenerateContentConstrained';
11753
+ keyName = 'access_token';
11754
+ }
11755
+ url = `${websocketBaseUrl}/ws/google.ai.generativelanguage.${apiVersion}.GenerativeService.${method}?${keyName}=${apiKey}`;
11717
11756
  }
11718
11757
  let onopenResolve = () => { };
11719
11758
  const onopenPromise = new Promise((resolve) => {
@@ -11819,7 +11858,7 @@ class Session {
11819
11858
  contents = contents.map((item) => contentToVertex(apiClient, item));
11820
11859
  }
11821
11860
  else {
11822
- contents = contents.map((item) => contentToMldev(apiClient, item));
11861
+ contents = contents.map((item) => contentToMldev$1(apiClient, item));
11823
11862
  }
11824
11863
  }
11825
11864
  catch (_a) {
@@ -12117,7 +12156,6 @@ class Models extends BaseModule {
12117
12156
  if (!hasMcpClientTools(params) || shouldDisableAfc(params.config)) {
12118
12157
  return await this.generateContentInternal(transformedParams);
12119
12158
  }
12120
- // TODO: b/418266406 - Improve the check for CallableTools and Tools.
12121
12159
  if (hasNonMcpTools(params)) {
12122
12160
  throw new Error('Automatic function calling with CallableTools and Tools is not yet supported.');
12123
12161
  }
@@ -13672,43 +13710,878 @@ class Operations extends BaseModule {
13672
13710
  * Copyright 2025 Google LLC
13673
13711
  * SPDX-License-Identifier: Apache-2.0
13674
13712
  */
13675
- function getTuningJobParametersToMldev(apiClient, fromObject) {
13713
+ function prebuiltVoiceConfigToMldev(apiClient, fromObject) {
13676
13714
  const toObject = {};
13677
- const fromName = getValueByPath(fromObject, ['name']);
13678
- if (fromName != null) {
13679
- setValueByPath(toObject, ['_url', 'name'], fromName);
13680
- }
13681
- const fromConfig = getValueByPath(fromObject, ['config']);
13682
- if (fromConfig != null) {
13683
- setValueByPath(toObject, ['config'], fromConfig);
13715
+ const fromVoiceName = getValueByPath(fromObject, ['voiceName']);
13716
+ if (fromVoiceName != null) {
13717
+ setValueByPath(toObject, ['voiceName'], fromVoiceName);
13684
13718
  }
13685
13719
  return toObject;
13686
13720
  }
13687
- function listTuningJobsConfigToMldev(apiClient, fromObject, parentObject) {
13721
+ function voiceConfigToMldev(apiClient, fromObject) {
13688
13722
  const toObject = {};
13689
- const fromPageSize = getValueByPath(fromObject, ['pageSize']);
13690
- if (parentObject !== undefined && fromPageSize != null) {
13691
- setValueByPath(parentObject, ['_query', 'pageSize'], fromPageSize);
13723
+ const fromPrebuiltVoiceConfig = getValueByPath(fromObject, [
13724
+ 'prebuiltVoiceConfig',
13725
+ ]);
13726
+ if (fromPrebuiltVoiceConfig != null) {
13727
+ setValueByPath(toObject, ['prebuiltVoiceConfig'], prebuiltVoiceConfigToMldev(apiClient, fromPrebuiltVoiceConfig));
13692
13728
  }
13693
- const fromPageToken = getValueByPath(fromObject, ['pageToken']);
13694
- if (parentObject !== undefined && fromPageToken != null) {
13695
- setValueByPath(parentObject, ['_query', 'pageToken'], fromPageToken);
13729
+ return toObject;
13730
+ }
13731
+ function speakerVoiceConfigToMldev(apiClient, fromObject) {
13732
+ const toObject = {};
13733
+ const fromSpeaker = getValueByPath(fromObject, ['speaker']);
13734
+ if (fromSpeaker != null) {
13735
+ setValueByPath(toObject, ['speaker'], fromSpeaker);
13696
13736
  }
13697
- const fromFilter = getValueByPath(fromObject, ['filter']);
13698
- if (parentObject !== undefined && fromFilter != null) {
13699
- setValueByPath(parentObject, ['_query', 'filter'], fromFilter);
13737
+ const fromVoiceConfig = getValueByPath(fromObject, ['voiceConfig']);
13738
+ if (fromVoiceConfig != null) {
13739
+ setValueByPath(toObject, ['voiceConfig'], voiceConfigToMldev(apiClient, fromVoiceConfig));
13700
13740
  }
13701
13741
  return toObject;
13702
13742
  }
13703
- function listTuningJobsParametersToMldev(apiClient, fromObject) {
13743
+ function multiSpeakerVoiceConfigToMldev(apiClient, fromObject) {
13704
13744
  const toObject = {};
13705
- const fromConfig = getValueByPath(fromObject, ['config']);
13706
- if (fromConfig != null) {
13707
- setValueByPath(toObject, ['config'], listTuningJobsConfigToMldev(apiClient, fromConfig, toObject));
13745
+ const fromSpeakerVoiceConfigs = getValueByPath(fromObject, [
13746
+ 'speakerVoiceConfigs',
13747
+ ]);
13748
+ if (fromSpeakerVoiceConfigs != null) {
13749
+ let transformedList = fromSpeakerVoiceConfigs;
13750
+ if (Array.isArray(transformedList)) {
13751
+ transformedList = transformedList.map((item) => {
13752
+ return speakerVoiceConfigToMldev(apiClient, item);
13753
+ });
13754
+ }
13755
+ setValueByPath(toObject, ['speakerVoiceConfigs'], transformedList);
13708
13756
  }
13709
13757
  return toObject;
13710
13758
  }
13711
- function tuningExampleToMldev(apiClient, fromObject) {
13759
+ function speechConfigToMldev(apiClient, fromObject) {
13760
+ const toObject = {};
13761
+ const fromVoiceConfig = getValueByPath(fromObject, ['voiceConfig']);
13762
+ if (fromVoiceConfig != null) {
13763
+ setValueByPath(toObject, ['voiceConfig'], voiceConfigToMldev(apiClient, fromVoiceConfig));
13764
+ }
13765
+ const fromMultiSpeakerVoiceConfig = getValueByPath(fromObject, [
13766
+ 'multiSpeakerVoiceConfig',
13767
+ ]);
13768
+ if (fromMultiSpeakerVoiceConfig != null) {
13769
+ setValueByPath(toObject, ['multiSpeakerVoiceConfig'], multiSpeakerVoiceConfigToMldev(apiClient, fromMultiSpeakerVoiceConfig));
13770
+ }
13771
+ const fromLanguageCode = getValueByPath(fromObject, ['languageCode']);
13772
+ if (fromLanguageCode != null) {
13773
+ setValueByPath(toObject, ['languageCode'], fromLanguageCode);
13774
+ }
13775
+ return toObject;
13776
+ }
13777
+ function videoMetadataToMldev(apiClient, fromObject) {
13778
+ const toObject = {};
13779
+ const fromFps = getValueByPath(fromObject, ['fps']);
13780
+ if (fromFps != null) {
13781
+ setValueByPath(toObject, ['fps'], fromFps);
13782
+ }
13783
+ const fromEndOffset = getValueByPath(fromObject, ['endOffset']);
13784
+ if (fromEndOffset != null) {
13785
+ setValueByPath(toObject, ['endOffset'], fromEndOffset);
13786
+ }
13787
+ const fromStartOffset = getValueByPath(fromObject, ['startOffset']);
13788
+ if (fromStartOffset != null) {
13789
+ setValueByPath(toObject, ['startOffset'], fromStartOffset);
13790
+ }
13791
+ return toObject;
13792
+ }
13793
+ function blobToMldev(apiClient, fromObject) {
13794
+ const toObject = {};
13795
+ if (getValueByPath(fromObject, ['displayName']) !== undefined) {
13796
+ throw new Error('displayName parameter is not supported in Gemini API.');
13797
+ }
13798
+ const fromData = getValueByPath(fromObject, ['data']);
13799
+ if (fromData != null) {
13800
+ setValueByPath(toObject, ['data'], fromData);
13801
+ }
13802
+ const fromMimeType = getValueByPath(fromObject, ['mimeType']);
13803
+ if (fromMimeType != null) {
13804
+ setValueByPath(toObject, ['mimeType'], fromMimeType);
13805
+ }
13806
+ return toObject;
13807
+ }
13808
+ function fileDataToMldev(apiClient, fromObject) {
13809
+ const toObject = {};
13810
+ if (getValueByPath(fromObject, ['displayName']) !== undefined) {
13811
+ throw new Error('displayName parameter is not supported in Gemini API.');
13812
+ }
13813
+ const fromFileUri = getValueByPath(fromObject, ['fileUri']);
13814
+ if (fromFileUri != null) {
13815
+ setValueByPath(toObject, ['fileUri'], fromFileUri);
13816
+ }
13817
+ const fromMimeType = getValueByPath(fromObject, ['mimeType']);
13818
+ if (fromMimeType != null) {
13819
+ setValueByPath(toObject, ['mimeType'], fromMimeType);
13820
+ }
13821
+ return toObject;
13822
+ }
13823
+ function partToMldev(apiClient, fromObject) {
13824
+ const toObject = {};
13825
+ const fromVideoMetadata = getValueByPath(fromObject, [
13826
+ 'videoMetadata',
13827
+ ]);
13828
+ if (fromVideoMetadata != null) {
13829
+ setValueByPath(toObject, ['videoMetadata'], videoMetadataToMldev(apiClient, fromVideoMetadata));
13830
+ }
13831
+ const fromThought = getValueByPath(fromObject, ['thought']);
13832
+ if (fromThought != null) {
13833
+ setValueByPath(toObject, ['thought'], fromThought);
13834
+ }
13835
+ const fromInlineData = getValueByPath(fromObject, ['inlineData']);
13836
+ if (fromInlineData != null) {
13837
+ setValueByPath(toObject, ['inlineData'], blobToMldev(apiClient, fromInlineData));
13838
+ }
13839
+ const fromFileData = getValueByPath(fromObject, ['fileData']);
13840
+ if (fromFileData != null) {
13841
+ setValueByPath(toObject, ['fileData'], fileDataToMldev(apiClient, fromFileData));
13842
+ }
13843
+ const fromThoughtSignature = getValueByPath(fromObject, [
13844
+ 'thoughtSignature',
13845
+ ]);
13846
+ if (fromThoughtSignature != null) {
13847
+ setValueByPath(toObject, ['thoughtSignature'], fromThoughtSignature);
13848
+ }
13849
+ const fromCodeExecutionResult = getValueByPath(fromObject, [
13850
+ 'codeExecutionResult',
13851
+ ]);
13852
+ if (fromCodeExecutionResult != null) {
13853
+ setValueByPath(toObject, ['codeExecutionResult'], fromCodeExecutionResult);
13854
+ }
13855
+ const fromExecutableCode = getValueByPath(fromObject, [
13856
+ 'executableCode',
13857
+ ]);
13858
+ if (fromExecutableCode != null) {
13859
+ setValueByPath(toObject, ['executableCode'], fromExecutableCode);
13860
+ }
13861
+ const fromFunctionCall = getValueByPath(fromObject, ['functionCall']);
13862
+ if (fromFunctionCall != null) {
13863
+ setValueByPath(toObject, ['functionCall'], fromFunctionCall);
13864
+ }
13865
+ const fromFunctionResponse = getValueByPath(fromObject, [
13866
+ 'functionResponse',
13867
+ ]);
13868
+ if (fromFunctionResponse != null) {
13869
+ setValueByPath(toObject, ['functionResponse'], fromFunctionResponse);
13870
+ }
13871
+ const fromText = getValueByPath(fromObject, ['text']);
13872
+ if (fromText != null) {
13873
+ setValueByPath(toObject, ['text'], fromText);
13874
+ }
13875
+ return toObject;
13876
+ }
13877
+ function contentToMldev(apiClient, fromObject) {
13878
+ const toObject = {};
13879
+ const fromParts = getValueByPath(fromObject, ['parts']);
13880
+ if (fromParts != null) {
13881
+ let transformedList = fromParts;
13882
+ if (Array.isArray(transformedList)) {
13883
+ transformedList = transformedList.map((item) => {
13884
+ return partToMldev(apiClient, item);
13885
+ });
13886
+ }
13887
+ setValueByPath(toObject, ['parts'], transformedList);
13888
+ }
13889
+ const fromRole = getValueByPath(fromObject, ['role']);
13890
+ if (fromRole != null) {
13891
+ setValueByPath(toObject, ['role'], fromRole);
13892
+ }
13893
+ return toObject;
13894
+ }
13895
+ function functionDeclarationToMldev(apiClient, fromObject) {
13896
+ const toObject = {};
13897
+ const fromBehavior = getValueByPath(fromObject, ['behavior']);
13898
+ if (fromBehavior != null) {
13899
+ setValueByPath(toObject, ['behavior'], fromBehavior);
13900
+ }
13901
+ const fromDescription = getValueByPath(fromObject, ['description']);
13902
+ if (fromDescription != null) {
13903
+ setValueByPath(toObject, ['description'], fromDescription);
13904
+ }
13905
+ const fromName = getValueByPath(fromObject, ['name']);
13906
+ if (fromName != null) {
13907
+ setValueByPath(toObject, ['name'], fromName);
13908
+ }
13909
+ const fromParameters = getValueByPath(fromObject, ['parameters']);
13910
+ if (fromParameters != null) {
13911
+ setValueByPath(toObject, ['parameters'], fromParameters);
13912
+ }
13913
+ const fromResponse = getValueByPath(fromObject, ['response']);
13914
+ if (fromResponse != null) {
13915
+ setValueByPath(toObject, ['response'], fromResponse);
13916
+ }
13917
+ return toObject;
13918
+ }
13919
+ function intervalToMldev(apiClient, fromObject) {
13920
+ const toObject = {};
13921
+ const fromStartTime = getValueByPath(fromObject, ['startTime']);
13922
+ if (fromStartTime != null) {
13923
+ setValueByPath(toObject, ['startTime'], fromStartTime);
13924
+ }
13925
+ const fromEndTime = getValueByPath(fromObject, ['endTime']);
13926
+ if (fromEndTime != null) {
13927
+ setValueByPath(toObject, ['endTime'], fromEndTime);
13928
+ }
13929
+ return toObject;
13930
+ }
13931
+ function googleSearchToMldev(apiClient, fromObject) {
13932
+ const toObject = {};
13933
+ const fromTimeRangeFilter = getValueByPath(fromObject, [
13934
+ 'timeRangeFilter',
13935
+ ]);
13936
+ if (fromTimeRangeFilter != null) {
13937
+ setValueByPath(toObject, ['timeRangeFilter'], intervalToMldev(apiClient, fromTimeRangeFilter));
13938
+ }
13939
+ return toObject;
13940
+ }
13941
+ function dynamicRetrievalConfigToMldev(apiClient, fromObject) {
13942
+ const toObject = {};
13943
+ const fromMode = getValueByPath(fromObject, ['mode']);
13944
+ if (fromMode != null) {
13945
+ setValueByPath(toObject, ['mode'], fromMode);
13946
+ }
13947
+ const fromDynamicThreshold = getValueByPath(fromObject, [
13948
+ 'dynamicThreshold',
13949
+ ]);
13950
+ if (fromDynamicThreshold != null) {
13951
+ setValueByPath(toObject, ['dynamicThreshold'], fromDynamicThreshold);
13952
+ }
13953
+ return toObject;
13954
+ }
13955
+ function googleSearchRetrievalToMldev(apiClient, fromObject) {
13956
+ const toObject = {};
13957
+ const fromDynamicRetrievalConfig = getValueByPath(fromObject, [
13958
+ 'dynamicRetrievalConfig',
13959
+ ]);
13960
+ if (fromDynamicRetrievalConfig != null) {
13961
+ setValueByPath(toObject, ['dynamicRetrievalConfig'], dynamicRetrievalConfigToMldev(apiClient, fromDynamicRetrievalConfig));
13962
+ }
13963
+ return toObject;
13964
+ }
13965
+ function urlContextToMldev() {
13966
+ const toObject = {};
13967
+ return toObject;
13968
+ }
13969
+ function toolToMldev(apiClient, fromObject) {
13970
+ const toObject = {};
13971
+ const fromFunctionDeclarations = getValueByPath(fromObject, [
13972
+ 'functionDeclarations',
13973
+ ]);
13974
+ if (fromFunctionDeclarations != null) {
13975
+ let transformedList = fromFunctionDeclarations;
13976
+ if (Array.isArray(transformedList)) {
13977
+ transformedList = transformedList.map((item) => {
13978
+ return functionDeclarationToMldev(apiClient, item);
13979
+ });
13980
+ }
13981
+ setValueByPath(toObject, ['functionDeclarations'], transformedList);
13982
+ }
13983
+ if (getValueByPath(fromObject, ['retrieval']) !== undefined) {
13984
+ throw new Error('retrieval parameter is not supported in Gemini API.');
13985
+ }
13986
+ const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
13987
+ if (fromGoogleSearch != null) {
13988
+ setValueByPath(toObject, ['googleSearch'], googleSearchToMldev(apiClient, fromGoogleSearch));
13989
+ }
13990
+ const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
13991
+ 'googleSearchRetrieval',
13992
+ ]);
13993
+ if (fromGoogleSearchRetrieval != null) {
13994
+ setValueByPath(toObject, ['googleSearchRetrieval'], googleSearchRetrievalToMldev(apiClient, fromGoogleSearchRetrieval));
13995
+ }
13996
+ if (getValueByPath(fromObject, ['enterpriseWebSearch']) !== undefined) {
13997
+ throw new Error('enterpriseWebSearch parameter is not supported in Gemini API.');
13998
+ }
13999
+ if (getValueByPath(fromObject, ['googleMaps']) !== undefined) {
14000
+ throw new Error('googleMaps parameter is not supported in Gemini API.');
14001
+ }
14002
+ const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
14003
+ if (fromUrlContext != null) {
14004
+ setValueByPath(toObject, ['urlContext'], urlContextToMldev());
14005
+ }
14006
+ const fromCodeExecution = getValueByPath(fromObject, [
14007
+ 'codeExecution',
14008
+ ]);
14009
+ if (fromCodeExecution != null) {
14010
+ setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
14011
+ }
14012
+ return toObject;
14013
+ }
14014
+ function sessionResumptionConfigToMldev(apiClient, fromObject) {
14015
+ const toObject = {};
14016
+ const fromHandle = getValueByPath(fromObject, ['handle']);
14017
+ if (fromHandle != null) {
14018
+ setValueByPath(toObject, ['handle'], fromHandle);
14019
+ }
14020
+ if (getValueByPath(fromObject, ['transparent']) !== undefined) {
14021
+ throw new Error('transparent parameter is not supported in Gemini API.');
14022
+ }
14023
+ return toObject;
14024
+ }
14025
+ function audioTranscriptionConfigToMldev() {
14026
+ const toObject = {};
14027
+ return toObject;
14028
+ }
14029
+ function automaticActivityDetectionToMldev(apiClient, fromObject) {
14030
+ const toObject = {};
14031
+ const fromDisabled = getValueByPath(fromObject, ['disabled']);
14032
+ if (fromDisabled != null) {
14033
+ setValueByPath(toObject, ['disabled'], fromDisabled);
14034
+ }
14035
+ const fromStartOfSpeechSensitivity = getValueByPath(fromObject, [
14036
+ 'startOfSpeechSensitivity',
14037
+ ]);
14038
+ if (fromStartOfSpeechSensitivity != null) {
14039
+ setValueByPath(toObject, ['startOfSpeechSensitivity'], fromStartOfSpeechSensitivity);
14040
+ }
14041
+ const fromEndOfSpeechSensitivity = getValueByPath(fromObject, [
14042
+ 'endOfSpeechSensitivity',
14043
+ ]);
14044
+ if (fromEndOfSpeechSensitivity != null) {
14045
+ setValueByPath(toObject, ['endOfSpeechSensitivity'], fromEndOfSpeechSensitivity);
14046
+ }
14047
+ const fromPrefixPaddingMs = getValueByPath(fromObject, [
14048
+ 'prefixPaddingMs',
14049
+ ]);
14050
+ if (fromPrefixPaddingMs != null) {
14051
+ setValueByPath(toObject, ['prefixPaddingMs'], fromPrefixPaddingMs);
14052
+ }
14053
+ const fromSilenceDurationMs = getValueByPath(fromObject, [
14054
+ 'silenceDurationMs',
14055
+ ]);
14056
+ if (fromSilenceDurationMs != null) {
14057
+ setValueByPath(toObject, ['silenceDurationMs'], fromSilenceDurationMs);
14058
+ }
14059
+ return toObject;
14060
+ }
14061
+ function realtimeInputConfigToMldev(apiClient, fromObject) {
14062
+ const toObject = {};
14063
+ const fromAutomaticActivityDetection = getValueByPath(fromObject, [
14064
+ 'automaticActivityDetection',
14065
+ ]);
14066
+ if (fromAutomaticActivityDetection != null) {
14067
+ setValueByPath(toObject, ['automaticActivityDetection'], automaticActivityDetectionToMldev(apiClient, fromAutomaticActivityDetection));
14068
+ }
14069
+ const fromActivityHandling = getValueByPath(fromObject, [
14070
+ 'activityHandling',
14071
+ ]);
14072
+ if (fromActivityHandling != null) {
14073
+ setValueByPath(toObject, ['activityHandling'], fromActivityHandling);
14074
+ }
14075
+ const fromTurnCoverage = getValueByPath(fromObject, ['turnCoverage']);
14076
+ if (fromTurnCoverage != null) {
14077
+ setValueByPath(toObject, ['turnCoverage'], fromTurnCoverage);
14078
+ }
14079
+ return toObject;
14080
+ }
14081
+ function slidingWindowToMldev(apiClient, fromObject) {
14082
+ const toObject = {};
14083
+ const fromTargetTokens = getValueByPath(fromObject, ['targetTokens']);
14084
+ if (fromTargetTokens != null) {
14085
+ setValueByPath(toObject, ['targetTokens'], fromTargetTokens);
14086
+ }
14087
+ return toObject;
14088
+ }
14089
+ function contextWindowCompressionConfigToMldev(apiClient, fromObject) {
14090
+ const toObject = {};
14091
+ const fromTriggerTokens = getValueByPath(fromObject, [
14092
+ 'triggerTokens',
14093
+ ]);
14094
+ if (fromTriggerTokens != null) {
14095
+ setValueByPath(toObject, ['triggerTokens'], fromTriggerTokens);
14096
+ }
14097
+ const fromSlidingWindow = getValueByPath(fromObject, [
14098
+ 'slidingWindow',
14099
+ ]);
14100
+ if (fromSlidingWindow != null) {
14101
+ setValueByPath(toObject, ['slidingWindow'], slidingWindowToMldev(apiClient, fromSlidingWindow));
14102
+ }
14103
+ return toObject;
14104
+ }
14105
+ function proactivityConfigToMldev(apiClient, fromObject) {
14106
+ const toObject = {};
14107
+ const fromProactiveAudio = getValueByPath(fromObject, [
14108
+ 'proactiveAudio',
14109
+ ]);
14110
+ if (fromProactiveAudio != null) {
14111
+ setValueByPath(toObject, ['proactiveAudio'], fromProactiveAudio);
14112
+ }
14113
+ return toObject;
14114
+ }
14115
+ function liveConnectConfigToMldev(apiClient, fromObject, parentObject) {
14116
+ const toObject = {};
14117
+ const fromGenerationConfig = getValueByPath(fromObject, [
14118
+ 'generationConfig',
14119
+ ]);
14120
+ if (parentObject !== undefined && fromGenerationConfig != null) {
14121
+ setValueByPath(parentObject, ['setup', 'generationConfig'], fromGenerationConfig);
14122
+ }
14123
+ const fromResponseModalities = getValueByPath(fromObject, [
14124
+ 'responseModalities',
14125
+ ]);
14126
+ if (parentObject !== undefined && fromResponseModalities != null) {
14127
+ setValueByPath(parentObject, ['setup', 'generationConfig', 'responseModalities'], fromResponseModalities);
14128
+ }
14129
+ const fromTemperature = getValueByPath(fromObject, ['temperature']);
14130
+ if (parentObject !== undefined && fromTemperature != null) {
14131
+ setValueByPath(parentObject, ['setup', 'generationConfig', 'temperature'], fromTemperature);
14132
+ }
14133
+ const fromTopP = getValueByPath(fromObject, ['topP']);
14134
+ if (parentObject !== undefined && fromTopP != null) {
14135
+ setValueByPath(parentObject, ['setup', 'generationConfig', 'topP'], fromTopP);
14136
+ }
14137
+ const fromTopK = getValueByPath(fromObject, ['topK']);
14138
+ if (parentObject !== undefined && fromTopK != null) {
14139
+ setValueByPath(parentObject, ['setup', 'generationConfig', 'topK'], fromTopK);
14140
+ }
14141
+ const fromMaxOutputTokens = getValueByPath(fromObject, [
14142
+ 'maxOutputTokens',
14143
+ ]);
14144
+ if (parentObject !== undefined && fromMaxOutputTokens != null) {
14145
+ setValueByPath(parentObject, ['setup', 'generationConfig', 'maxOutputTokens'], fromMaxOutputTokens);
14146
+ }
14147
+ const fromMediaResolution = getValueByPath(fromObject, [
14148
+ 'mediaResolution',
14149
+ ]);
14150
+ if (parentObject !== undefined && fromMediaResolution != null) {
14151
+ setValueByPath(parentObject, ['setup', 'generationConfig', 'mediaResolution'], fromMediaResolution);
14152
+ }
14153
+ const fromSeed = getValueByPath(fromObject, ['seed']);
14154
+ if (parentObject !== undefined && fromSeed != null) {
14155
+ setValueByPath(parentObject, ['setup', 'generationConfig', 'seed'], fromSeed);
14156
+ }
14157
+ const fromSpeechConfig = getValueByPath(fromObject, ['speechConfig']);
14158
+ if (parentObject !== undefined && fromSpeechConfig != null) {
14159
+ setValueByPath(parentObject, ['setup', 'generationConfig', 'speechConfig'], speechConfigToMldev(apiClient, tLiveSpeechConfig(apiClient, fromSpeechConfig)));
14160
+ }
14161
+ const fromEnableAffectiveDialog = getValueByPath(fromObject, [
14162
+ 'enableAffectiveDialog',
14163
+ ]);
14164
+ if (parentObject !== undefined && fromEnableAffectiveDialog != null) {
14165
+ setValueByPath(parentObject, ['setup', 'generationConfig', 'enableAffectiveDialog'], fromEnableAffectiveDialog);
14166
+ }
14167
+ const fromSystemInstruction = getValueByPath(fromObject, [
14168
+ 'systemInstruction',
14169
+ ]);
14170
+ if (parentObject !== undefined && fromSystemInstruction != null) {
14171
+ setValueByPath(parentObject, ['setup', 'systemInstruction'], contentToMldev(apiClient, tContent(apiClient, fromSystemInstruction)));
14172
+ }
14173
+ const fromTools = getValueByPath(fromObject, ['tools']);
14174
+ if (parentObject !== undefined && fromTools != null) {
14175
+ let transformedList = tTools(apiClient, fromTools);
14176
+ if (Array.isArray(transformedList)) {
14177
+ transformedList = transformedList.map((item) => {
14178
+ return toolToMldev(apiClient, tTool(apiClient, item));
14179
+ });
14180
+ }
14181
+ setValueByPath(parentObject, ['setup', 'tools'], transformedList);
14182
+ }
14183
+ const fromSessionResumption = getValueByPath(fromObject, [
14184
+ 'sessionResumption',
14185
+ ]);
14186
+ if (parentObject !== undefined && fromSessionResumption != null) {
14187
+ setValueByPath(parentObject, ['setup', 'sessionResumption'], sessionResumptionConfigToMldev(apiClient, fromSessionResumption));
14188
+ }
14189
+ const fromInputAudioTranscription = getValueByPath(fromObject, [
14190
+ 'inputAudioTranscription',
14191
+ ]);
14192
+ if (parentObject !== undefined && fromInputAudioTranscription != null) {
14193
+ setValueByPath(parentObject, ['setup', 'inputAudioTranscription'], audioTranscriptionConfigToMldev());
14194
+ }
14195
+ const fromOutputAudioTranscription = getValueByPath(fromObject, [
14196
+ 'outputAudioTranscription',
14197
+ ]);
14198
+ if (parentObject !== undefined && fromOutputAudioTranscription != null) {
14199
+ setValueByPath(parentObject, ['setup', 'outputAudioTranscription'], audioTranscriptionConfigToMldev());
14200
+ }
14201
+ const fromRealtimeInputConfig = getValueByPath(fromObject, [
14202
+ 'realtimeInputConfig',
14203
+ ]);
14204
+ if (parentObject !== undefined && fromRealtimeInputConfig != null) {
14205
+ setValueByPath(parentObject, ['setup', 'realtimeInputConfig'], realtimeInputConfigToMldev(apiClient, fromRealtimeInputConfig));
14206
+ }
14207
+ const fromContextWindowCompression = getValueByPath(fromObject, [
14208
+ 'contextWindowCompression',
14209
+ ]);
14210
+ if (parentObject !== undefined && fromContextWindowCompression != null) {
14211
+ setValueByPath(parentObject, ['setup', 'contextWindowCompression'], contextWindowCompressionConfigToMldev(apiClient, fromContextWindowCompression));
14212
+ }
14213
+ const fromProactivity = getValueByPath(fromObject, ['proactivity']);
14214
+ if (parentObject !== undefined && fromProactivity != null) {
14215
+ setValueByPath(parentObject, ['setup', 'proactivity'], proactivityConfigToMldev(apiClient, fromProactivity));
14216
+ }
14217
+ return toObject;
14218
+ }
14219
+ function liveConnectConstraintsToMldev(apiClient, fromObject) {
14220
+ const toObject = {};
14221
+ const fromModel = getValueByPath(fromObject, ['model']);
14222
+ if (fromModel != null) {
14223
+ setValueByPath(toObject, ['setup', 'model'], tModel(apiClient, fromModel));
14224
+ }
14225
+ const fromConfig = getValueByPath(fromObject, ['config']);
14226
+ if (fromConfig != null) {
14227
+ setValueByPath(toObject, ['config'], liveConnectConfigToMldev(apiClient, fromConfig, toObject));
14228
+ }
14229
+ return toObject;
14230
+ }
14231
+ function createAuthTokenConfigToMldev(apiClient, fromObject, parentObject) {
14232
+ const toObject = {};
14233
+ const fromExpireTime = getValueByPath(fromObject, ['expireTime']);
14234
+ if (parentObject !== undefined && fromExpireTime != null) {
14235
+ setValueByPath(parentObject, ['expireTime'], fromExpireTime);
14236
+ }
14237
+ const fromNewSessionExpireTime = getValueByPath(fromObject, [
14238
+ 'newSessionExpireTime',
14239
+ ]);
14240
+ if (parentObject !== undefined && fromNewSessionExpireTime != null) {
14241
+ setValueByPath(parentObject, ['newSessionExpireTime'], fromNewSessionExpireTime);
14242
+ }
14243
+ const fromUses = getValueByPath(fromObject, ['uses']);
14244
+ if (parentObject !== undefined && fromUses != null) {
14245
+ setValueByPath(parentObject, ['uses'], fromUses);
14246
+ }
14247
+ const fromLiveConnectConstraints = getValueByPath(fromObject, [
14248
+ 'liveConnectConstraints',
14249
+ ]);
14250
+ if (parentObject !== undefined && fromLiveConnectConstraints != null) {
14251
+ setValueByPath(parentObject, ['bidiGenerateContentSetup'], liveConnectConstraintsToMldev(apiClient, fromLiveConnectConstraints));
14252
+ }
14253
+ const fromLockAdditionalFields = getValueByPath(fromObject, [
14254
+ 'lockAdditionalFields',
14255
+ ]);
14256
+ if (parentObject !== undefined && fromLockAdditionalFields != null) {
14257
+ setValueByPath(parentObject, ['fieldMask'], fromLockAdditionalFields);
14258
+ }
14259
+ return toObject;
14260
+ }
14261
+ function createAuthTokenParametersToMldev(apiClient, fromObject) {
14262
+ const toObject = {};
14263
+ const fromConfig = getValueByPath(fromObject, ['config']);
14264
+ if (fromConfig != null) {
14265
+ setValueByPath(toObject, ['config'], createAuthTokenConfigToMldev(apiClient, fromConfig, toObject));
14266
+ }
14267
+ return toObject;
14268
+ }
14269
+ function authTokenFromMldev(apiClient, fromObject) {
14270
+ const toObject = {};
14271
+ const fromName = getValueByPath(fromObject, ['name']);
14272
+ if (fromName != null) {
14273
+ setValueByPath(toObject, ['name'], fromName);
14274
+ }
14275
+ return toObject;
14276
+ }
14277
+
14278
+ /**
14279
+ * @license
14280
+ * Copyright 2025 Google LLC
14281
+ * SPDX-License-Identifier: Apache-2.0
14282
+ */
14283
+ /**
14284
+ * Returns a comma-separated list of field masks from a given object.
14285
+ *
14286
+ * @param setup The object to extract field masks from.
14287
+ * @return A comma-separated list of field masks.
14288
+ */
14289
+ function getFieldMasks(setup) {
14290
+ const fields = [];
14291
+ for (const key in setup) {
14292
+ if (Object.prototype.hasOwnProperty.call(setup, key)) {
14293
+ const value = setup[key];
14294
+ // 2nd layer, recursively get field masks see TODO(b/418290100)
14295
+ if (typeof value === 'object' &&
14296
+ value != null &&
14297
+ Object.keys(value).length > 0) {
14298
+ const field = Object.keys(value).map((kk) => `${key}.${kk}`);
14299
+ fields.push(...field);
14300
+ }
14301
+ else {
14302
+ fields.push(key); // 1st layer
14303
+ }
14304
+ }
14305
+ }
14306
+ return fields.join(',');
14307
+ }
14308
+ /**
14309
+ * Converts bidiGenerateContentSetup.
14310
+ * @param requestDict - The request dictionary.
14311
+ * @param config - The configuration object.
14312
+ * @return - The modified request dictionary.
14313
+ */
14314
+ function convertBidiSetupToTokenSetup(requestDict, config) {
14315
+ // Convert bidiGenerateContentSetup from bidiGenerateContentSetup.setup.
14316
+ let setupForMaskGeneration = null;
14317
+ const bidiGenerateContentSetupValue = requestDict['bidiGenerateContentSetup'];
14318
+ if (typeof bidiGenerateContentSetupValue === 'object' &&
14319
+ bidiGenerateContentSetupValue !== null &&
14320
+ 'setup' in bidiGenerateContentSetupValue) {
14321
+ // Now we know bidiGenerateContentSetupValue is an object and has a 'setup'
14322
+ // property.
14323
+ const innerSetup = bidiGenerateContentSetupValue
14324
+ .setup;
14325
+ if (typeof innerSetup === 'object' && innerSetup !== null) {
14326
+ // Valid inner setup found.
14327
+ requestDict['bidiGenerateContentSetup'] = innerSetup;
14328
+ setupForMaskGeneration = innerSetup;
14329
+ }
14330
+ else {
14331
+ // `bidiGenerateContentSetupValue.setup` is not a valid object; treat as
14332
+ // if bidiGenerateContentSetup is invalid.
14333
+ delete requestDict['bidiGenerateContentSetup'];
14334
+ }
14335
+ }
14336
+ else if (bidiGenerateContentSetupValue !== undefined) {
14337
+ // `bidiGenerateContentSetup` exists but not in the expected
14338
+ // shape {setup: {...}}; treat as invalid.
14339
+ delete requestDict['bidiGenerateContentSetup'];
14340
+ }
14341
+ const preExistingFieldMask = requestDict['fieldMask'];
14342
+ // Handle mask generation setup.
14343
+ if (setupForMaskGeneration) {
14344
+ const generatedMaskFromBidi = getFieldMasks(setupForMaskGeneration);
14345
+ if (Array.isArray(config === null || config === void 0 ? void 0 : config.lockAdditionalFields) &&
14346
+ (config === null || config === void 0 ? void 0 : config.lockAdditionalFields.length) === 0) {
14347
+ // Case 1: lockAdditionalFields is an empty array. Lock only fields from
14348
+ // bidi setup.
14349
+ if (generatedMaskFromBidi) {
14350
+ // Only assign if mask is not empty
14351
+ requestDict['fieldMask'] = generatedMaskFromBidi;
14352
+ }
14353
+ else {
14354
+ delete requestDict['fieldMask']; // If mask is empty, effectively no
14355
+ // specific fields locked by bidi
14356
+ }
14357
+ }
14358
+ else if ((config === null || config === void 0 ? void 0 : config.lockAdditionalFields) &&
14359
+ config.lockAdditionalFields.length > 0 &&
14360
+ preExistingFieldMask !== null &&
14361
+ Array.isArray(preExistingFieldMask) &&
14362
+ preExistingFieldMask.length > 0) {
14363
+ // Case 2: Lock fields from bidi setup + additional fields
14364
+ // (preExistingFieldMask).
14365
+ const generationConfigFields = [
14366
+ 'temperature',
14367
+ 'topK',
14368
+ 'topP',
14369
+ 'maxOutputTokens',
14370
+ 'responseModalities',
14371
+ 'seed',
14372
+ 'speechConfig',
14373
+ ];
14374
+ let mappedFieldsFromPreExisting = [];
14375
+ if (preExistingFieldMask.length > 0) {
14376
+ mappedFieldsFromPreExisting = preExistingFieldMask.map((field) => {
14377
+ if (generationConfigFields.includes(field)) {
14378
+ return `generationConfig.${field}`;
14379
+ }
14380
+ return field; // Keep original field name if not in
14381
+ // generationConfigFields
14382
+ });
14383
+ }
14384
+ const finalMaskParts = [];
14385
+ if (generatedMaskFromBidi) {
14386
+ finalMaskParts.push(generatedMaskFromBidi);
14387
+ }
14388
+ if (mappedFieldsFromPreExisting.length > 0) {
14389
+ finalMaskParts.push(...mappedFieldsFromPreExisting);
14390
+ }
14391
+ if (finalMaskParts.length > 0) {
14392
+ requestDict['fieldMask'] = finalMaskParts.join(',');
14393
+ }
14394
+ else {
14395
+ // If no fields from bidi and no valid additional fields from
14396
+ // pre-existing mask.
14397
+ delete requestDict['fieldMask'];
14398
+ }
14399
+ }
14400
+ else {
14401
+ // Case 3: "Lock all fields" (meaning, don't send a field_mask, let server
14402
+ // defaults apply or all are mutable). This is hit if:
14403
+ // - `config.lockAdditionalFields` is undefined.
14404
+ // - `config.lockAdditionalFields` is non-empty, BUT
14405
+ // `preExistingFieldMask` is null, not a string, or an empty string.
14406
+ delete requestDict['fieldMask'];
14407
+ }
14408
+ }
14409
+ else {
14410
+ // No valid `bidiGenerateContentSetup` was found or extracted.
14411
+ // "Lock additional null fields if any".
14412
+ if (preExistingFieldMask !== null &&
14413
+ Array.isArray(preExistingFieldMask) &&
14414
+ preExistingFieldMask.length > 0) {
14415
+ // If there's a pre-existing field mask, it's a string, and it's not
14416
+ // empty, then we should lock all fields.
14417
+ requestDict['fieldMask'] = preExistingFieldMask.join(',');
14418
+ }
14419
+ else {
14420
+ delete requestDict['fieldMask'];
14421
+ }
14422
+ }
14423
+ return requestDict;
14424
+ }
14425
+ class Tokens extends BaseModule {
14426
+ constructor(apiClient) {
14427
+ super();
14428
+ this.apiClient = apiClient;
14429
+ }
14430
+ /**
14431
+ * Creates an ephemeral auth token resource.
14432
+ *
14433
+ * @experimental
14434
+ *
14435
+ * @remarks
14436
+ * Ephermeral auth tokens is only supported in the Gemini Developer API.
14437
+ * It can be used for the session connection to the Live constrained API.
14438
+ *
14439
+ * @param params - The parameters for the create request.
14440
+ * @return The created auth token.
14441
+ *
14442
+ * @example
14443
+ * ```ts
14444
+ * // Case 1: If LiveEphemeralParameters is unset, unlock LiveConnectConfig
14445
+ * // when using the token in Live API sessions. Each session connection can
14446
+ * // use a different configuration.
14447
+ * const config: CreateAuthTokenConfig = {
14448
+ * uses: 3,
14449
+ * expireTime: '2025-05-01T00:00:00Z',
14450
+ * }
14451
+ * const token = await ai.tokens.create(config);
14452
+ *
14453
+ * // Case 2: If LiveEphemeralParameters is set, lock all fields in
14454
+ * // LiveConnectConfig when using the token in Live API sessions. For
14455
+ * // example, changing `outputAudioTranscription` in the Live API
14456
+ * // connection will be ignored by the API.
14457
+ * const config: CreateAuthTokenConfig =
14458
+ * uses: 3,
14459
+ * expireTime: '2025-05-01T00:00:00Z',
14460
+ * LiveEphemeralParameters: {
14461
+ * model: 'gemini-2.0-flash-001',
14462
+ * config: {
14463
+ * 'responseModalities': ['AUDIO'],
14464
+ * 'systemInstruction': 'Always answer in English.',
14465
+ * }
14466
+ * }
14467
+ * }
14468
+ * const token = await ai.tokens.create(config);
14469
+ *
14470
+ * // Case 3: If LiveEphemeralParameters is set and lockAdditionalFields is
14471
+ * // set, lock LiveConnectConfig with set and additional fields (e.g.
14472
+ * // responseModalities, systemInstruction, temperature in this example) when
14473
+ * // using the token in Live API sessions.
14474
+ * const config: CreateAuthTokenConfig =
14475
+ * uses: 3,
14476
+ * expireTime: '2025-05-01T00:00:00Z',
14477
+ * LiveEphemeralParameters: {
14478
+ * model: 'gemini-2.0-flash-001',
14479
+ * config: {
14480
+ * 'responseModalities': ['AUDIO'],
14481
+ * 'systemInstruction': 'Always answer in English.',
14482
+ * }
14483
+ * },
14484
+ * lockAdditionalFields: ['temperature'],
14485
+ * }
14486
+ * const token = await ai.tokens.create(config);
14487
+ *
14488
+ * // Case 4: If LiveEphemeralParameters is set and lockAdditionalFields is
14489
+ * // empty array, lock LiveConnectConfig with set fields (e.g.
14490
+ * // responseModalities, systemInstruction in this example) when using the
14491
+ * // token in Live API sessions.
14492
+ * const config: CreateAuthTokenConfig =
14493
+ * uses: 3,
14494
+ * expireTime: '2025-05-01T00:00:00Z',
14495
+ * LiveEphemeralParameters: {
14496
+ * model: 'gemini-2.0-flash-001',
14497
+ * config: {
14498
+ * 'responseModalities': ['AUDIO'],
14499
+ * 'systemInstruction': 'Always answer in English.',
14500
+ * }
14501
+ * },
14502
+ * lockAdditionalFields: [],
14503
+ * }
14504
+ * const token = await ai.tokens.create(config);
14505
+ * ```
14506
+ */
14507
+ async create(params) {
14508
+ var _a, _b;
14509
+ let response;
14510
+ let path = '';
14511
+ let queryParams = {};
14512
+ if (this.apiClient.isVertexAI()) {
14513
+ throw new Error('The client.tokens.create method is only supported by the Gemini Developer API.');
14514
+ }
14515
+ else {
14516
+ const body = createAuthTokenParametersToMldev(this.apiClient, params);
14517
+ path = formatMap('auth_tokens', body['_url']);
14518
+ queryParams = body['_query'];
14519
+ delete body['config'];
14520
+ delete body['_url'];
14521
+ delete body['_query'];
14522
+ const transformedBody = convertBidiSetupToTokenSetup(body, params.config);
14523
+ response = this.apiClient
14524
+ .request({
14525
+ path: path,
14526
+ queryParams: queryParams,
14527
+ body: JSON.stringify(transformedBody),
14528
+ httpMethod: 'POST',
14529
+ httpOptions: (_a = params.config) === null || _a === void 0 ? void 0 : _a.httpOptions,
14530
+ abortSignal: (_b = params.config) === null || _b === void 0 ? void 0 : _b.abortSignal,
14531
+ })
14532
+ .then((httpResponse) => {
14533
+ return httpResponse.json();
14534
+ });
14535
+ return response.then((apiResponse) => {
14536
+ const resp = authTokenFromMldev(this.apiClient, apiResponse);
14537
+ return resp;
14538
+ });
14539
+ }
14540
+ }
14541
+ }
14542
+
14543
+ /**
14544
+ * @license
14545
+ * Copyright 2025 Google LLC
14546
+ * SPDX-License-Identifier: Apache-2.0
14547
+ */
14548
+ function getTuningJobParametersToMldev(apiClient, fromObject) {
14549
+ const toObject = {};
14550
+ const fromName = getValueByPath(fromObject, ['name']);
14551
+ if (fromName != null) {
14552
+ setValueByPath(toObject, ['_url', 'name'], fromName);
14553
+ }
14554
+ const fromConfig = getValueByPath(fromObject, ['config']);
14555
+ if (fromConfig != null) {
14556
+ setValueByPath(toObject, ['config'], fromConfig);
14557
+ }
14558
+ return toObject;
14559
+ }
14560
+ function listTuningJobsConfigToMldev(apiClient, fromObject, parentObject) {
14561
+ const toObject = {};
14562
+ const fromPageSize = getValueByPath(fromObject, ['pageSize']);
14563
+ if (parentObject !== undefined && fromPageSize != null) {
14564
+ setValueByPath(parentObject, ['_query', 'pageSize'], fromPageSize);
14565
+ }
14566
+ const fromPageToken = getValueByPath(fromObject, ['pageToken']);
14567
+ if (parentObject !== undefined && fromPageToken != null) {
14568
+ setValueByPath(parentObject, ['_query', 'pageToken'], fromPageToken);
14569
+ }
14570
+ const fromFilter = getValueByPath(fromObject, ['filter']);
14571
+ if (parentObject !== undefined && fromFilter != null) {
14572
+ setValueByPath(parentObject, ['_query', 'filter'], fromFilter);
14573
+ }
14574
+ return toObject;
14575
+ }
14576
+ function listTuningJobsParametersToMldev(apiClient, fromObject) {
14577
+ const toObject = {};
14578
+ const fromConfig = getValueByPath(fromObject, ['config']);
14579
+ if (fromConfig != null) {
14580
+ setValueByPath(toObject, ['config'], listTuningJobsConfigToMldev(apiClient, fromConfig, toObject));
14581
+ }
14582
+ return toObject;
14583
+ }
14584
+ function tuningExampleToMldev(apiClient, fromObject) {
13712
14585
  const toObject = {};
13713
14586
  const fromTextInput = getValueByPath(fromObject, ['textInput']);
13714
14587
  if (fromTextInput != null) {
@@ -14464,6 +15337,13 @@ class WebAuth {
14464
15337
  if (headers.get(GOOGLE_API_KEY_HEADER) !== null) {
14465
15338
  return;
14466
15339
  }
15340
+ if (this.apiKey.startsWith('auth_tokens/')) {
15341
+ throw new Error('Ephemeral tokens are only supported by the live API.');
15342
+ }
15343
+ // Check if API key is empty or null
15344
+ if (!this.apiKey) {
15345
+ throw new Error('API key is missing. Please provide a valid API key.');
15346
+ }
14467
15347
  headers.append(GOOGLE_API_KEY_HEADER, this.apiKey);
14468
15348
  }
14469
15349
  }
@@ -14531,6 +15411,7 @@ class GoogleGenAI {
14531
15411
  this.caches = new Caches(this.apiClient);
14532
15412
  this.files = new Files(this.apiClient);
14533
15413
  this.operations = new Operations(this.apiClient);
15414
+ this.authTokens = new Tokens(this.apiClient);
14534
15415
  this.tunings = new Tunings(this.apiClient);
14535
15416
  }
14536
15417
  }
@@ -14574,6 +15455,7 @@ exports.ReplayResponse = ReplayResponse;
14574
15455
  exports.Session = Session;
14575
15456
  exports.StyleReferenceImage = StyleReferenceImage;
14576
15457
  exports.SubjectReferenceImage = SubjectReferenceImage;
15458
+ exports.Tokens = Tokens;
14577
15459
  exports.UpscaleImageResponse = UpscaleImageResponse;
14578
15460
  exports.createModelContent = createModelContent;
14579
15461
  exports.createPartFromBase64 = createPartFromBase64;