@google/genai 1.8.0 → 1.10.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.
@@ -1,5 +1,3 @@
1
- import { z } from 'zod';
2
-
3
1
  /**
4
2
  * @license
5
3
  * Copyright 2025 Google LLC
@@ -791,11 +789,38 @@ var PersonGeneration;
791
789
  /** Enum that specifies the language of the text in the prompt. */
792
790
  var ImagePromptLanguage;
793
791
  (function (ImagePromptLanguage) {
792
+ /**
793
+ * Auto-detect the language.
794
+ */
794
795
  ImagePromptLanguage["auto"] = "auto";
796
+ /**
797
+ * English
798
+ */
795
799
  ImagePromptLanguage["en"] = "en";
800
+ /**
801
+ * Japanese
802
+ */
796
803
  ImagePromptLanguage["ja"] = "ja";
804
+ /**
805
+ * Korean
806
+ */
797
807
  ImagePromptLanguage["ko"] = "ko";
808
+ /**
809
+ * Hindi
810
+ */
798
811
  ImagePromptLanguage["hi"] = "hi";
812
+ /**
813
+ * Chinese
814
+ */
815
+ ImagePromptLanguage["zh"] = "zh";
816
+ /**
817
+ * Portuguese
818
+ */
819
+ ImagePromptLanguage["pt"] = "pt";
820
+ /**
821
+ * Spanish
822
+ */
823
+ ImagePromptLanguage["es"] = "es";
799
824
  })(ImagePromptLanguage || (ImagePromptLanguage = {}));
800
825
  /** Enum representing the mask mode of a mask reference image. */
801
826
  var MaskReferenceMode;
@@ -1896,133 +1921,12 @@ function tContents(origin) {
1896
1921
  }
1897
1922
  return result;
1898
1923
  }
1899
- // The fields that are supported by JSONSchema. Must be kept in sync with the
1900
- // JSONSchema interface above.
1901
- const supportedJsonSchemaFields = new Set([
1902
- 'type',
1903
- 'format',
1904
- 'title',
1905
- 'description',
1906
- 'default',
1907
- 'items',
1908
- 'minItems',
1909
- 'maxItems',
1910
- 'enum',
1911
- 'properties',
1912
- 'required',
1913
- 'minProperties',
1914
- 'maxProperties',
1915
- 'minimum',
1916
- 'maximum',
1917
- 'minLength',
1918
- 'maxLength',
1919
- 'pattern',
1920
- 'anyOf',
1921
- 'propertyOrdering',
1922
- ]);
1923
- const jsonSchemaTypeValidator = z.enum([
1924
- 'string',
1925
- 'number',
1926
- 'integer',
1927
- 'object',
1928
- 'array',
1929
- 'boolean',
1930
- 'null',
1931
- ]);
1932
- // Handles all types and arrays of all types.
1933
- const schemaTypeUnion = z.union([
1934
- jsonSchemaTypeValidator,
1935
- z.array(jsonSchemaTypeValidator),
1936
- ]);
1937
- /**
1938
- * Creates a zod validator for JSONSchema.
1939
- *
1940
- * @param strictMode Whether to enable strict mode, default to true. When
1941
- * strict mode is enabled, the zod validator will throw error if there
1942
- * are unrecognized fields in the input data. If strict mode is
1943
- * disabled, the zod validator will ignore the unrecognized fields, only
1944
- * populate the fields that are listed in the JSONSchema. Regardless of
1945
- * the mode the type mismatch will always result in an error, for example
1946
- * items field should be a single JSONSchema, but for tuple type it would
1947
- * be an array of JSONSchema, this will always result in an error.
1948
- * @return The zod validator for JSONSchema.
1949
- */
1950
- function createJsonSchemaValidator(strictMode = true) {
1951
- const jsonSchemaValidator = z.lazy(() => {
1952
- // Define the base object shape *inside* the z.lazy callback
1953
- const baseShape = z.object({
1954
- // --- Type ---
1955
- type: schemaTypeUnion.optional(),
1956
- // --- Annotations ---
1957
- format: z.string().optional(),
1958
- title: z.string().optional(),
1959
- description: z.string().optional(),
1960
- default: z.unknown().optional(),
1961
- // --- Array Validations ---
1962
- items: jsonSchemaValidator.optional(),
1963
- minItems: z.coerce.string().optional(),
1964
- maxItems: z.coerce.string().optional(),
1965
- // --- Generic Validations ---
1966
- enum: z.array(z.unknown()).optional(),
1967
- // --- Object Validations ---
1968
- properties: z.record(z.string(), jsonSchemaValidator).optional(),
1969
- required: z.array(z.string()).optional(),
1970
- minProperties: z.coerce.string().optional(),
1971
- maxProperties: z.coerce.string().optional(),
1972
- propertyOrdering: z.array(z.string()).optional(),
1973
- // --- Numeric Validations ---
1974
- minimum: z.number().optional(),
1975
- maximum: z.number().optional(),
1976
- // --- String Validations ---
1977
- minLength: z.coerce.string().optional(),
1978
- maxLength: z.coerce.string().optional(),
1979
- pattern: z.string().optional(),
1980
- // --- Schema Composition ---
1981
- anyOf: z.array(jsonSchemaValidator).optional(),
1982
- // --- Additional Properties --- This field is not included in the
1983
- // JSONSchema, will not be communicated to the model, it is here purely
1984
- // for enabling the zod validation strict mode.
1985
- additionalProperties: z.boolean().optional(),
1986
- });
1987
- // Conditionally apply .strict() based on the flag
1988
- return strictMode ? baseShape.strict() : baseShape;
1989
- });
1990
- return jsonSchemaValidator;
1991
- }
1992
1924
  /*
1993
- Handle type field:
1994
- The resulted type field in JSONSchema form zod_to_json_schema can be either
1995
- an array consist of primitive types or a single primitive type.
1996
- This is due to the optimization of zod_to_json_schema, when the types in the
1997
- union are primitive types without any additional specifications,
1998
- zod_to_json_schema will squash the types into an array instead of put them
1999
- in anyOf fields. Otherwise, it will put the types in anyOf fields.
2000
- See the following link for more details:
2001
- https://github.com/zodjs/zod-to-json-schema/blob/main/src/index.ts#L101
2002
- The logic here is trying to undo that optimization, flattening the array of
2003
- types to anyOf fields.
2004
- type field
2005
- |
2006
- ___________________________
2007
- / \
2008
- / \
2009
- / \
2010
- Array Type.*
2011
- / \ |
2012
- Include null. Not included null type = Type.*.
2013
- [null, Type.*, Type.*] multiple types.
2014
- [null, Type.*] [Type.*, Type.*]
2015
- / \
2016
- remove null \
2017
- add nullable = true \
2018
- / \ \
2019
- [Type.*] [Type.*, Type.*] \
2020
- only one type left multiple types left \
2021
- add type = Type.*. \ /
2022
- \ /
2023
- not populate the type field in final result
2024
- and make the types into anyOf fields
2025
- anyOf:[{type: 'Type.*'}, {type: 'Type.*'}];
1925
+ Transform the type field from an array of types to an array of anyOf fields.
1926
+ Example:
1927
+ {type: ['STRING', 'NUMBER']}
1928
+ will be transformed to
1929
+ {anyOf: [{type: 'STRING'}, {type: 'NUMBER'}]}
2026
1930
  */
2027
1931
  function flattenTypeArrayToAnyOf(typeList, resultingSchema) {
2028
1932
  if (typeList.includes('null')) {
@@ -2168,15 +2072,11 @@ function processJsonSchema(_jsonSchema) {
2168
2072
  // https://github.com/StefanTerdell/zod-to-json-schema/blob/70525efe555cd226691e093d171370a3b10921d1/src/zodToJsonSchema.ts#L7
2169
2073
  // typebox can return unknown, see details in
2170
2074
  // https://github.com/sinclairzx81/typebox/blob/5a5431439f7d5ca6b494d0d18fbfd7b1a356d67c/src/type/create/type.ts#L35
2075
+ // Note: proper json schemas with the $schema field set never arrive to this
2076
+ // transformer. Schemas with $schema are routed to the equivalent API json
2077
+ // schema field.
2171
2078
  function tSchema(schema) {
2172
- if (Object.keys(schema).includes('$schema')) {
2173
- delete schema['$schema'];
2174
- const validatedJsonSchema = createJsonSchemaValidator().parse(schema);
2175
- return processJsonSchema(validatedJsonSchema);
2176
- }
2177
- else {
2178
- return processJsonSchema(schema);
2179
- }
2079
+ return processJsonSchema(schema);
2180
2080
  }
2181
2081
  function tSpeechConfig(speechConfig) {
2182
2082
  if (typeof speechConfig === 'object') {
@@ -2205,10 +2105,28 @@ function tTool(tool) {
2205
2105
  if (tool.functionDeclarations) {
2206
2106
  for (const functionDeclaration of tool.functionDeclarations) {
2207
2107
  if (functionDeclaration.parameters) {
2208
- functionDeclaration.parameters = tSchema(functionDeclaration.parameters);
2108
+ if (!Object.keys(functionDeclaration.parameters).includes('$schema')) {
2109
+ functionDeclaration.parameters = processJsonSchema(functionDeclaration.parameters);
2110
+ }
2111
+ else {
2112
+ if (!functionDeclaration.parametersJsonSchema) {
2113
+ functionDeclaration.parametersJsonSchema =
2114
+ functionDeclaration.parameters;
2115
+ delete functionDeclaration.parameters;
2116
+ }
2117
+ }
2209
2118
  }
2210
2119
  if (functionDeclaration.response) {
2211
- functionDeclaration.response = tSchema(functionDeclaration.response);
2120
+ if (!Object.keys(functionDeclaration.response).includes('$schema')) {
2121
+ functionDeclaration.response = processJsonSchema(functionDeclaration.response);
2122
+ }
2123
+ else {
2124
+ if (!functionDeclaration.responseJsonSchema) {
2125
+ functionDeclaration.responseJsonSchema =
2126
+ functionDeclaration.response;
2127
+ delete functionDeclaration.response;
2128
+ }
2129
+ }
2212
2130
  }
2213
2131
  }
2214
2132
  }
@@ -2413,7 +2331,7 @@ function mcpToGeminiTool(mcpTool, config = {}) {
2413
2331
  const functionDeclaration = {
2414
2332
  name: mcpToolSchema['name'],
2415
2333
  description: mcpToolSchema['description'],
2416
- parameters: processJsonSchema(filterToJsonSchema(mcpToolSchema['inputSchema'])),
2334
+ parametersJsonSchema: mcpToolSchema['inputSchema'],
2417
2335
  };
2418
2336
  if (config.behavior) {
2419
2337
  functionDeclaration['behavior'] = config.behavior;
@@ -2445,53 +2363,6 @@ function mcpToolsToGeminiTool(mcpTools, config = {}) {
2445
2363
  }
2446
2364
  return { functionDeclarations: functionDeclarations };
2447
2365
  }
2448
- // Filters the list schema field to only include fields that are supported by
2449
- // JSONSchema.
2450
- function filterListSchemaField(fieldValue) {
2451
- const listSchemaFieldValue = [];
2452
- for (const listFieldValue of fieldValue) {
2453
- listSchemaFieldValue.push(filterToJsonSchema(listFieldValue));
2454
- }
2455
- return listSchemaFieldValue;
2456
- }
2457
- // Filters the dict schema field to only include fields that are supported by
2458
- // JSONSchema.
2459
- function filterDictSchemaField(fieldValue) {
2460
- const dictSchemaFieldValue = {};
2461
- for (const [key, value] of Object.entries(fieldValue)) {
2462
- const valueRecord = value;
2463
- dictSchemaFieldValue[key] = filterToJsonSchema(valueRecord);
2464
- }
2465
- return dictSchemaFieldValue;
2466
- }
2467
- // Filters the schema to only include fields that are supported by JSONSchema.
2468
- function filterToJsonSchema(schema) {
2469
- const schemaFieldNames = new Set(['items']); // 'additional_properties' to come
2470
- const listSchemaFieldNames = new Set(['anyOf']); // 'one_of', 'all_of', 'not' to come
2471
- const dictSchemaFieldNames = new Set(['properties']); // 'defs' to come
2472
- const filteredSchema = {};
2473
- for (const [fieldName, fieldValue] of Object.entries(schema)) {
2474
- if (schemaFieldNames.has(fieldName)) {
2475
- filteredSchema[fieldName] = filterToJsonSchema(fieldValue);
2476
- }
2477
- else if (listSchemaFieldNames.has(fieldName)) {
2478
- filteredSchema[fieldName] = filterListSchemaField(fieldValue);
2479
- }
2480
- else if (dictSchemaFieldNames.has(fieldName)) {
2481
- filteredSchema[fieldName] = filterDictSchemaField(fieldValue);
2482
- }
2483
- else if (fieldName === 'type') {
2484
- const typeValue = fieldValue.toUpperCase();
2485
- filteredSchema[fieldName] = Object.values(Type).includes(typeValue)
2486
- ? typeValue
2487
- : Type.TYPE_UNSPECIFIED;
2488
- }
2489
- else if (supportedJsonSchemaFields.has(fieldName)) {
2490
- filteredSchema[fieldName] = fieldValue;
2491
- }
2492
- }
2493
- return filteredSchema;
2494
- }
2495
2366
  // Transforms a source input into a BatchJobSource object with validation.
2496
2367
  function tBatchJobSource(apiClient, src) {
2497
2368
  if (typeof src !== 'string' && !Array.isArray(src)) {
@@ -2540,6 +2411,9 @@ function tBatchJobSource(apiClient, src) {
2540
2411
  throw new Error(`Unsupported source: ${src}`);
2541
2412
  }
2542
2413
  function tBatchJobDestination(dest) {
2414
+ if (typeof dest !== 'string') {
2415
+ return dest;
2416
+ }
2543
2417
  const destString = dest;
2544
2418
  if (destString.startsWith('gs://')) {
2545
2419
  return {
@@ -3525,10 +3399,6 @@ function deleteBatchJobParametersToVertex(apiClient, fromObject) {
3525
3399
  }
3526
3400
  return toObject;
3527
3401
  }
3528
- function jobErrorFromMldev() {
3529
- const toObject = {};
3530
- return toObject;
3531
- }
3532
3402
  function videoMetadataFromMldev$2(fromObject) {
3533
3403
  const toObject = {};
3534
3404
  const fromFps = getValueByPath(fromObject, ['fps']);
@@ -3733,6 +3603,12 @@ function candidateFromMldev$1(fromObject) {
3733
3603
  }
3734
3604
  function generateContentResponseFromMldev$1(fromObject) {
3735
3605
  const toObject = {};
3606
+ const fromSdkHttpResponse = getValueByPath(fromObject, [
3607
+ 'sdkHttpResponse',
3608
+ ]);
3609
+ if (fromSdkHttpResponse != null) {
3610
+ setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
3611
+ }
3736
3612
  const fromCandidates = getValueByPath(fromObject, ['candidates']);
3737
3613
  if (fromCandidates != null) {
3738
3614
  let transformedList = fromCandidates;
@@ -3761,6 +3637,22 @@ function generateContentResponseFromMldev$1(fromObject) {
3761
3637
  }
3762
3638
  return toObject;
3763
3639
  }
3640
+ function jobErrorFromMldev(fromObject) {
3641
+ const toObject = {};
3642
+ const fromDetails = getValueByPath(fromObject, ['details']);
3643
+ if (fromDetails != null) {
3644
+ setValueByPath(toObject, ['details'], fromDetails);
3645
+ }
3646
+ const fromCode = getValueByPath(fromObject, ['code']);
3647
+ if (fromCode != null) {
3648
+ setValueByPath(toObject, ['code'], fromCode);
3649
+ }
3650
+ const fromMessage = getValueByPath(fromObject, ['message']);
3651
+ if (fromMessage != null) {
3652
+ setValueByPath(toObject, ['message'], fromMessage);
3653
+ }
3654
+ return toObject;
3655
+ }
3764
3656
  function inlinedResponseFromMldev(fromObject) {
3765
3657
  const toObject = {};
3766
3658
  const fromResponse = getValueByPath(fromObject, ['response']);
@@ -3769,7 +3661,7 @@ function inlinedResponseFromMldev(fromObject) {
3769
3661
  }
3770
3662
  const fromError = getValueByPath(fromObject, ['error']);
3771
3663
  if (fromError != null) {
3772
- setValueByPath(toObject, ['error'], jobErrorFromMldev());
3664
+ setValueByPath(toObject, ['error'], jobErrorFromMldev(fromError));
3773
3665
  }
3774
3666
  return toObject;
3775
3667
  }
@@ -3874,7 +3766,7 @@ function deleteResourceJobFromMldev(fromObject) {
3874
3766
  }
3875
3767
  const fromError = getValueByPath(fromObject, ['error']);
3876
3768
  if (fromError != null) {
3877
- setValueByPath(toObject, ['error'], jobErrorFromMldev());
3769
+ setValueByPath(toObject, ['error'], jobErrorFromMldev(fromError));
3878
3770
  }
3879
3771
  return toObject;
3880
3772
  }
@@ -6640,8 +6532,14 @@ function listFilesResponseFromMldev(fromObject) {
6640
6532
  }
6641
6533
  return toObject;
6642
6534
  }
6643
- function createFileResponseFromMldev() {
6535
+ function createFileResponseFromMldev(fromObject) {
6644
6536
  const toObject = {};
6537
+ const fromSdkHttpResponse = getValueByPath(fromObject, [
6538
+ 'sdkHttpResponse',
6539
+ ]);
6540
+ if (fromSdkHttpResponse != null) {
6541
+ setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
6542
+ }
6645
6543
  return toObject;
6646
6544
  }
6647
6545
  function deleteFileResponseFromMldev() {
@@ -6814,8 +6712,8 @@ class Files extends BaseModule {
6814
6712
  .then((httpResponse) => {
6815
6713
  return httpResponse.json();
6816
6714
  });
6817
- return response.then(() => {
6818
- const resp = createFileResponseFromMldev();
6715
+ return response.then((apiResponse) => {
6716
+ const resp = createFileResponseFromMldev(apiResponse);
6819
6717
  const typedResp = new CreateFileResponse();
6820
6718
  Object.assign(typedResp, resp);
6821
6719
  return typedResp;
@@ -6933,14 +6831,6 @@ function prebuiltVoiceConfigToMldev$2(fromObject) {
6933
6831
  }
6934
6832
  return toObject;
6935
6833
  }
6936
- function prebuiltVoiceConfigToVertex$1(fromObject) {
6937
- const toObject = {};
6938
- const fromVoiceName = getValueByPath(fromObject, ['voiceName']);
6939
- if (fromVoiceName != null) {
6940
- setValueByPath(toObject, ['voiceName'], fromVoiceName);
6941
- }
6942
- return toObject;
6943
- }
6944
6834
  function voiceConfigToMldev$2(fromObject) {
6945
6835
  const toObject = {};
6946
6836
  const fromPrebuiltVoiceConfig = getValueByPath(fromObject, [
@@ -6951,16 +6841,6 @@ function voiceConfigToMldev$2(fromObject) {
6951
6841
  }
6952
6842
  return toObject;
6953
6843
  }
6954
- function voiceConfigToVertex$1(fromObject) {
6955
- const toObject = {};
6956
- const fromPrebuiltVoiceConfig = getValueByPath(fromObject, [
6957
- 'prebuiltVoiceConfig',
6958
- ]);
6959
- if (fromPrebuiltVoiceConfig != null) {
6960
- setValueByPath(toObject, ['prebuiltVoiceConfig'], prebuiltVoiceConfigToVertex$1(fromPrebuiltVoiceConfig));
6961
- }
6962
- return toObject;
6963
- }
6964
6844
  function speakerVoiceConfigToMldev$2(fromObject) {
6965
6845
  const toObject = {};
6966
6846
  const fromSpeaker = getValueByPath(fromObject, ['speaker']);
@@ -7007,21 +6887,6 @@ function speechConfigToMldev$2(fromObject) {
7007
6887
  }
7008
6888
  return toObject;
7009
6889
  }
7010
- function speechConfigToVertex$1(fromObject) {
7011
- const toObject = {};
7012
- const fromVoiceConfig = getValueByPath(fromObject, ['voiceConfig']);
7013
- if (fromVoiceConfig != null) {
7014
- setValueByPath(toObject, ['voiceConfig'], voiceConfigToVertex$1(fromVoiceConfig));
7015
- }
7016
- if (getValueByPath(fromObject, ['multiSpeakerVoiceConfig']) !== undefined) {
7017
- throw new Error('multiSpeakerVoiceConfig parameter is not supported in Vertex AI.');
7018
- }
7019
- const fromLanguageCode = getValueByPath(fromObject, ['languageCode']);
7020
- if (fromLanguageCode != null) {
7021
- setValueByPath(toObject, ['languageCode'], fromLanguageCode);
7022
- }
7023
- return toObject;
7024
- }
7025
6890
  function videoMetadataToMldev$2(fromObject) {
7026
6891
  const toObject = {};
7027
6892
  const fromFps = getValueByPath(fromObject, ['fps']);
@@ -7038,22 +6903,6 @@ function videoMetadataToMldev$2(fromObject) {
7038
6903
  }
7039
6904
  return toObject;
7040
6905
  }
7041
- function videoMetadataToVertex$1(fromObject) {
7042
- const toObject = {};
7043
- const fromFps = getValueByPath(fromObject, ['fps']);
7044
- if (fromFps != null) {
7045
- setValueByPath(toObject, ['fps'], fromFps);
7046
- }
7047
- const fromEndOffset = getValueByPath(fromObject, ['endOffset']);
7048
- if (fromEndOffset != null) {
7049
- setValueByPath(toObject, ['endOffset'], fromEndOffset);
7050
- }
7051
- const fromStartOffset = getValueByPath(fromObject, ['startOffset']);
7052
- if (fromStartOffset != null) {
7053
- setValueByPath(toObject, ['startOffset'], fromStartOffset);
7054
- }
7055
- return toObject;
7056
- }
7057
6906
  function blobToMldev$2(fromObject) {
7058
6907
  const toObject = {};
7059
6908
  if (getValueByPath(fromObject, ['displayName']) !== undefined) {
@@ -7069,22 +6918,6 @@ function blobToMldev$2(fromObject) {
7069
6918
  }
7070
6919
  return toObject;
7071
6920
  }
7072
- function blobToVertex$1(fromObject) {
7073
- const toObject = {};
7074
- const fromDisplayName = getValueByPath(fromObject, ['displayName']);
7075
- if (fromDisplayName != null) {
7076
- setValueByPath(toObject, ['displayName'], fromDisplayName);
7077
- }
7078
- const fromData = getValueByPath(fromObject, ['data']);
7079
- if (fromData != null) {
7080
- setValueByPath(toObject, ['data'], fromData);
7081
- }
7082
- const fromMimeType = getValueByPath(fromObject, ['mimeType']);
7083
- if (fromMimeType != null) {
7084
- setValueByPath(toObject, ['mimeType'], fromMimeType);
7085
- }
7086
- return toObject;
7087
- }
7088
6921
  function fileDataToMldev$2(fromObject) {
7089
6922
  const toObject = {};
7090
6923
  if (getValueByPath(fromObject, ['displayName']) !== undefined) {
@@ -7100,22 +6933,6 @@ function fileDataToMldev$2(fromObject) {
7100
6933
  }
7101
6934
  return toObject;
7102
6935
  }
7103
- function fileDataToVertex$1(fromObject) {
7104
- const toObject = {};
7105
- const fromDisplayName = getValueByPath(fromObject, ['displayName']);
7106
- if (fromDisplayName != null) {
7107
- setValueByPath(toObject, ['displayName'], fromDisplayName);
7108
- }
7109
- const fromFileUri = getValueByPath(fromObject, ['fileUri']);
7110
- if (fromFileUri != null) {
7111
- setValueByPath(toObject, ['fileUri'], fromFileUri);
7112
- }
7113
- const fromMimeType = getValueByPath(fromObject, ['mimeType']);
7114
- if (fromMimeType != null) {
7115
- setValueByPath(toObject, ['mimeType'], fromMimeType);
7116
- }
7117
- return toObject;
7118
- }
7119
6936
  function partToMldev$2(fromObject) {
7120
6937
  const toObject = {};
7121
6938
  const fromVideoMetadata = getValueByPath(fromObject, [
@@ -7170,60 +6987,6 @@ function partToMldev$2(fromObject) {
7170
6987
  }
7171
6988
  return toObject;
7172
6989
  }
7173
- function partToVertex$1(fromObject) {
7174
- const toObject = {};
7175
- const fromVideoMetadata = getValueByPath(fromObject, [
7176
- 'videoMetadata',
7177
- ]);
7178
- if (fromVideoMetadata != null) {
7179
- setValueByPath(toObject, ['videoMetadata'], videoMetadataToVertex$1(fromVideoMetadata));
7180
- }
7181
- const fromThought = getValueByPath(fromObject, ['thought']);
7182
- if (fromThought != null) {
7183
- setValueByPath(toObject, ['thought'], fromThought);
7184
- }
7185
- const fromInlineData = getValueByPath(fromObject, ['inlineData']);
7186
- if (fromInlineData != null) {
7187
- setValueByPath(toObject, ['inlineData'], blobToVertex$1(fromInlineData));
7188
- }
7189
- const fromFileData = getValueByPath(fromObject, ['fileData']);
7190
- if (fromFileData != null) {
7191
- setValueByPath(toObject, ['fileData'], fileDataToVertex$1(fromFileData));
7192
- }
7193
- const fromThoughtSignature = getValueByPath(fromObject, [
7194
- 'thoughtSignature',
7195
- ]);
7196
- if (fromThoughtSignature != null) {
7197
- setValueByPath(toObject, ['thoughtSignature'], fromThoughtSignature);
7198
- }
7199
- const fromCodeExecutionResult = getValueByPath(fromObject, [
7200
- 'codeExecutionResult',
7201
- ]);
7202
- if (fromCodeExecutionResult != null) {
7203
- setValueByPath(toObject, ['codeExecutionResult'], fromCodeExecutionResult);
7204
- }
7205
- const fromExecutableCode = getValueByPath(fromObject, [
7206
- 'executableCode',
7207
- ]);
7208
- if (fromExecutableCode != null) {
7209
- setValueByPath(toObject, ['executableCode'], fromExecutableCode);
7210
- }
7211
- const fromFunctionCall = getValueByPath(fromObject, ['functionCall']);
7212
- if (fromFunctionCall != null) {
7213
- setValueByPath(toObject, ['functionCall'], fromFunctionCall);
7214
- }
7215
- const fromFunctionResponse = getValueByPath(fromObject, [
7216
- 'functionResponse',
7217
- ]);
7218
- if (fromFunctionResponse != null) {
7219
- setValueByPath(toObject, ['functionResponse'], fromFunctionResponse);
7220
- }
7221
- const fromText = getValueByPath(fromObject, ['text']);
7222
- if (fromText != null) {
7223
- setValueByPath(toObject, ['text'], fromText);
7224
- }
7225
- return toObject;
7226
- }
7227
6990
  function contentToMldev$2(fromObject) {
7228
6991
  const toObject = {};
7229
6992
  const fromParts = getValueByPath(fromObject, ['parts']);
@@ -7242,24 +7005,6 @@ function contentToMldev$2(fromObject) {
7242
7005
  }
7243
7006
  return toObject;
7244
7007
  }
7245
- function contentToVertex$1(fromObject) {
7246
- const toObject = {};
7247
- const fromParts = getValueByPath(fromObject, ['parts']);
7248
- if (fromParts != null) {
7249
- let transformedList = fromParts;
7250
- if (Array.isArray(transformedList)) {
7251
- transformedList = transformedList.map((item) => {
7252
- return partToVertex$1(item);
7253
- });
7254
- }
7255
- setValueByPath(toObject, ['parts'], transformedList);
7256
- }
7257
- const fromRole = getValueByPath(fromObject, ['role']);
7258
- if (fromRole != null) {
7259
- setValueByPath(toObject, ['role'], fromRole);
7260
- }
7261
- return toObject;
7262
- }
7263
7008
  function functionDeclarationToMldev$2(fromObject) {
7264
7009
  const toObject = {};
7265
7010
  const fromBehavior = getValueByPath(fromObject, ['behavior']);
@@ -7296,41 +7041,6 @@ function functionDeclarationToMldev$2(fromObject) {
7296
7041
  }
7297
7042
  return toObject;
7298
7043
  }
7299
- function functionDeclarationToVertex$1(fromObject) {
7300
- const toObject = {};
7301
- if (getValueByPath(fromObject, ['behavior']) !== undefined) {
7302
- throw new Error('behavior parameter is not supported in Vertex AI.');
7303
- }
7304
- const fromDescription = getValueByPath(fromObject, ['description']);
7305
- if (fromDescription != null) {
7306
- setValueByPath(toObject, ['description'], fromDescription);
7307
- }
7308
- const fromName = getValueByPath(fromObject, ['name']);
7309
- if (fromName != null) {
7310
- setValueByPath(toObject, ['name'], fromName);
7311
- }
7312
- const fromParameters = getValueByPath(fromObject, ['parameters']);
7313
- if (fromParameters != null) {
7314
- setValueByPath(toObject, ['parameters'], fromParameters);
7315
- }
7316
- const fromParametersJsonSchema = getValueByPath(fromObject, [
7317
- 'parametersJsonSchema',
7318
- ]);
7319
- if (fromParametersJsonSchema != null) {
7320
- setValueByPath(toObject, ['parametersJsonSchema'], fromParametersJsonSchema);
7321
- }
7322
- const fromResponse = getValueByPath(fromObject, ['response']);
7323
- if (fromResponse != null) {
7324
- setValueByPath(toObject, ['response'], fromResponse);
7325
- }
7326
- const fromResponseJsonSchema = getValueByPath(fromObject, [
7327
- 'responseJsonSchema',
7328
- ]);
7329
- if (fromResponseJsonSchema != null) {
7330
- setValueByPath(toObject, ['responseJsonSchema'], fromResponseJsonSchema);
7331
- }
7332
- return toObject;
7333
- }
7334
7044
  function intervalToMldev$2(fromObject) {
7335
7045
  const toObject = {};
7336
7046
  const fromStartTime = getValueByPath(fromObject, ['startTime']);
@@ -7343,19 +7053,7 @@ function intervalToMldev$2(fromObject) {
7343
7053
  }
7344
7054
  return toObject;
7345
7055
  }
7346
- function intervalToVertex$1(fromObject) {
7347
- const toObject = {};
7348
- const fromStartTime = getValueByPath(fromObject, ['startTime']);
7349
- if (fromStartTime != null) {
7350
- setValueByPath(toObject, ['startTime'], fromStartTime);
7351
- }
7352
- const fromEndTime = getValueByPath(fromObject, ['endTime']);
7353
- if (fromEndTime != null) {
7354
- setValueByPath(toObject, ['endTime'], fromEndTime);
7355
- }
7356
- return toObject;
7357
- }
7358
- function googleSearchToMldev$2(fromObject) {
7056
+ function googleSearchToMldev$2(fromObject) {
7359
7057
  const toObject = {};
7360
7058
  const fromTimeRangeFilter = getValueByPath(fromObject, [
7361
7059
  'timeRangeFilter',
@@ -7365,16 +7063,6 @@ function googleSearchToMldev$2(fromObject) {
7365
7063
  }
7366
7064
  return toObject;
7367
7065
  }
7368
- function googleSearchToVertex$1(fromObject) {
7369
- const toObject = {};
7370
- const fromTimeRangeFilter = getValueByPath(fromObject, [
7371
- 'timeRangeFilter',
7372
- ]);
7373
- if (fromTimeRangeFilter != null) {
7374
- setValueByPath(toObject, ['timeRangeFilter'], intervalToVertex$1(fromTimeRangeFilter));
7375
- }
7376
- return toObject;
7377
- }
7378
7066
  function dynamicRetrievalConfigToMldev$2(fromObject) {
7379
7067
  const toObject = {};
7380
7068
  const fromMode = getValueByPath(fromObject, ['mode']);
@@ -7389,20 +7077,6 @@ function dynamicRetrievalConfigToMldev$2(fromObject) {
7389
7077
  }
7390
7078
  return toObject;
7391
7079
  }
7392
- function dynamicRetrievalConfigToVertex$1(fromObject) {
7393
- const toObject = {};
7394
- const fromMode = getValueByPath(fromObject, ['mode']);
7395
- if (fromMode != null) {
7396
- setValueByPath(toObject, ['mode'], fromMode);
7397
- }
7398
- const fromDynamicThreshold = getValueByPath(fromObject, [
7399
- 'dynamicThreshold',
7400
- ]);
7401
- if (fromDynamicThreshold != null) {
7402
- setValueByPath(toObject, ['dynamicThreshold'], fromDynamicThreshold);
7403
- }
7404
- return toObject;
7405
- }
7406
7080
  function googleSearchRetrievalToMldev$2(fromObject) {
7407
7081
  const toObject = {};
7408
7082
  const fromDynamicRetrievalConfig = getValueByPath(fromObject, [
@@ -7413,76 +7087,10 @@ function googleSearchRetrievalToMldev$2(fromObject) {
7413
7087
  }
7414
7088
  return toObject;
7415
7089
  }
7416
- function googleSearchRetrievalToVertex$1(fromObject) {
7417
- const toObject = {};
7418
- const fromDynamicRetrievalConfig = getValueByPath(fromObject, [
7419
- 'dynamicRetrievalConfig',
7420
- ]);
7421
- if (fromDynamicRetrievalConfig != null) {
7422
- setValueByPath(toObject, ['dynamicRetrievalConfig'], dynamicRetrievalConfigToVertex$1(fromDynamicRetrievalConfig));
7423
- }
7424
- return toObject;
7425
- }
7426
- function enterpriseWebSearchToVertex$1() {
7427
- const toObject = {};
7428
- return toObject;
7429
- }
7430
- function apiKeyConfigToVertex$1(fromObject) {
7431
- const toObject = {};
7432
- const fromApiKeyString = getValueByPath(fromObject, ['apiKeyString']);
7433
- if (fromApiKeyString != null) {
7434
- setValueByPath(toObject, ['apiKeyString'], fromApiKeyString);
7435
- }
7436
- return toObject;
7437
- }
7438
- function authConfigToVertex$1(fromObject) {
7439
- const toObject = {};
7440
- const fromApiKeyConfig = getValueByPath(fromObject, ['apiKeyConfig']);
7441
- if (fromApiKeyConfig != null) {
7442
- setValueByPath(toObject, ['apiKeyConfig'], apiKeyConfigToVertex$1(fromApiKeyConfig));
7443
- }
7444
- const fromAuthType = getValueByPath(fromObject, ['authType']);
7445
- if (fromAuthType != null) {
7446
- setValueByPath(toObject, ['authType'], fromAuthType);
7447
- }
7448
- const fromGoogleServiceAccountConfig = getValueByPath(fromObject, [
7449
- 'googleServiceAccountConfig',
7450
- ]);
7451
- if (fromGoogleServiceAccountConfig != null) {
7452
- setValueByPath(toObject, ['googleServiceAccountConfig'], fromGoogleServiceAccountConfig);
7453
- }
7454
- const fromHttpBasicAuthConfig = getValueByPath(fromObject, [
7455
- 'httpBasicAuthConfig',
7456
- ]);
7457
- if (fromHttpBasicAuthConfig != null) {
7458
- setValueByPath(toObject, ['httpBasicAuthConfig'], fromHttpBasicAuthConfig);
7459
- }
7460
- const fromOauthConfig = getValueByPath(fromObject, ['oauthConfig']);
7461
- if (fromOauthConfig != null) {
7462
- setValueByPath(toObject, ['oauthConfig'], fromOauthConfig);
7463
- }
7464
- const fromOidcConfig = getValueByPath(fromObject, ['oidcConfig']);
7465
- if (fromOidcConfig != null) {
7466
- setValueByPath(toObject, ['oidcConfig'], fromOidcConfig);
7467
- }
7468
- return toObject;
7469
- }
7470
- function googleMapsToVertex$1(fromObject) {
7471
- const toObject = {};
7472
- const fromAuthConfig = getValueByPath(fromObject, ['authConfig']);
7473
- if (fromAuthConfig != null) {
7474
- setValueByPath(toObject, ['authConfig'], authConfigToVertex$1(fromAuthConfig));
7475
- }
7476
- return toObject;
7477
- }
7478
7090
  function urlContextToMldev$2() {
7479
7091
  const toObject = {};
7480
7092
  return toObject;
7481
7093
  }
7482
- function urlContextToVertex$1() {
7483
- const toObject = {};
7484
- return toObject;
7485
- }
7486
7094
  function toolToMldev$2(fromObject) {
7487
7095
  const toObject = {};
7488
7096
  const fromFunctionDeclarations = getValueByPath(fromObject, [
@@ -7532,60 +7140,6 @@ function toolToMldev$2(fromObject) {
7532
7140
  }
7533
7141
  return toObject;
7534
7142
  }
7535
- function toolToVertex$1(fromObject) {
7536
- const toObject = {};
7537
- const fromFunctionDeclarations = getValueByPath(fromObject, [
7538
- 'functionDeclarations',
7539
- ]);
7540
- if (fromFunctionDeclarations != null) {
7541
- let transformedList = fromFunctionDeclarations;
7542
- if (Array.isArray(transformedList)) {
7543
- transformedList = transformedList.map((item) => {
7544
- return functionDeclarationToVertex$1(item);
7545
- });
7546
- }
7547
- setValueByPath(toObject, ['functionDeclarations'], transformedList);
7548
- }
7549
- const fromRetrieval = getValueByPath(fromObject, ['retrieval']);
7550
- if (fromRetrieval != null) {
7551
- setValueByPath(toObject, ['retrieval'], fromRetrieval);
7552
- }
7553
- const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
7554
- if (fromGoogleSearch != null) {
7555
- setValueByPath(toObject, ['googleSearch'], googleSearchToVertex$1(fromGoogleSearch));
7556
- }
7557
- const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
7558
- 'googleSearchRetrieval',
7559
- ]);
7560
- if (fromGoogleSearchRetrieval != null) {
7561
- setValueByPath(toObject, ['googleSearchRetrieval'], googleSearchRetrievalToVertex$1(fromGoogleSearchRetrieval));
7562
- }
7563
- const fromEnterpriseWebSearch = getValueByPath(fromObject, [
7564
- 'enterpriseWebSearch',
7565
- ]);
7566
- if (fromEnterpriseWebSearch != null) {
7567
- setValueByPath(toObject, ['enterpriseWebSearch'], enterpriseWebSearchToVertex$1());
7568
- }
7569
- const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
7570
- if (fromGoogleMaps != null) {
7571
- setValueByPath(toObject, ['googleMaps'], googleMapsToVertex$1(fromGoogleMaps));
7572
- }
7573
- const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
7574
- if (fromUrlContext != null) {
7575
- setValueByPath(toObject, ['urlContext'], urlContextToVertex$1());
7576
- }
7577
- const fromCodeExecution = getValueByPath(fromObject, [
7578
- 'codeExecution',
7579
- ]);
7580
- if (fromCodeExecution != null) {
7581
- setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
7582
- }
7583
- const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
7584
- if (fromComputerUse != null) {
7585
- setValueByPath(toObject, ['computerUse'], fromComputerUse);
7586
- }
7587
- return toObject;
7588
- }
7589
7143
  function sessionResumptionConfigToMldev$1(fromObject) {
7590
7144
  const toObject = {};
7591
7145
  const fromHandle = getValueByPath(fromObject, ['handle']);
@@ -7597,26 +7151,10 @@ function sessionResumptionConfigToMldev$1(fromObject) {
7597
7151
  }
7598
7152
  return toObject;
7599
7153
  }
7600
- function sessionResumptionConfigToVertex(fromObject) {
7601
- const toObject = {};
7602
- const fromHandle = getValueByPath(fromObject, ['handle']);
7603
- if (fromHandle != null) {
7604
- setValueByPath(toObject, ['handle'], fromHandle);
7605
- }
7606
- const fromTransparent = getValueByPath(fromObject, ['transparent']);
7607
- if (fromTransparent != null) {
7608
- setValueByPath(toObject, ['transparent'], fromTransparent);
7609
- }
7610
- return toObject;
7611
- }
7612
7154
  function audioTranscriptionConfigToMldev$1() {
7613
7155
  const toObject = {};
7614
7156
  return toObject;
7615
7157
  }
7616
- function audioTranscriptionConfigToVertex() {
7617
- const toObject = {};
7618
- return toObject;
7619
- }
7620
7158
  function automaticActivityDetectionToMldev$1(fromObject) {
7621
7159
  const toObject = {};
7622
7160
  const fromDisabled = getValueByPath(fromObject, ['disabled']);
@@ -7649,38 +7187,6 @@ function automaticActivityDetectionToMldev$1(fromObject) {
7649
7187
  }
7650
7188
  return toObject;
7651
7189
  }
7652
- function automaticActivityDetectionToVertex(fromObject) {
7653
- const toObject = {};
7654
- const fromDisabled = getValueByPath(fromObject, ['disabled']);
7655
- if (fromDisabled != null) {
7656
- setValueByPath(toObject, ['disabled'], fromDisabled);
7657
- }
7658
- const fromStartOfSpeechSensitivity = getValueByPath(fromObject, [
7659
- 'startOfSpeechSensitivity',
7660
- ]);
7661
- if (fromStartOfSpeechSensitivity != null) {
7662
- setValueByPath(toObject, ['startOfSpeechSensitivity'], fromStartOfSpeechSensitivity);
7663
- }
7664
- const fromEndOfSpeechSensitivity = getValueByPath(fromObject, [
7665
- 'endOfSpeechSensitivity',
7666
- ]);
7667
- if (fromEndOfSpeechSensitivity != null) {
7668
- setValueByPath(toObject, ['endOfSpeechSensitivity'], fromEndOfSpeechSensitivity);
7669
- }
7670
- const fromPrefixPaddingMs = getValueByPath(fromObject, [
7671
- 'prefixPaddingMs',
7672
- ]);
7673
- if (fromPrefixPaddingMs != null) {
7674
- setValueByPath(toObject, ['prefixPaddingMs'], fromPrefixPaddingMs);
7675
- }
7676
- const fromSilenceDurationMs = getValueByPath(fromObject, [
7677
- 'silenceDurationMs',
7678
- ]);
7679
- if (fromSilenceDurationMs != null) {
7680
- setValueByPath(toObject, ['silenceDurationMs'], fromSilenceDurationMs);
7681
- }
7682
- return toObject;
7683
- }
7684
7190
  function realtimeInputConfigToMldev$1(fromObject) {
7685
7191
  const toObject = {};
7686
7192
  const fromAutomaticActivityDetection = getValueByPath(fromObject, [
@@ -7701,26 +7207,6 @@ function realtimeInputConfigToMldev$1(fromObject) {
7701
7207
  }
7702
7208
  return toObject;
7703
7209
  }
7704
- function realtimeInputConfigToVertex(fromObject) {
7705
- const toObject = {};
7706
- const fromAutomaticActivityDetection = getValueByPath(fromObject, [
7707
- 'automaticActivityDetection',
7708
- ]);
7709
- if (fromAutomaticActivityDetection != null) {
7710
- setValueByPath(toObject, ['automaticActivityDetection'], automaticActivityDetectionToVertex(fromAutomaticActivityDetection));
7711
- }
7712
- const fromActivityHandling = getValueByPath(fromObject, [
7713
- 'activityHandling',
7714
- ]);
7715
- if (fromActivityHandling != null) {
7716
- setValueByPath(toObject, ['activityHandling'], fromActivityHandling);
7717
- }
7718
- const fromTurnCoverage = getValueByPath(fromObject, ['turnCoverage']);
7719
- if (fromTurnCoverage != null) {
7720
- setValueByPath(toObject, ['turnCoverage'], fromTurnCoverage);
7721
- }
7722
- return toObject;
7723
- }
7724
7210
  function slidingWindowToMldev$1(fromObject) {
7725
7211
  const toObject = {};
7726
7212
  const fromTargetTokens = getValueByPath(fromObject, ['targetTokens']);
@@ -7729,14 +7215,6 @@ function slidingWindowToMldev$1(fromObject) {
7729
7215
  }
7730
7216
  return toObject;
7731
7217
  }
7732
- function slidingWindowToVertex(fromObject) {
7733
- const toObject = {};
7734
- const fromTargetTokens = getValueByPath(fromObject, ['targetTokens']);
7735
- if (fromTargetTokens != null) {
7736
- setValueByPath(toObject, ['targetTokens'], fromTargetTokens);
7737
- }
7738
- return toObject;
7739
- }
7740
7218
  function contextWindowCompressionConfigToMldev$1(fromObject) {
7741
7219
  const toObject = {};
7742
7220
  const fromTriggerTokens = getValueByPath(fromObject, [
@@ -7753,22 +7231,6 @@ function contextWindowCompressionConfigToMldev$1(fromObject) {
7753
7231
  }
7754
7232
  return toObject;
7755
7233
  }
7756
- function contextWindowCompressionConfigToVertex(fromObject) {
7757
- const toObject = {};
7758
- const fromTriggerTokens = getValueByPath(fromObject, [
7759
- 'triggerTokens',
7760
- ]);
7761
- if (fromTriggerTokens != null) {
7762
- setValueByPath(toObject, ['triggerTokens'], fromTriggerTokens);
7763
- }
7764
- const fromSlidingWindow = getValueByPath(fromObject, [
7765
- 'slidingWindow',
7766
- ]);
7767
- if (fromSlidingWindow != null) {
7768
- setValueByPath(toObject, ['slidingWindow'], slidingWindowToVertex(fromSlidingWindow));
7769
- }
7770
- return toObject;
7771
- }
7772
7234
  function proactivityConfigToMldev$1(fromObject) {
7773
7235
  const toObject = {};
7774
7236
  const fromProactiveAudio = getValueByPath(fromObject, [
@@ -7779,16 +7241,6 @@ function proactivityConfigToMldev$1(fromObject) {
7779
7241
  }
7780
7242
  return toObject;
7781
7243
  }
7782
- function proactivityConfigToVertex(fromObject) {
7783
- const toObject = {};
7784
- const fromProactiveAudio = getValueByPath(fromObject, [
7785
- 'proactiveAudio',
7786
- ]);
7787
- if (fromProactiveAudio != null) {
7788
- setValueByPath(toObject, ['proactiveAudio'], fromProactiveAudio);
7789
- }
7790
- return toObject;
7791
- }
7792
7244
  function liveConnectConfigToMldev$1(fromObject, parentObject) {
7793
7245
  const toObject = {};
7794
7246
  const fromGenerationConfig = getValueByPath(fromObject, [
@@ -7893,110 +7345,6 @@ function liveConnectConfigToMldev$1(fromObject, parentObject) {
7893
7345
  }
7894
7346
  return toObject;
7895
7347
  }
7896
- function liveConnectConfigToVertex(fromObject, parentObject) {
7897
- const toObject = {};
7898
- const fromGenerationConfig = getValueByPath(fromObject, [
7899
- 'generationConfig',
7900
- ]);
7901
- if (parentObject !== undefined && fromGenerationConfig != null) {
7902
- setValueByPath(parentObject, ['setup', 'generationConfig'], fromGenerationConfig);
7903
- }
7904
- const fromResponseModalities = getValueByPath(fromObject, [
7905
- 'responseModalities',
7906
- ]);
7907
- if (parentObject !== undefined && fromResponseModalities != null) {
7908
- setValueByPath(parentObject, ['setup', 'generationConfig', 'responseModalities'], fromResponseModalities);
7909
- }
7910
- const fromTemperature = getValueByPath(fromObject, ['temperature']);
7911
- if (parentObject !== undefined && fromTemperature != null) {
7912
- setValueByPath(parentObject, ['setup', 'generationConfig', 'temperature'], fromTemperature);
7913
- }
7914
- const fromTopP = getValueByPath(fromObject, ['topP']);
7915
- if (parentObject !== undefined && fromTopP != null) {
7916
- setValueByPath(parentObject, ['setup', 'generationConfig', 'topP'], fromTopP);
7917
- }
7918
- const fromTopK = getValueByPath(fromObject, ['topK']);
7919
- if (parentObject !== undefined && fromTopK != null) {
7920
- setValueByPath(parentObject, ['setup', 'generationConfig', 'topK'], fromTopK);
7921
- }
7922
- const fromMaxOutputTokens = getValueByPath(fromObject, [
7923
- 'maxOutputTokens',
7924
- ]);
7925
- if (parentObject !== undefined && fromMaxOutputTokens != null) {
7926
- setValueByPath(parentObject, ['setup', 'generationConfig', 'maxOutputTokens'], fromMaxOutputTokens);
7927
- }
7928
- const fromMediaResolution = getValueByPath(fromObject, [
7929
- 'mediaResolution',
7930
- ]);
7931
- if (parentObject !== undefined && fromMediaResolution != null) {
7932
- setValueByPath(parentObject, ['setup', 'generationConfig', 'mediaResolution'], fromMediaResolution);
7933
- }
7934
- const fromSeed = getValueByPath(fromObject, ['seed']);
7935
- if (parentObject !== undefined && fromSeed != null) {
7936
- setValueByPath(parentObject, ['setup', 'generationConfig', 'seed'], fromSeed);
7937
- }
7938
- const fromSpeechConfig = getValueByPath(fromObject, ['speechConfig']);
7939
- if (parentObject !== undefined && fromSpeechConfig != null) {
7940
- setValueByPath(parentObject, ['setup', 'generationConfig', 'speechConfig'], speechConfigToVertex$1(tLiveSpeechConfig(fromSpeechConfig)));
7941
- }
7942
- const fromEnableAffectiveDialog = getValueByPath(fromObject, [
7943
- 'enableAffectiveDialog',
7944
- ]);
7945
- if (parentObject !== undefined && fromEnableAffectiveDialog != null) {
7946
- setValueByPath(parentObject, ['setup', 'generationConfig', 'enableAffectiveDialog'], fromEnableAffectiveDialog);
7947
- }
7948
- const fromSystemInstruction = getValueByPath(fromObject, [
7949
- 'systemInstruction',
7950
- ]);
7951
- if (parentObject !== undefined && fromSystemInstruction != null) {
7952
- setValueByPath(parentObject, ['setup', 'systemInstruction'], contentToVertex$1(tContent(fromSystemInstruction)));
7953
- }
7954
- const fromTools = getValueByPath(fromObject, ['tools']);
7955
- if (parentObject !== undefined && fromTools != null) {
7956
- let transformedList = tTools(fromTools);
7957
- if (Array.isArray(transformedList)) {
7958
- transformedList = transformedList.map((item) => {
7959
- return toolToVertex$1(tTool(item));
7960
- });
7961
- }
7962
- setValueByPath(parentObject, ['setup', 'tools'], transformedList);
7963
- }
7964
- const fromSessionResumption = getValueByPath(fromObject, [
7965
- 'sessionResumption',
7966
- ]);
7967
- if (parentObject !== undefined && fromSessionResumption != null) {
7968
- setValueByPath(parentObject, ['setup', 'sessionResumption'], sessionResumptionConfigToVertex(fromSessionResumption));
7969
- }
7970
- const fromInputAudioTranscription = getValueByPath(fromObject, [
7971
- 'inputAudioTranscription',
7972
- ]);
7973
- if (parentObject !== undefined && fromInputAudioTranscription != null) {
7974
- setValueByPath(parentObject, ['setup', 'inputAudioTranscription'], audioTranscriptionConfigToVertex());
7975
- }
7976
- const fromOutputAudioTranscription = getValueByPath(fromObject, [
7977
- 'outputAudioTranscription',
7978
- ]);
7979
- if (parentObject !== undefined && fromOutputAudioTranscription != null) {
7980
- setValueByPath(parentObject, ['setup', 'outputAudioTranscription'], audioTranscriptionConfigToVertex());
7981
- }
7982
- const fromRealtimeInputConfig = getValueByPath(fromObject, [
7983
- 'realtimeInputConfig',
7984
- ]);
7985
- if (parentObject !== undefined && fromRealtimeInputConfig != null) {
7986
- setValueByPath(parentObject, ['setup', 'realtimeInputConfig'], realtimeInputConfigToVertex(fromRealtimeInputConfig));
7987
- }
7988
- const fromContextWindowCompression = getValueByPath(fromObject, [
7989
- 'contextWindowCompression',
7990
- ]);
7991
- if (parentObject !== undefined && fromContextWindowCompression != null) {
7992
- setValueByPath(parentObject, ['setup', 'contextWindowCompression'], contextWindowCompressionConfigToVertex(fromContextWindowCompression));
7993
- }
7994
- const fromProactivity = getValueByPath(fromObject, ['proactivity']);
7995
- if (parentObject !== undefined && fromProactivity != null) {
7996
- setValueByPath(parentObject, ['setup', 'proactivity'], proactivityConfigToVertex(fromProactivity));
7997
- }
7998
- return toObject;
7999
- }
8000
7348
  function liveConnectParametersToMldev(apiClient, fromObject) {
8001
7349
  const toObject = {};
8002
7350
  const fromModel = getValueByPath(fromObject, ['model']);
@@ -8009,34 +7357,14 @@ function liveConnectParametersToMldev(apiClient, fromObject) {
8009
7357
  }
8010
7358
  return toObject;
8011
7359
  }
8012
- function liveConnectParametersToVertex(apiClient, fromObject) {
8013
- const toObject = {};
8014
- const fromModel = getValueByPath(fromObject, ['model']);
8015
- if (fromModel != null) {
8016
- setValueByPath(toObject, ['setup', 'model'], tModel(apiClient, fromModel));
8017
- }
8018
- const fromConfig = getValueByPath(fromObject, ['config']);
8019
- if (fromConfig != null) {
8020
- setValueByPath(toObject, ['config'], liveConnectConfigToVertex(fromConfig, toObject));
8021
- }
8022
- return toObject;
8023
- }
8024
7360
  function activityStartToMldev() {
8025
7361
  const toObject = {};
8026
7362
  return toObject;
8027
7363
  }
8028
- function activityStartToVertex() {
8029
- const toObject = {};
8030
- return toObject;
8031
- }
8032
7364
  function activityEndToMldev() {
8033
7365
  const toObject = {};
8034
7366
  return toObject;
8035
7367
  }
8036
- function activityEndToVertex() {
8037
- const toObject = {};
8038
- return toObject;
8039
- }
8040
7368
  function liveSendRealtimeInputParametersToMldev(fromObject) {
8041
7369
  const toObject = {};
8042
7370
  const fromMedia = getValueByPath(fromObject, ['media']);
@@ -8073,42 +7401,6 @@ function liveSendRealtimeInputParametersToMldev(fromObject) {
8073
7401
  }
8074
7402
  return toObject;
8075
7403
  }
8076
- function liveSendRealtimeInputParametersToVertex(fromObject) {
8077
- const toObject = {};
8078
- const fromMedia = getValueByPath(fromObject, ['media']);
8079
- if (fromMedia != null) {
8080
- setValueByPath(toObject, ['mediaChunks'], tBlobs(fromMedia));
8081
- }
8082
- const fromAudio = getValueByPath(fromObject, ['audio']);
8083
- if (fromAudio != null) {
8084
- setValueByPath(toObject, ['audio'], tAudioBlob(fromAudio));
8085
- }
8086
- const fromAudioStreamEnd = getValueByPath(fromObject, [
8087
- 'audioStreamEnd',
8088
- ]);
8089
- if (fromAudioStreamEnd != null) {
8090
- setValueByPath(toObject, ['audioStreamEnd'], fromAudioStreamEnd);
8091
- }
8092
- const fromVideo = getValueByPath(fromObject, ['video']);
8093
- if (fromVideo != null) {
8094
- setValueByPath(toObject, ['video'], tImageBlob(fromVideo));
8095
- }
8096
- const fromText = getValueByPath(fromObject, ['text']);
8097
- if (fromText != null) {
8098
- setValueByPath(toObject, ['text'], fromText);
8099
- }
8100
- const fromActivityStart = getValueByPath(fromObject, [
8101
- 'activityStart',
8102
- ]);
8103
- if (fromActivityStart != null) {
8104
- setValueByPath(toObject, ['activityStart'], activityStartToVertex());
8105
- }
8106
- const fromActivityEnd = getValueByPath(fromObject, ['activityEnd']);
8107
- if (fromActivityEnd != null) {
8108
- setValueByPath(toObject, ['activityEnd'], activityEndToVertex());
8109
- }
8110
- return toObject;
8111
- }
8112
7404
  function weightedPromptToMldev(fromObject) {
8113
7405
  const toObject = {};
8114
7406
  const fromText = getValueByPath(fromObject, ['text']);
@@ -8247,35 +7539,40 @@ function liveMusicClientMessageToMldev(fromObject) {
8247
7539
  }
8248
7540
  return toObject;
8249
7541
  }
8250
- function liveServerSetupCompleteFromMldev() {
7542
+ function prebuiltVoiceConfigToVertex$1(fromObject) {
8251
7543
  const toObject = {};
7544
+ const fromVoiceName = getValueByPath(fromObject, ['voiceName']);
7545
+ if (fromVoiceName != null) {
7546
+ setValueByPath(toObject, ['voiceName'], fromVoiceName);
7547
+ }
8252
7548
  return toObject;
8253
7549
  }
8254
- function liveServerSetupCompleteFromVertex(fromObject) {
7550
+ function voiceConfigToVertex$1(fromObject) {
8255
7551
  const toObject = {};
8256
- const fromSessionId = getValueByPath(fromObject, ['sessionId']);
8257
- if (fromSessionId != null) {
8258
- setValueByPath(toObject, ['sessionId'], fromSessionId);
7552
+ const fromPrebuiltVoiceConfig = getValueByPath(fromObject, [
7553
+ 'prebuiltVoiceConfig',
7554
+ ]);
7555
+ if (fromPrebuiltVoiceConfig != null) {
7556
+ setValueByPath(toObject, ['prebuiltVoiceConfig'], prebuiltVoiceConfigToVertex$1(fromPrebuiltVoiceConfig));
8259
7557
  }
8260
7558
  return toObject;
8261
7559
  }
8262
- function videoMetadataFromMldev$1(fromObject) {
7560
+ function speechConfigToVertex$1(fromObject) {
8263
7561
  const toObject = {};
8264
- const fromFps = getValueByPath(fromObject, ['fps']);
8265
- if (fromFps != null) {
8266
- setValueByPath(toObject, ['fps'], fromFps);
7562
+ const fromVoiceConfig = getValueByPath(fromObject, ['voiceConfig']);
7563
+ if (fromVoiceConfig != null) {
7564
+ setValueByPath(toObject, ['voiceConfig'], voiceConfigToVertex$1(fromVoiceConfig));
8267
7565
  }
8268
- const fromEndOffset = getValueByPath(fromObject, ['endOffset']);
8269
- if (fromEndOffset != null) {
8270
- setValueByPath(toObject, ['endOffset'], fromEndOffset);
7566
+ if (getValueByPath(fromObject, ['multiSpeakerVoiceConfig']) !== undefined) {
7567
+ throw new Error('multiSpeakerVoiceConfig parameter is not supported in Vertex AI.');
8271
7568
  }
8272
- const fromStartOffset = getValueByPath(fromObject, ['startOffset']);
8273
- if (fromStartOffset != null) {
8274
- setValueByPath(toObject, ['startOffset'], fromStartOffset);
7569
+ const fromLanguageCode = getValueByPath(fromObject, ['languageCode']);
7570
+ if (fromLanguageCode != null) {
7571
+ setValueByPath(toObject, ['languageCode'], fromLanguageCode);
8275
7572
  }
8276
7573
  return toObject;
8277
7574
  }
8278
- function videoMetadataFromVertex$1(fromObject) {
7575
+ function videoMetadataToVertex$1(fromObject) {
8279
7576
  const toObject = {};
8280
7577
  const fromFps = getValueByPath(fromObject, ['fps']);
8281
7578
  if (fromFps != null) {
@@ -8291,19 +7588,7 @@ function videoMetadataFromVertex$1(fromObject) {
8291
7588
  }
8292
7589
  return toObject;
8293
7590
  }
8294
- function blobFromMldev$1(fromObject) {
8295
- const toObject = {};
8296
- const fromData = getValueByPath(fromObject, ['data']);
8297
- if (fromData != null) {
8298
- setValueByPath(toObject, ['data'], fromData);
8299
- }
8300
- const fromMimeType = getValueByPath(fromObject, ['mimeType']);
8301
- if (fromMimeType != null) {
8302
- setValueByPath(toObject, ['mimeType'], fromMimeType);
8303
- }
8304
- return toObject;
8305
- }
8306
- function blobFromVertex$1(fromObject) {
7591
+ function blobToVertex$1(fromObject) {
8307
7592
  const toObject = {};
8308
7593
  const fromDisplayName = getValueByPath(fromObject, ['displayName']);
8309
7594
  if (fromDisplayName != null) {
@@ -8319,19 +7604,7 @@ function blobFromVertex$1(fromObject) {
8319
7604
  }
8320
7605
  return toObject;
8321
7606
  }
8322
- function fileDataFromMldev$1(fromObject) {
8323
- const toObject = {};
8324
- const fromFileUri = getValueByPath(fromObject, ['fileUri']);
8325
- if (fromFileUri != null) {
8326
- setValueByPath(toObject, ['fileUri'], fromFileUri);
8327
- }
8328
- const fromMimeType = getValueByPath(fromObject, ['mimeType']);
8329
- if (fromMimeType != null) {
8330
- setValueByPath(toObject, ['mimeType'], fromMimeType);
8331
- }
8332
- return toObject;
8333
- }
8334
- function fileDataFromVertex$1(fromObject) {
7607
+ function fileDataToVertex$1(fromObject) {
8335
7608
  const toObject = {};
8336
7609
  const fromDisplayName = getValueByPath(fromObject, ['displayName']);
8337
7610
  if (fromDisplayName != null) {
@@ -8347,13 +7620,13 @@ function fileDataFromVertex$1(fromObject) {
8347
7620
  }
8348
7621
  return toObject;
8349
7622
  }
8350
- function partFromMldev$1(fromObject) {
7623
+ function partToVertex$1(fromObject) {
8351
7624
  const toObject = {};
8352
7625
  const fromVideoMetadata = getValueByPath(fromObject, [
8353
7626
  'videoMetadata',
8354
7627
  ]);
8355
7628
  if (fromVideoMetadata != null) {
8356
- setValueByPath(toObject, ['videoMetadata'], videoMetadataFromMldev$1(fromVideoMetadata));
7629
+ setValueByPath(toObject, ['videoMetadata'], videoMetadataToVertex$1(fromVideoMetadata));
8357
7630
  }
8358
7631
  const fromThought = getValueByPath(fromObject, ['thought']);
8359
7632
  if (fromThought != null) {
@@ -8361,11 +7634,11 @@ function partFromMldev$1(fromObject) {
8361
7634
  }
8362
7635
  const fromInlineData = getValueByPath(fromObject, ['inlineData']);
8363
7636
  if (fromInlineData != null) {
8364
- setValueByPath(toObject, ['inlineData'], blobFromMldev$1(fromInlineData));
7637
+ setValueByPath(toObject, ['inlineData'], blobToVertex$1(fromInlineData));
8365
7638
  }
8366
7639
  const fromFileData = getValueByPath(fromObject, ['fileData']);
8367
7640
  if (fromFileData != null) {
8368
- setValueByPath(toObject, ['fileData'], fileDataFromMldev$1(fromFileData));
7641
+ setValueByPath(toObject, ['fileData'], fileDataToVertex$1(fromFileData));
8369
7642
  }
8370
7643
  const fromThoughtSignature = getValueByPath(fromObject, [
8371
7644
  'thoughtSignature',
@@ -8401,19 +7674,1122 @@ function partFromMldev$1(fromObject) {
8401
7674
  }
8402
7675
  return toObject;
8403
7676
  }
8404
- function partFromVertex$1(fromObject) {
7677
+ function contentToVertex$1(fromObject) {
8405
7678
  const toObject = {};
8406
- const fromVideoMetadata = getValueByPath(fromObject, [
8407
- 'videoMetadata',
8408
- ]);
8409
- if (fromVideoMetadata != null) {
8410
- setValueByPath(toObject, ['videoMetadata'], videoMetadataFromVertex$1(fromVideoMetadata));
7679
+ const fromParts = getValueByPath(fromObject, ['parts']);
7680
+ if (fromParts != null) {
7681
+ let transformedList = fromParts;
7682
+ if (Array.isArray(transformedList)) {
7683
+ transformedList = transformedList.map((item) => {
7684
+ return partToVertex$1(item);
7685
+ });
7686
+ }
7687
+ setValueByPath(toObject, ['parts'], transformedList);
8411
7688
  }
8412
- const fromThought = getValueByPath(fromObject, ['thought']);
8413
- if (fromThought != null) {
8414
- setValueByPath(toObject, ['thought'], fromThought);
7689
+ const fromRole = getValueByPath(fromObject, ['role']);
7690
+ if (fromRole != null) {
7691
+ setValueByPath(toObject, ['role'], fromRole);
8415
7692
  }
8416
- const fromInlineData = getValueByPath(fromObject, ['inlineData']);
7693
+ return toObject;
7694
+ }
7695
+ function functionDeclarationToVertex$1(fromObject) {
7696
+ const toObject = {};
7697
+ if (getValueByPath(fromObject, ['behavior']) !== undefined) {
7698
+ throw new Error('behavior parameter is not supported in Vertex AI.');
7699
+ }
7700
+ const fromDescription = getValueByPath(fromObject, ['description']);
7701
+ if (fromDescription != null) {
7702
+ setValueByPath(toObject, ['description'], fromDescription);
7703
+ }
7704
+ const fromName = getValueByPath(fromObject, ['name']);
7705
+ if (fromName != null) {
7706
+ setValueByPath(toObject, ['name'], fromName);
7707
+ }
7708
+ const fromParameters = getValueByPath(fromObject, ['parameters']);
7709
+ if (fromParameters != null) {
7710
+ setValueByPath(toObject, ['parameters'], fromParameters);
7711
+ }
7712
+ const fromParametersJsonSchema = getValueByPath(fromObject, [
7713
+ 'parametersJsonSchema',
7714
+ ]);
7715
+ if (fromParametersJsonSchema != null) {
7716
+ setValueByPath(toObject, ['parametersJsonSchema'], fromParametersJsonSchema);
7717
+ }
7718
+ const fromResponse = getValueByPath(fromObject, ['response']);
7719
+ if (fromResponse != null) {
7720
+ setValueByPath(toObject, ['response'], fromResponse);
7721
+ }
7722
+ const fromResponseJsonSchema = getValueByPath(fromObject, [
7723
+ 'responseJsonSchema',
7724
+ ]);
7725
+ if (fromResponseJsonSchema != null) {
7726
+ setValueByPath(toObject, ['responseJsonSchema'], fromResponseJsonSchema);
7727
+ }
7728
+ return toObject;
7729
+ }
7730
+ function intervalToVertex$1(fromObject) {
7731
+ const toObject = {};
7732
+ const fromStartTime = getValueByPath(fromObject, ['startTime']);
7733
+ if (fromStartTime != null) {
7734
+ setValueByPath(toObject, ['startTime'], fromStartTime);
7735
+ }
7736
+ const fromEndTime = getValueByPath(fromObject, ['endTime']);
7737
+ if (fromEndTime != null) {
7738
+ setValueByPath(toObject, ['endTime'], fromEndTime);
7739
+ }
7740
+ return toObject;
7741
+ }
7742
+ function googleSearchToVertex$1(fromObject) {
7743
+ const toObject = {};
7744
+ const fromTimeRangeFilter = getValueByPath(fromObject, [
7745
+ 'timeRangeFilter',
7746
+ ]);
7747
+ if (fromTimeRangeFilter != null) {
7748
+ setValueByPath(toObject, ['timeRangeFilter'], intervalToVertex$1(fromTimeRangeFilter));
7749
+ }
7750
+ return toObject;
7751
+ }
7752
+ function dynamicRetrievalConfigToVertex$1(fromObject) {
7753
+ const toObject = {};
7754
+ const fromMode = getValueByPath(fromObject, ['mode']);
7755
+ if (fromMode != null) {
7756
+ setValueByPath(toObject, ['mode'], fromMode);
7757
+ }
7758
+ const fromDynamicThreshold = getValueByPath(fromObject, [
7759
+ 'dynamicThreshold',
7760
+ ]);
7761
+ if (fromDynamicThreshold != null) {
7762
+ setValueByPath(toObject, ['dynamicThreshold'], fromDynamicThreshold);
7763
+ }
7764
+ return toObject;
7765
+ }
7766
+ function googleSearchRetrievalToVertex$1(fromObject) {
7767
+ const toObject = {};
7768
+ const fromDynamicRetrievalConfig = getValueByPath(fromObject, [
7769
+ 'dynamicRetrievalConfig',
7770
+ ]);
7771
+ if (fromDynamicRetrievalConfig != null) {
7772
+ setValueByPath(toObject, ['dynamicRetrievalConfig'], dynamicRetrievalConfigToVertex$1(fromDynamicRetrievalConfig));
7773
+ }
7774
+ return toObject;
7775
+ }
7776
+ function enterpriseWebSearchToVertex$1() {
7777
+ const toObject = {};
7778
+ return toObject;
7779
+ }
7780
+ function apiKeyConfigToVertex$1(fromObject) {
7781
+ const toObject = {};
7782
+ const fromApiKeyString = getValueByPath(fromObject, ['apiKeyString']);
7783
+ if (fromApiKeyString != null) {
7784
+ setValueByPath(toObject, ['apiKeyString'], fromApiKeyString);
7785
+ }
7786
+ return toObject;
7787
+ }
7788
+ function authConfigToVertex$1(fromObject) {
7789
+ const toObject = {};
7790
+ const fromApiKeyConfig = getValueByPath(fromObject, ['apiKeyConfig']);
7791
+ if (fromApiKeyConfig != null) {
7792
+ setValueByPath(toObject, ['apiKeyConfig'], apiKeyConfigToVertex$1(fromApiKeyConfig));
7793
+ }
7794
+ const fromAuthType = getValueByPath(fromObject, ['authType']);
7795
+ if (fromAuthType != null) {
7796
+ setValueByPath(toObject, ['authType'], fromAuthType);
7797
+ }
7798
+ const fromGoogleServiceAccountConfig = getValueByPath(fromObject, [
7799
+ 'googleServiceAccountConfig',
7800
+ ]);
7801
+ if (fromGoogleServiceAccountConfig != null) {
7802
+ setValueByPath(toObject, ['googleServiceAccountConfig'], fromGoogleServiceAccountConfig);
7803
+ }
7804
+ const fromHttpBasicAuthConfig = getValueByPath(fromObject, [
7805
+ 'httpBasicAuthConfig',
7806
+ ]);
7807
+ if (fromHttpBasicAuthConfig != null) {
7808
+ setValueByPath(toObject, ['httpBasicAuthConfig'], fromHttpBasicAuthConfig);
7809
+ }
7810
+ const fromOauthConfig = getValueByPath(fromObject, ['oauthConfig']);
7811
+ if (fromOauthConfig != null) {
7812
+ setValueByPath(toObject, ['oauthConfig'], fromOauthConfig);
7813
+ }
7814
+ const fromOidcConfig = getValueByPath(fromObject, ['oidcConfig']);
7815
+ if (fromOidcConfig != null) {
7816
+ setValueByPath(toObject, ['oidcConfig'], fromOidcConfig);
7817
+ }
7818
+ return toObject;
7819
+ }
7820
+ function googleMapsToVertex$1(fromObject) {
7821
+ const toObject = {};
7822
+ const fromAuthConfig = getValueByPath(fromObject, ['authConfig']);
7823
+ if (fromAuthConfig != null) {
7824
+ setValueByPath(toObject, ['authConfig'], authConfigToVertex$1(fromAuthConfig));
7825
+ }
7826
+ return toObject;
7827
+ }
7828
+ function urlContextToVertex$1() {
7829
+ const toObject = {};
7830
+ return toObject;
7831
+ }
7832
+ function toolToVertex$1(fromObject) {
7833
+ const toObject = {};
7834
+ const fromFunctionDeclarations = getValueByPath(fromObject, [
7835
+ 'functionDeclarations',
7836
+ ]);
7837
+ if (fromFunctionDeclarations != null) {
7838
+ let transformedList = fromFunctionDeclarations;
7839
+ if (Array.isArray(transformedList)) {
7840
+ transformedList = transformedList.map((item) => {
7841
+ return functionDeclarationToVertex$1(item);
7842
+ });
7843
+ }
7844
+ setValueByPath(toObject, ['functionDeclarations'], transformedList);
7845
+ }
7846
+ const fromRetrieval = getValueByPath(fromObject, ['retrieval']);
7847
+ if (fromRetrieval != null) {
7848
+ setValueByPath(toObject, ['retrieval'], fromRetrieval);
7849
+ }
7850
+ const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
7851
+ if (fromGoogleSearch != null) {
7852
+ setValueByPath(toObject, ['googleSearch'], googleSearchToVertex$1(fromGoogleSearch));
7853
+ }
7854
+ const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
7855
+ 'googleSearchRetrieval',
7856
+ ]);
7857
+ if (fromGoogleSearchRetrieval != null) {
7858
+ setValueByPath(toObject, ['googleSearchRetrieval'], googleSearchRetrievalToVertex$1(fromGoogleSearchRetrieval));
7859
+ }
7860
+ const fromEnterpriseWebSearch = getValueByPath(fromObject, [
7861
+ 'enterpriseWebSearch',
7862
+ ]);
7863
+ if (fromEnterpriseWebSearch != null) {
7864
+ setValueByPath(toObject, ['enterpriseWebSearch'], enterpriseWebSearchToVertex$1());
7865
+ }
7866
+ const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
7867
+ if (fromGoogleMaps != null) {
7868
+ setValueByPath(toObject, ['googleMaps'], googleMapsToVertex$1(fromGoogleMaps));
7869
+ }
7870
+ const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
7871
+ if (fromUrlContext != null) {
7872
+ setValueByPath(toObject, ['urlContext'], urlContextToVertex$1());
7873
+ }
7874
+ const fromCodeExecution = getValueByPath(fromObject, [
7875
+ 'codeExecution',
7876
+ ]);
7877
+ if (fromCodeExecution != null) {
7878
+ setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
7879
+ }
7880
+ const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
7881
+ if (fromComputerUse != null) {
7882
+ setValueByPath(toObject, ['computerUse'], fromComputerUse);
7883
+ }
7884
+ return toObject;
7885
+ }
7886
+ function sessionResumptionConfigToVertex(fromObject) {
7887
+ const toObject = {};
7888
+ const fromHandle = getValueByPath(fromObject, ['handle']);
7889
+ if (fromHandle != null) {
7890
+ setValueByPath(toObject, ['handle'], fromHandle);
7891
+ }
7892
+ const fromTransparent = getValueByPath(fromObject, ['transparent']);
7893
+ if (fromTransparent != null) {
7894
+ setValueByPath(toObject, ['transparent'], fromTransparent);
7895
+ }
7896
+ return toObject;
7897
+ }
7898
+ function audioTranscriptionConfigToVertex() {
7899
+ const toObject = {};
7900
+ return toObject;
7901
+ }
7902
+ function automaticActivityDetectionToVertex(fromObject) {
7903
+ const toObject = {};
7904
+ const fromDisabled = getValueByPath(fromObject, ['disabled']);
7905
+ if (fromDisabled != null) {
7906
+ setValueByPath(toObject, ['disabled'], fromDisabled);
7907
+ }
7908
+ const fromStartOfSpeechSensitivity = getValueByPath(fromObject, [
7909
+ 'startOfSpeechSensitivity',
7910
+ ]);
7911
+ if (fromStartOfSpeechSensitivity != null) {
7912
+ setValueByPath(toObject, ['startOfSpeechSensitivity'], fromStartOfSpeechSensitivity);
7913
+ }
7914
+ const fromEndOfSpeechSensitivity = getValueByPath(fromObject, [
7915
+ 'endOfSpeechSensitivity',
7916
+ ]);
7917
+ if (fromEndOfSpeechSensitivity != null) {
7918
+ setValueByPath(toObject, ['endOfSpeechSensitivity'], fromEndOfSpeechSensitivity);
7919
+ }
7920
+ const fromPrefixPaddingMs = getValueByPath(fromObject, [
7921
+ 'prefixPaddingMs',
7922
+ ]);
7923
+ if (fromPrefixPaddingMs != null) {
7924
+ setValueByPath(toObject, ['prefixPaddingMs'], fromPrefixPaddingMs);
7925
+ }
7926
+ const fromSilenceDurationMs = getValueByPath(fromObject, [
7927
+ 'silenceDurationMs',
7928
+ ]);
7929
+ if (fromSilenceDurationMs != null) {
7930
+ setValueByPath(toObject, ['silenceDurationMs'], fromSilenceDurationMs);
7931
+ }
7932
+ return toObject;
7933
+ }
7934
+ function realtimeInputConfigToVertex(fromObject) {
7935
+ const toObject = {};
7936
+ const fromAutomaticActivityDetection = getValueByPath(fromObject, [
7937
+ 'automaticActivityDetection',
7938
+ ]);
7939
+ if (fromAutomaticActivityDetection != null) {
7940
+ setValueByPath(toObject, ['automaticActivityDetection'], automaticActivityDetectionToVertex(fromAutomaticActivityDetection));
7941
+ }
7942
+ const fromActivityHandling = getValueByPath(fromObject, [
7943
+ 'activityHandling',
7944
+ ]);
7945
+ if (fromActivityHandling != null) {
7946
+ setValueByPath(toObject, ['activityHandling'], fromActivityHandling);
7947
+ }
7948
+ const fromTurnCoverage = getValueByPath(fromObject, ['turnCoverage']);
7949
+ if (fromTurnCoverage != null) {
7950
+ setValueByPath(toObject, ['turnCoverage'], fromTurnCoverage);
7951
+ }
7952
+ return toObject;
7953
+ }
7954
+ function slidingWindowToVertex(fromObject) {
7955
+ const toObject = {};
7956
+ const fromTargetTokens = getValueByPath(fromObject, ['targetTokens']);
7957
+ if (fromTargetTokens != null) {
7958
+ setValueByPath(toObject, ['targetTokens'], fromTargetTokens);
7959
+ }
7960
+ return toObject;
7961
+ }
7962
+ function contextWindowCompressionConfigToVertex(fromObject) {
7963
+ const toObject = {};
7964
+ const fromTriggerTokens = getValueByPath(fromObject, [
7965
+ 'triggerTokens',
7966
+ ]);
7967
+ if (fromTriggerTokens != null) {
7968
+ setValueByPath(toObject, ['triggerTokens'], fromTriggerTokens);
7969
+ }
7970
+ const fromSlidingWindow = getValueByPath(fromObject, [
7971
+ 'slidingWindow',
7972
+ ]);
7973
+ if (fromSlidingWindow != null) {
7974
+ setValueByPath(toObject, ['slidingWindow'], slidingWindowToVertex(fromSlidingWindow));
7975
+ }
7976
+ return toObject;
7977
+ }
7978
+ function proactivityConfigToVertex(fromObject) {
7979
+ const toObject = {};
7980
+ const fromProactiveAudio = getValueByPath(fromObject, [
7981
+ 'proactiveAudio',
7982
+ ]);
7983
+ if (fromProactiveAudio != null) {
7984
+ setValueByPath(toObject, ['proactiveAudio'], fromProactiveAudio);
7985
+ }
7986
+ return toObject;
7987
+ }
7988
+ function liveConnectConfigToVertex(fromObject, parentObject) {
7989
+ const toObject = {};
7990
+ const fromGenerationConfig = getValueByPath(fromObject, [
7991
+ 'generationConfig',
7992
+ ]);
7993
+ if (parentObject !== undefined && fromGenerationConfig != null) {
7994
+ setValueByPath(parentObject, ['setup', 'generationConfig'], fromGenerationConfig);
7995
+ }
7996
+ const fromResponseModalities = getValueByPath(fromObject, [
7997
+ 'responseModalities',
7998
+ ]);
7999
+ if (parentObject !== undefined && fromResponseModalities != null) {
8000
+ setValueByPath(parentObject, ['setup', 'generationConfig', 'responseModalities'], fromResponseModalities);
8001
+ }
8002
+ const fromTemperature = getValueByPath(fromObject, ['temperature']);
8003
+ if (parentObject !== undefined && fromTemperature != null) {
8004
+ setValueByPath(parentObject, ['setup', 'generationConfig', 'temperature'], fromTemperature);
8005
+ }
8006
+ const fromTopP = getValueByPath(fromObject, ['topP']);
8007
+ if (parentObject !== undefined && fromTopP != null) {
8008
+ setValueByPath(parentObject, ['setup', 'generationConfig', 'topP'], fromTopP);
8009
+ }
8010
+ const fromTopK = getValueByPath(fromObject, ['topK']);
8011
+ if (parentObject !== undefined && fromTopK != null) {
8012
+ setValueByPath(parentObject, ['setup', 'generationConfig', 'topK'], fromTopK);
8013
+ }
8014
+ const fromMaxOutputTokens = getValueByPath(fromObject, [
8015
+ 'maxOutputTokens',
8016
+ ]);
8017
+ if (parentObject !== undefined && fromMaxOutputTokens != null) {
8018
+ setValueByPath(parentObject, ['setup', 'generationConfig', 'maxOutputTokens'], fromMaxOutputTokens);
8019
+ }
8020
+ const fromMediaResolution = getValueByPath(fromObject, [
8021
+ 'mediaResolution',
8022
+ ]);
8023
+ if (parentObject !== undefined && fromMediaResolution != null) {
8024
+ setValueByPath(parentObject, ['setup', 'generationConfig', 'mediaResolution'], fromMediaResolution);
8025
+ }
8026
+ const fromSeed = getValueByPath(fromObject, ['seed']);
8027
+ if (parentObject !== undefined && fromSeed != null) {
8028
+ setValueByPath(parentObject, ['setup', 'generationConfig', 'seed'], fromSeed);
8029
+ }
8030
+ const fromSpeechConfig = getValueByPath(fromObject, ['speechConfig']);
8031
+ if (parentObject !== undefined && fromSpeechConfig != null) {
8032
+ setValueByPath(parentObject, ['setup', 'generationConfig', 'speechConfig'], speechConfigToVertex$1(tLiveSpeechConfig(fromSpeechConfig)));
8033
+ }
8034
+ const fromEnableAffectiveDialog = getValueByPath(fromObject, [
8035
+ 'enableAffectiveDialog',
8036
+ ]);
8037
+ if (parentObject !== undefined && fromEnableAffectiveDialog != null) {
8038
+ setValueByPath(parentObject, ['setup', 'generationConfig', 'enableAffectiveDialog'], fromEnableAffectiveDialog);
8039
+ }
8040
+ const fromSystemInstruction = getValueByPath(fromObject, [
8041
+ 'systemInstruction',
8042
+ ]);
8043
+ if (parentObject !== undefined && fromSystemInstruction != null) {
8044
+ setValueByPath(parentObject, ['setup', 'systemInstruction'], contentToVertex$1(tContent(fromSystemInstruction)));
8045
+ }
8046
+ const fromTools = getValueByPath(fromObject, ['tools']);
8047
+ if (parentObject !== undefined && fromTools != null) {
8048
+ let transformedList = tTools(fromTools);
8049
+ if (Array.isArray(transformedList)) {
8050
+ transformedList = transformedList.map((item) => {
8051
+ return toolToVertex$1(tTool(item));
8052
+ });
8053
+ }
8054
+ setValueByPath(parentObject, ['setup', 'tools'], transformedList);
8055
+ }
8056
+ const fromSessionResumption = getValueByPath(fromObject, [
8057
+ 'sessionResumption',
8058
+ ]);
8059
+ if (parentObject !== undefined && fromSessionResumption != null) {
8060
+ setValueByPath(parentObject, ['setup', 'sessionResumption'], sessionResumptionConfigToVertex(fromSessionResumption));
8061
+ }
8062
+ const fromInputAudioTranscription = getValueByPath(fromObject, [
8063
+ 'inputAudioTranscription',
8064
+ ]);
8065
+ if (parentObject !== undefined && fromInputAudioTranscription != null) {
8066
+ setValueByPath(parentObject, ['setup', 'inputAudioTranscription'], audioTranscriptionConfigToVertex());
8067
+ }
8068
+ const fromOutputAudioTranscription = getValueByPath(fromObject, [
8069
+ 'outputAudioTranscription',
8070
+ ]);
8071
+ if (parentObject !== undefined && fromOutputAudioTranscription != null) {
8072
+ setValueByPath(parentObject, ['setup', 'outputAudioTranscription'], audioTranscriptionConfigToVertex());
8073
+ }
8074
+ const fromRealtimeInputConfig = getValueByPath(fromObject, [
8075
+ 'realtimeInputConfig',
8076
+ ]);
8077
+ if (parentObject !== undefined && fromRealtimeInputConfig != null) {
8078
+ setValueByPath(parentObject, ['setup', 'realtimeInputConfig'], realtimeInputConfigToVertex(fromRealtimeInputConfig));
8079
+ }
8080
+ const fromContextWindowCompression = getValueByPath(fromObject, [
8081
+ 'contextWindowCompression',
8082
+ ]);
8083
+ if (parentObject !== undefined && fromContextWindowCompression != null) {
8084
+ setValueByPath(parentObject, ['setup', 'contextWindowCompression'], contextWindowCompressionConfigToVertex(fromContextWindowCompression));
8085
+ }
8086
+ const fromProactivity = getValueByPath(fromObject, ['proactivity']);
8087
+ if (parentObject !== undefined && fromProactivity != null) {
8088
+ setValueByPath(parentObject, ['setup', 'proactivity'], proactivityConfigToVertex(fromProactivity));
8089
+ }
8090
+ return toObject;
8091
+ }
8092
+ function liveConnectParametersToVertex(apiClient, fromObject) {
8093
+ const toObject = {};
8094
+ const fromModel = getValueByPath(fromObject, ['model']);
8095
+ if (fromModel != null) {
8096
+ setValueByPath(toObject, ['setup', 'model'], tModel(apiClient, fromModel));
8097
+ }
8098
+ const fromConfig = getValueByPath(fromObject, ['config']);
8099
+ if (fromConfig != null) {
8100
+ setValueByPath(toObject, ['config'], liveConnectConfigToVertex(fromConfig, toObject));
8101
+ }
8102
+ return toObject;
8103
+ }
8104
+ function activityStartToVertex() {
8105
+ const toObject = {};
8106
+ return toObject;
8107
+ }
8108
+ function activityEndToVertex() {
8109
+ const toObject = {};
8110
+ return toObject;
8111
+ }
8112
+ function liveSendRealtimeInputParametersToVertex(fromObject) {
8113
+ const toObject = {};
8114
+ const fromMedia = getValueByPath(fromObject, ['media']);
8115
+ if (fromMedia != null) {
8116
+ setValueByPath(toObject, ['mediaChunks'], tBlobs(fromMedia));
8117
+ }
8118
+ const fromAudio = getValueByPath(fromObject, ['audio']);
8119
+ if (fromAudio != null) {
8120
+ setValueByPath(toObject, ['audio'], tAudioBlob(fromAudio));
8121
+ }
8122
+ const fromAudioStreamEnd = getValueByPath(fromObject, [
8123
+ 'audioStreamEnd',
8124
+ ]);
8125
+ if (fromAudioStreamEnd != null) {
8126
+ setValueByPath(toObject, ['audioStreamEnd'], fromAudioStreamEnd);
8127
+ }
8128
+ const fromVideo = getValueByPath(fromObject, ['video']);
8129
+ if (fromVideo != null) {
8130
+ setValueByPath(toObject, ['video'], tImageBlob(fromVideo));
8131
+ }
8132
+ const fromText = getValueByPath(fromObject, ['text']);
8133
+ if (fromText != null) {
8134
+ setValueByPath(toObject, ['text'], fromText);
8135
+ }
8136
+ const fromActivityStart = getValueByPath(fromObject, [
8137
+ 'activityStart',
8138
+ ]);
8139
+ if (fromActivityStart != null) {
8140
+ setValueByPath(toObject, ['activityStart'], activityStartToVertex());
8141
+ }
8142
+ const fromActivityEnd = getValueByPath(fromObject, ['activityEnd']);
8143
+ if (fromActivityEnd != null) {
8144
+ setValueByPath(toObject, ['activityEnd'], activityEndToVertex());
8145
+ }
8146
+ return toObject;
8147
+ }
8148
+ function liveServerSetupCompleteFromMldev() {
8149
+ const toObject = {};
8150
+ return toObject;
8151
+ }
8152
+ function videoMetadataFromMldev$1(fromObject) {
8153
+ const toObject = {};
8154
+ const fromFps = getValueByPath(fromObject, ['fps']);
8155
+ if (fromFps != null) {
8156
+ setValueByPath(toObject, ['fps'], fromFps);
8157
+ }
8158
+ const fromEndOffset = getValueByPath(fromObject, ['endOffset']);
8159
+ if (fromEndOffset != null) {
8160
+ setValueByPath(toObject, ['endOffset'], fromEndOffset);
8161
+ }
8162
+ const fromStartOffset = getValueByPath(fromObject, ['startOffset']);
8163
+ if (fromStartOffset != null) {
8164
+ setValueByPath(toObject, ['startOffset'], fromStartOffset);
8165
+ }
8166
+ return toObject;
8167
+ }
8168
+ function blobFromMldev$1(fromObject) {
8169
+ const toObject = {};
8170
+ const fromData = getValueByPath(fromObject, ['data']);
8171
+ if (fromData != null) {
8172
+ setValueByPath(toObject, ['data'], fromData);
8173
+ }
8174
+ const fromMimeType = getValueByPath(fromObject, ['mimeType']);
8175
+ if (fromMimeType != null) {
8176
+ setValueByPath(toObject, ['mimeType'], fromMimeType);
8177
+ }
8178
+ return toObject;
8179
+ }
8180
+ function fileDataFromMldev$1(fromObject) {
8181
+ const toObject = {};
8182
+ const fromFileUri = getValueByPath(fromObject, ['fileUri']);
8183
+ if (fromFileUri != null) {
8184
+ setValueByPath(toObject, ['fileUri'], fromFileUri);
8185
+ }
8186
+ const fromMimeType = getValueByPath(fromObject, ['mimeType']);
8187
+ if (fromMimeType != null) {
8188
+ setValueByPath(toObject, ['mimeType'], fromMimeType);
8189
+ }
8190
+ return toObject;
8191
+ }
8192
+ function partFromMldev$1(fromObject) {
8193
+ const toObject = {};
8194
+ const fromVideoMetadata = getValueByPath(fromObject, [
8195
+ 'videoMetadata',
8196
+ ]);
8197
+ if (fromVideoMetadata != null) {
8198
+ setValueByPath(toObject, ['videoMetadata'], videoMetadataFromMldev$1(fromVideoMetadata));
8199
+ }
8200
+ const fromThought = getValueByPath(fromObject, ['thought']);
8201
+ if (fromThought != null) {
8202
+ setValueByPath(toObject, ['thought'], fromThought);
8203
+ }
8204
+ const fromInlineData = getValueByPath(fromObject, ['inlineData']);
8205
+ if (fromInlineData != null) {
8206
+ setValueByPath(toObject, ['inlineData'], blobFromMldev$1(fromInlineData));
8207
+ }
8208
+ const fromFileData = getValueByPath(fromObject, ['fileData']);
8209
+ if (fromFileData != null) {
8210
+ setValueByPath(toObject, ['fileData'], fileDataFromMldev$1(fromFileData));
8211
+ }
8212
+ const fromThoughtSignature = getValueByPath(fromObject, [
8213
+ 'thoughtSignature',
8214
+ ]);
8215
+ if (fromThoughtSignature != null) {
8216
+ setValueByPath(toObject, ['thoughtSignature'], fromThoughtSignature);
8217
+ }
8218
+ const fromCodeExecutionResult = getValueByPath(fromObject, [
8219
+ 'codeExecutionResult',
8220
+ ]);
8221
+ if (fromCodeExecutionResult != null) {
8222
+ setValueByPath(toObject, ['codeExecutionResult'], fromCodeExecutionResult);
8223
+ }
8224
+ const fromExecutableCode = getValueByPath(fromObject, [
8225
+ 'executableCode',
8226
+ ]);
8227
+ if (fromExecutableCode != null) {
8228
+ setValueByPath(toObject, ['executableCode'], fromExecutableCode);
8229
+ }
8230
+ const fromFunctionCall = getValueByPath(fromObject, ['functionCall']);
8231
+ if (fromFunctionCall != null) {
8232
+ setValueByPath(toObject, ['functionCall'], fromFunctionCall);
8233
+ }
8234
+ const fromFunctionResponse = getValueByPath(fromObject, [
8235
+ 'functionResponse',
8236
+ ]);
8237
+ if (fromFunctionResponse != null) {
8238
+ setValueByPath(toObject, ['functionResponse'], fromFunctionResponse);
8239
+ }
8240
+ const fromText = getValueByPath(fromObject, ['text']);
8241
+ if (fromText != null) {
8242
+ setValueByPath(toObject, ['text'], fromText);
8243
+ }
8244
+ return toObject;
8245
+ }
8246
+ function contentFromMldev$1(fromObject) {
8247
+ const toObject = {};
8248
+ const fromParts = getValueByPath(fromObject, ['parts']);
8249
+ if (fromParts != null) {
8250
+ let transformedList = fromParts;
8251
+ if (Array.isArray(transformedList)) {
8252
+ transformedList = transformedList.map((item) => {
8253
+ return partFromMldev$1(item);
8254
+ });
8255
+ }
8256
+ setValueByPath(toObject, ['parts'], transformedList);
8257
+ }
8258
+ const fromRole = getValueByPath(fromObject, ['role']);
8259
+ if (fromRole != null) {
8260
+ setValueByPath(toObject, ['role'], fromRole);
8261
+ }
8262
+ return toObject;
8263
+ }
8264
+ function transcriptionFromMldev(fromObject) {
8265
+ const toObject = {};
8266
+ const fromText = getValueByPath(fromObject, ['text']);
8267
+ if (fromText != null) {
8268
+ setValueByPath(toObject, ['text'], fromText);
8269
+ }
8270
+ const fromFinished = getValueByPath(fromObject, ['finished']);
8271
+ if (fromFinished != null) {
8272
+ setValueByPath(toObject, ['finished'], fromFinished);
8273
+ }
8274
+ return toObject;
8275
+ }
8276
+ function urlMetadataFromMldev$1(fromObject) {
8277
+ const toObject = {};
8278
+ const fromRetrievedUrl = getValueByPath(fromObject, ['retrievedUrl']);
8279
+ if (fromRetrievedUrl != null) {
8280
+ setValueByPath(toObject, ['retrievedUrl'], fromRetrievedUrl);
8281
+ }
8282
+ const fromUrlRetrievalStatus = getValueByPath(fromObject, [
8283
+ 'urlRetrievalStatus',
8284
+ ]);
8285
+ if (fromUrlRetrievalStatus != null) {
8286
+ setValueByPath(toObject, ['urlRetrievalStatus'], fromUrlRetrievalStatus);
8287
+ }
8288
+ return toObject;
8289
+ }
8290
+ function urlContextMetadataFromMldev$1(fromObject) {
8291
+ const toObject = {};
8292
+ const fromUrlMetadata = getValueByPath(fromObject, ['urlMetadata']);
8293
+ if (fromUrlMetadata != null) {
8294
+ let transformedList = fromUrlMetadata;
8295
+ if (Array.isArray(transformedList)) {
8296
+ transformedList = transformedList.map((item) => {
8297
+ return urlMetadataFromMldev$1(item);
8298
+ });
8299
+ }
8300
+ setValueByPath(toObject, ['urlMetadata'], transformedList);
8301
+ }
8302
+ return toObject;
8303
+ }
8304
+ function liveServerContentFromMldev(fromObject) {
8305
+ const toObject = {};
8306
+ const fromModelTurn = getValueByPath(fromObject, ['modelTurn']);
8307
+ if (fromModelTurn != null) {
8308
+ setValueByPath(toObject, ['modelTurn'], contentFromMldev$1(fromModelTurn));
8309
+ }
8310
+ const fromTurnComplete = getValueByPath(fromObject, ['turnComplete']);
8311
+ if (fromTurnComplete != null) {
8312
+ setValueByPath(toObject, ['turnComplete'], fromTurnComplete);
8313
+ }
8314
+ const fromInterrupted = getValueByPath(fromObject, ['interrupted']);
8315
+ if (fromInterrupted != null) {
8316
+ setValueByPath(toObject, ['interrupted'], fromInterrupted);
8317
+ }
8318
+ const fromGroundingMetadata = getValueByPath(fromObject, [
8319
+ 'groundingMetadata',
8320
+ ]);
8321
+ if (fromGroundingMetadata != null) {
8322
+ setValueByPath(toObject, ['groundingMetadata'], fromGroundingMetadata);
8323
+ }
8324
+ const fromGenerationComplete = getValueByPath(fromObject, [
8325
+ 'generationComplete',
8326
+ ]);
8327
+ if (fromGenerationComplete != null) {
8328
+ setValueByPath(toObject, ['generationComplete'], fromGenerationComplete);
8329
+ }
8330
+ const fromInputTranscription = getValueByPath(fromObject, [
8331
+ 'inputTranscription',
8332
+ ]);
8333
+ if (fromInputTranscription != null) {
8334
+ setValueByPath(toObject, ['inputTranscription'], transcriptionFromMldev(fromInputTranscription));
8335
+ }
8336
+ const fromOutputTranscription = getValueByPath(fromObject, [
8337
+ 'outputTranscription',
8338
+ ]);
8339
+ if (fromOutputTranscription != null) {
8340
+ setValueByPath(toObject, ['outputTranscription'], transcriptionFromMldev(fromOutputTranscription));
8341
+ }
8342
+ const fromUrlContextMetadata = getValueByPath(fromObject, [
8343
+ 'urlContextMetadata',
8344
+ ]);
8345
+ if (fromUrlContextMetadata != null) {
8346
+ setValueByPath(toObject, ['urlContextMetadata'], urlContextMetadataFromMldev$1(fromUrlContextMetadata));
8347
+ }
8348
+ return toObject;
8349
+ }
8350
+ function functionCallFromMldev(fromObject) {
8351
+ const toObject = {};
8352
+ const fromId = getValueByPath(fromObject, ['id']);
8353
+ if (fromId != null) {
8354
+ setValueByPath(toObject, ['id'], fromId);
8355
+ }
8356
+ const fromArgs = getValueByPath(fromObject, ['args']);
8357
+ if (fromArgs != null) {
8358
+ setValueByPath(toObject, ['args'], fromArgs);
8359
+ }
8360
+ const fromName = getValueByPath(fromObject, ['name']);
8361
+ if (fromName != null) {
8362
+ setValueByPath(toObject, ['name'], fromName);
8363
+ }
8364
+ return toObject;
8365
+ }
8366
+ function liveServerToolCallFromMldev(fromObject) {
8367
+ const toObject = {};
8368
+ const fromFunctionCalls = getValueByPath(fromObject, [
8369
+ 'functionCalls',
8370
+ ]);
8371
+ if (fromFunctionCalls != null) {
8372
+ let transformedList = fromFunctionCalls;
8373
+ if (Array.isArray(transformedList)) {
8374
+ transformedList = transformedList.map((item) => {
8375
+ return functionCallFromMldev(item);
8376
+ });
8377
+ }
8378
+ setValueByPath(toObject, ['functionCalls'], transformedList);
8379
+ }
8380
+ return toObject;
8381
+ }
8382
+ function liveServerToolCallCancellationFromMldev(fromObject) {
8383
+ const toObject = {};
8384
+ const fromIds = getValueByPath(fromObject, ['ids']);
8385
+ if (fromIds != null) {
8386
+ setValueByPath(toObject, ['ids'], fromIds);
8387
+ }
8388
+ return toObject;
8389
+ }
8390
+ function modalityTokenCountFromMldev(fromObject) {
8391
+ const toObject = {};
8392
+ const fromModality = getValueByPath(fromObject, ['modality']);
8393
+ if (fromModality != null) {
8394
+ setValueByPath(toObject, ['modality'], fromModality);
8395
+ }
8396
+ const fromTokenCount = getValueByPath(fromObject, ['tokenCount']);
8397
+ if (fromTokenCount != null) {
8398
+ setValueByPath(toObject, ['tokenCount'], fromTokenCount);
8399
+ }
8400
+ return toObject;
8401
+ }
8402
+ function usageMetadataFromMldev(fromObject) {
8403
+ const toObject = {};
8404
+ const fromPromptTokenCount = getValueByPath(fromObject, [
8405
+ 'promptTokenCount',
8406
+ ]);
8407
+ if (fromPromptTokenCount != null) {
8408
+ setValueByPath(toObject, ['promptTokenCount'], fromPromptTokenCount);
8409
+ }
8410
+ const fromCachedContentTokenCount = getValueByPath(fromObject, [
8411
+ 'cachedContentTokenCount',
8412
+ ]);
8413
+ if (fromCachedContentTokenCount != null) {
8414
+ setValueByPath(toObject, ['cachedContentTokenCount'], fromCachedContentTokenCount);
8415
+ }
8416
+ const fromResponseTokenCount = getValueByPath(fromObject, [
8417
+ 'responseTokenCount',
8418
+ ]);
8419
+ if (fromResponseTokenCount != null) {
8420
+ setValueByPath(toObject, ['responseTokenCount'], fromResponseTokenCount);
8421
+ }
8422
+ const fromToolUsePromptTokenCount = getValueByPath(fromObject, [
8423
+ 'toolUsePromptTokenCount',
8424
+ ]);
8425
+ if (fromToolUsePromptTokenCount != null) {
8426
+ setValueByPath(toObject, ['toolUsePromptTokenCount'], fromToolUsePromptTokenCount);
8427
+ }
8428
+ const fromThoughtsTokenCount = getValueByPath(fromObject, [
8429
+ 'thoughtsTokenCount',
8430
+ ]);
8431
+ if (fromThoughtsTokenCount != null) {
8432
+ setValueByPath(toObject, ['thoughtsTokenCount'], fromThoughtsTokenCount);
8433
+ }
8434
+ const fromTotalTokenCount = getValueByPath(fromObject, [
8435
+ 'totalTokenCount',
8436
+ ]);
8437
+ if (fromTotalTokenCount != null) {
8438
+ setValueByPath(toObject, ['totalTokenCount'], fromTotalTokenCount);
8439
+ }
8440
+ const fromPromptTokensDetails = getValueByPath(fromObject, [
8441
+ 'promptTokensDetails',
8442
+ ]);
8443
+ if (fromPromptTokensDetails != null) {
8444
+ let transformedList = fromPromptTokensDetails;
8445
+ if (Array.isArray(transformedList)) {
8446
+ transformedList = transformedList.map((item) => {
8447
+ return modalityTokenCountFromMldev(item);
8448
+ });
8449
+ }
8450
+ setValueByPath(toObject, ['promptTokensDetails'], transformedList);
8451
+ }
8452
+ const fromCacheTokensDetails = getValueByPath(fromObject, [
8453
+ 'cacheTokensDetails',
8454
+ ]);
8455
+ if (fromCacheTokensDetails != null) {
8456
+ let transformedList = fromCacheTokensDetails;
8457
+ if (Array.isArray(transformedList)) {
8458
+ transformedList = transformedList.map((item) => {
8459
+ return modalityTokenCountFromMldev(item);
8460
+ });
8461
+ }
8462
+ setValueByPath(toObject, ['cacheTokensDetails'], transformedList);
8463
+ }
8464
+ const fromResponseTokensDetails = getValueByPath(fromObject, [
8465
+ 'responseTokensDetails',
8466
+ ]);
8467
+ if (fromResponseTokensDetails != null) {
8468
+ let transformedList = fromResponseTokensDetails;
8469
+ if (Array.isArray(transformedList)) {
8470
+ transformedList = transformedList.map((item) => {
8471
+ return modalityTokenCountFromMldev(item);
8472
+ });
8473
+ }
8474
+ setValueByPath(toObject, ['responseTokensDetails'], transformedList);
8475
+ }
8476
+ const fromToolUsePromptTokensDetails = getValueByPath(fromObject, [
8477
+ 'toolUsePromptTokensDetails',
8478
+ ]);
8479
+ if (fromToolUsePromptTokensDetails != null) {
8480
+ let transformedList = fromToolUsePromptTokensDetails;
8481
+ if (Array.isArray(transformedList)) {
8482
+ transformedList = transformedList.map((item) => {
8483
+ return modalityTokenCountFromMldev(item);
8484
+ });
8485
+ }
8486
+ setValueByPath(toObject, ['toolUsePromptTokensDetails'], transformedList);
8487
+ }
8488
+ return toObject;
8489
+ }
8490
+ function liveServerGoAwayFromMldev(fromObject) {
8491
+ const toObject = {};
8492
+ const fromTimeLeft = getValueByPath(fromObject, ['timeLeft']);
8493
+ if (fromTimeLeft != null) {
8494
+ setValueByPath(toObject, ['timeLeft'], fromTimeLeft);
8495
+ }
8496
+ return toObject;
8497
+ }
8498
+ function liveServerSessionResumptionUpdateFromMldev(fromObject) {
8499
+ const toObject = {};
8500
+ const fromNewHandle = getValueByPath(fromObject, ['newHandle']);
8501
+ if (fromNewHandle != null) {
8502
+ setValueByPath(toObject, ['newHandle'], fromNewHandle);
8503
+ }
8504
+ const fromResumable = getValueByPath(fromObject, ['resumable']);
8505
+ if (fromResumable != null) {
8506
+ setValueByPath(toObject, ['resumable'], fromResumable);
8507
+ }
8508
+ const fromLastConsumedClientMessageIndex = getValueByPath(fromObject, [
8509
+ 'lastConsumedClientMessageIndex',
8510
+ ]);
8511
+ if (fromLastConsumedClientMessageIndex != null) {
8512
+ setValueByPath(toObject, ['lastConsumedClientMessageIndex'], fromLastConsumedClientMessageIndex);
8513
+ }
8514
+ return toObject;
8515
+ }
8516
+ function liveServerMessageFromMldev(fromObject) {
8517
+ const toObject = {};
8518
+ const fromSetupComplete = getValueByPath(fromObject, [
8519
+ 'setupComplete',
8520
+ ]);
8521
+ if (fromSetupComplete != null) {
8522
+ setValueByPath(toObject, ['setupComplete'], liveServerSetupCompleteFromMldev());
8523
+ }
8524
+ const fromServerContent = getValueByPath(fromObject, [
8525
+ 'serverContent',
8526
+ ]);
8527
+ if (fromServerContent != null) {
8528
+ setValueByPath(toObject, ['serverContent'], liveServerContentFromMldev(fromServerContent));
8529
+ }
8530
+ const fromToolCall = getValueByPath(fromObject, ['toolCall']);
8531
+ if (fromToolCall != null) {
8532
+ setValueByPath(toObject, ['toolCall'], liveServerToolCallFromMldev(fromToolCall));
8533
+ }
8534
+ const fromToolCallCancellation = getValueByPath(fromObject, [
8535
+ 'toolCallCancellation',
8536
+ ]);
8537
+ if (fromToolCallCancellation != null) {
8538
+ setValueByPath(toObject, ['toolCallCancellation'], liveServerToolCallCancellationFromMldev(fromToolCallCancellation));
8539
+ }
8540
+ const fromUsageMetadata = getValueByPath(fromObject, [
8541
+ 'usageMetadata',
8542
+ ]);
8543
+ if (fromUsageMetadata != null) {
8544
+ setValueByPath(toObject, ['usageMetadata'], usageMetadataFromMldev(fromUsageMetadata));
8545
+ }
8546
+ const fromGoAway = getValueByPath(fromObject, ['goAway']);
8547
+ if (fromGoAway != null) {
8548
+ setValueByPath(toObject, ['goAway'], liveServerGoAwayFromMldev(fromGoAway));
8549
+ }
8550
+ const fromSessionResumptionUpdate = getValueByPath(fromObject, [
8551
+ 'sessionResumptionUpdate',
8552
+ ]);
8553
+ if (fromSessionResumptionUpdate != null) {
8554
+ setValueByPath(toObject, ['sessionResumptionUpdate'], liveServerSessionResumptionUpdateFromMldev(fromSessionResumptionUpdate));
8555
+ }
8556
+ return toObject;
8557
+ }
8558
+ function liveMusicServerSetupCompleteFromMldev() {
8559
+ const toObject = {};
8560
+ return toObject;
8561
+ }
8562
+ function weightedPromptFromMldev(fromObject) {
8563
+ const toObject = {};
8564
+ const fromText = getValueByPath(fromObject, ['text']);
8565
+ if (fromText != null) {
8566
+ setValueByPath(toObject, ['text'], fromText);
8567
+ }
8568
+ const fromWeight = getValueByPath(fromObject, ['weight']);
8569
+ if (fromWeight != null) {
8570
+ setValueByPath(toObject, ['weight'], fromWeight);
8571
+ }
8572
+ return toObject;
8573
+ }
8574
+ function liveMusicClientContentFromMldev(fromObject) {
8575
+ const toObject = {};
8576
+ const fromWeightedPrompts = getValueByPath(fromObject, [
8577
+ 'weightedPrompts',
8578
+ ]);
8579
+ if (fromWeightedPrompts != null) {
8580
+ let transformedList = fromWeightedPrompts;
8581
+ if (Array.isArray(transformedList)) {
8582
+ transformedList = transformedList.map((item) => {
8583
+ return weightedPromptFromMldev(item);
8584
+ });
8585
+ }
8586
+ setValueByPath(toObject, ['weightedPrompts'], transformedList);
8587
+ }
8588
+ return toObject;
8589
+ }
8590
+ function liveMusicGenerationConfigFromMldev(fromObject) {
8591
+ const toObject = {};
8592
+ const fromTemperature = getValueByPath(fromObject, ['temperature']);
8593
+ if (fromTemperature != null) {
8594
+ setValueByPath(toObject, ['temperature'], fromTemperature);
8595
+ }
8596
+ const fromTopK = getValueByPath(fromObject, ['topK']);
8597
+ if (fromTopK != null) {
8598
+ setValueByPath(toObject, ['topK'], fromTopK);
8599
+ }
8600
+ const fromSeed = getValueByPath(fromObject, ['seed']);
8601
+ if (fromSeed != null) {
8602
+ setValueByPath(toObject, ['seed'], fromSeed);
8603
+ }
8604
+ const fromGuidance = getValueByPath(fromObject, ['guidance']);
8605
+ if (fromGuidance != null) {
8606
+ setValueByPath(toObject, ['guidance'], fromGuidance);
8607
+ }
8608
+ const fromBpm = getValueByPath(fromObject, ['bpm']);
8609
+ if (fromBpm != null) {
8610
+ setValueByPath(toObject, ['bpm'], fromBpm);
8611
+ }
8612
+ const fromDensity = getValueByPath(fromObject, ['density']);
8613
+ if (fromDensity != null) {
8614
+ setValueByPath(toObject, ['density'], fromDensity);
8615
+ }
8616
+ const fromBrightness = getValueByPath(fromObject, ['brightness']);
8617
+ if (fromBrightness != null) {
8618
+ setValueByPath(toObject, ['brightness'], fromBrightness);
8619
+ }
8620
+ const fromScale = getValueByPath(fromObject, ['scale']);
8621
+ if (fromScale != null) {
8622
+ setValueByPath(toObject, ['scale'], fromScale);
8623
+ }
8624
+ const fromMuteBass = getValueByPath(fromObject, ['muteBass']);
8625
+ if (fromMuteBass != null) {
8626
+ setValueByPath(toObject, ['muteBass'], fromMuteBass);
8627
+ }
8628
+ const fromMuteDrums = getValueByPath(fromObject, ['muteDrums']);
8629
+ if (fromMuteDrums != null) {
8630
+ setValueByPath(toObject, ['muteDrums'], fromMuteDrums);
8631
+ }
8632
+ const fromOnlyBassAndDrums = getValueByPath(fromObject, [
8633
+ 'onlyBassAndDrums',
8634
+ ]);
8635
+ if (fromOnlyBassAndDrums != null) {
8636
+ setValueByPath(toObject, ['onlyBassAndDrums'], fromOnlyBassAndDrums);
8637
+ }
8638
+ return toObject;
8639
+ }
8640
+ function liveMusicSourceMetadataFromMldev(fromObject) {
8641
+ const toObject = {};
8642
+ const fromClientContent = getValueByPath(fromObject, [
8643
+ 'clientContent',
8644
+ ]);
8645
+ if (fromClientContent != null) {
8646
+ setValueByPath(toObject, ['clientContent'], liveMusicClientContentFromMldev(fromClientContent));
8647
+ }
8648
+ const fromMusicGenerationConfig = getValueByPath(fromObject, [
8649
+ 'musicGenerationConfig',
8650
+ ]);
8651
+ if (fromMusicGenerationConfig != null) {
8652
+ setValueByPath(toObject, ['musicGenerationConfig'], liveMusicGenerationConfigFromMldev(fromMusicGenerationConfig));
8653
+ }
8654
+ return toObject;
8655
+ }
8656
+ function audioChunkFromMldev(fromObject) {
8657
+ const toObject = {};
8658
+ const fromData = getValueByPath(fromObject, ['data']);
8659
+ if (fromData != null) {
8660
+ setValueByPath(toObject, ['data'], fromData);
8661
+ }
8662
+ const fromMimeType = getValueByPath(fromObject, ['mimeType']);
8663
+ if (fromMimeType != null) {
8664
+ setValueByPath(toObject, ['mimeType'], fromMimeType);
8665
+ }
8666
+ const fromSourceMetadata = getValueByPath(fromObject, [
8667
+ 'sourceMetadata',
8668
+ ]);
8669
+ if (fromSourceMetadata != null) {
8670
+ setValueByPath(toObject, ['sourceMetadata'], liveMusicSourceMetadataFromMldev(fromSourceMetadata));
8671
+ }
8672
+ return toObject;
8673
+ }
8674
+ function liveMusicServerContentFromMldev(fromObject) {
8675
+ const toObject = {};
8676
+ const fromAudioChunks = getValueByPath(fromObject, ['audioChunks']);
8677
+ if (fromAudioChunks != null) {
8678
+ let transformedList = fromAudioChunks;
8679
+ if (Array.isArray(transformedList)) {
8680
+ transformedList = transformedList.map((item) => {
8681
+ return audioChunkFromMldev(item);
8682
+ });
8683
+ }
8684
+ setValueByPath(toObject, ['audioChunks'], transformedList);
8685
+ }
8686
+ return toObject;
8687
+ }
8688
+ function liveMusicFilteredPromptFromMldev(fromObject) {
8689
+ const toObject = {};
8690
+ const fromText = getValueByPath(fromObject, ['text']);
8691
+ if (fromText != null) {
8692
+ setValueByPath(toObject, ['text'], fromText);
8693
+ }
8694
+ const fromFilteredReason = getValueByPath(fromObject, [
8695
+ 'filteredReason',
8696
+ ]);
8697
+ if (fromFilteredReason != null) {
8698
+ setValueByPath(toObject, ['filteredReason'], fromFilteredReason);
8699
+ }
8700
+ return toObject;
8701
+ }
8702
+ function liveMusicServerMessageFromMldev(fromObject) {
8703
+ const toObject = {};
8704
+ const fromSetupComplete = getValueByPath(fromObject, [
8705
+ 'setupComplete',
8706
+ ]);
8707
+ if (fromSetupComplete != null) {
8708
+ setValueByPath(toObject, ['setupComplete'], liveMusicServerSetupCompleteFromMldev());
8709
+ }
8710
+ const fromServerContent = getValueByPath(fromObject, [
8711
+ 'serverContent',
8712
+ ]);
8713
+ if (fromServerContent != null) {
8714
+ setValueByPath(toObject, ['serverContent'], liveMusicServerContentFromMldev(fromServerContent));
8715
+ }
8716
+ const fromFilteredPrompt = getValueByPath(fromObject, [
8717
+ 'filteredPrompt',
8718
+ ]);
8719
+ if (fromFilteredPrompt != null) {
8720
+ setValueByPath(toObject, ['filteredPrompt'], liveMusicFilteredPromptFromMldev(fromFilteredPrompt));
8721
+ }
8722
+ return toObject;
8723
+ }
8724
+ function liveServerSetupCompleteFromVertex(fromObject) {
8725
+ const toObject = {};
8726
+ const fromSessionId = getValueByPath(fromObject, ['sessionId']);
8727
+ if (fromSessionId != null) {
8728
+ setValueByPath(toObject, ['sessionId'], fromSessionId);
8729
+ }
8730
+ return toObject;
8731
+ }
8732
+ function videoMetadataFromVertex$1(fromObject) {
8733
+ const toObject = {};
8734
+ const fromFps = getValueByPath(fromObject, ['fps']);
8735
+ if (fromFps != null) {
8736
+ setValueByPath(toObject, ['fps'], fromFps);
8737
+ }
8738
+ const fromEndOffset = getValueByPath(fromObject, ['endOffset']);
8739
+ if (fromEndOffset != null) {
8740
+ setValueByPath(toObject, ['endOffset'], fromEndOffset);
8741
+ }
8742
+ const fromStartOffset = getValueByPath(fromObject, ['startOffset']);
8743
+ if (fromStartOffset != null) {
8744
+ setValueByPath(toObject, ['startOffset'], fromStartOffset);
8745
+ }
8746
+ return toObject;
8747
+ }
8748
+ function blobFromVertex$1(fromObject) {
8749
+ const toObject = {};
8750
+ const fromDisplayName = getValueByPath(fromObject, ['displayName']);
8751
+ if (fromDisplayName != null) {
8752
+ setValueByPath(toObject, ['displayName'], fromDisplayName);
8753
+ }
8754
+ const fromData = getValueByPath(fromObject, ['data']);
8755
+ if (fromData != null) {
8756
+ setValueByPath(toObject, ['data'], fromData);
8757
+ }
8758
+ const fromMimeType = getValueByPath(fromObject, ['mimeType']);
8759
+ if (fromMimeType != null) {
8760
+ setValueByPath(toObject, ['mimeType'], fromMimeType);
8761
+ }
8762
+ return toObject;
8763
+ }
8764
+ function fileDataFromVertex$1(fromObject) {
8765
+ const toObject = {};
8766
+ const fromDisplayName = getValueByPath(fromObject, ['displayName']);
8767
+ if (fromDisplayName != null) {
8768
+ setValueByPath(toObject, ['displayName'], fromDisplayName);
8769
+ }
8770
+ const fromFileUri = getValueByPath(fromObject, ['fileUri']);
8771
+ if (fromFileUri != null) {
8772
+ setValueByPath(toObject, ['fileUri'], fromFileUri);
8773
+ }
8774
+ const fromMimeType = getValueByPath(fromObject, ['mimeType']);
8775
+ if (fromMimeType != null) {
8776
+ setValueByPath(toObject, ['mimeType'], fromMimeType);
8777
+ }
8778
+ return toObject;
8779
+ }
8780
+ function partFromVertex$1(fromObject) {
8781
+ const toObject = {};
8782
+ const fromVideoMetadata = getValueByPath(fromObject, [
8783
+ 'videoMetadata',
8784
+ ]);
8785
+ if (fromVideoMetadata != null) {
8786
+ setValueByPath(toObject, ['videoMetadata'], videoMetadataFromVertex$1(fromVideoMetadata));
8787
+ }
8788
+ const fromThought = getValueByPath(fromObject, ['thought']);
8789
+ if (fromThought != null) {
8790
+ setValueByPath(toObject, ['thought'], fromThought);
8791
+ }
8792
+ const fromInlineData = getValueByPath(fromObject, ['inlineData']);
8417
8793
  if (fromInlineData != null) {
8418
8794
  setValueByPath(toObject, ['inlineData'], blobFromVertex$1(fromInlineData));
8419
8795
  }
@@ -8455,24 +8831,6 @@ function partFromVertex$1(fromObject) {
8455
8831
  }
8456
8832
  return toObject;
8457
8833
  }
8458
- function contentFromMldev$1(fromObject) {
8459
- const toObject = {};
8460
- const fromParts = getValueByPath(fromObject, ['parts']);
8461
- if (fromParts != null) {
8462
- let transformedList = fromParts;
8463
- if (Array.isArray(transformedList)) {
8464
- transformedList = transformedList.map((item) => {
8465
- return partFromMldev$1(item);
8466
- });
8467
- }
8468
- setValueByPath(toObject, ['parts'], transformedList);
8469
- }
8470
- const fromRole = getValueByPath(fromObject, ['role']);
8471
- if (fromRole != null) {
8472
- setValueByPath(toObject, ['role'], fromRole);
8473
- }
8474
- return toObject;
8475
- }
8476
8834
  function contentFromVertex$1(fromObject) {
8477
8835
  const toObject = {};
8478
8836
  const fromParts = getValueByPath(fromObject, ['parts']);
@@ -8491,18 +8849,6 @@ function contentFromVertex$1(fromObject) {
8491
8849
  }
8492
8850
  return toObject;
8493
8851
  }
8494
- function transcriptionFromMldev(fromObject) {
8495
- const toObject = {};
8496
- const fromText = getValueByPath(fromObject, ['text']);
8497
- if (fromText != null) {
8498
- setValueByPath(toObject, ['text'], fromText);
8499
- }
8500
- const fromFinished = getValueByPath(fromObject, ['finished']);
8501
- if (fromFinished != null) {
8502
- setValueByPath(toObject, ['finished'], fromFinished);
8503
- }
8504
- return toObject;
8505
- }
8506
8852
  function transcriptionFromVertex(fromObject) {
8507
8853
  const toObject = {};
8508
8854
  const fromText = getValueByPath(fromObject, ['text']);
@@ -8515,80 +8861,6 @@ function transcriptionFromVertex(fromObject) {
8515
8861
  }
8516
8862
  return toObject;
8517
8863
  }
8518
- function urlMetadataFromMldev$1(fromObject) {
8519
- const toObject = {};
8520
- const fromRetrievedUrl = getValueByPath(fromObject, ['retrievedUrl']);
8521
- if (fromRetrievedUrl != null) {
8522
- setValueByPath(toObject, ['retrievedUrl'], fromRetrievedUrl);
8523
- }
8524
- const fromUrlRetrievalStatus = getValueByPath(fromObject, [
8525
- 'urlRetrievalStatus',
8526
- ]);
8527
- if (fromUrlRetrievalStatus != null) {
8528
- setValueByPath(toObject, ['urlRetrievalStatus'], fromUrlRetrievalStatus);
8529
- }
8530
- return toObject;
8531
- }
8532
- function urlContextMetadataFromMldev$1(fromObject) {
8533
- const toObject = {};
8534
- const fromUrlMetadata = getValueByPath(fromObject, ['urlMetadata']);
8535
- if (fromUrlMetadata != null) {
8536
- let transformedList = fromUrlMetadata;
8537
- if (Array.isArray(transformedList)) {
8538
- transformedList = transformedList.map((item) => {
8539
- return urlMetadataFromMldev$1(item);
8540
- });
8541
- }
8542
- setValueByPath(toObject, ['urlMetadata'], transformedList);
8543
- }
8544
- return toObject;
8545
- }
8546
- function liveServerContentFromMldev(fromObject) {
8547
- const toObject = {};
8548
- const fromModelTurn = getValueByPath(fromObject, ['modelTurn']);
8549
- if (fromModelTurn != null) {
8550
- setValueByPath(toObject, ['modelTurn'], contentFromMldev$1(fromModelTurn));
8551
- }
8552
- const fromTurnComplete = getValueByPath(fromObject, ['turnComplete']);
8553
- if (fromTurnComplete != null) {
8554
- setValueByPath(toObject, ['turnComplete'], fromTurnComplete);
8555
- }
8556
- const fromInterrupted = getValueByPath(fromObject, ['interrupted']);
8557
- if (fromInterrupted != null) {
8558
- setValueByPath(toObject, ['interrupted'], fromInterrupted);
8559
- }
8560
- const fromGroundingMetadata = getValueByPath(fromObject, [
8561
- 'groundingMetadata',
8562
- ]);
8563
- if (fromGroundingMetadata != null) {
8564
- setValueByPath(toObject, ['groundingMetadata'], fromGroundingMetadata);
8565
- }
8566
- const fromGenerationComplete = getValueByPath(fromObject, [
8567
- 'generationComplete',
8568
- ]);
8569
- if (fromGenerationComplete != null) {
8570
- setValueByPath(toObject, ['generationComplete'], fromGenerationComplete);
8571
- }
8572
- const fromInputTranscription = getValueByPath(fromObject, [
8573
- 'inputTranscription',
8574
- ]);
8575
- if (fromInputTranscription != null) {
8576
- setValueByPath(toObject, ['inputTranscription'], transcriptionFromMldev(fromInputTranscription));
8577
- }
8578
- const fromOutputTranscription = getValueByPath(fromObject, [
8579
- 'outputTranscription',
8580
- ]);
8581
- if (fromOutputTranscription != null) {
8582
- setValueByPath(toObject, ['outputTranscription'], transcriptionFromMldev(fromOutputTranscription));
8583
- }
8584
- const fromUrlContextMetadata = getValueByPath(fromObject, [
8585
- 'urlContextMetadata',
8586
- ]);
8587
- if (fromUrlContextMetadata != null) {
8588
- setValueByPath(toObject, ['urlContextMetadata'], urlContextMetadataFromMldev$1(fromUrlContextMetadata));
8589
- }
8590
- return toObject;
8591
- }
8592
8864
  function liveServerContentFromVertex(fromObject) {
8593
8865
  const toObject = {};
8594
8866
  const fromModelTurn = getValueByPath(fromObject, ['modelTurn']);
@@ -8629,22 +8901,6 @@ function liveServerContentFromVertex(fromObject) {
8629
8901
  }
8630
8902
  return toObject;
8631
8903
  }
8632
- function functionCallFromMldev(fromObject) {
8633
- const toObject = {};
8634
- const fromId = getValueByPath(fromObject, ['id']);
8635
- if (fromId != null) {
8636
- setValueByPath(toObject, ['id'], fromId);
8637
- }
8638
- const fromArgs = getValueByPath(fromObject, ['args']);
8639
- if (fromArgs != null) {
8640
- setValueByPath(toObject, ['args'], fromArgs);
8641
- }
8642
- const fromName = getValueByPath(fromObject, ['name']);
8643
- if (fromName != null) {
8644
- setValueByPath(toObject, ['name'], fromName);
8645
- }
8646
- return toObject;
8647
- }
8648
8904
  function functionCallFromVertex(fromObject) {
8649
8905
  const toObject = {};
8650
8906
  const fromArgs = getValueByPath(fromObject, ['args']);
@@ -8657,22 +8913,6 @@ function functionCallFromVertex(fromObject) {
8657
8913
  }
8658
8914
  return toObject;
8659
8915
  }
8660
- function liveServerToolCallFromMldev(fromObject) {
8661
- const toObject = {};
8662
- const fromFunctionCalls = getValueByPath(fromObject, [
8663
- 'functionCalls',
8664
- ]);
8665
- if (fromFunctionCalls != null) {
8666
- let transformedList = fromFunctionCalls;
8667
- if (Array.isArray(transformedList)) {
8668
- transformedList = transformedList.map((item) => {
8669
- return functionCallFromMldev(item);
8670
- });
8671
- }
8672
- setValueByPath(toObject, ['functionCalls'], transformedList);
8673
- }
8674
- return toObject;
8675
- }
8676
8916
  function liveServerToolCallFromVertex(fromObject) {
8677
8917
  const toObject = {};
8678
8918
  const fromFunctionCalls = getValueByPath(fromObject, [
@@ -8689,14 +8929,6 @@ function liveServerToolCallFromVertex(fromObject) {
8689
8929
  }
8690
8930
  return toObject;
8691
8931
  }
8692
- function liveServerToolCallCancellationFromMldev(fromObject) {
8693
- const toObject = {};
8694
- const fromIds = getValueByPath(fromObject, ['ids']);
8695
- if (fromIds != null) {
8696
- setValueByPath(toObject, ['ids'], fromIds);
8697
- }
8698
- return toObject;
8699
- }
8700
8932
  function liveServerToolCallCancellationFromVertex(fromObject) {
8701
8933
  const toObject = {};
8702
8934
  const fromIds = getValueByPath(fromObject, ['ids']);
@@ -8705,18 +8937,6 @@ function liveServerToolCallCancellationFromVertex(fromObject) {
8705
8937
  }
8706
8938
  return toObject;
8707
8939
  }
8708
- function modalityTokenCountFromMldev(fromObject) {
8709
- const toObject = {};
8710
- const fromModality = getValueByPath(fromObject, ['modality']);
8711
- if (fromModality != null) {
8712
- setValueByPath(toObject, ['modality'], fromModality);
8713
- }
8714
- const fromTokenCount = getValueByPath(fromObject, ['tokenCount']);
8715
- if (fromTokenCount != null) {
8716
- setValueByPath(toObject, ['tokenCount'], fromTokenCount);
8717
- }
8718
- return toObject;
8719
- }
8720
8940
  function modalityTokenCountFromVertex(fromObject) {
8721
8941
  const toObject = {};
8722
8942
  const fromModality = getValueByPath(fromObject, ['modality']);
@@ -8729,94 +8949,6 @@ function modalityTokenCountFromVertex(fromObject) {
8729
8949
  }
8730
8950
  return toObject;
8731
8951
  }
8732
- function usageMetadataFromMldev(fromObject) {
8733
- const toObject = {};
8734
- const fromPromptTokenCount = getValueByPath(fromObject, [
8735
- 'promptTokenCount',
8736
- ]);
8737
- if (fromPromptTokenCount != null) {
8738
- setValueByPath(toObject, ['promptTokenCount'], fromPromptTokenCount);
8739
- }
8740
- const fromCachedContentTokenCount = getValueByPath(fromObject, [
8741
- 'cachedContentTokenCount',
8742
- ]);
8743
- if (fromCachedContentTokenCount != null) {
8744
- setValueByPath(toObject, ['cachedContentTokenCount'], fromCachedContentTokenCount);
8745
- }
8746
- const fromResponseTokenCount = getValueByPath(fromObject, [
8747
- 'responseTokenCount',
8748
- ]);
8749
- if (fromResponseTokenCount != null) {
8750
- setValueByPath(toObject, ['responseTokenCount'], fromResponseTokenCount);
8751
- }
8752
- const fromToolUsePromptTokenCount = getValueByPath(fromObject, [
8753
- 'toolUsePromptTokenCount',
8754
- ]);
8755
- if (fromToolUsePromptTokenCount != null) {
8756
- setValueByPath(toObject, ['toolUsePromptTokenCount'], fromToolUsePromptTokenCount);
8757
- }
8758
- const fromThoughtsTokenCount = getValueByPath(fromObject, [
8759
- 'thoughtsTokenCount',
8760
- ]);
8761
- if (fromThoughtsTokenCount != null) {
8762
- setValueByPath(toObject, ['thoughtsTokenCount'], fromThoughtsTokenCount);
8763
- }
8764
- const fromTotalTokenCount = getValueByPath(fromObject, [
8765
- 'totalTokenCount',
8766
- ]);
8767
- if (fromTotalTokenCount != null) {
8768
- setValueByPath(toObject, ['totalTokenCount'], fromTotalTokenCount);
8769
- }
8770
- const fromPromptTokensDetails = getValueByPath(fromObject, [
8771
- 'promptTokensDetails',
8772
- ]);
8773
- if (fromPromptTokensDetails != null) {
8774
- let transformedList = fromPromptTokensDetails;
8775
- if (Array.isArray(transformedList)) {
8776
- transformedList = transformedList.map((item) => {
8777
- return modalityTokenCountFromMldev(item);
8778
- });
8779
- }
8780
- setValueByPath(toObject, ['promptTokensDetails'], transformedList);
8781
- }
8782
- const fromCacheTokensDetails = getValueByPath(fromObject, [
8783
- 'cacheTokensDetails',
8784
- ]);
8785
- if (fromCacheTokensDetails != null) {
8786
- let transformedList = fromCacheTokensDetails;
8787
- if (Array.isArray(transformedList)) {
8788
- transformedList = transformedList.map((item) => {
8789
- return modalityTokenCountFromMldev(item);
8790
- });
8791
- }
8792
- setValueByPath(toObject, ['cacheTokensDetails'], transformedList);
8793
- }
8794
- const fromResponseTokensDetails = getValueByPath(fromObject, [
8795
- 'responseTokensDetails',
8796
- ]);
8797
- if (fromResponseTokensDetails != null) {
8798
- let transformedList = fromResponseTokensDetails;
8799
- if (Array.isArray(transformedList)) {
8800
- transformedList = transformedList.map((item) => {
8801
- return modalityTokenCountFromMldev(item);
8802
- });
8803
- }
8804
- setValueByPath(toObject, ['responseTokensDetails'], transformedList);
8805
- }
8806
- const fromToolUsePromptTokensDetails = getValueByPath(fromObject, [
8807
- 'toolUsePromptTokensDetails',
8808
- ]);
8809
- if (fromToolUsePromptTokensDetails != null) {
8810
- let transformedList = fromToolUsePromptTokensDetails;
8811
- if (Array.isArray(transformedList)) {
8812
- transformedList = transformedList.map((item) => {
8813
- return modalityTokenCountFromMldev(item);
8814
- });
8815
- }
8816
- setValueByPath(toObject, ['toolUsePromptTokensDetails'], transformedList);
8817
- }
8818
- return toObject;
8819
- }
8820
8952
  function usageMetadataFromVertex(fromObject) {
8821
8953
  const toObject = {};
8822
8954
  const fromPromptTokenCount = getValueByPath(fromObject, [
@@ -8903,17 +9035,9 @@ function usageMetadataFromVertex(fromObject) {
8903
9035
  }
8904
9036
  setValueByPath(toObject, ['toolUsePromptTokensDetails'], transformedList);
8905
9037
  }
8906
- const fromTrafficType = getValueByPath(fromObject, ['trafficType']);
8907
- if (fromTrafficType != null) {
8908
- setValueByPath(toObject, ['trafficType'], fromTrafficType);
8909
- }
8910
- return toObject;
8911
- }
8912
- function liveServerGoAwayFromMldev(fromObject) {
8913
- const toObject = {};
8914
- const fromTimeLeft = getValueByPath(fromObject, ['timeLeft']);
8915
- if (fromTimeLeft != null) {
8916
- setValueByPath(toObject, ['timeLeft'], fromTimeLeft);
9038
+ const fromTrafficType = getValueByPath(fromObject, ['trafficType']);
9039
+ if (fromTrafficType != null) {
9040
+ setValueByPath(toObject, ['trafficType'], fromTrafficType);
8917
9041
  }
8918
9042
  return toObject;
8919
9043
  }
@@ -8925,24 +9049,6 @@ function liveServerGoAwayFromVertex(fromObject) {
8925
9049
  }
8926
9050
  return toObject;
8927
9051
  }
8928
- function liveServerSessionResumptionUpdateFromMldev(fromObject) {
8929
- const toObject = {};
8930
- const fromNewHandle = getValueByPath(fromObject, ['newHandle']);
8931
- if (fromNewHandle != null) {
8932
- setValueByPath(toObject, ['newHandle'], fromNewHandle);
8933
- }
8934
- const fromResumable = getValueByPath(fromObject, ['resumable']);
8935
- if (fromResumable != null) {
8936
- setValueByPath(toObject, ['resumable'], fromResumable);
8937
- }
8938
- const fromLastConsumedClientMessageIndex = getValueByPath(fromObject, [
8939
- 'lastConsumedClientMessageIndex',
8940
- ]);
8941
- if (fromLastConsumedClientMessageIndex != null) {
8942
- setValueByPath(toObject, ['lastConsumedClientMessageIndex'], fromLastConsumedClientMessageIndex);
8943
- }
8944
- return toObject;
8945
- }
8946
9052
  function liveServerSessionResumptionUpdateFromVertex(fromObject) {
8947
9053
  const toObject = {};
8948
9054
  const fromNewHandle = getValueByPath(fromObject, ['newHandle']);
@@ -8961,48 +9067,6 @@ function liveServerSessionResumptionUpdateFromVertex(fromObject) {
8961
9067
  }
8962
9068
  return toObject;
8963
9069
  }
8964
- function liveServerMessageFromMldev(fromObject) {
8965
- const toObject = {};
8966
- const fromSetupComplete = getValueByPath(fromObject, [
8967
- 'setupComplete',
8968
- ]);
8969
- if (fromSetupComplete != null) {
8970
- setValueByPath(toObject, ['setupComplete'], liveServerSetupCompleteFromMldev());
8971
- }
8972
- const fromServerContent = getValueByPath(fromObject, [
8973
- 'serverContent',
8974
- ]);
8975
- if (fromServerContent != null) {
8976
- setValueByPath(toObject, ['serverContent'], liveServerContentFromMldev(fromServerContent));
8977
- }
8978
- const fromToolCall = getValueByPath(fromObject, ['toolCall']);
8979
- if (fromToolCall != null) {
8980
- setValueByPath(toObject, ['toolCall'], liveServerToolCallFromMldev(fromToolCall));
8981
- }
8982
- const fromToolCallCancellation = getValueByPath(fromObject, [
8983
- 'toolCallCancellation',
8984
- ]);
8985
- if (fromToolCallCancellation != null) {
8986
- setValueByPath(toObject, ['toolCallCancellation'], liveServerToolCallCancellationFromMldev(fromToolCallCancellation));
8987
- }
8988
- const fromUsageMetadata = getValueByPath(fromObject, [
8989
- 'usageMetadata',
8990
- ]);
8991
- if (fromUsageMetadata != null) {
8992
- setValueByPath(toObject, ['usageMetadata'], usageMetadataFromMldev(fromUsageMetadata));
8993
- }
8994
- const fromGoAway = getValueByPath(fromObject, ['goAway']);
8995
- if (fromGoAway != null) {
8996
- setValueByPath(toObject, ['goAway'], liveServerGoAwayFromMldev(fromGoAway));
8997
- }
8998
- const fromSessionResumptionUpdate = getValueByPath(fromObject, [
8999
- 'sessionResumptionUpdate',
9000
- ]);
9001
- if (fromSessionResumptionUpdate != null) {
9002
- setValueByPath(toObject, ['sessionResumptionUpdate'], liveServerSessionResumptionUpdateFromMldev(fromSessionResumptionUpdate));
9003
- }
9004
- return toObject;
9005
- }
9006
9070
  function liveServerMessageFromVertex(fromObject) {
9007
9071
  const toObject = {};
9008
9072
  const fromSetupComplete = getValueByPath(fromObject, [
@@ -9045,172 +9109,6 @@ function liveServerMessageFromVertex(fromObject) {
9045
9109
  }
9046
9110
  return toObject;
9047
9111
  }
9048
- function liveMusicServerSetupCompleteFromMldev() {
9049
- const toObject = {};
9050
- return toObject;
9051
- }
9052
- function weightedPromptFromMldev(fromObject) {
9053
- const toObject = {};
9054
- const fromText = getValueByPath(fromObject, ['text']);
9055
- if (fromText != null) {
9056
- setValueByPath(toObject, ['text'], fromText);
9057
- }
9058
- const fromWeight = getValueByPath(fromObject, ['weight']);
9059
- if (fromWeight != null) {
9060
- setValueByPath(toObject, ['weight'], fromWeight);
9061
- }
9062
- return toObject;
9063
- }
9064
- function liveMusicClientContentFromMldev(fromObject) {
9065
- const toObject = {};
9066
- const fromWeightedPrompts = getValueByPath(fromObject, [
9067
- 'weightedPrompts',
9068
- ]);
9069
- if (fromWeightedPrompts != null) {
9070
- let transformedList = fromWeightedPrompts;
9071
- if (Array.isArray(transformedList)) {
9072
- transformedList = transformedList.map((item) => {
9073
- return weightedPromptFromMldev(item);
9074
- });
9075
- }
9076
- setValueByPath(toObject, ['weightedPrompts'], transformedList);
9077
- }
9078
- return toObject;
9079
- }
9080
- function liveMusicGenerationConfigFromMldev(fromObject) {
9081
- const toObject = {};
9082
- const fromTemperature = getValueByPath(fromObject, ['temperature']);
9083
- if (fromTemperature != null) {
9084
- setValueByPath(toObject, ['temperature'], fromTemperature);
9085
- }
9086
- const fromTopK = getValueByPath(fromObject, ['topK']);
9087
- if (fromTopK != null) {
9088
- setValueByPath(toObject, ['topK'], fromTopK);
9089
- }
9090
- const fromSeed = getValueByPath(fromObject, ['seed']);
9091
- if (fromSeed != null) {
9092
- setValueByPath(toObject, ['seed'], fromSeed);
9093
- }
9094
- const fromGuidance = getValueByPath(fromObject, ['guidance']);
9095
- if (fromGuidance != null) {
9096
- setValueByPath(toObject, ['guidance'], fromGuidance);
9097
- }
9098
- const fromBpm = getValueByPath(fromObject, ['bpm']);
9099
- if (fromBpm != null) {
9100
- setValueByPath(toObject, ['bpm'], fromBpm);
9101
- }
9102
- const fromDensity = getValueByPath(fromObject, ['density']);
9103
- if (fromDensity != null) {
9104
- setValueByPath(toObject, ['density'], fromDensity);
9105
- }
9106
- const fromBrightness = getValueByPath(fromObject, ['brightness']);
9107
- if (fromBrightness != null) {
9108
- setValueByPath(toObject, ['brightness'], fromBrightness);
9109
- }
9110
- const fromScale = getValueByPath(fromObject, ['scale']);
9111
- if (fromScale != null) {
9112
- setValueByPath(toObject, ['scale'], fromScale);
9113
- }
9114
- const fromMuteBass = getValueByPath(fromObject, ['muteBass']);
9115
- if (fromMuteBass != null) {
9116
- setValueByPath(toObject, ['muteBass'], fromMuteBass);
9117
- }
9118
- const fromMuteDrums = getValueByPath(fromObject, ['muteDrums']);
9119
- if (fromMuteDrums != null) {
9120
- setValueByPath(toObject, ['muteDrums'], fromMuteDrums);
9121
- }
9122
- const fromOnlyBassAndDrums = getValueByPath(fromObject, [
9123
- 'onlyBassAndDrums',
9124
- ]);
9125
- if (fromOnlyBassAndDrums != null) {
9126
- setValueByPath(toObject, ['onlyBassAndDrums'], fromOnlyBassAndDrums);
9127
- }
9128
- return toObject;
9129
- }
9130
- function liveMusicSourceMetadataFromMldev(fromObject) {
9131
- const toObject = {};
9132
- const fromClientContent = getValueByPath(fromObject, [
9133
- 'clientContent',
9134
- ]);
9135
- if (fromClientContent != null) {
9136
- setValueByPath(toObject, ['clientContent'], liveMusicClientContentFromMldev(fromClientContent));
9137
- }
9138
- const fromMusicGenerationConfig = getValueByPath(fromObject, [
9139
- 'musicGenerationConfig',
9140
- ]);
9141
- if (fromMusicGenerationConfig != null) {
9142
- setValueByPath(toObject, ['musicGenerationConfig'], liveMusicGenerationConfigFromMldev(fromMusicGenerationConfig));
9143
- }
9144
- return toObject;
9145
- }
9146
- function audioChunkFromMldev(fromObject) {
9147
- const toObject = {};
9148
- const fromData = getValueByPath(fromObject, ['data']);
9149
- if (fromData != null) {
9150
- setValueByPath(toObject, ['data'], fromData);
9151
- }
9152
- const fromMimeType = getValueByPath(fromObject, ['mimeType']);
9153
- if (fromMimeType != null) {
9154
- setValueByPath(toObject, ['mimeType'], fromMimeType);
9155
- }
9156
- const fromSourceMetadata = getValueByPath(fromObject, [
9157
- 'sourceMetadata',
9158
- ]);
9159
- if (fromSourceMetadata != null) {
9160
- setValueByPath(toObject, ['sourceMetadata'], liveMusicSourceMetadataFromMldev(fromSourceMetadata));
9161
- }
9162
- return toObject;
9163
- }
9164
- function liveMusicServerContentFromMldev(fromObject) {
9165
- const toObject = {};
9166
- const fromAudioChunks = getValueByPath(fromObject, ['audioChunks']);
9167
- if (fromAudioChunks != null) {
9168
- let transformedList = fromAudioChunks;
9169
- if (Array.isArray(transformedList)) {
9170
- transformedList = transformedList.map((item) => {
9171
- return audioChunkFromMldev(item);
9172
- });
9173
- }
9174
- setValueByPath(toObject, ['audioChunks'], transformedList);
9175
- }
9176
- return toObject;
9177
- }
9178
- function liveMusicFilteredPromptFromMldev(fromObject) {
9179
- const toObject = {};
9180
- const fromText = getValueByPath(fromObject, ['text']);
9181
- if (fromText != null) {
9182
- setValueByPath(toObject, ['text'], fromText);
9183
- }
9184
- const fromFilteredReason = getValueByPath(fromObject, [
9185
- 'filteredReason',
9186
- ]);
9187
- if (fromFilteredReason != null) {
9188
- setValueByPath(toObject, ['filteredReason'], fromFilteredReason);
9189
- }
9190
- return toObject;
9191
- }
9192
- function liveMusicServerMessageFromMldev(fromObject) {
9193
- const toObject = {};
9194
- const fromSetupComplete = getValueByPath(fromObject, [
9195
- 'setupComplete',
9196
- ]);
9197
- if (fromSetupComplete != null) {
9198
- setValueByPath(toObject, ['setupComplete'], liveMusicServerSetupCompleteFromMldev());
9199
- }
9200
- const fromServerContent = getValueByPath(fromObject, [
9201
- 'serverContent',
9202
- ]);
9203
- if (fromServerContent != null) {
9204
- setValueByPath(toObject, ['serverContent'], liveMusicServerContentFromMldev(fromServerContent));
9205
- }
9206
- const fromFilteredPrompt = getValueByPath(fromObject, [
9207
- 'filteredPrompt',
9208
- ]);
9209
- if (fromFilteredPrompt != null) {
9210
- setValueByPath(toObject, ['filteredPrompt'], liveMusicFilteredPromptFromMldev(fromFilteredPrompt));
9211
- }
9212
- return toObject;
9213
- }
9214
9112
 
9215
9113
  /**
9216
9114
  * @license
@@ -11291,6 +11189,10 @@ function editImageConfigToVertex(fromObject, parentObject) {
11291
11189
  if (parentObject !== undefined && fromOutputCompressionQuality != null) {
11292
11190
  setValueByPath(parentObject, ['parameters', 'outputOptions', 'compressionQuality'], fromOutputCompressionQuality);
11293
11191
  }
11192
+ const fromAddWatermark = getValueByPath(fromObject, ['addWatermark']);
11193
+ if (parentObject !== undefined && fromAddWatermark != null) {
11194
+ setValueByPath(parentObject, ['parameters', 'addWatermark'], fromAddWatermark);
11195
+ }
11294
11196
  const fromEditMode = getValueByPath(fromObject, ['editMode']);
11295
11197
  if (parentObject !== undefined && fromEditMode != null) {
11296
11198
  setValueByPath(parentObject, ['parameters', 'editMode'], fromEditMode);
@@ -11865,6 +11767,12 @@ function candidateFromMldev(fromObject) {
11865
11767
  }
11866
11768
  function generateContentResponseFromMldev(fromObject) {
11867
11769
  const toObject = {};
11770
+ const fromSdkHttpResponse = getValueByPath(fromObject, [
11771
+ 'sdkHttpResponse',
11772
+ ]);
11773
+ if (fromSdkHttpResponse != null) {
11774
+ setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
11775
+ }
11868
11776
  const fromCandidates = getValueByPath(fromObject, ['candidates']);
11869
11777
  if (fromCandidates != null) {
11870
11778
  let transformedList = fromCandidates;
@@ -12391,6 +12299,12 @@ function candidateFromVertex(fromObject) {
12391
12299
  }
12392
12300
  function generateContentResponseFromVertex(fromObject) {
12393
12301
  const toObject = {};
12302
+ const fromSdkHttpResponse = getValueByPath(fromObject, [
12303
+ 'sdkHttpResponse',
12304
+ ]);
12305
+ if (fromSdkHttpResponse != null) {
12306
+ setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
12307
+ }
12394
12308
  const fromCandidates = getValueByPath(fromObject, ['candidates']);
12395
12309
  if (fromCandidates != null) {
12396
12310
  let transformedList = fromCandidates;
@@ -12827,7 +12741,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
12827
12741
  const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
12828
12742
  const USER_AGENT_HEADER = 'User-Agent';
12829
12743
  const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
12830
- const SDK_VERSION = '1.8.0'; // x-release-please-version
12744
+ const SDK_VERSION = '1.10.0'; // x-release-please-version
12831
12745
  const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
12832
12746
  const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
12833
12747
  const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';
@@ -13058,7 +12972,14 @@ class ApiClient {
13058
12972
  const abortController = new AbortController();
13059
12973
  const signal = abortController.signal;
13060
12974
  if (httpOptions.timeout && (httpOptions === null || httpOptions === void 0 ? void 0 : httpOptions.timeout) > 0) {
13061
- setTimeout(() => abortController.abort(), httpOptions.timeout);
12975
+ const timeoutHandle = setTimeout(() => abortController.abort(), httpOptions.timeout);
12976
+ if (timeoutHandle &&
12977
+ typeof timeoutHandle.unref ===
12978
+ 'function') {
12979
+ // call unref to prevent nodejs process from hanging, see
12980
+ // https://nodejs.org/api/timers.html#timeoutunref
12981
+ timeoutHandle.unref();
12982
+ }
13062
12983
  }
13063
12984
  if (abortSignal) {
13064
12985
  abortSignal.addEventListener('abort', () => {
@@ -13121,7 +13042,7 @@ class ApiClient {
13121
13042
  }
13122
13043
  break;
13123
13044
  }
13124
- const chunkString = decoder.decode(value);
13045
+ const chunkString = decoder.decode(value, { stream: true });
13125
13046
  // Parse and throw an error if the chunk contains an error.
13126
13047
  try {
13127
13048
  const chunkJson = JSON.parse(chunkString);
@@ -13392,6 +13313,9 @@ function includeExtraBodyToRequestInit(requestInit, extraBody) {
13392
13313
  */
13393
13314
  // TODO: b/416041229 - Determine how to retrieve the MCP package version.
13394
13315
  const MCP_LABEL = 'mcp_used/unknown';
13316
+ // Whether MCP tool usage is detected from mcpToTool. This is used for
13317
+ // telemetry.
13318
+ let hasMcpToolUsageFromMcpToTool = false;
13395
13319
  // Checks whether the list of tools contains any MCP tools.
13396
13320
  function hasMcpToolUsage(tools) {
13397
13321
  for (const tool of tools) {
@@ -13402,7 +13326,7 @@ function hasMcpToolUsage(tools) {
13402
13326
  return true;
13403
13327
  }
13404
13328
  }
13405
- return false;
13329
+ return hasMcpToolUsageFromMcpToTool;
13406
13330
  }
13407
13331
  // Sets the MCP version label in the Google API client header.
13408
13332
  function setMcpUsageHeader(headers) {
@@ -13559,6 +13483,8 @@ function isMcpClient(client) {
13559
13483
  * versions.
13560
13484
  */
13561
13485
  function mcpToTool(...args) {
13486
+ // Set MCP usage for telemetry.
13487
+ hasMcpToolUsageFromMcpToTool = true;
13562
13488
  if (args.length === 0) {
13563
13489
  throw new Error('No MCP clients provided');
13564
13490
  }
@@ -13878,7 +13804,7 @@ class Live {
13878
13804
  if (GOOGLE_GENAI_USE_VERTEXAI) {
13879
13805
  model = 'gemini-2.0-flash-live-preview-04-09';
13880
13806
  } else {
13881
- model = 'gemini-2.0-flash-live-001';
13807
+ model = 'gemini-live-2.5-flash-preview';
13882
13808
  }
13883
13809
  const session = await ai.live.connect({
13884
13810
  model: model,
@@ -13904,6 +13830,12 @@ class Live {
13904
13830
  */
13905
13831
  async connect(params) {
13906
13832
  var _a, _b, _c, _d, _e, _f;
13833
+ // TODO: b/404946746 - Support per request HTTP options.
13834
+ if (params.config && params.config.httpOptions) {
13835
+ throw new Error('The Live module does not support httpOptions at request-level in' +
13836
+ ' LiveConnectConfig yet. Please use the client-level httpOptions' +
13837
+ ' configuration instead.');
13838
+ }
13907
13839
  const websocketBaseUrl = this.apiClient.getWebsocketBaseUrl();
13908
13840
  const apiVersion = this.apiClient.getApiVersion();
13909
13841
  let url;
@@ -13924,6 +13856,9 @@ class Live {
13924
13856
  let keyName = 'key';
13925
13857
  if (apiKey === null || apiKey === void 0 ? void 0 : apiKey.startsWith('auth_tokens/')) {
13926
13858
  console.warn('Warning: Ephemeral token support is experimental and may change in future versions.');
13859
+ if (apiVersion !== 'v1alpha') {
13860
+ console.warn("Warning: The SDK's ephemeral token support is in v1alpha only. Please use const ai = new GoogleGenAI({apiKey: token.name, httpOptions: { apiVersion: 'v1alpha' }}); before session connection.");
13861
+ }
13927
13862
  method = 'BidiGenerateContentConstrained';
13928
13863
  keyName = 'access_token';
13929
13864
  }
@@ -14199,7 +14134,7 @@ class Session {
14199
14134
  if (GOOGLE_GENAI_USE_VERTEXAI) {
14200
14135
  model = 'gemini-2.0-flash-live-preview-04-09';
14201
14136
  } else {
14202
- model = 'gemini-2.0-flash-live-001';
14137
+ model = 'gemini-live-2.5-flash-preview';
14203
14138
  }
14204
14139
  const session = await ai.live.connect({
14205
14140
  model: model,
@@ -14328,6 +14263,7 @@ class Models extends BaseModule {
14328
14263
  this.generateContent = async (params) => {
14329
14264
  var _a, _b, _c, _d, _e;
14330
14265
  const transformedParams = await this.processParamsForMcpUsage(params);
14266
+ this.maybeMoveToResponseJsonSchem(params);
14331
14267
  if (!hasMcpClientTools(params) || shouldDisableAfc(params.config)) {
14332
14268
  return await this.generateContentInternal(transformedParams);
14333
14269
  }
@@ -14414,6 +14350,7 @@ class Models extends BaseModule {
14414
14350
  * ```
14415
14351
  */
14416
14352
  this.generateContentStream = async (params) => {
14353
+ this.maybeMoveToResponseJsonSchem(params);
14417
14354
  if (shouldDisableAfc(params.config)) {
14418
14355
  const transformedParams = await this.processParamsForMcpUsage(params);
14419
14356
  return await this.generateContentStreamInternal(transformedParams);
@@ -14565,6 +14502,24 @@ class Models extends BaseModule {
14565
14502
  return await this.upscaleImageInternal(apiParams);
14566
14503
  };
14567
14504
  }
14505
+ /**
14506
+ * This logic is needed for GenerateContentConfig only.
14507
+ * Previously we made GenerateContentConfig.responseSchema field to accept
14508
+ * unknown. Since v1.9.0, we switch to use backend JSON schema support.
14509
+ * To maintain backward compatibility, we move the data that was treated as
14510
+ * JSON schema from the responseSchema field to the responseJsonSchema field.
14511
+ */
14512
+ maybeMoveToResponseJsonSchem(params) {
14513
+ if (params.config && params.config.responseSchema) {
14514
+ if (!params.config.responseJsonSchema) {
14515
+ if (Object.keys(params.config.responseSchema).includes('$schema')) {
14516
+ params.config.responseJsonSchema = params.config.responseSchema;
14517
+ delete params.config.responseSchema;
14518
+ }
14519
+ }
14520
+ }
14521
+ return;
14522
+ }
14568
14523
  /**
14569
14524
  * Transforms the CallableTools in the parameters to be simply Tools, it
14570
14525
  * copies the params into a new object and replaces the tools, it does not
@@ -14726,7 +14681,13 @@ class Models extends BaseModule {
14726
14681
  abortSignal: (_b = params.config) === null || _b === void 0 ? void 0 : _b.abortSignal,
14727
14682
  })
14728
14683
  .then((httpResponse) => {
14729
- return httpResponse.json();
14684
+ return httpResponse.json().then((jsonResponse) => {
14685
+ const response = jsonResponse;
14686
+ response.sdkHttpResponse = {
14687
+ headers: httpResponse.headers,
14688
+ };
14689
+ return response;
14690
+ });
14730
14691
  });
14731
14692
  return response.then((apiResponse) => {
14732
14693
  const resp = generateContentResponseFromVertex(apiResponse);
@@ -14752,7 +14713,13 @@ class Models extends BaseModule {
14752
14713
  abortSignal: (_d = params.config) === null || _d === void 0 ? void 0 : _d.abortSignal,
14753
14714
  })
14754
14715
  .then((httpResponse) => {
14755
- return httpResponse.json();
14716
+ return httpResponse.json().then((jsonResponse) => {
14717
+ const response = jsonResponse;
14718
+ response.sdkHttpResponse = {
14719
+ headers: httpResponse.headers,
14720
+ };
14721
+ return response;
14722
+ });
14756
14723
  });
14757
14724
  return response.then((apiResponse) => {
14758
14725
  const resp = generateContentResponseFromMldev(apiResponse);
@@ -14792,6 +14759,9 @@ class Models extends BaseModule {
14792
14759
  _d = false;
14793
14760
  const chunk = _c;
14794
14761
  const resp = generateContentResponseFromVertex((yield __await(chunk.json())));
14762
+ resp['sdkHttpResponse'] = {
14763
+ headers: chunk.headers,
14764
+ };
14795
14765
  const typedResp = new GenerateContentResponse();
14796
14766
  Object.assign(typedResp, resp);
14797
14767
  yield yield __await(typedResp);
@@ -14832,6 +14802,9 @@ class Models extends BaseModule {
14832
14802
  _d = false;
14833
14803
  const chunk = _c;
14834
14804
  const resp = generateContentResponseFromMldev((yield __await(chunk.json())));
14805
+ resp['sdkHttpResponse'] = {
14806
+ headers: chunk.headers,
14807
+ };
14835
14808
  const typedResp = new GenerateContentResponse();
14836
14809
  Object.assign(typedResp, resp);
14837
14810
  yield yield __await(typedResp);
@@ -16625,14 +16598,20 @@ class Tokens extends BaseModule {
16625
16598
  * @experimental
16626
16599
  *
16627
16600
  * @remarks
16628
- * Ephermeral auth tokens is only supported in the Gemini Developer API.
16601
+ * Ephemeral auth tokens is only supported in the Gemini Developer API.
16629
16602
  * It can be used for the session connection to the Live constrained API.
16603
+ * Support in v1alpha only.
16630
16604
  *
16631
16605
  * @param params - The parameters for the create request.
16632
16606
  * @return The created auth token.
16633
16607
  *
16634
16608
  * @example
16635
16609
  * ```ts
16610
+ * const ai = new GoogleGenAI({
16611
+ * apiKey: token.name,
16612
+ * httpOptions: { apiVersion: 'v1alpha' } // Support in v1alpha only.
16613
+ * });
16614
+ *
16636
16615
  * // Case 1: If LiveEphemeralParameters is unset, unlock LiveConnectConfig
16637
16616
  * // when using the token in Live API sessions. Each session connection can
16638
16617
  * // use a different configuration.
@@ -17112,7 +17091,7 @@ function listTuningJobsResponseFromMldev(fromObject) {
17112
17091
  }
17113
17092
  return toObject;
17114
17093
  }
17115
- function operationFromMldev(fromObject) {
17094
+ function tuningOperationFromMldev(fromObject) {
17116
17095
  const toObject = {};
17117
17096
  const fromName = getValueByPath(fromObject, ['name']);
17118
17097
  if (fromName != null) {
@@ -17539,7 +17518,7 @@ class Tunings extends BaseModule {
17539
17518
  return httpResponse.json();
17540
17519
  });
17541
17520
  return response.then((apiResponse) => {
17542
- const resp = operationFromMldev(apiResponse);
17521
+ const resp = tuningOperationFromMldev(apiResponse);
17543
17522
  return resp;
17544
17523
  });
17545
17524
  }