@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,6 +1,5 @@
1
1
  'use strict';
2
2
 
3
- var zod = require('zod');
4
3
  var googleAuthLibrary = require('google-auth-library');
5
4
  var fs = require('fs');
6
5
  var node_stream = require('node:stream');
@@ -818,11 +817,38 @@ exports.PersonGeneration = void 0;
818
817
  /** Enum that specifies the language of the text in the prompt. */
819
818
  exports.ImagePromptLanguage = void 0;
820
819
  (function (ImagePromptLanguage) {
820
+ /**
821
+ * Auto-detect the language.
822
+ */
821
823
  ImagePromptLanguage["auto"] = "auto";
824
+ /**
825
+ * English
826
+ */
822
827
  ImagePromptLanguage["en"] = "en";
828
+ /**
829
+ * Japanese
830
+ */
823
831
  ImagePromptLanguage["ja"] = "ja";
832
+ /**
833
+ * Korean
834
+ */
824
835
  ImagePromptLanguage["ko"] = "ko";
836
+ /**
837
+ * Hindi
838
+ */
825
839
  ImagePromptLanguage["hi"] = "hi";
840
+ /**
841
+ * Chinese
842
+ */
843
+ ImagePromptLanguage["zh"] = "zh";
844
+ /**
845
+ * Portuguese
846
+ */
847
+ ImagePromptLanguage["pt"] = "pt";
848
+ /**
849
+ * Spanish
850
+ */
851
+ ImagePromptLanguage["es"] = "es";
826
852
  })(exports.ImagePromptLanguage || (exports.ImagePromptLanguage = {}));
827
853
  /** Enum representing the mask mode of a mask reference image. */
828
854
  exports.MaskReferenceMode = void 0;
@@ -1923,133 +1949,12 @@ function tContents(origin) {
1923
1949
  }
1924
1950
  return result;
1925
1951
  }
1926
- // The fields that are supported by JSONSchema. Must be kept in sync with the
1927
- // JSONSchema interface above.
1928
- const supportedJsonSchemaFields = new Set([
1929
- 'type',
1930
- 'format',
1931
- 'title',
1932
- 'description',
1933
- 'default',
1934
- 'items',
1935
- 'minItems',
1936
- 'maxItems',
1937
- 'enum',
1938
- 'properties',
1939
- 'required',
1940
- 'minProperties',
1941
- 'maxProperties',
1942
- 'minimum',
1943
- 'maximum',
1944
- 'minLength',
1945
- 'maxLength',
1946
- 'pattern',
1947
- 'anyOf',
1948
- 'propertyOrdering',
1949
- ]);
1950
- const jsonSchemaTypeValidator = zod.z.enum([
1951
- 'string',
1952
- 'number',
1953
- 'integer',
1954
- 'object',
1955
- 'array',
1956
- 'boolean',
1957
- 'null',
1958
- ]);
1959
- // Handles all types and arrays of all types.
1960
- const schemaTypeUnion = zod.z.union([
1961
- jsonSchemaTypeValidator,
1962
- zod.z.array(jsonSchemaTypeValidator),
1963
- ]);
1964
- /**
1965
- * Creates a zod validator for JSONSchema.
1966
- *
1967
- * @param strictMode Whether to enable strict mode, default to true. When
1968
- * strict mode is enabled, the zod validator will throw error if there
1969
- * are unrecognized fields in the input data. If strict mode is
1970
- * disabled, the zod validator will ignore the unrecognized fields, only
1971
- * populate the fields that are listed in the JSONSchema. Regardless of
1972
- * the mode the type mismatch will always result in an error, for example
1973
- * items field should be a single JSONSchema, but for tuple type it would
1974
- * be an array of JSONSchema, this will always result in an error.
1975
- * @return The zod validator for JSONSchema.
1976
- */
1977
- function createJsonSchemaValidator(strictMode = true) {
1978
- const jsonSchemaValidator = zod.z.lazy(() => {
1979
- // Define the base object shape *inside* the z.lazy callback
1980
- const baseShape = zod.z.object({
1981
- // --- Type ---
1982
- type: schemaTypeUnion.optional(),
1983
- // --- Annotations ---
1984
- format: zod.z.string().optional(),
1985
- title: zod.z.string().optional(),
1986
- description: zod.z.string().optional(),
1987
- default: zod.z.unknown().optional(),
1988
- // --- Array Validations ---
1989
- items: jsonSchemaValidator.optional(),
1990
- minItems: zod.z.coerce.string().optional(),
1991
- maxItems: zod.z.coerce.string().optional(),
1992
- // --- Generic Validations ---
1993
- enum: zod.z.array(zod.z.unknown()).optional(),
1994
- // --- Object Validations ---
1995
- properties: zod.z.record(zod.z.string(), jsonSchemaValidator).optional(),
1996
- required: zod.z.array(zod.z.string()).optional(),
1997
- minProperties: zod.z.coerce.string().optional(),
1998
- maxProperties: zod.z.coerce.string().optional(),
1999
- propertyOrdering: zod.z.array(zod.z.string()).optional(),
2000
- // --- Numeric Validations ---
2001
- minimum: zod.z.number().optional(),
2002
- maximum: zod.z.number().optional(),
2003
- // --- String Validations ---
2004
- minLength: zod.z.coerce.string().optional(),
2005
- maxLength: zod.z.coerce.string().optional(),
2006
- pattern: zod.z.string().optional(),
2007
- // --- Schema Composition ---
2008
- anyOf: zod.z.array(jsonSchemaValidator).optional(),
2009
- // --- Additional Properties --- This field is not included in the
2010
- // JSONSchema, will not be communicated to the model, it is here purely
2011
- // for enabling the zod validation strict mode.
2012
- additionalProperties: zod.z.boolean().optional(),
2013
- });
2014
- // Conditionally apply .strict() based on the flag
2015
- return strictMode ? baseShape.strict() : baseShape;
2016
- });
2017
- return jsonSchemaValidator;
2018
- }
2019
1952
  /*
2020
- Handle type field:
2021
- The resulted type field in JSONSchema form zod_to_json_schema can be either
2022
- an array consist of primitive types or a single primitive type.
2023
- This is due to the optimization of zod_to_json_schema, when the types in the
2024
- union are primitive types without any additional specifications,
2025
- zod_to_json_schema will squash the types into an array instead of put them
2026
- in anyOf fields. Otherwise, it will put the types in anyOf fields.
2027
- See the following link for more details:
2028
- https://github.com/zodjs/zod-to-json-schema/blob/main/src/index.ts#L101
2029
- The logic here is trying to undo that optimization, flattening the array of
2030
- types to anyOf fields.
2031
- type field
2032
- |
2033
- ___________________________
2034
- / \
2035
- / \
2036
- / \
2037
- Array Type.*
2038
- / \ |
2039
- Include null. Not included null type = Type.*.
2040
- [null, Type.*, Type.*] multiple types.
2041
- [null, Type.*] [Type.*, Type.*]
2042
- / \
2043
- remove null \
2044
- add nullable = true \
2045
- / \ \
2046
- [Type.*] [Type.*, Type.*] \
2047
- only one type left multiple types left \
2048
- add type = Type.*. \ /
2049
- \ /
2050
- not populate the type field in final result
2051
- and make the types into anyOf fields
2052
- anyOf:[{type: 'Type.*'}, {type: 'Type.*'}];
1953
+ Transform the type field from an array of types to an array of anyOf fields.
1954
+ Example:
1955
+ {type: ['STRING', 'NUMBER']}
1956
+ will be transformed to
1957
+ {anyOf: [{type: 'STRING'}, {type: 'NUMBER'}]}
2053
1958
  */
2054
1959
  function flattenTypeArrayToAnyOf(typeList, resultingSchema) {
2055
1960
  if (typeList.includes('null')) {
@@ -2195,15 +2100,11 @@ function processJsonSchema(_jsonSchema) {
2195
2100
  // https://github.com/StefanTerdell/zod-to-json-schema/blob/70525efe555cd226691e093d171370a3b10921d1/src/zodToJsonSchema.ts#L7
2196
2101
  // typebox can return unknown, see details in
2197
2102
  // https://github.com/sinclairzx81/typebox/blob/5a5431439f7d5ca6b494d0d18fbfd7b1a356d67c/src/type/create/type.ts#L35
2103
+ // Note: proper json schemas with the $schema field set never arrive to this
2104
+ // transformer. Schemas with $schema are routed to the equivalent API json
2105
+ // schema field.
2198
2106
  function tSchema(schema) {
2199
- if (Object.keys(schema).includes('$schema')) {
2200
- delete schema['$schema'];
2201
- const validatedJsonSchema = createJsonSchemaValidator().parse(schema);
2202
- return processJsonSchema(validatedJsonSchema);
2203
- }
2204
- else {
2205
- return processJsonSchema(schema);
2206
- }
2107
+ return processJsonSchema(schema);
2207
2108
  }
2208
2109
  function tSpeechConfig(speechConfig) {
2209
2110
  if (typeof speechConfig === 'object') {
@@ -2232,10 +2133,28 @@ function tTool(tool) {
2232
2133
  if (tool.functionDeclarations) {
2233
2134
  for (const functionDeclaration of tool.functionDeclarations) {
2234
2135
  if (functionDeclaration.parameters) {
2235
- functionDeclaration.parameters = tSchema(functionDeclaration.parameters);
2136
+ if (!Object.keys(functionDeclaration.parameters).includes('$schema')) {
2137
+ functionDeclaration.parameters = processJsonSchema(functionDeclaration.parameters);
2138
+ }
2139
+ else {
2140
+ if (!functionDeclaration.parametersJsonSchema) {
2141
+ functionDeclaration.parametersJsonSchema =
2142
+ functionDeclaration.parameters;
2143
+ delete functionDeclaration.parameters;
2144
+ }
2145
+ }
2236
2146
  }
2237
2147
  if (functionDeclaration.response) {
2238
- functionDeclaration.response = tSchema(functionDeclaration.response);
2148
+ if (!Object.keys(functionDeclaration.response).includes('$schema')) {
2149
+ functionDeclaration.response = processJsonSchema(functionDeclaration.response);
2150
+ }
2151
+ else {
2152
+ if (!functionDeclaration.responseJsonSchema) {
2153
+ functionDeclaration.responseJsonSchema =
2154
+ functionDeclaration.response;
2155
+ delete functionDeclaration.response;
2156
+ }
2157
+ }
2239
2158
  }
2240
2159
  }
2241
2160
  }
@@ -2440,7 +2359,7 @@ function mcpToGeminiTool(mcpTool, config = {}) {
2440
2359
  const functionDeclaration = {
2441
2360
  name: mcpToolSchema['name'],
2442
2361
  description: mcpToolSchema['description'],
2443
- parameters: processJsonSchema(filterToJsonSchema(mcpToolSchema['inputSchema'])),
2362
+ parametersJsonSchema: mcpToolSchema['inputSchema'],
2444
2363
  };
2445
2364
  if (config.behavior) {
2446
2365
  functionDeclaration['behavior'] = config.behavior;
@@ -2472,53 +2391,6 @@ function mcpToolsToGeminiTool(mcpTools, config = {}) {
2472
2391
  }
2473
2392
  return { functionDeclarations: functionDeclarations };
2474
2393
  }
2475
- // Filters the list schema field to only include fields that are supported by
2476
- // JSONSchema.
2477
- function filterListSchemaField(fieldValue) {
2478
- const listSchemaFieldValue = [];
2479
- for (const listFieldValue of fieldValue) {
2480
- listSchemaFieldValue.push(filterToJsonSchema(listFieldValue));
2481
- }
2482
- return listSchemaFieldValue;
2483
- }
2484
- // Filters the dict schema field to only include fields that are supported by
2485
- // JSONSchema.
2486
- function filterDictSchemaField(fieldValue) {
2487
- const dictSchemaFieldValue = {};
2488
- for (const [key, value] of Object.entries(fieldValue)) {
2489
- const valueRecord = value;
2490
- dictSchemaFieldValue[key] = filterToJsonSchema(valueRecord);
2491
- }
2492
- return dictSchemaFieldValue;
2493
- }
2494
- // Filters the schema to only include fields that are supported by JSONSchema.
2495
- function filterToJsonSchema(schema) {
2496
- const schemaFieldNames = new Set(['items']); // 'additional_properties' to come
2497
- const listSchemaFieldNames = new Set(['anyOf']); // 'one_of', 'all_of', 'not' to come
2498
- const dictSchemaFieldNames = new Set(['properties']); // 'defs' to come
2499
- const filteredSchema = {};
2500
- for (const [fieldName, fieldValue] of Object.entries(schema)) {
2501
- if (schemaFieldNames.has(fieldName)) {
2502
- filteredSchema[fieldName] = filterToJsonSchema(fieldValue);
2503
- }
2504
- else if (listSchemaFieldNames.has(fieldName)) {
2505
- filteredSchema[fieldName] = filterListSchemaField(fieldValue);
2506
- }
2507
- else if (dictSchemaFieldNames.has(fieldName)) {
2508
- filteredSchema[fieldName] = filterDictSchemaField(fieldValue);
2509
- }
2510
- else if (fieldName === 'type') {
2511
- const typeValue = fieldValue.toUpperCase();
2512
- filteredSchema[fieldName] = Object.values(exports.Type).includes(typeValue)
2513
- ? typeValue
2514
- : exports.Type.TYPE_UNSPECIFIED;
2515
- }
2516
- else if (supportedJsonSchemaFields.has(fieldName)) {
2517
- filteredSchema[fieldName] = fieldValue;
2518
- }
2519
- }
2520
- return filteredSchema;
2521
- }
2522
2394
  // Transforms a source input into a BatchJobSource object with validation.
2523
2395
  function tBatchJobSource(apiClient, src) {
2524
2396
  if (typeof src !== 'string' && !Array.isArray(src)) {
@@ -2567,6 +2439,9 @@ function tBatchJobSource(apiClient, src) {
2567
2439
  throw new Error(`Unsupported source: ${src}`);
2568
2440
  }
2569
2441
  function tBatchJobDestination(dest) {
2442
+ if (typeof dest !== 'string') {
2443
+ return dest;
2444
+ }
2570
2445
  const destString = dest;
2571
2446
  if (destString.startsWith('gs://')) {
2572
2447
  return {
@@ -3552,10 +3427,6 @@ function deleteBatchJobParametersToVertex(apiClient, fromObject) {
3552
3427
  }
3553
3428
  return toObject;
3554
3429
  }
3555
- function jobErrorFromMldev() {
3556
- const toObject = {};
3557
- return toObject;
3558
- }
3559
3430
  function videoMetadataFromMldev$2(fromObject) {
3560
3431
  const toObject = {};
3561
3432
  const fromFps = getValueByPath(fromObject, ['fps']);
@@ -3760,6 +3631,12 @@ function candidateFromMldev$1(fromObject) {
3760
3631
  }
3761
3632
  function generateContentResponseFromMldev$1(fromObject) {
3762
3633
  const toObject = {};
3634
+ const fromSdkHttpResponse = getValueByPath(fromObject, [
3635
+ 'sdkHttpResponse',
3636
+ ]);
3637
+ if (fromSdkHttpResponse != null) {
3638
+ setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
3639
+ }
3763
3640
  const fromCandidates = getValueByPath(fromObject, ['candidates']);
3764
3641
  if (fromCandidates != null) {
3765
3642
  let transformedList = fromCandidates;
@@ -3788,6 +3665,22 @@ function generateContentResponseFromMldev$1(fromObject) {
3788
3665
  }
3789
3666
  return toObject;
3790
3667
  }
3668
+ function jobErrorFromMldev(fromObject) {
3669
+ const toObject = {};
3670
+ const fromDetails = getValueByPath(fromObject, ['details']);
3671
+ if (fromDetails != null) {
3672
+ setValueByPath(toObject, ['details'], fromDetails);
3673
+ }
3674
+ const fromCode = getValueByPath(fromObject, ['code']);
3675
+ if (fromCode != null) {
3676
+ setValueByPath(toObject, ['code'], fromCode);
3677
+ }
3678
+ const fromMessage = getValueByPath(fromObject, ['message']);
3679
+ if (fromMessage != null) {
3680
+ setValueByPath(toObject, ['message'], fromMessage);
3681
+ }
3682
+ return toObject;
3683
+ }
3791
3684
  function inlinedResponseFromMldev(fromObject) {
3792
3685
  const toObject = {};
3793
3686
  const fromResponse = getValueByPath(fromObject, ['response']);
@@ -3796,7 +3689,7 @@ function inlinedResponseFromMldev(fromObject) {
3796
3689
  }
3797
3690
  const fromError = getValueByPath(fromObject, ['error']);
3798
3691
  if (fromError != null) {
3799
- setValueByPath(toObject, ['error'], jobErrorFromMldev());
3692
+ setValueByPath(toObject, ['error'], jobErrorFromMldev(fromError));
3800
3693
  }
3801
3694
  return toObject;
3802
3695
  }
@@ -3901,7 +3794,7 @@ function deleteResourceJobFromMldev(fromObject) {
3901
3794
  }
3902
3795
  const fromError = getValueByPath(fromObject, ['error']);
3903
3796
  if (fromError != null) {
3904
- setValueByPath(toObject, ['error'], jobErrorFromMldev());
3797
+ setValueByPath(toObject, ['error'], jobErrorFromMldev(fromError));
3905
3798
  }
3906
3799
  return toObject;
3907
3800
  }
@@ -6667,8 +6560,14 @@ function listFilesResponseFromMldev(fromObject) {
6667
6560
  }
6668
6561
  return toObject;
6669
6562
  }
6670
- function createFileResponseFromMldev() {
6563
+ function createFileResponseFromMldev(fromObject) {
6671
6564
  const toObject = {};
6565
+ const fromSdkHttpResponse = getValueByPath(fromObject, [
6566
+ 'sdkHttpResponse',
6567
+ ]);
6568
+ if (fromSdkHttpResponse != null) {
6569
+ setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
6570
+ }
6672
6571
  return toObject;
6673
6572
  }
6674
6573
  function deleteFileResponseFromMldev() {
@@ -6841,8 +6740,8 @@ class Files extends BaseModule {
6841
6740
  .then((httpResponse) => {
6842
6741
  return httpResponse.json();
6843
6742
  });
6844
- return response.then(() => {
6845
- const resp = createFileResponseFromMldev();
6743
+ return response.then((apiResponse) => {
6744
+ const resp = createFileResponseFromMldev(apiResponse);
6846
6745
  const typedResp = new CreateFileResponse();
6847
6746
  Object.assign(typedResp, resp);
6848
6747
  return typedResp;
@@ -6960,14 +6859,6 @@ function prebuiltVoiceConfigToMldev$2(fromObject) {
6960
6859
  }
6961
6860
  return toObject;
6962
6861
  }
6963
- function prebuiltVoiceConfigToVertex$1(fromObject) {
6964
- const toObject = {};
6965
- const fromVoiceName = getValueByPath(fromObject, ['voiceName']);
6966
- if (fromVoiceName != null) {
6967
- setValueByPath(toObject, ['voiceName'], fromVoiceName);
6968
- }
6969
- return toObject;
6970
- }
6971
6862
  function voiceConfigToMldev$2(fromObject) {
6972
6863
  const toObject = {};
6973
6864
  const fromPrebuiltVoiceConfig = getValueByPath(fromObject, [
@@ -6978,16 +6869,6 @@ function voiceConfigToMldev$2(fromObject) {
6978
6869
  }
6979
6870
  return toObject;
6980
6871
  }
6981
- function voiceConfigToVertex$1(fromObject) {
6982
- const toObject = {};
6983
- const fromPrebuiltVoiceConfig = getValueByPath(fromObject, [
6984
- 'prebuiltVoiceConfig',
6985
- ]);
6986
- if (fromPrebuiltVoiceConfig != null) {
6987
- setValueByPath(toObject, ['prebuiltVoiceConfig'], prebuiltVoiceConfigToVertex$1(fromPrebuiltVoiceConfig));
6988
- }
6989
- return toObject;
6990
- }
6991
6872
  function speakerVoiceConfigToMldev$2(fromObject) {
6992
6873
  const toObject = {};
6993
6874
  const fromSpeaker = getValueByPath(fromObject, ['speaker']);
@@ -7034,21 +6915,6 @@ function speechConfigToMldev$2(fromObject) {
7034
6915
  }
7035
6916
  return toObject;
7036
6917
  }
7037
- function speechConfigToVertex$1(fromObject) {
7038
- const toObject = {};
7039
- const fromVoiceConfig = getValueByPath(fromObject, ['voiceConfig']);
7040
- if (fromVoiceConfig != null) {
7041
- setValueByPath(toObject, ['voiceConfig'], voiceConfigToVertex$1(fromVoiceConfig));
7042
- }
7043
- if (getValueByPath(fromObject, ['multiSpeakerVoiceConfig']) !== undefined) {
7044
- throw new Error('multiSpeakerVoiceConfig parameter is not supported in Vertex AI.');
7045
- }
7046
- const fromLanguageCode = getValueByPath(fromObject, ['languageCode']);
7047
- if (fromLanguageCode != null) {
7048
- setValueByPath(toObject, ['languageCode'], fromLanguageCode);
7049
- }
7050
- return toObject;
7051
- }
7052
6918
  function videoMetadataToMldev$2(fromObject) {
7053
6919
  const toObject = {};
7054
6920
  const fromFps = getValueByPath(fromObject, ['fps']);
@@ -7065,22 +6931,6 @@ function videoMetadataToMldev$2(fromObject) {
7065
6931
  }
7066
6932
  return toObject;
7067
6933
  }
7068
- function videoMetadataToVertex$1(fromObject) {
7069
- const toObject = {};
7070
- const fromFps = getValueByPath(fromObject, ['fps']);
7071
- if (fromFps != null) {
7072
- setValueByPath(toObject, ['fps'], fromFps);
7073
- }
7074
- const fromEndOffset = getValueByPath(fromObject, ['endOffset']);
7075
- if (fromEndOffset != null) {
7076
- setValueByPath(toObject, ['endOffset'], fromEndOffset);
7077
- }
7078
- const fromStartOffset = getValueByPath(fromObject, ['startOffset']);
7079
- if (fromStartOffset != null) {
7080
- setValueByPath(toObject, ['startOffset'], fromStartOffset);
7081
- }
7082
- return toObject;
7083
- }
7084
6934
  function blobToMldev$2(fromObject) {
7085
6935
  const toObject = {};
7086
6936
  if (getValueByPath(fromObject, ['displayName']) !== undefined) {
@@ -7096,22 +6946,6 @@ function blobToMldev$2(fromObject) {
7096
6946
  }
7097
6947
  return toObject;
7098
6948
  }
7099
- function blobToVertex$1(fromObject) {
7100
- const toObject = {};
7101
- const fromDisplayName = getValueByPath(fromObject, ['displayName']);
7102
- if (fromDisplayName != null) {
7103
- setValueByPath(toObject, ['displayName'], fromDisplayName);
7104
- }
7105
- const fromData = getValueByPath(fromObject, ['data']);
7106
- if (fromData != null) {
7107
- setValueByPath(toObject, ['data'], fromData);
7108
- }
7109
- const fromMimeType = getValueByPath(fromObject, ['mimeType']);
7110
- if (fromMimeType != null) {
7111
- setValueByPath(toObject, ['mimeType'], fromMimeType);
7112
- }
7113
- return toObject;
7114
- }
7115
6949
  function fileDataToMldev$2(fromObject) {
7116
6950
  const toObject = {};
7117
6951
  if (getValueByPath(fromObject, ['displayName']) !== undefined) {
@@ -7127,22 +6961,6 @@ function fileDataToMldev$2(fromObject) {
7127
6961
  }
7128
6962
  return toObject;
7129
6963
  }
7130
- function fileDataToVertex$1(fromObject) {
7131
- const toObject = {};
7132
- const fromDisplayName = getValueByPath(fromObject, ['displayName']);
7133
- if (fromDisplayName != null) {
7134
- setValueByPath(toObject, ['displayName'], fromDisplayName);
7135
- }
7136
- const fromFileUri = getValueByPath(fromObject, ['fileUri']);
7137
- if (fromFileUri != null) {
7138
- setValueByPath(toObject, ['fileUri'], fromFileUri);
7139
- }
7140
- const fromMimeType = getValueByPath(fromObject, ['mimeType']);
7141
- if (fromMimeType != null) {
7142
- setValueByPath(toObject, ['mimeType'], fromMimeType);
7143
- }
7144
- return toObject;
7145
- }
7146
6964
  function partToMldev$2(fromObject) {
7147
6965
  const toObject = {};
7148
6966
  const fromVideoMetadata = getValueByPath(fromObject, [
@@ -7197,60 +7015,6 @@ function partToMldev$2(fromObject) {
7197
7015
  }
7198
7016
  return toObject;
7199
7017
  }
7200
- function partToVertex$1(fromObject) {
7201
- const toObject = {};
7202
- const fromVideoMetadata = getValueByPath(fromObject, [
7203
- 'videoMetadata',
7204
- ]);
7205
- if (fromVideoMetadata != null) {
7206
- setValueByPath(toObject, ['videoMetadata'], videoMetadataToVertex$1(fromVideoMetadata));
7207
- }
7208
- const fromThought = getValueByPath(fromObject, ['thought']);
7209
- if (fromThought != null) {
7210
- setValueByPath(toObject, ['thought'], fromThought);
7211
- }
7212
- const fromInlineData = getValueByPath(fromObject, ['inlineData']);
7213
- if (fromInlineData != null) {
7214
- setValueByPath(toObject, ['inlineData'], blobToVertex$1(fromInlineData));
7215
- }
7216
- const fromFileData = getValueByPath(fromObject, ['fileData']);
7217
- if (fromFileData != null) {
7218
- setValueByPath(toObject, ['fileData'], fileDataToVertex$1(fromFileData));
7219
- }
7220
- const fromThoughtSignature = getValueByPath(fromObject, [
7221
- 'thoughtSignature',
7222
- ]);
7223
- if (fromThoughtSignature != null) {
7224
- setValueByPath(toObject, ['thoughtSignature'], fromThoughtSignature);
7225
- }
7226
- const fromCodeExecutionResult = getValueByPath(fromObject, [
7227
- 'codeExecutionResult',
7228
- ]);
7229
- if (fromCodeExecutionResult != null) {
7230
- setValueByPath(toObject, ['codeExecutionResult'], fromCodeExecutionResult);
7231
- }
7232
- const fromExecutableCode = getValueByPath(fromObject, [
7233
- 'executableCode',
7234
- ]);
7235
- if (fromExecutableCode != null) {
7236
- setValueByPath(toObject, ['executableCode'], fromExecutableCode);
7237
- }
7238
- const fromFunctionCall = getValueByPath(fromObject, ['functionCall']);
7239
- if (fromFunctionCall != null) {
7240
- setValueByPath(toObject, ['functionCall'], fromFunctionCall);
7241
- }
7242
- const fromFunctionResponse = getValueByPath(fromObject, [
7243
- 'functionResponse',
7244
- ]);
7245
- if (fromFunctionResponse != null) {
7246
- setValueByPath(toObject, ['functionResponse'], fromFunctionResponse);
7247
- }
7248
- const fromText = getValueByPath(fromObject, ['text']);
7249
- if (fromText != null) {
7250
- setValueByPath(toObject, ['text'], fromText);
7251
- }
7252
- return toObject;
7253
- }
7254
7018
  function contentToMldev$2(fromObject) {
7255
7019
  const toObject = {};
7256
7020
  const fromParts = getValueByPath(fromObject, ['parts']);
@@ -7269,24 +7033,6 @@ function contentToMldev$2(fromObject) {
7269
7033
  }
7270
7034
  return toObject;
7271
7035
  }
7272
- function contentToVertex$1(fromObject) {
7273
- const toObject = {};
7274
- const fromParts = getValueByPath(fromObject, ['parts']);
7275
- if (fromParts != null) {
7276
- let transformedList = fromParts;
7277
- if (Array.isArray(transformedList)) {
7278
- transformedList = transformedList.map((item) => {
7279
- return partToVertex$1(item);
7280
- });
7281
- }
7282
- setValueByPath(toObject, ['parts'], transformedList);
7283
- }
7284
- const fromRole = getValueByPath(fromObject, ['role']);
7285
- if (fromRole != null) {
7286
- setValueByPath(toObject, ['role'], fromRole);
7287
- }
7288
- return toObject;
7289
- }
7290
7036
  function functionDeclarationToMldev$2(fromObject) {
7291
7037
  const toObject = {};
7292
7038
  const fromBehavior = getValueByPath(fromObject, ['behavior']);
@@ -7323,41 +7069,6 @@ function functionDeclarationToMldev$2(fromObject) {
7323
7069
  }
7324
7070
  return toObject;
7325
7071
  }
7326
- function functionDeclarationToVertex$1(fromObject) {
7327
- const toObject = {};
7328
- if (getValueByPath(fromObject, ['behavior']) !== undefined) {
7329
- throw new Error('behavior parameter is not supported in Vertex AI.');
7330
- }
7331
- const fromDescription = getValueByPath(fromObject, ['description']);
7332
- if (fromDescription != null) {
7333
- setValueByPath(toObject, ['description'], fromDescription);
7334
- }
7335
- const fromName = getValueByPath(fromObject, ['name']);
7336
- if (fromName != null) {
7337
- setValueByPath(toObject, ['name'], fromName);
7338
- }
7339
- const fromParameters = getValueByPath(fromObject, ['parameters']);
7340
- if (fromParameters != null) {
7341
- setValueByPath(toObject, ['parameters'], fromParameters);
7342
- }
7343
- const fromParametersJsonSchema = getValueByPath(fromObject, [
7344
- 'parametersJsonSchema',
7345
- ]);
7346
- if (fromParametersJsonSchema != null) {
7347
- setValueByPath(toObject, ['parametersJsonSchema'], fromParametersJsonSchema);
7348
- }
7349
- const fromResponse = getValueByPath(fromObject, ['response']);
7350
- if (fromResponse != null) {
7351
- setValueByPath(toObject, ['response'], fromResponse);
7352
- }
7353
- const fromResponseJsonSchema = getValueByPath(fromObject, [
7354
- 'responseJsonSchema',
7355
- ]);
7356
- if (fromResponseJsonSchema != null) {
7357
- setValueByPath(toObject, ['responseJsonSchema'], fromResponseJsonSchema);
7358
- }
7359
- return toObject;
7360
- }
7361
7072
  function intervalToMldev$2(fromObject) {
7362
7073
  const toObject = {};
7363
7074
  const fromStartTime = getValueByPath(fromObject, ['startTime']);
@@ -7370,19 +7081,7 @@ function intervalToMldev$2(fromObject) {
7370
7081
  }
7371
7082
  return toObject;
7372
7083
  }
7373
- function intervalToVertex$1(fromObject) {
7374
- const toObject = {};
7375
- const fromStartTime = getValueByPath(fromObject, ['startTime']);
7376
- if (fromStartTime != null) {
7377
- setValueByPath(toObject, ['startTime'], fromStartTime);
7378
- }
7379
- const fromEndTime = getValueByPath(fromObject, ['endTime']);
7380
- if (fromEndTime != null) {
7381
- setValueByPath(toObject, ['endTime'], fromEndTime);
7382
- }
7383
- return toObject;
7384
- }
7385
- function googleSearchToMldev$2(fromObject) {
7084
+ function googleSearchToMldev$2(fromObject) {
7386
7085
  const toObject = {};
7387
7086
  const fromTimeRangeFilter = getValueByPath(fromObject, [
7388
7087
  'timeRangeFilter',
@@ -7392,16 +7091,6 @@ function googleSearchToMldev$2(fromObject) {
7392
7091
  }
7393
7092
  return toObject;
7394
7093
  }
7395
- function googleSearchToVertex$1(fromObject) {
7396
- const toObject = {};
7397
- const fromTimeRangeFilter = getValueByPath(fromObject, [
7398
- 'timeRangeFilter',
7399
- ]);
7400
- if (fromTimeRangeFilter != null) {
7401
- setValueByPath(toObject, ['timeRangeFilter'], intervalToVertex$1(fromTimeRangeFilter));
7402
- }
7403
- return toObject;
7404
- }
7405
7094
  function dynamicRetrievalConfigToMldev$2(fromObject) {
7406
7095
  const toObject = {};
7407
7096
  const fromMode = getValueByPath(fromObject, ['mode']);
@@ -7416,20 +7105,6 @@ function dynamicRetrievalConfigToMldev$2(fromObject) {
7416
7105
  }
7417
7106
  return toObject;
7418
7107
  }
7419
- function dynamicRetrievalConfigToVertex$1(fromObject) {
7420
- const toObject = {};
7421
- const fromMode = getValueByPath(fromObject, ['mode']);
7422
- if (fromMode != null) {
7423
- setValueByPath(toObject, ['mode'], fromMode);
7424
- }
7425
- const fromDynamicThreshold = getValueByPath(fromObject, [
7426
- 'dynamicThreshold',
7427
- ]);
7428
- if (fromDynamicThreshold != null) {
7429
- setValueByPath(toObject, ['dynamicThreshold'], fromDynamicThreshold);
7430
- }
7431
- return toObject;
7432
- }
7433
7108
  function googleSearchRetrievalToMldev$2(fromObject) {
7434
7109
  const toObject = {};
7435
7110
  const fromDynamicRetrievalConfig = getValueByPath(fromObject, [
@@ -7440,76 +7115,10 @@ function googleSearchRetrievalToMldev$2(fromObject) {
7440
7115
  }
7441
7116
  return toObject;
7442
7117
  }
7443
- function googleSearchRetrievalToVertex$1(fromObject) {
7444
- const toObject = {};
7445
- const fromDynamicRetrievalConfig = getValueByPath(fromObject, [
7446
- 'dynamicRetrievalConfig',
7447
- ]);
7448
- if (fromDynamicRetrievalConfig != null) {
7449
- setValueByPath(toObject, ['dynamicRetrievalConfig'], dynamicRetrievalConfigToVertex$1(fromDynamicRetrievalConfig));
7450
- }
7451
- return toObject;
7452
- }
7453
- function enterpriseWebSearchToVertex$1() {
7454
- const toObject = {};
7455
- return toObject;
7456
- }
7457
- function apiKeyConfigToVertex$1(fromObject) {
7458
- const toObject = {};
7459
- const fromApiKeyString = getValueByPath(fromObject, ['apiKeyString']);
7460
- if (fromApiKeyString != null) {
7461
- setValueByPath(toObject, ['apiKeyString'], fromApiKeyString);
7462
- }
7463
- return toObject;
7464
- }
7465
- function authConfigToVertex$1(fromObject) {
7466
- const toObject = {};
7467
- const fromApiKeyConfig = getValueByPath(fromObject, ['apiKeyConfig']);
7468
- if (fromApiKeyConfig != null) {
7469
- setValueByPath(toObject, ['apiKeyConfig'], apiKeyConfigToVertex$1(fromApiKeyConfig));
7470
- }
7471
- const fromAuthType = getValueByPath(fromObject, ['authType']);
7472
- if (fromAuthType != null) {
7473
- setValueByPath(toObject, ['authType'], fromAuthType);
7474
- }
7475
- const fromGoogleServiceAccountConfig = getValueByPath(fromObject, [
7476
- 'googleServiceAccountConfig',
7477
- ]);
7478
- if (fromGoogleServiceAccountConfig != null) {
7479
- setValueByPath(toObject, ['googleServiceAccountConfig'], fromGoogleServiceAccountConfig);
7480
- }
7481
- const fromHttpBasicAuthConfig = getValueByPath(fromObject, [
7482
- 'httpBasicAuthConfig',
7483
- ]);
7484
- if (fromHttpBasicAuthConfig != null) {
7485
- setValueByPath(toObject, ['httpBasicAuthConfig'], fromHttpBasicAuthConfig);
7486
- }
7487
- const fromOauthConfig = getValueByPath(fromObject, ['oauthConfig']);
7488
- if (fromOauthConfig != null) {
7489
- setValueByPath(toObject, ['oauthConfig'], fromOauthConfig);
7490
- }
7491
- const fromOidcConfig = getValueByPath(fromObject, ['oidcConfig']);
7492
- if (fromOidcConfig != null) {
7493
- setValueByPath(toObject, ['oidcConfig'], fromOidcConfig);
7494
- }
7495
- return toObject;
7496
- }
7497
- function googleMapsToVertex$1(fromObject) {
7498
- const toObject = {};
7499
- const fromAuthConfig = getValueByPath(fromObject, ['authConfig']);
7500
- if (fromAuthConfig != null) {
7501
- setValueByPath(toObject, ['authConfig'], authConfigToVertex$1(fromAuthConfig));
7502
- }
7503
- return toObject;
7504
- }
7505
7118
  function urlContextToMldev$2() {
7506
7119
  const toObject = {};
7507
7120
  return toObject;
7508
7121
  }
7509
- function urlContextToVertex$1() {
7510
- const toObject = {};
7511
- return toObject;
7512
- }
7513
7122
  function toolToMldev$2(fromObject) {
7514
7123
  const toObject = {};
7515
7124
  const fromFunctionDeclarations = getValueByPath(fromObject, [
@@ -7559,60 +7168,6 @@ function toolToMldev$2(fromObject) {
7559
7168
  }
7560
7169
  return toObject;
7561
7170
  }
7562
- function toolToVertex$1(fromObject) {
7563
- const toObject = {};
7564
- const fromFunctionDeclarations = getValueByPath(fromObject, [
7565
- 'functionDeclarations',
7566
- ]);
7567
- if (fromFunctionDeclarations != null) {
7568
- let transformedList = fromFunctionDeclarations;
7569
- if (Array.isArray(transformedList)) {
7570
- transformedList = transformedList.map((item) => {
7571
- return functionDeclarationToVertex$1(item);
7572
- });
7573
- }
7574
- setValueByPath(toObject, ['functionDeclarations'], transformedList);
7575
- }
7576
- const fromRetrieval = getValueByPath(fromObject, ['retrieval']);
7577
- if (fromRetrieval != null) {
7578
- setValueByPath(toObject, ['retrieval'], fromRetrieval);
7579
- }
7580
- const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
7581
- if (fromGoogleSearch != null) {
7582
- setValueByPath(toObject, ['googleSearch'], googleSearchToVertex$1(fromGoogleSearch));
7583
- }
7584
- const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
7585
- 'googleSearchRetrieval',
7586
- ]);
7587
- if (fromGoogleSearchRetrieval != null) {
7588
- setValueByPath(toObject, ['googleSearchRetrieval'], googleSearchRetrievalToVertex$1(fromGoogleSearchRetrieval));
7589
- }
7590
- const fromEnterpriseWebSearch = getValueByPath(fromObject, [
7591
- 'enterpriseWebSearch',
7592
- ]);
7593
- if (fromEnterpriseWebSearch != null) {
7594
- setValueByPath(toObject, ['enterpriseWebSearch'], enterpriseWebSearchToVertex$1());
7595
- }
7596
- const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
7597
- if (fromGoogleMaps != null) {
7598
- setValueByPath(toObject, ['googleMaps'], googleMapsToVertex$1(fromGoogleMaps));
7599
- }
7600
- const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
7601
- if (fromUrlContext != null) {
7602
- setValueByPath(toObject, ['urlContext'], urlContextToVertex$1());
7603
- }
7604
- const fromCodeExecution = getValueByPath(fromObject, [
7605
- 'codeExecution',
7606
- ]);
7607
- if (fromCodeExecution != null) {
7608
- setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
7609
- }
7610
- const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
7611
- if (fromComputerUse != null) {
7612
- setValueByPath(toObject, ['computerUse'], fromComputerUse);
7613
- }
7614
- return toObject;
7615
- }
7616
7171
  function sessionResumptionConfigToMldev$1(fromObject) {
7617
7172
  const toObject = {};
7618
7173
  const fromHandle = getValueByPath(fromObject, ['handle']);
@@ -7624,26 +7179,10 @@ function sessionResumptionConfigToMldev$1(fromObject) {
7624
7179
  }
7625
7180
  return toObject;
7626
7181
  }
7627
- function sessionResumptionConfigToVertex(fromObject) {
7628
- const toObject = {};
7629
- const fromHandle = getValueByPath(fromObject, ['handle']);
7630
- if (fromHandle != null) {
7631
- setValueByPath(toObject, ['handle'], fromHandle);
7632
- }
7633
- const fromTransparent = getValueByPath(fromObject, ['transparent']);
7634
- if (fromTransparent != null) {
7635
- setValueByPath(toObject, ['transparent'], fromTransparent);
7636
- }
7637
- return toObject;
7638
- }
7639
7182
  function audioTranscriptionConfigToMldev$1() {
7640
7183
  const toObject = {};
7641
7184
  return toObject;
7642
7185
  }
7643
- function audioTranscriptionConfigToVertex() {
7644
- const toObject = {};
7645
- return toObject;
7646
- }
7647
7186
  function automaticActivityDetectionToMldev$1(fromObject) {
7648
7187
  const toObject = {};
7649
7188
  const fromDisabled = getValueByPath(fromObject, ['disabled']);
@@ -7676,38 +7215,6 @@ function automaticActivityDetectionToMldev$1(fromObject) {
7676
7215
  }
7677
7216
  return toObject;
7678
7217
  }
7679
- function automaticActivityDetectionToVertex(fromObject) {
7680
- const toObject = {};
7681
- const fromDisabled = getValueByPath(fromObject, ['disabled']);
7682
- if (fromDisabled != null) {
7683
- setValueByPath(toObject, ['disabled'], fromDisabled);
7684
- }
7685
- const fromStartOfSpeechSensitivity = getValueByPath(fromObject, [
7686
- 'startOfSpeechSensitivity',
7687
- ]);
7688
- if (fromStartOfSpeechSensitivity != null) {
7689
- setValueByPath(toObject, ['startOfSpeechSensitivity'], fromStartOfSpeechSensitivity);
7690
- }
7691
- const fromEndOfSpeechSensitivity = getValueByPath(fromObject, [
7692
- 'endOfSpeechSensitivity',
7693
- ]);
7694
- if (fromEndOfSpeechSensitivity != null) {
7695
- setValueByPath(toObject, ['endOfSpeechSensitivity'], fromEndOfSpeechSensitivity);
7696
- }
7697
- const fromPrefixPaddingMs = getValueByPath(fromObject, [
7698
- 'prefixPaddingMs',
7699
- ]);
7700
- if (fromPrefixPaddingMs != null) {
7701
- setValueByPath(toObject, ['prefixPaddingMs'], fromPrefixPaddingMs);
7702
- }
7703
- const fromSilenceDurationMs = getValueByPath(fromObject, [
7704
- 'silenceDurationMs',
7705
- ]);
7706
- if (fromSilenceDurationMs != null) {
7707
- setValueByPath(toObject, ['silenceDurationMs'], fromSilenceDurationMs);
7708
- }
7709
- return toObject;
7710
- }
7711
7218
  function realtimeInputConfigToMldev$1(fromObject) {
7712
7219
  const toObject = {};
7713
7220
  const fromAutomaticActivityDetection = getValueByPath(fromObject, [
@@ -7728,26 +7235,6 @@ function realtimeInputConfigToMldev$1(fromObject) {
7728
7235
  }
7729
7236
  return toObject;
7730
7237
  }
7731
- function realtimeInputConfigToVertex(fromObject) {
7732
- const toObject = {};
7733
- const fromAutomaticActivityDetection = getValueByPath(fromObject, [
7734
- 'automaticActivityDetection',
7735
- ]);
7736
- if (fromAutomaticActivityDetection != null) {
7737
- setValueByPath(toObject, ['automaticActivityDetection'], automaticActivityDetectionToVertex(fromAutomaticActivityDetection));
7738
- }
7739
- const fromActivityHandling = getValueByPath(fromObject, [
7740
- 'activityHandling',
7741
- ]);
7742
- if (fromActivityHandling != null) {
7743
- setValueByPath(toObject, ['activityHandling'], fromActivityHandling);
7744
- }
7745
- const fromTurnCoverage = getValueByPath(fromObject, ['turnCoverage']);
7746
- if (fromTurnCoverage != null) {
7747
- setValueByPath(toObject, ['turnCoverage'], fromTurnCoverage);
7748
- }
7749
- return toObject;
7750
- }
7751
7238
  function slidingWindowToMldev$1(fromObject) {
7752
7239
  const toObject = {};
7753
7240
  const fromTargetTokens = getValueByPath(fromObject, ['targetTokens']);
@@ -7756,14 +7243,6 @@ function slidingWindowToMldev$1(fromObject) {
7756
7243
  }
7757
7244
  return toObject;
7758
7245
  }
7759
- function slidingWindowToVertex(fromObject) {
7760
- const toObject = {};
7761
- const fromTargetTokens = getValueByPath(fromObject, ['targetTokens']);
7762
- if (fromTargetTokens != null) {
7763
- setValueByPath(toObject, ['targetTokens'], fromTargetTokens);
7764
- }
7765
- return toObject;
7766
- }
7767
7246
  function contextWindowCompressionConfigToMldev$1(fromObject) {
7768
7247
  const toObject = {};
7769
7248
  const fromTriggerTokens = getValueByPath(fromObject, [
@@ -7780,22 +7259,6 @@ function contextWindowCompressionConfigToMldev$1(fromObject) {
7780
7259
  }
7781
7260
  return toObject;
7782
7261
  }
7783
- function contextWindowCompressionConfigToVertex(fromObject) {
7784
- const toObject = {};
7785
- const fromTriggerTokens = getValueByPath(fromObject, [
7786
- 'triggerTokens',
7787
- ]);
7788
- if (fromTriggerTokens != null) {
7789
- setValueByPath(toObject, ['triggerTokens'], fromTriggerTokens);
7790
- }
7791
- const fromSlidingWindow = getValueByPath(fromObject, [
7792
- 'slidingWindow',
7793
- ]);
7794
- if (fromSlidingWindow != null) {
7795
- setValueByPath(toObject, ['slidingWindow'], slidingWindowToVertex(fromSlidingWindow));
7796
- }
7797
- return toObject;
7798
- }
7799
7262
  function proactivityConfigToMldev$1(fromObject) {
7800
7263
  const toObject = {};
7801
7264
  const fromProactiveAudio = getValueByPath(fromObject, [
@@ -7806,16 +7269,6 @@ function proactivityConfigToMldev$1(fromObject) {
7806
7269
  }
7807
7270
  return toObject;
7808
7271
  }
7809
- function proactivityConfigToVertex(fromObject) {
7810
- const toObject = {};
7811
- const fromProactiveAudio = getValueByPath(fromObject, [
7812
- 'proactiveAudio',
7813
- ]);
7814
- if (fromProactiveAudio != null) {
7815
- setValueByPath(toObject, ['proactiveAudio'], fromProactiveAudio);
7816
- }
7817
- return toObject;
7818
- }
7819
7272
  function liveConnectConfigToMldev$1(fromObject, parentObject) {
7820
7273
  const toObject = {};
7821
7274
  const fromGenerationConfig = getValueByPath(fromObject, [
@@ -7920,110 +7373,6 @@ function liveConnectConfigToMldev$1(fromObject, parentObject) {
7920
7373
  }
7921
7374
  return toObject;
7922
7375
  }
7923
- function liveConnectConfigToVertex(fromObject, parentObject) {
7924
- const toObject = {};
7925
- const fromGenerationConfig = getValueByPath(fromObject, [
7926
- 'generationConfig',
7927
- ]);
7928
- if (parentObject !== undefined && fromGenerationConfig != null) {
7929
- setValueByPath(parentObject, ['setup', 'generationConfig'], fromGenerationConfig);
7930
- }
7931
- const fromResponseModalities = getValueByPath(fromObject, [
7932
- 'responseModalities',
7933
- ]);
7934
- if (parentObject !== undefined && fromResponseModalities != null) {
7935
- setValueByPath(parentObject, ['setup', 'generationConfig', 'responseModalities'], fromResponseModalities);
7936
- }
7937
- const fromTemperature = getValueByPath(fromObject, ['temperature']);
7938
- if (parentObject !== undefined && fromTemperature != null) {
7939
- setValueByPath(parentObject, ['setup', 'generationConfig', 'temperature'], fromTemperature);
7940
- }
7941
- const fromTopP = getValueByPath(fromObject, ['topP']);
7942
- if (parentObject !== undefined && fromTopP != null) {
7943
- setValueByPath(parentObject, ['setup', 'generationConfig', 'topP'], fromTopP);
7944
- }
7945
- const fromTopK = getValueByPath(fromObject, ['topK']);
7946
- if (parentObject !== undefined && fromTopK != null) {
7947
- setValueByPath(parentObject, ['setup', 'generationConfig', 'topK'], fromTopK);
7948
- }
7949
- const fromMaxOutputTokens = getValueByPath(fromObject, [
7950
- 'maxOutputTokens',
7951
- ]);
7952
- if (parentObject !== undefined && fromMaxOutputTokens != null) {
7953
- setValueByPath(parentObject, ['setup', 'generationConfig', 'maxOutputTokens'], fromMaxOutputTokens);
7954
- }
7955
- const fromMediaResolution = getValueByPath(fromObject, [
7956
- 'mediaResolution',
7957
- ]);
7958
- if (parentObject !== undefined && fromMediaResolution != null) {
7959
- setValueByPath(parentObject, ['setup', 'generationConfig', 'mediaResolution'], fromMediaResolution);
7960
- }
7961
- const fromSeed = getValueByPath(fromObject, ['seed']);
7962
- if (parentObject !== undefined && fromSeed != null) {
7963
- setValueByPath(parentObject, ['setup', 'generationConfig', 'seed'], fromSeed);
7964
- }
7965
- const fromSpeechConfig = getValueByPath(fromObject, ['speechConfig']);
7966
- if (parentObject !== undefined && fromSpeechConfig != null) {
7967
- setValueByPath(parentObject, ['setup', 'generationConfig', 'speechConfig'], speechConfigToVertex$1(tLiveSpeechConfig(fromSpeechConfig)));
7968
- }
7969
- const fromEnableAffectiveDialog = getValueByPath(fromObject, [
7970
- 'enableAffectiveDialog',
7971
- ]);
7972
- if (parentObject !== undefined && fromEnableAffectiveDialog != null) {
7973
- setValueByPath(parentObject, ['setup', 'generationConfig', 'enableAffectiveDialog'], fromEnableAffectiveDialog);
7974
- }
7975
- const fromSystemInstruction = getValueByPath(fromObject, [
7976
- 'systemInstruction',
7977
- ]);
7978
- if (parentObject !== undefined && fromSystemInstruction != null) {
7979
- setValueByPath(parentObject, ['setup', 'systemInstruction'], contentToVertex$1(tContent(fromSystemInstruction)));
7980
- }
7981
- const fromTools = getValueByPath(fromObject, ['tools']);
7982
- if (parentObject !== undefined && fromTools != null) {
7983
- let transformedList = tTools(fromTools);
7984
- if (Array.isArray(transformedList)) {
7985
- transformedList = transformedList.map((item) => {
7986
- return toolToVertex$1(tTool(item));
7987
- });
7988
- }
7989
- setValueByPath(parentObject, ['setup', 'tools'], transformedList);
7990
- }
7991
- const fromSessionResumption = getValueByPath(fromObject, [
7992
- 'sessionResumption',
7993
- ]);
7994
- if (parentObject !== undefined && fromSessionResumption != null) {
7995
- setValueByPath(parentObject, ['setup', 'sessionResumption'], sessionResumptionConfigToVertex(fromSessionResumption));
7996
- }
7997
- const fromInputAudioTranscription = getValueByPath(fromObject, [
7998
- 'inputAudioTranscription',
7999
- ]);
8000
- if (parentObject !== undefined && fromInputAudioTranscription != null) {
8001
- setValueByPath(parentObject, ['setup', 'inputAudioTranscription'], audioTranscriptionConfigToVertex());
8002
- }
8003
- const fromOutputAudioTranscription = getValueByPath(fromObject, [
8004
- 'outputAudioTranscription',
8005
- ]);
8006
- if (parentObject !== undefined && fromOutputAudioTranscription != null) {
8007
- setValueByPath(parentObject, ['setup', 'outputAudioTranscription'], audioTranscriptionConfigToVertex());
8008
- }
8009
- const fromRealtimeInputConfig = getValueByPath(fromObject, [
8010
- 'realtimeInputConfig',
8011
- ]);
8012
- if (parentObject !== undefined && fromRealtimeInputConfig != null) {
8013
- setValueByPath(parentObject, ['setup', 'realtimeInputConfig'], realtimeInputConfigToVertex(fromRealtimeInputConfig));
8014
- }
8015
- const fromContextWindowCompression = getValueByPath(fromObject, [
8016
- 'contextWindowCompression',
8017
- ]);
8018
- if (parentObject !== undefined && fromContextWindowCompression != null) {
8019
- setValueByPath(parentObject, ['setup', 'contextWindowCompression'], contextWindowCompressionConfigToVertex(fromContextWindowCompression));
8020
- }
8021
- const fromProactivity = getValueByPath(fromObject, ['proactivity']);
8022
- if (parentObject !== undefined && fromProactivity != null) {
8023
- setValueByPath(parentObject, ['setup', 'proactivity'], proactivityConfigToVertex(fromProactivity));
8024
- }
8025
- return toObject;
8026
- }
8027
7376
  function liveConnectParametersToMldev(apiClient, fromObject) {
8028
7377
  const toObject = {};
8029
7378
  const fromModel = getValueByPath(fromObject, ['model']);
@@ -8036,34 +7385,14 @@ function liveConnectParametersToMldev(apiClient, fromObject) {
8036
7385
  }
8037
7386
  return toObject;
8038
7387
  }
8039
- function liveConnectParametersToVertex(apiClient, fromObject) {
8040
- const toObject = {};
8041
- const fromModel = getValueByPath(fromObject, ['model']);
8042
- if (fromModel != null) {
8043
- setValueByPath(toObject, ['setup', 'model'], tModel(apiClient, fromModel));
8044
- }
8045
- const fromConfig = getValueByPath(fromObject, ['config']);
8046
- if (fromConfig != null) {
8047
- setValueByPath(toObject, ['config'], liveConnectConfigToVertex(fromConfig, toObject));
8048
- }
8049
- return toObject;
8050
- }
8051
7388
  function activityStartToMldev() {
8052
7389
  const toObject = {};
8053
7390
  return toObject;
8054
7391
  }
8055
- function activityStartToVertex() {
8056
- const toObject = {};
8057
- return toObject;
8058
- }
8059
7392
  function activityEndToMldev() {
8060
7393
  const toObject = {};
8061
7394
  return toObject;
8062
7395
  }
8063
- function activityEndToVertex() {
8064
- const toObject = {};
8065
- return toObject;
8066
- }
8067
7396
  function liveSendRealtimeInputParametersToMldev(fromObject) {
8068
7397
  const toObject = {};
8069
7398
  const fromMedia = getValueByPath(fromObject, ['media']);
@@ -8100,42 +7429,6 @@ function liveSendRealtimeInputParametersToMldev(fromObject) {
8100
7429
  }
8101
7430
  return toObject;
8102
7431
  }
8103
- function liveSendRealtimeInputParametersToVertex(fromObject) {
8104
- const toObject = {};
8105
- const fromMedia = getValueByPath(fromObject, ['media']);
8106
- if (fromMedia != null) {
8107
- setValueByPath(toObject, ['mediaChunks'], tBlobs(fromMedia));
8108
- }
8109
- const fromAudio = getValueByPath(fromObject, ['audio']);
8110
- if (fromAudio != null) {
8111
- setValueByPath(toObject, ['audio'], tAudioBlob(fromAudio));
8112
- }
8113
- const fromAudioStreamEnd = getValueByPath(fromObject, [
8114
- 'audioStreamEnd',
8115
- ]);
8116
- if (fromAudioStreamEnd != null) {
8117
- setValueByPath(toObject, ['audioStreamEnd'], fromAudioStreamEnd);
8118
- }
8119
- const fromVideo = getValueByPath(fromObject, ['video']);
8120
- if (fromVideo != null) {
8121
- setValueByPath(toObject, ['video'], tImageBlob(fromVideo));
8122
- }
8123
- const fromText = getValueByPath(fromObject, ['text']);
8124
- if (fromText != null) {
8125
- setValueByPath(toObject, ['text'], fromText);
8126
- }
8127
- const fromActivityStart = getValueByPath(fromObject, [
8128
- 'activityStart',
8129
- ]);
8130
- if (fromActivityStart != null) {
8131
- setValueByPath(toObject, ['activityStart'], activityStartToVertex());
8132
- }
8133
- const fromActivityEnd = getValueByPath(fromObject, ['activityEnd']);
8134
- if (fromActivityEnd != null) {
8135
- setValueByPath(toObject, ['activityEnd'], activityEndToVertex());
8136
- }
8137
- return toObject;
8138
- }
8139
7432
  function weightedPromptToMldev(fromObject) {
8140
7433
  const toObject = {};
8141
7434
  const fromText = getValueByPath(fromObject, ['text']);
@@ -8274,35 +7567,40 @@ function liveMusicClientMessageToMldev(fromObject) {
8274
7567
  }
8275
7568
  return toObject;
8276
7569
  }
8277
- function liveServerSetupCompleteFromMldev() {
7570
+ function prebuiltVoiceConfigToVertex$1(fromObject) {
8278
7571
  const toObject = {};
7572
+ const fromVoiceName = getValueByPath(fromObject, ['voiceName']);
7573
+ if (fromVoiceName != null) {
7574
+ setValueByPath(toObject, ['voiceName'], fromVoiceName);
7575
+ }
8279
7576
  return toObject;
8280
7577
  }
8281
- function liveServerSetupCompleteFromVertex(fromObject) {
7578
+ function voiceConfigToVertex$1(fromObject) {
8282
7579
  const toObject = {};
8283
- const fromSessionId = getValueByPath(fromObject, ['sessionId']);
8284
- if (fromSessionId != null) {
8285
- setValueByPath(toObject, ['sessionId'], fromSessionId);
7580
+ const fromPrebuiltVoiceConfig = getValueByPath(fromObject, [
7581
+ 'prebuiltVoiceConfig',
7582
+ ]);
7583
+ if (fromPrebuiltVoiceConfig != null) {
7584
+ setValueByPath(toObject, ['prebuiltVoiceConfig'], prebuiltVoiceConfigToVertex$1(fromPrebuiltVoiceConfig));
8286
7585
  }
8287
7586
  return toObject;
8288
7587
  }
8289
- function videoMetadataFromMldev$1(fromObject) {
7588
+ function speechConfigToVertex$1(fromObject) {
8290
7589
  const toObject = {};
8291
- const fromFps = getValueByPath(fromObject, ['fps']);
8292
- if (fromFps != null) {
8293
- setValueByPath(toObject, ['fps'], fromFps);
7590
+ const fromVoiceConfig = getValueByPath(fromObject, ['voiceConfig']);
7591
+ if (fromVoiceConfig != null) {
7592
+ setValueByPath(toObject, ['voiceConfig'], voiceConfigToVertex$1(fromVoiceConfig));
8294
7593
  }
8295
- const fromEndOffset = getValueByPath(fromObject, ['endOffset']);
8296
- if (fromEndOffset != null) {
8297
- setValueByPath(toObject, ['endOffset'], fromEndOffset);
7594
+ if (getValueByPath(fromObject, ['multiSpeakerVoiceConfig']) !== undefined) {
7595
+ throw new Error('multiSpeakerVoiceConfig parameter is not supported in Vertex AI.');
8298
7596
  }
8299
- const fromStartOffset = getValueByPath(fromObject, ['startOffset']);
8300
- if (fromStartOffset != null) {
8301
- setValueByPath(toObject, ['startOffset'], fromStartOffset);
7597
+ const fromLanguageCode = getValueByPath(fromObject, ['languageCode']);
7598
+ if (fromLanguageCode != null) {
7599
+ setValueByPath(toObject, ['languageCode'], fromLanguageCode);
8302
7600
  }
8303
7601
  return toObject;
8304
7602
  }
8305
- function videoMetadataFromVertex$1(fromObject) {
7603
+ function videoMetadataToVertex$1(fromObject) {
8306
7604
  const toObject = {};
8307
7605
  const fromFps = getValueByPath(fromObject, ['fps']);
8308
7606
  if (fromFps != null) {
@@ -8318,19 +7616,7 @@ function videoMetadataFromVertex$1(fromObject) {
8318
7616
  }
8319
7617
  return toObject;
8320
7618
  }
8321
- function blobFromMldev$1(fromObject) {
8322
- const toObject = {};
8323
- const fromData = getValueByPath(fromObject, ['data']);
8324
- if (fromData != null) {
8325
- setValueByPath(toObject, ['data'], fromData);
8326
- }
8327
- const fromMimeType = getValueByPath(fromObject, ['mimeType']);
8328
- if (fromMimeType != null) {
8329
- setValueByPath(toObject, ['mimeType'], fromMimeType);
8330
- }
8331
- return toObject;
8332
- }
8333
- function blobFromVertex$1(fromObject) {
7619
+ function blobToVertex$1(fromObject) {
8334
7620
  const toObject = {};
8335
7621
  const fromDisplayName = getValueByPath(fromObject, ['displayName']);
8336
7622
  if (fromDisplayName != null) {
@@ -8346,19 +7632,7 @@ function blobFromVertex$1(fromObject) {
8346
7632
  }
8347
7633
  return toObject;
8348
7634
  }
8349
- function fileDataFromMldev$1(fromObject) {
8350
- const toObject = {};
8351
- const fromFileUri = getValueByPath(fromObject, ['fileUri']);
8352
- if (fromFileUri != null) {
8353
- setValueByPath(toObject, ['fileUri'], fromFileUri);
8354
- }
8355
- const fromMimeType = getValueByPath(fromObject, ['mimeType']);
8356
- if (fromMimeType != null) {
8357
- setValueByPath(toObject, ['mimeType'], fromMimeType);
8358
- }
8359
- return toObject;
8360
- }
8361
- function fileDataFromVertex$1(fromObject) {
7635
+ function fileDataToVertex$1(fromObject) {
8362
7636
  const toObject = {};
8363
7637
  const fromDisplayName = getValueByPath(fromObject, ['displayName']);
8364
7638
  if (fromDisplayName != null) {
@@ -8374,13 +7648,13 @@ function fileDataFromVertex$1(fromObject) {
8374
7648
  }
8375
7649
  return toObject;
8376
7650
  }
8377
- function partFromMldev$1(fromObject) {
7651
+ function partToVertex$1(fromObject) {
8378
7652
  const toObject = {};
8379
7653
  const fromVideoMetadata = getValueByPath(fromObject, [
8380
7654
  'videoMetadata',
8381
7655
  ]);
8382
7656
  if (fromVideoMetadata != null) {
8383
- setValueByPath(toObject, ['videoMetadata'], videoMetadataFromMldev$1(fromVideoMetadata));
7657
+ setValueByPath(toObject, ['videoMetadata'], videoMetadataToVertex$1(fromVideoMetadata));
8384
7658
  }
8385
7659
  const fromThought = getValueByPath(fromObject, ['thought']);
8386
7660
  if (fromThought != null) {
@@ -8388,11 +7662,11 @@ function partFromMldev$1(fromObject) {
8388
7662
  }
8389
7663
  const fromInlineData = getValueByPath(fromObject, ['inlineData']);
8390
7664
  if (fromInlineData != null) {
8391
- setValueByPath(toObject, ['inlineData'], blobFromMldev$1(fromInlineData));
7665
+ setValueByPath(toObject, ['inlineData'], blobToVertex$1(fromInlineData));
8392
7666
  }
8393
7667
  const fromFileData = getValueByPath(fromObject, ['fileData']);
8394
7668
  if (fromFileData != null) {
8395
- setValueByPath(toObject, ['fileData'], fileDataFromMldev$1(fromFileData));
7669
+ setValueByPath(toObject, ['fileData'], fileDataToVertex$1(fromFileData));
8396
7670
  }
8397
7671
  const fromThoughtSignature = getValueByPath(fromObject, [
8398
7672
  'thoughtSignature',
@@ -8428,20 +7702,1123 @@ function partFromMldev$1(fromObject) {
8428
7702
  }
8429
7703
  return toObject;
8430
7704
  }
8431
- function partFromVertex$1(fromObject) {
7705
+ function contentToVertex$1(fromObject) {
8432
7706
  const toObject = {};
8433
- const fromVideoMetadata = getValueByPath(fromObject, [
8434
- 'videoMetadata',
8435
- ]);
8436
- if (fromVideoMetadata != null) {
8437
- setValueByPath(toObject, ['videoMetadata'], videoMetadataFromVertex$1(fromVideoMetadata));
7707
+ const fromParts = getValueByPath(fromObject, ['parts']);
7708
+ if (fromParts != null) {
7709
+ let transformedList = fromParts;
7710
+ if (Array.isArray(transformedList)) {
7711
+ transformedList = transformedList.map((item) => {
7712
+ return partToVertex$1(item);
7713
+ });
7714
+ }
7715
+ setValueByPath(toObject, ['parts'], transformedList);
8438
7716
  }
8439
- const fromThought = getValueByPath(fromObject, ['thought']);
8440
- if (fromThought != null) {
8441
- setValueByPath(toObject, ['thought'], fromThought);
7717
+ const fromRole = getValueByPath(fromObject, ['role']);
7718
+ if (fromRole != null) {
7719
+ setValueByPath(toObject, ['role'], fromRole);
8442
7720
  }
8443
- const fromInlineData = getValueByPath(fromObject, ['inlineData']);
8444
- if (fromInlineData != null) {
7721
+ return toObject;
7722
+ }
7723
+ function functionDeclarationToVertex$1(fromObject) {
7724
+ const toObject = {};
7725
+ if (getValueByPath(fromObject, ['behavior']) !== undefined) {
7726
+ throw new Error('behavior parameter is not supported in Vertex AI.');
7727
+ }
7728
+ const fromDescription = getValueByPath(fromObject, ['description']);
7729
+ if (fromDescription != null) {
7730
+ setValueByPath(toObject, ['description'], fromDescription);
7731
+ }
7732
+ const fromName = getValueByPath(fromObject, ['name']);
7733
+ if (fromName != null) {
7734
+ setValueByPath(toObject, ['name'], fromName);
7735
+ }
7736
+ const fromParameters = getValueByPath(fromObject, ['parameters']);
7737
+ if (fromParameters != null) {
7738
+ setValueByPath(toObject, ['parameters'], fromParameters);
7739
+ }
7740
+ const fromParametersJsonSchema = getValueByPath(fromObject, [
7741
+ 'parametersJsonSchema',
7742
+ ]);
7743
+ if (fromParametersJsonSchema != null) {
7744
+ setValueByPath(toObject, ['parametersJsonSchema'], fromParametersJsonSchema);
7745
+ }
7746
+ const fromResponse = getValueByPath(fromObject, ['response']);
7747
+ if (fromResponse != null) {
7748
+ setValueByPath(toObject, ['response'], fromResponse);
7749
+ }
7750
+ const fromResponseJsonSchema = getValueByPath(fromObject, [
7751
+ 'responseJsonSchema',
7752
+ ]);
7753
+ if (fromResponseJsonSchema != null) {
7754
+ setValueByPath(toObject, ['responseJsonSchema'], fromResponseJsonSchema);
7755
+ }
7756
+ return toObject;
7757
+ }
7758
+ function intervalToVertex$1(fromObject) {
7759
+ const toObject = {};
7760
+ const fromStartTime = getValueByPath(fromObject, ['startTime']);
7761
+ if (fromStartTime != null) {
7762
+ setValueByPath(toObject, ['startTime'], fromStartTime);
7763
+ }
7764
+ const fromEndTime = getValueByPath(fromObject, ['endTime']);
7765
+ if (fromEndTime != null) {
7766
+ setValueByPath(toObject, ['endTime'], fromEndTime);
7767
+ }
7768
+ return toObject;
7769
+ }
7770
+ function googleSearchToVertex$1(fromObject) {
7771
+ const toObject = {};
7772
+ const fromTimeRangeFilter = getValueByPath(fromObject, [
7773
+ 'timeRangeFilter',
7774
+ ]);
7775
+ if (fromTimeRangeFilter != null) {
7776
+ setValueByPath(toObject, ['timeRangeFilter'], intervalToVertex$1(fromTimeRangeFilter));
7777
+ }
7778
+ return toObject;
7779
+ }
7780
+ function dynamicRetrievalConfigToVertex$1(fromObject) {
7781
+ const toObject = {};
7782
+ const fromMode = getValueByPath(fromObject, ['mode']);
7783
+ if (fromMode != null) {
7784
+ setValueByPath(toObject, ['mode'], fromMode);
7785
+ }
7786
+ const fromDynamicThreshold = getValueByPath(fromObject, [
7787
+ 'dynamicThreshold',
7788
+ ]);
7789
+ if (fromDynamicThreshold != null) {
7790
+ setValueByPath(toObject, ['dynamicThreshold'], fromDynamicThreshold);
7791
+ }
7792
+ return toObject;
7793
+ }
7794
+ function googleSearchRetrievalToVertex$1(fromObject) {
7795
+ const toObject = {};
7796
+ const fromDynamicRetrievalConfig = getValueByPath(fromObject, [
7797
+ 'dynamicRetrievalConfig',
7798
+ ]);
7799
+ if (fromDynamicRetrievalConfig != null) {
7800
+ setValueByPath(toObject, ['dynamicRetrievalConfig'], dynamicRetrievalConfigToVertex$1(fromDynamicRetrievalConfig));
7801
+ }
7802
+ return toObject;
7803
+ }
7804
+ function enterpriseWebSearchToVertex$1() {
7805
+ const toObject = {};
7806
+ return toObject;
7807
+ }
7808
+ function apiKeyConfigToVertex$1(fromObject) {
7809
+ const toObject = {};
7810
+ const fromApiKeyString = getValueByPath(fromObject, ['apiKeyString']);
7811
+ if (fromApiKeyString != null) {
7812
+ setValueByPath(toObject, ['apiKeyString'], fromApiKeyString);
7813
+ }
7814
+ return toObject;
7815
+ }
7816
+ function authConfigToVertex$1(fromObject) {
7817
+ const toObject = {};
7818
+ const fromApiKeyConfig = getValueByPath(fromObject, ['apiKeyConfig']);
7819
+ if (fromApiKeyConfig != null) {
7820
+ setValueByPath(toObject, ['apiKeyConfig'], apiKeyConfigToVertex$1(fromApiKeyConfig));
7821
+ }
7822
+ const fromAuthType = getValueByPath(fromObject, ['authType']);
7823
+ if (fromAuthType != null) {
7824
+ setValueByPath(toObject, ['authType'], fromAuthType);
7825
+ }
7826
+ const fromGoogleServiceAccountConfig = getValueByPath(fromObject, [
7827
+ 'googleServiceAccountConfig',
7828
+ ]);
7829
+ if (fromGoogleServiceAccountConfig != null) {
7830
+ setValueByPath(toObject, ['googleServiceAccountConfig'], fromGoogleServiceAccountConfig);
7831
+ }
7832
+ const fromHttpBasicAuthConfig = getValueByPath(fromObject, [
7833
+ 'httpBasicAuthConfig',
7834
+ ]);
7835
+ if (fromHttpBasicAuthConfig != null) {
7836
+ setValueByPath(toObject, ['httpBasicAuthConfig'], fromHttpBasicAuthConfig);
7837
+ }
7838
+ const fromOauthConfig = getValueByPath(fromObject, ['oauthConfig']);
7839
+ if (fromOauthConfig != null) {
7840
+ setValueByPath(toObject, ['oauthConfig'], fromOauthConfig);
7841
+ }
7842
+ const fromOidcConfig = getValueByPath(fromObject, ['oidcConfig']);
7843
+ if (fromOidcConfig != null) {
7844
+ setValueByPath(toObject, ['oidcConfig'], fromOidcConfig);
7845
+ }
7846
+ return toObject;
7847
+ }
7848
+ function googleMapsToVertex$1(fromObject) {
7849
+ const toObject = {};
7850
+ const fromAuthConfig = getValueByPath(fromObject, ['authConfig']);
7851
+ if (fromAuthConfig != null) {
7852
+ setValueByPath(toObject, ['authConfig'], authConfigToVertex$1(fromAuthConfig));
7853
+ }
7854
+ return toObject;
7855
+ }
7856
+ function urlContextToVertex$1() {
7857
+ const toObject = {};
7858
+ return toObject;
7859
+ }
7860
+ function toolToVertex$1(fromObject) {
7861
+ const toObject = {};
7862
+ const fromFunctionDeclarations = getValueByPath(fromObject, [
7863
+ 'functionDeclarations',
7864
+ ]);
7865
+ if (fromFunctionDeclarations != null) {
7866
+ let transformedList = fromFunctionDeclarations;
7867
+ if (Array.isArray(transformedList)) {
7868
+ transformedList = transformedList.map((item) => {
7869
+ return functionDeclarationToVertex$1(item);
7870
+ });
7871
+ }
7872
+ setValueByPath(toObject, ['functionDeclarations'], transformedList);
7873
+ }
7874
+ const fromRetrieval = getValueByPath(fromObject, ['retrieval']);
7875
+ if (fromRetrieval != null) {
7876
+ setValueByPath(toObject, ['retrieval'], fromRetrieval);
7877
+ }
7878
+ const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
7879
+ if (fromGoogleSearch != null) {
7880
+ setValueByPath(toObject, ['googleSearch'], googleSearchToVertex$1(fromGoogleSearch));
7881
+ }
7882
+ const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
7883
+ 'googleSearchRetrieval',
7884
+ ]);
7885
+ if (fromGoogleSearchRetrieval != null) {
7886
+ setValueByPath(toObject, ['googleSearchRetrieval'], googleSearchRetrievalToVertex$1(fromGoogleSearchRetrieval));
7887
+ }
7888
+ const fromEnterpriseWebSearch = getValueByPath(fromObject, [
7889
+ 'enterpriseWebSearch',
7890
+ ]);
7891
+ if (fromEnterpriseWebSearch != null) {
7892
+ setValueByPath(toObject, ['enterpriseWebSearch'], enterpriseWebSearchToVertex$1());
7893
+ }
7894
+ const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
7895
+ if (fromGoogleMaps != null) {
7896
+ setValueByPath(toObject, ['googleMaps'], googleMapsToVertex$1(fromGoogleMaps));
7897
+ }
7898
+ const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
7899
+ if (fromUrlContext != null) {
7900
+ setValueByPath(toObject, ['urlContext'], urlContextToVertex$1());
7901
+ }
7902
+ const fromCodeExecution = getValueByPath(fromObject, [
7903
+ 'codeExecution',
7904
+ ]);
7905
+ if (fromCodeExecution != null) {
7906
+ setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
7907
+ }
7908
+ const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
7909
+ if (fromComputerUse != null) {
7910
+ setValueByPath(toObject, ['computerUse'], fromComputerUse);
7911
+ }
7912
+ return toObject;
7913
+ }
7914
+ function sessionResumptionConfigToVertex(fromObject) {
7915
+ const toObject = {};
7916
+ const fromHandle = getValueByPath(fromObject, ['handle']);
7917
+ if (fromHandle != null) {
7918
+ setValueByPath(toObject, ['handle'], fromHandle);
7919
+ }
7920
+ const fromTransparent = getValueByPath(fromObject, ['transparent']);
7921
+ if (fromTransparent != null) {
7922
+ setValueByPath(toObject, ['transparent'], fromTransparent);
7923
+ }
7924
+ return toObject;
7925
+ }
7926
+ function audioTranscriptionConfigToVertex() {
7927
+ const toObject = {};
7928
+ return toObject;
7929
+ }
7930
+ function automaticActivityDetectionToVertex(fromObject) {
7931
+ const toObject = {};
7932
+ const fromDisabled = getValueByPath(fromObject, ['disabled']);
7933
+ if (fromDisabled != null) {
7934
+ setValueByPath(toObject, ['disabled'], fromDisabled);
7935
+ }
7936
+ const fromStartOfSpeechSensitivity = getValueByPath(fromObject, [
7937
+ 'startOfSpeechSensitivity',
7938
+ ]);
7939
+ if (fromStartOfSpeechSensitivity != null) {
7940
+ setValueByPath(toObject, ['startOfSpeechSensitivity'], fromStartOfSpeechSensitivity);
7941
+ }
7942
+ const fromEndOfSpeechSensitivity = getValueByPath(fromObject, [
7943
+ 'endOfSpeechSensitivity',
7944
+ ]);
7945
+ if (fromEndOfSpeechSensitivity != null) {
7946
+ setValueByPath(toObject, ['endOfSpeechSensitivity'], fromEndOfSpeechSensitivity);
7947
+ }
7948
+ const fromPrefixPaddingMs = getValueByPath(fromObject, [
7949
+ 'prefixPaddingMs',
7950
+ ]);
7951
+ if (fromPrefixPaddingMs != null) {
7952
+ setValueByPath(toObject, ['prefixPaddingMs'], fromPrefixPaddingMs);
7953
+ }
7954
+ const fromSilenceDurationMs = getValueByPath(fromObject, [
7955
+ 'silenceDurationMs',
7956
+ ]);
7957
+ if (fromSilenceDurationMs != null) {
7958
+ setValueByPath(toObject, ['silenceDurationMs'], fromSilenceDurationMs);
7959
+ }
7960
+ return toObject;
7961
+ }
7962
+ function realtimeInputConfigToVertex(fromObject) {
7963
+ const toObject = {};
7964
+ const fromAutomaticActivityDetection = getValueByPath(fromObject, [
7965
+ 'automaticActivityDetection',
7966
+ ]);
7967
+ if (fromAutomaticActivityDetection != null) {
7968
+ setValueByPath(toObject, ['automaticActivityDetection'], automaticActivityDetectionToVertex(fromAutomaticActivityDetection));
7969
+ }
7970
+ const fromActivityHandling = getValueByPath(fromObject, [
7971
+ 'activityHandling',
7972
+ ]);
7973
+ if (fromActivityHandling != null) {
7974
+ setValueByPath(toObject, ['activityHandling'], fromActivityHandling);
7975
+ }
7976
+ const fromTurnCoverage = getValueByPath(fromObject, ['turnCoverage']);
7977
+ if (fromTurnCoverage != null) {
7978
+ setValueByPath(toObject, ['turnCoverage'], fromTurnCoverage);
7979
+ }
7980
+ return toObject;
7981
+ }
7982
+ function slidingWindowToVertex(fromObject) {
7983
+ const toObject = {};
7984
+ const fromTargetTokens = getValueByPath(fromObject, ['targetTokens']);
7985
+ if (fromTargetTokens != null) {
7986
+ setValueByPath(toObject, ['targetTokens'], fromTargetTokens);
7987
+ }
7988
+ return toObject;
7989
+ }
7990
+ function contextWindowCompressionConfigToVertex(fromObject) {
7991
+ const toObject = {};
7992
+ const fromTriggerTokens = getValueByPath(fromObject, [
7993
+ 'triggerTokens',
7994
+ ]);
7995
+ if (fromTriggerTokens != null) {
7996
+ setValueByPath(toObject, ['triggerTokens'], fromTriggerTokens);
7997
+ }
7998
+ const fromSlidingWindow = getValueByPath(fromObject, [
7999
+ 'slidingWindow',
8000
+ ]);
8001
+ if (fromSlidingWindow != null) {
8002
+ setValueByPath(toObject, ['slidingWindow'], slidingWindowToVertex(fromSlidingWindow));
8003
+ }
8004
+ return toObject;
8005
+ }
8006
+ function proactivityConfigToVertex(fromObject) {
8007
+ const toObject = {};
8008
+ const fromProactiveAudio = getValueByPath(fromObject, [
8009
+ 'proactiveAudio',
8010
+ ]);
8011
+ if (fromProactiveAudio != null) {
8012
+ setValueByPath(toObject, ['proactiveAudio'], fromProactiveAudio);
8013
+ }
8014
+ return toObject;
8015
+ }
8016
+ function liveConnectConfigToVertex(fromObject, parentObject) {
8017
+ const toObject = {};
8018
+ const fromGenerationConfig = getValueByPath(fromObject, [
8019
+ 'generationConfig',
8020
+ ]);
8021
+ if (parentObject !== undefined && fromGenerationConfig != null) {
8022
+ setValueByPath(parentObject, ['setup', 'generationConfig'], fromGenerationConfig);
8023
+ }
8024
+ const fromResponseModalities = getValueByPath(fromObject, [
8025
+ 'responseModalities',
8026
+ ]);
8027
+ if (parentObject !== undefined && fromResponseModalities != null) {
8028
+ setValueByPath(parentObject, ['setup', 'generationConfig', 'responseModalities'], fromResponseModalities);
8029
+ }
8030
+ const fromTemperature = getValueByPath(fromObject, ['temperature']);
8031
+ if (parentObject !== undefined && fromTemperature != null) {
8032
+ setValueByPath(parentObject, ['setup', 'generationConfig', 'temperature'], fromTemperature);
8033
+ }
8034
+ const fromTopP = getValueByPath(fromObject, ['topP']);
8035
+ if (parentObject !== undefined && fromTopP != null) {
8036
+ setValueByPath(parentObject, ['setup', 'generationConfig', 'topP'], fromTopP);
8037
+ }
8038
+ const fromTopK = getValueByPath(fromObject, ['topK']);
8039
+ if (parentObject !== undefined && fromTopK != null) {
8040
+ setValueByPath(parentObject, ['setup', 'generationConfig', 'topK'], fromTopK);
8041
+ }
8042
+ const fromMaxOutputTokens = getValueByPath(fromObject, [
8043
+ 'maxOutputTokens',
8044
+ ]);
8045
+ if (parentObject !== undefined && fromMaxOutputTokens != null) {
8046
+ setValueByPath(parentObject, ['setup', 'generationConfig', 'maxOutputTokens'], fromMaxOutputTokens);
8047
+ }
8048
+ const fromMediaResolution = getValueByPath(fromObject, [
8049
+ 'mediaResolution',
8050
+ ]);
8051
+ if (parentObject !== undefined && fromMediaResolution != null) {
8052
+ setValueByPath(parentObject, ['setup', 'generationConfig', 'mediaResolution'], fromMediaResolution);
8053
+ }
8054
+ const fromSeed = getValueByPath(fromObject, ['seed']);
8055
+ if (parentObject !== undefined && fromSeed != null) {
8056
+ setValueByPath(parentObject, ['setup', 'generationConfig', 'seed'], fromSeed);
8057
+ }
8058
+ const fromSpeechConfig = getValueByPath(fromObject, ['speechConfig']);
8059
+ if (parentObject !== undefined && fromSpeechConfig != null) {
8060
+ setValueByPath(parentObject, ['setup', 'generationConfig', 'speechConfig'], speechConfigToVertex$1(tLiveSpeechConfig(fromSpeechConfig)));
8061
+ }
8062
+ const fromEnableAffectiveDialog = getValueByPath(fromObject, [
8063
+ 'enableAffectiveDialog',
8064
+ ]);
8065
+ if (parentObject !== undefined && fromEnableAffectiveDialog != null) {
8066
+ setValueByPath(parentObject, ['setup', 'generationConfig', 'enableAffectiveDialog'], fromEnableAffectiveDialog);
8067
+ }
8068
+ const fromSystemInstruction = getValueByPath(fromObject, [
8069
+ 'systemInstruction',
8070
+ ]);
8071
+ if (parentObject !== undefined && fromSystemInstruction != null) {
8072
+ setValueByPath(parentObject, ['setup', 'systemInstruction'], contentToVertex$1(tContent(fromSystemInstruction)));
8073
+ }
8074
+ const fromTools = getValueByPath(fromObject, ['tools']);
8075
+ if (parentObject !== undefined && fromTools != null) {
8076
+ let transformedList = tTools(fromTools);
8077
+ if (Array.isArray(transformedList)) {
8078
+ transformedList = transformedList.map((item) => {
8079
+ return toolToVertex$1(tTool(item));
8080
+ });
8081
+ }
8082
+ setValueByPath(parentObject, ['setup', 'tools'], transformedList);
8083
+ }
8084
+ const fromSessionResumption = getValueByPath(fromObject, [
8085
+ 'sessionResumption',
8086
+ ]);
8087
+ if (parentObject !== undefined && fromSessionResumption != null) {
8088
+ setValueByPath(parentObject, ['setup', 'sessionResumption'], sessionResumptionConfigToVertex(fromSessionResumption));
8089
+ }
8090
+ const fromInputAudioTranscription = getValueByPath(fromObject, [
8091
+ 'inputAudioTranscription',
8092
+ ]);
8093
+ if (parentObject !== undefined && fromInputAudioTranscription != null) {
8094
+ setValueByPath(parentObject, ['setup', 'inputAudioTranscription'], audioTranscriptionConfigToVertex());
8095
+ }
8096
+ const fromOutputAudioTranscription = getValueByPath(fromObject, [
8097
+ 'outputAudioTranscription',
8098
+ ]);
8099
+ if (parentObject !== undefined && fromOutputAudioTranscription != null) {
8100
+ setValueByPath(parentObject, ['setup', 'outputAudioTranscription'], audioTranscriptionConfigToVertex());
8101
+ }
8102
+ const fromRealtimeInputConfig = getValueByPath(fromObject, [
8103
+ 'realtimeInputConfig',
8104
+ ]);
8105
+ if (parentObject !== undefined && fromRealtimeInputConfig != null) {
8106
+ setValueByPath(parentObject, ['setup', 'realtimeInputConfig'], realtimeInputConfigToVertex(fromRealtimeInputConfig));
8107
+ }
8108
+ const fromContextWindowCompression = getValueByPath(fromObject, [
8109
+ 'contextWindowCompression',
8110
+ ]);
8111
+ if (parentObject !== undefined && fromContextWindowCompression != null) {
8112
+ setValueByPath(parentObject, ['setup', 'contextWindowCompression'], contextWindowCompressionConfigToVertex(fromContextWindowCompression));
8113
+ }
8114
+ const fromProactivity = getValueByPath(fromObject, ['proactivity']);
8115
+ if (parentObject !== undefined && fromProactivity != null) {
8116
+ setValueByPath(parentObject, ['setup', 'proactivity'], proactivityConfigToVertex(fromProactivity));
8117
+ }
8118
+ return toObject;
8119
+ }
8120
+ function liveConnectParametersToVertex(apiClient, fromObject) {
8121
+ const toObject = {};
8122
+ const fromModel = getValueByPath(fromObject, ['model']);
8123
+ if (fromModel != null) {
8124
+ setValueByPath(toObject, ['setup', 'model'], tModel(apiClient, fromModel));
8125
+ }
8126
+ const fromConfig = getValueByPath(fromObject, ['config']);
8127
+ if (fromConfig != null) {
8128
+ setValueByPath(toObject, ['config'], liveConnectConfigToVertex(fromConfig, toObject));
8129
+ }
8130
+ return toObject;
8131
+ }
8132
+ function activityStartToVertex() {
8133
+ const toObject = {};
8134
+ return toObject;
8135
+ }
8136
+ function activityEndToVertex() {
8137
+ const toObject = {};
8138
+ return toObject;
8139
+ }
8140
+ function liveSendRealtimeInputParametersToVertex(fromObject) {
8141
+ const toObject = {};
8142
+ const fromMedia = getValueByPath(fromObject, ['media']);
8143
+ if (fromMedia != null) {
8144
+ setValueByPath(toObject, ['mediaChunks'], tBlobs(fromMedia));
8145
+ }
8146
+ const fromAudio = getValueByPath(fromObject, ['audio']);
8147
+ if (fromAudio != null) {
8148
+ setValueByPath(toObject, ['audio'], tAudioBlob(fromAudio));
8149
+ }
8150
+ const fromAudioStreamEnd = getValueByPath(fromObject, [
8151
+ 'audioStreamEnd',
8152
+ ]);
8153
+ if (fromAudioStreamEnd != null) {
8154
+ setValueByPath(toObject, ['audioStreamEnd'], fromAudioStreamEnd);
8155
+ }
8156
+ const fromVideo = getValueByPath(fromObject, ['video']);
8157
+ if (fromVideo != null) {
8158
+ setValueByPath(toObject, ['video'], tImageBlob(fromVideo));
8159
+ }
8160
+ const fromText = getValueByPath(fromObject, ['text']);
8161
+ if (fromText != null) {
8162
+ setValueByPath(toObject, ['text'], fromText);
8163
+ }
8164
+ const fromActivityStart = getValueByPath(fromObject, [
8165
+ 'activityStart',
8166
+ ]);
8167
+ if (fromActivityStart != null) {
8168
+ setValueByPath(toObject, ['activityStart'], activityStartToVertex());
8169
+ }
8170
+ const fromActivityEnd = getValueByPath(fromObject, ['activityEnd']);
8171
+ if (fromActivityEnd != null) {
8172
+ setValueByPath(toObject, ['activityEnd'], activityEndToVertex());
8173
+ }
8174
+ return toObject;
8175
+ }
8176
+ function liveServerSetupCompleteFromMldev() {
8177
+ const toObject = {};
8178
+ return toObject;
8179
+ }
8180
+ function videoMetadataFromMldev$1(fromObject) {
8181
+ const toObject = {};
8182
+ const fromFps = getValueByPath(fromObject, ['fps']);
8183
+ if (fromFps != null) {
8184
+ setValueByPath(toObject, ['fps'], fromFps);
8185
+ }
8186
+ const fromEndOffset = getValueByPath(fromObject, ['endOffset']);
8187
+ if (fromEndOffset != null) {
8188
+ setValueByPath(toObject, ['endOffset'], fromEndOffset);
8189
+ }
8190
+ const fromStartOffset = getValueByPath(fromObject, ['startOffset']);
8191
+ if (fromStartOffset != null) {
8192
+ setValueByPath(toObject, ['startOffset'], fromStartOffset);
8193
+ }
8194
+ return toObject;
8195
+ }
8196
+ function blobFromMldev$1(fromObject) {
8197
+ const toObject = {};
8198
+ const fromData = getValueByPath(fromObject, ['data']);
8199
+ if (fromData != null) {
8200
+ setValueByPath(toObject, ['data'], fromData);
8201
+ }
8202
+ const fromMimeType = getValueByPath(fromObject, ['mimeType']);
8203
+ if (fromMimeType != null) {
8204
+ setValueByPath(toObject, ['mimeType'], fromMimeType);
8205
+ }
8206
+ return toObject;
8207
+ }
8208
+ function fileDataFromMldev$1(fromObject) {
8209
+ const toObject = {};
8210
+ const fromFileUri = getValueByPath(fromObject, ['fileUri']);
8211
+ if (fromFileUri != null) {
8212
+ setValueByPath(toObject, ['fileUri'], fromFileUri);
8213
+ }
8214
+ const fromMimeType = getValueByPath(fromObject, ['mimeType']);
8215
+ if (fromMimeType != null) {
8216
+ setValueByPath(toObject, ['mimeType'], fromMimeType);
8217
+ }
8218
+ return toObject;
8219
+ }
8220
+ function partFromMldev$1(fromObject) {
8221
+ const toObject = {};
8222
+ const fromVideoMetadata = getValueByPath(fromObject, [
8223
+ 'videoMetadata',
8224
+ ]);
8225
+ if (fromVideoMetadata != null) {
8226
+ setValueByPath(toObject, ['videoMetadata'], videoMetadataFromMldev$1(fromVideoMetadata));
8227
+ }
8228
+ const fromThought = getValueByPath(fromObject, ['thought']);
8229
+ if (fromThought != null) {
8230
+ setValueByPath(toObject, ['thought'], fromThought);
8231
+ }
8232
+ const fromInlineData = getValueByPath(fromObject, ['inlineData']);
8233
+ if (fromInlineData != null) {
8234
+ setValueByPath(toObject, ['inlineData'], blobFromMldev$1(fromInlineData));
8235
+ }
8236
+ const fromFileData = getValueByPath(fromObject, ['fileData']);
8237
+ if (fromFileData != null) {
8238
+ setValueByPath(toObject, ['fileData'], fileDataFromMldev$1(fromFileData));
8239
+ }
8240
+ const fromThoughtSignature = getValueByPath(fromObject, [
8241
+ 'thoughtSignature',
8242
+ ]);
8243
+ if (fromThoughtSignature != null) {
8244
+ setValueByPath(toObject, ['thoughtSignature'], fromThoughtSignature);
8245
+ }
8246
+ const fromCodeExecutionResult = getValueByPath(fromObject, [
8247
+ 'codeExecutionResult',
8248
+ ]);
8249
+ if (fromCodeExecutionResult != null) {
8250
+ setValueByPath(toObject, ['codeExecutionResult'], fromCodeExecutionResult);
8251
+ }
8252
+ const fromExecutableCode = getValueByPath(fromObject, [
8253
+ 'executableCode',
8254
+ ]);
8255
+ if (fromExecutableCode != null) {
8256
+ setValueByPath(toObject, ['executableCode'], fromExecutableCode);
8257
+ }
8258
+ const fromFunctionCall = getValueByPath(fromObject, ['functionCall']);
8259
+ if (fromFunctionCall != null) {
8260
+ setValueByPath(toObject, ['functionCall'], fromFunctionCall);
8261
+ }
8262
+ const fromFunctionResponse = getValueByPath(fromObject, [
8263
+ 'functionResponse',
8264
+ ]);
8265
+ if (fromFunctionResponse != null) {
8266
+ setValueByPath(toObject, ['functionResponse'], fromFunctionResponse);
8267
+ }
8268
+ const fromText = getValueByPath(fromObject, ['text']);
8269
+ if (fromText != null) {
8270
+ setValueByPath(toObject, ['text'], fromText);
8271
+ }
8272
+ return toObject;
8273
+ }
8274
+ function contentFromMldev$1(fromObject) {
8275
+ const toObject = {};
8276
+ const fromParts = getValueByPath(fromObject, ['parts']);
8277
+ if (fromParts != null) {
8278
+ let transformedList = fromParts;
8279
+ if (Array.isArray(transformedList)) {
8280
+ transformedList = transformedList.map((item) => {
8281
+ return partFromMldev$1(item);
8282
+ });
8283
+ }
8284
+ setValueByPath(toObject, ['parts'], transformedList);
8285
+ }
8286
+ const fromRole = getValueByPath(fromObject, ['role']);
8287
+ if (fromRole != null) {
8288
+ setValueByPath(toObject, ['role'], fromRole);
8289
+ }
8290
+ return toObject;
8291
+ }
8292
+ function transcriptionFromMldev(fromObject) {
8293
+ const toObject = {};
8294
+ const fromText = getValueByPath(fromObject, ['text']);
8295
+ if (fromText != null) {
8296
+ setValueByPath(toObject, ['text'], fromText);
8297
+ }
8298
+ const fromFinished = getValueByPath(fromObject, ['finished']);
8299
+ if (fromFinished != null) {
8300
+ setValueByPath(toObject, ['finished'], fromFinished);
8301
+ }
8302
+ return toObject;
8303
+ }
8304
+ function urlMetadataFromMldev$1(fromObject) {
8305
+ const toObject = {};
8306
+ const fromRetrievedUrl = getValueByPath(fromObject, ['retrievedUrl']);
8307
+ if (fromRetrievedUrl != null) {
8308
+ setValueByPath(toObject, ['retrievedUrl'], fromRetrievedUrl);
8309
+ }
8310
+ const fromUrlRetrievalStatus = getValueByPath(fromObject, [
8311
+ 'urlRetrievalStatus',
8312
+ ]);
8313
+ if (fromUrlRetrievalStatus != null) {
8314
+ setValueByPath(toObject, ['urlRetrievalStatus'], fromUrlRetrievalStatus);
8315
+ }
8316
+ return toObject;
8317
+ }
8318
+ function urlContextMetadataFromMldev$1(fromObject) {
8319
+ const toObject = {};
8320
+ const fromUrlMetadata = getValueByPath(fromObject, ['urlMetadata']);
8321
+ if (fromUrlMetadata != null) {
8322
+ let transformedList = fromUrlMetadata;
8323
+ if (Array.isArray(transformedList)) {
8324
+ transformedList = transformedList.map((item) => {
8325
+ return urlMetadataFromMldev$1(item);
8326
+ });
8327
+ }
8328
+ setValueByPath(toObject, ['urlMetadata'], transformedList);
8329
+ }
8330
+ return toObject;
8331
+ }
8332
+ function liveServerContentFromMldev(fromObject) {
8333
+ const toObject = {};
8334
+ const fromModelTurn = getValueByPath(fromObject, ['modelTurn']);
8335
+ if (fromModelTurn != null) {
8336
+ setValueByPath(toObject, ['modelTurn'], contentFromMldev$1(fromModelTurn));
8337
+ }
8338
+ const fromTurnComplete = getValueByPath(fromObject, ['turnComplete']);
8339
+ if (fromTurnComplete != null) {
8340
+ setValueByPath(toObject, ['turnComplete'], fromTurnComplete);
8341
+ }
8342
+ const fromInterrupted = getValueByPath(fromObject, ['interrupted']);
8343
+ if (fromInterrupted != null) {
8344
+ setValueByPath(toObject, ['interrupted'], fromInterrupted);
8345
+ }
8346
+ const fromGroundingMetadata = getValueByPath(fromObject, [
8347
+ 'groundingMetadata',
8348
+ ]);
8349
+ if (fromGroundingMetadata != null) {
8350
+ setValueByPath(toObject, ['groundingMetadata'], fromGroundingMetadata);
8351
+ }
8352
+ const fromGenerationComplete = getValueByPath(fromObject, [
8353
+ 'generationComplete',
8354
+ ]);
8355
+ if (fromGenerationComplete != null) {
8356
+ setValueByPath(toObject, ['generationComplete'], fromGenerationComplete);
8357
+ }
8358
+ const fromInputTranscription = getValueByPath(fromObject, [
8359
+ 'inputTranscription',
8360
+ ]);
8361
+ if (fromInputTranscription != null) {
8362
+ setValueByPath(toObject, ['inputTranscription'], transcriptionFromMldev(fromInputTranscription));
8363
+ }
8364
+ const fromOutputTranscription = getValueByPath(fromObject, [
8365
+ 'outputTranscription',
8366
+ ]);
8367
+ if (fromOutputTranscription != null) {
8368
+ setValueByPath(toObject, ['outputTranscription'], transcriptionFromMldev(fromOutputTranscription));
8369
+ }
8370
+ const fromUrlContextMetadata = getValueByPath(fromObject, [
8371
+ 'urlContextMetadata',
8372
+ ]);
8373
+ if (fromUrlContextMetadata != null) {
8374
+ setValueByPath(toObject, ['urlContextMetadata'], urlContextMetadataFromMldev$1(fromUrlContextMetadata));
8375
+ }
8376
+ return toObject;
8377
+ }
8378
+ function functionCallFromMldev(fromObject) {
8379
+ const toObject = {};
8380
+ const fromId = getValueByPath(fromObject, ['id']);
8381
+ if (fromId != null) {
8382
+ setValueByPath(toObject, ['id'], fromId);
8383
+ }
8384
+ const fromArgs = getValueByPath(fromObject, ['args']);
8385
+ if (fromArgs != null) {
8386
+ setValueByPath(toObject, ['args'], fromArgs);
8387
+ }
8388
+ const fromName = getValueByPath(fromObject, ['name']);
8389
+ if (fromName != null) {
8390
+ setValueByPath(toObject, ['name'], fromName);
8391
+ }
8392
+ return toObject;
8393
+ }
8394
+ function liveServerToolCallFromMldev(fromObject) {
8395
+ const toObject = {};
8396
+ const fromFunctionCalls = getValueByPath(fromObject, [
8397
+ 'functionCalls',
8398
+ ]);
8399
+ if (fromFunctionCalls != null) {
8400
+ let transformedList = fromFunctionCalls;
8401
+ if (Array.isArray(transformedList)) {
8402
+ transformedList = transformedList.map((item) => {
8403
+ return functionCallFromMldev(item);
8404
+ });
8405
+ }
8406
+ setValueByPath(toObject, ['functionCalls'], transformedList);
8407
+ }
8408
+ return toObject;
8409
+ }
8410
+ function liveServerToolCallCancellationFromMldev(fromObject) {
8411
+ const toObject = {};
8412
+ const fromIds = getValueByPath(fromObject, ['ids']);
8413
+ if (fromIds != null) {
8414
+ setValueByPath(toObject, ['ids'], fromIds);
8415
+ }
8416
+ return toObject;
8417
+ }
8418
+ function modalityTokenCountFromMldev(fromObject) {
8419
+ const toObject = {};
8420
+ const fromModality = getValueByPath(fromObject, ['modality']);
8421
+ if (fromModality != null) {
8422
+ setValueByPath(toObject, ['modality'], fromModality);
8423
+ }
8424
+ const fromTokenCount = getValueByPath(fromObject, ['tokenCount']);
8425
+ if (fromTokenCount != null) {
8426
+ setValueByPath(toObject, ['tokenCount'], fromTokenCount);
8427
+ }
8428
+ return toObject;
8429
+ }
8430
+ function usageMetadataFromMldev(fromObject) {
8431
+ const toObject = {};
8432
+ const fromPromptTokenCount = getValueByPath(fromObject, [
8433
+ 'promptTokenCount',
8434
+ ]);
8435
+ if (fromPromptTokenCount != null) {
8436
+ setValueByPath(toObject, ['promptTokenCount'], fromPromptTokenCount);
8437
+ }
8438
+ const fromCachedContentTokenCount = getValueByPath(fromObject, [
8439
+ 'cachedContentTokenCount',
8440
+ ]);
8441
+ if (fromCachedContentTokenCount != null) {
8442
+ setValueByPath(toObject, ['cachedContentTokenCount'], fromCachedContentTokenCount);
8443
+ }
8444
+ const fromResponseTokenCount = getValueByPath(fromObject, [
8445
+ 'responseTokenCount',
8446
+ ]);
8447
+ if (fromResponseTokenCount != null) {
8448
+ setValueByPath(toObject, ['responseTokenCount'], fromResponseTokenCount);
8449
+ }
8450
+ const fromToolUsePromptTokenCount = getValueByPath(fromObject, [
8451
+ 'toolUsePromptTokenCount',
8452
+ ]);
8453
+ if (fromToolUsePromptTokenCount != null) {
8454
+ setValueByPath(toObject, ['toolUsePromptTokenCount'], fromToolUsePromptTokenCount);
8455
+ }
8456
+ const fromThoughtsTokenCount = getValueByPath(fromObject, [
8457
+ 'thoughtsTokenCount',
8458
+ ]);
8459
+ if (fromThoughtsTokenCount != null) {
8460
+ setValueByPath(toObject, ['thoughtsTokenCount'], fromThoughtsTokenCount);
8461
+ }
8462
+ const fromTotalTokenCount = getValueByPath(fromObject, [
8463
+ 'totalTokenCount',
8464
+ ]);
8465
+ if (fromTotalTokenCount != null) {
8466
+ setValueByPath(toObject, ['totalTokenCount'], fromTotalTokenCount);
8467
+ }
8468
+ const fromPromptTokensDetails = getValueByPath(fromObject, [
8469
+ 'promptTokensDetails',
8470
+ ]);
8471
+ if (fromPromptTokensDetails != null) {
8472
+ let transformedList = fromPromptTokensDetails;
8473
+ if (Array.isArray(transformedList)) {
8474
+ transformedList = transformedList.map((item) => {
8475
+ return modalityTokenCountFromMldev(item);
8476
+ });
8477
+ }
8478
+ setValueByPath(toObject, ['promptTokensDetails'], transformedList);
8479
+ }
8480
+ const fromCacheTokensDetails = getValueByPath(fromObject, [
8481
+ 'cacheTokensDetails',
8482
+ ]);
8483
+ if (fromCacheTokensDetails != null) {
8484
+ let transformedList = fromCacheTokensDetails;
8485
+ if (Array.isArray(transformedList)) {
8486
+ transformedList = transformedList.map((item) => {
8487
+ return modalityTokenCountFromMldev(item);
8488
+ });
8489
+ }
8490
+ setValueByPath(toObject, ['cacheTokensDetails'], transformedList);
8491
+ }
8492
+ const fromResponseTokensDetails = getValueByPath(fromObject, [
8493
+ 'responseTokensDetails',
8494
+ ]);
8495
+ if (fromResponseTokensDetails != null) {
8496
+ let transformedList = fromResponseTokensDetails;
8497
+ if (Array.isArray(transformedList)) {
8498
+ transformedList = transformedList.map((item) => {
8499
+ return modalityTokenCountFromMldev(item);
8500
+ });
8501
+ }
8502
+ setValueByPath(toObject, ['responseTokensDetails'], transformedList);
8503
+ }
8504
+ const fromToolUsePromptTokensDetails = getValueByPath(fromObject, [
8505
+ 'toolUsePromptTokensDetails',
8506
+ ]);
8507
+ if (fromToolUsePromptTokensDetails != null) {
8508
+ let transformedList = fromToolUsePromptTokensDetails;
8509
+ if (Array.isArray(transformedList)) {
8510
+ transformedList = transformedList.map((item) => {
8511
+ return modalityTokenCountFromMldev(item);
8512
+ });
8513
+ }
8514
+ setValueByPath(toObject, ['toolUsePromptTokensDetails'], transformedList);
8515
+ }
8516
+ return toObject;
8517
+ }
8518
+ function liveServerGoAwayFromMldev(fromObject) {
8519
+ const toObject = {};
8520
+ const fromTimeLeft = getValueByPath(fromObject, ['timeLeft']);
8521
+ if (fromTimeLeft != null) {
8522
+ setValueByPath(toObject, ['timeLeft'], fromTimeLeft);
8523
+ }
8524
+ return toObject;
8525
+ }
8526
+ function liveServerSessionResumptionUpdateFromMldev(fromObject) {
8527
+ const toObject = {};
8528
+ const fromNewHandle = getValueByPath(fromObject, ['newHandle']);
8529
+ if (fromNewHandle != null) {
8530
+ setValueByPath(toObject, ['newHandle'], fromNewHandle);
8531
+ }
8532
+ const fromResumable = getValueByPath(fromObject, ['resumable']);
8533
+ if (fromResumable != null) {
8534
+ setValueByPath(toObject, ['resumable'], fromResumable);
8535
+ }
8536
+ const fromLastConsumedClientMessageIndex = getValueByPath(fromObject, [
8537
+ 'lastConsumedClientMessageIndex',
8538
+ ]);
8539
+ if (fromLastConsumedClientMessageIndex != null) {
8540
+ setValueByPath(toObject, ['lastConsumedClientMessageIndex'], fromLastConsumedClientMessageIndex);
8541
+ }
8542
+ return toObject;
8543
+ }
8544
+ function liveServerMessageFromMldev(fromObject) {
8545
+ const toObject = {};
8546
+ const fromSetupComplete = getValueByPath(fromObject, [
8547
+ 'setupComplete',
8548
+ ]);
8549
+ if (fromSetupComplete != null) {
8550
+ setValueByPath(toObject, ['setupComplete'], liveServerSetupCompleteFromMldev());
8551
+ }
8552
+ const fromServerContent = getValueByPath(fromObject, [
8553
+ 'serverContent',
8554
+ ]);
8555
+ if (fromServerContent != null) {
8556
+ setValueByPath(toObject, ['serverContent'], liveServerContentFromMldev(fromServerContent));
8557
+ }
8558
+ const fromToolCall = getValueByPath(fromObject, ['toolCall']);
8559
+ if (fromToolCall != null) {
8560
+ setValueByPath(toObject, ['toolCall'], liveServerToolCallFromMldev(fromToolCall));
8561
+ }
8562
+ const fromToolCallCancellation = getValueByPath(fromObject, [
8563
+ 'toolCallCancellation',
8564
+ ]);
8565
+ if (fromToolCallCancellation != null) {
8566
+ setValueByPath(toObject, ['toolCallCancellation'], liveServerToolCallCancellationFromMldev(fromToolCallCancellation));
8567
+ }
8568
+ const fromUsageMetadata = getValueByPath(fromObject, [
8569
+ 'usageMetadata',
8570
+ ]);
8571
+ if (fromUsageMetadata != null) {
8572
+ setValueByPath(toObject, ['usageMetadata'], usageMetadataFromMldev(fromUsageMetadata));
8573
+ }
8574
+ const fromGoAway = getValueByPath(fromObject, ['goAway']);
8575
+ if (fromGoAway != null) {
8576
+ setValueByPath(toObject, ['goAway'], liveServerGoAwayFromMldev(fromGoAway));
8577
+ }
8578
+ const fromSessionResumptionUpdate = getValueByPath(fromObject, [
8579
+ 'sessionResumptionUpdate',
8580
+ ]);
8581
+ if (fromSessionResumptionUpdate != null) {
8582
+ setValueByPath(toObject, ['sessionResumptionUpdate'], liveServerSessionResumptionUpdateFromMldev(fromSessionResumptionUpdate));
8583
+ }
8584
+ return toObject;
8585
+ }
8586
+ function liveMusicServerSetupCompleteFromMldev() {
8587
+ const toObject = {};
8588
+ return toObject;
8589
+ }
8590
+ function weightedPromptFromMldev(fromObject) {
8591
+ const toObject = {};
8592
+ const fromText = getValueByPath(fromObject, ['text']);
8593
+ if (fromText != null) {
8594
+ setValueByPath(toObject, ['text'], fromText);
8595
+ }
8596
+ const fromWeight = getValueByPath(fromObject, ['weight']);
8597
+ if (fromWeight != null) {
8598
+ setValueByPath(toObject, ['weight'], fromWeight);
8599
+ }
8600
+ return toObject;
8601
+ }
8602
+ function liveMusicClientContentFromMldev(fromObject) {
8603
+ const toObject = {};
8604
+ const fromWeightedPrompts = getValueByPath(fromObject, [
8605
+ 'weightedPrompts',
8606
+ ]);
8607
+ if (fromWeightedPrompts != null) {
8608
+ let transformedList = fromWeightedPrompts;
8609
+ if (Array.isArray(transformedList)) {
8610
+ transformedList = transformedList.map((item) => {
8611
+ return weightedPromptFromMldev(item);
8612
+ });
8613
+ }
8614
+ setValueByPath(toObject, ['weightedPrompts'], transformedList);
8615
+ }
8616
+ return toObject;
8617
+ }
8618
+ function liveMusicGenerationConfigFromMldev(fromObject) {
8619
+ const toObject = {};
8620
+ const fromTemperature = getValueByPath(fromObject, ['temperature']);
8621
+ if (fromTemperature != null) {
8622
+ setValueByPath(toObject, ['temperature'], fromTemperature);
8623
+ }
8624
+ const fromTopK = getValueByPath(fromObject, ['topK']);
8625
+ if (fromTopK != null) {
8626
+ setValueByPath(toObject, ['topK'], fromTopK);
8627
+ }
8628
+ const fromSeed = getValueByPath(fromObject, ['seed']);
8629
+ if (fromSeed != null) {
8630
+ setValueByPath(toObject, ['seed'], fromSeed);
8631
+ }
8632
+ const fromGuidance = getValueByPath(fromObject, ['guidance']);
8633
+ if (fromGuidance != null) {
8634
+ setValueByPath(toObject, ['guidance'], fromGuidance);
8635
+ }
8636
+ const fromBpm = getValueByPath(fromObject, ['bpm']);
8637
+ if (fromBpm != null) {
8638
+ setValueByPath(toObject, ['bpm'], fromBpm);
8639
+ }
8640
+ const fromDensity = getValueByPath(fromObject, ['density']);
8641
+ if (fromDensity != null) {
8642
+ setValueByPath(toObject, ['density'], fromDensity);
8643
+ }
8644
+ const fromBrightness = getValueByPath(fromObject, ['brightness']);
8645
+ if (fromBrightness != null) {
8646
+ setValueByPath(toObject, ['brightness'], fromBrightness);
8647
+ }
8648
+ const fromScale = getValueByPath(fromObject, ['scale']);
8649
+ if (fromScale != null) {
8650
+ setValueByPath(toObject, ['scale'], fromScale);
8651
+ }
8652
+ const fromMuteBass = getValueByPath(fromObject, ['muteBass']);
8653
+ if (fromMuteBass != null) {
8654
+ setValueByPath(toObject, ['muteBass'], fromMuteBass);
8655
+ }
8656
+ const fromMuteDrums = getValueByPath(fromObject, ['muteDrums']);
8657
+ if (fromMuteDrums != null) {
8658
+ setValueByPath(toObject, ['muteDrums'], fromMuteDrums);
8659
+ }
8660
+ const fromOnlyBassAndDrums = getValueByPath(fromObject, [
8661
+ 'onlyBassAndDrums',
8662
+ ]);
8663
+ if (fromOnlyBassAndDrums != null) {
8664
+ setValueByPath(toObject, ['onlyBassAndDrums'], fromOnlyBassAndDrums);
8665
+ }
8666
+ return toObject;
8667
+ }
8668
+ function liveMusicSourceMetadataFromMldev(fromObject) {
8669
+ const toObject = {};
8670
+ const fromClientContent = getValueByPath(fromObject, [
8671
+ 'clientContent',
8672
+ ]);
8673
+ if (fromClientContent != null) {
8674
+ setValueByPath(toObject, ['clientContent'], liveMusicClientContentFromMldev(fromClientContent));
8675
+ }
8676
+ const fromMusicGenerationConfig = getValueByPath(fromObject, [
8677
+ 'musicGenerationConfig',
8678
+ ]);
8679
+ if (fromMusicGenerationConfig != null) {
8680
+ setValueByPath(toObject, ['musicGenerationConfig'], liveMusicGenerationConfigFromMldev(fromMusicGenerationConfig));
8681
+ }
8682
+ return toObject;
8683
+ }
8684
+ function audioChunkFromMldev(fromObject) {
8685
+ const toObject = {};
8686
+ const fromData = getValueByPath(fromObject, ['data']);
8687
+ if (fromData != null) {
8688
+ setValueByPath(toObject, ['data'], fromData);
8689
+ }
8690
+ const fromMimeType = getValueByPath(fromObject, ['mimeType']);
8691
+ if (fromMimeType != null) {
8692
+ setValueByPath(toObject, ['mimeType'], fromMimeType);
8693
+ }
8694
+ const fromSourceMetadata = getValueByPath(fromObject, [
8695
+ 'sourceMetadata',
8696
+ ]);
8697
+ if (fromSourceMetadata != null) {
8698
+ setValueByPath(toObject, ['sourceMetadata'], liveMusicSourceMetadataFromMldev(fromSourceMetadata));
8699
+ }
8700
+ return toObject;
8701
+ }
8702
+ function liveMusicServerContentFromMldev(fromObject) {
8703
+ const toObject = {};
8704
+ const fromAudioChunks = getValueByPath(fromObject, ['audioChunks']);
8705
+ if (fromAudioChunks != null) {
8706
+ let transformedList = fromAudioChunks;
8707
+ if (Array.isArray(transformedList)) {
8708
+ transformedList = transformedList.map((item) => {
8709
+ return audioChunkFromMldev(item);
8710
+ });
8711
+ }
8712
+ setValueByPath(toObject, ['audioChunks'], transformedList);
8713
+ }
8714
+ return toObject;
8715
+ }
8716
+ function liveMusicFilteredPromptFromMldev(fromObject) {
8717
+ const toObject = {};
8718
+ const fromText = getValueByPath(fromObject, ['text']);
8719
+ if (fromText != null) {
8720
+ setValueByPath(toObject, ['text'], fromText);
8721
+ }
8722
+ const fromFilteredReason = getValueByPath(fromObject, [
8723
+ 'filteredReason',
8724
+ ]);
8725
+ if (fromFilteredReason != null) {
8726
+ setValueByPath(toObject, ['filteredReason'], fromFilteredReason);
8727
+ }
8728
+ return toObject;
8729
+ }
8730
+ function liveMusicServerMessageFromMldev(fromObject) {
8731
+ const toObject = {};
8732
+ const fromSetupComplete = getValueByPath(fromObject, [
8733
+ 'setupComplete',
8734
+ ]);
8735
+ if (fromSetupComplete != null) {
8736
+ setValueByPath(toObject, ['setupComplete'], liveMusicServerSetupCompleteFromMldev());
8737
+ }
8738
+ const fromServerContent = getValueByPath(fromObject, [
8739
+ 'serverContent',
8740
+ ]);
8741
+ if (fromServerContent != null) {
8742
+ setValueByPath(toObject, ['serverContent'], liveMusicServerContentFromMldev(fromServerContent));
8743
+ }
8744
+ const fromFilteredPrompt = getValueByPath(fromObject, [
8745
+ 'filteredPrompt',
8746
+ ]);
8747
+ if (fromFilteredPrompt != null) {
8748
+ setValueByPath(toObject, ['filteredPrompt'], liveMusicFilteredPromptFromMldev(fromFilteredPrompt));
8749
+ }
8750
+ return toObject;
8751
+ }
8752
+ function liveServerSetupCompleteFromVertex(fromObject) {
8753
+ const toObject = {};
8754
+ const fromSessionId = getValueByPath(fromObject, ['sessionId']);
8755
+ if (fromSessionId != null) {
8756
+ setValueByPath(toObject, ['sessionId'], fromSessionId);
8757
+ }
8758
+ return toObject;
8759
+ }
8760
+ function videoMetadataFromVertex$1(fromObject) {
8761
+ const toObject = {};
8762
+ const fromFps = getValueByPath(fromObject, ['fps']);
8763
+ if (fromFps != null) {
8764
+ setValueByPath(toObject, ['fps'], fromFps);
8765
+ }
8766
+ const fromEndOffset = getValueByPath(fromObject, ['endOffset']);
8767
+ if (fromEndOffset != null) {
8768
+ setValueByPath(toObject, ['endOffset'], fromEndOffset);
8769
+ }
8770
+ const fromStartOffset = getValueByPath(fromObject, ['startOffset']);
8771
+ if (fromStartOffset != null) {
8772
+ setValueByPath(toObject, ['startOffset'], fromStartOffset);
8773
+ }
8774
+ return toObject;
8775
+ }
8776
+ function blobFromVertex$1(fromObject) {
8777
+ const toObject = {};
8778
+ const fromDisplayName = getValueByPath(fromObject, ['displayName']);
8779
+ if (fromDisplayName != null) {
8780
+ setValueByPath(toObject, ['displayName'], fromDisplayName);
8781
+ }
8782
+ const fromData = getValueByPath(fromObject, ['data']);
8783
+ if (fromData != null) {
8784
+ setValueByPath(toObject, ['data'], fromData);
8785
+ }
8786
+ const fromMimeType = getValueByPath(fromObject, ['mimeType']);
8787
+ if (fromMimeType != null) {
8788
+ setValueByPath(toObject, ['mimeType'], fromMimeType);
8789
+ }
8790
+ return toObject;
8791
+ }
8792
+ function fileDataFromVertex$1(fromObject) {
8793
+ const toObject = {};
8794
+ const fromDisplayName = getValueByPath(fromObject, ['displayName']);
8795
+ if (fromDisplayName != null) {
8796
+ setValueByPath(toObject, ['displayName'], fromDisplayName);
8797
+ }
8798
+ const fromFileUri = getValueByPath(fromObject, ['fileUri']);
8799
+ if (fromFileUri != null) {
8800
+ setValueByPath(toObject, ['fileUri'], fromFileUri);
8801
+ }
8802
+ const fromMimeType = getValueByPath(fromObject, ['mimeType']);
8803
+ if (fromMimeType != null) {
8804
+ setValueByPath(toObject, ['mimeType'], fromMimeType);
8805
+ }
8806
+ return toObject;
8807
+ }
8808
+ function partFromVertex$1(fromObject) {
8809
+ const toObject = {};
8810
+ const fromVideoMetadata = getValueByPath(fromObject, [
8811
+ 'videoMetadata',
8812
+ ]);
8813
+ if (fromVideoMetadata != null) {
8814
+ setValueByPath(toObject, ['videoMetadata'], videoMetadataFromVertex$1(fromVideoMetadata));
8815
+ }
8816
+ const fromThought = getValueByPath(fromObject, ['thought']);
8817
+ if (fromThought != null) {
8818
+ setValueByPath(toObject, ['thought'], fromThought);
8819
+ }
8820
+ const fromInlineData = getValueByPath(fromObject, ['inlineData']);
8821
+ if (fromInlineData != null) {
8445
8822
  setValueByPath(toObject, ['inlineData'], blobFromVertex$1(fromInlineData));
8446
8823
  }
8447
8824
  const fromFileData = getValueByPath(fromObject, ['fileData']);
@@ -8482,24 +8859,6 @@ function partFromVertex$1(fromObject) {
8482
8859
  }
8483
8860
  return toObject;
8484
8861
  }
8485
- function contentFromMldev$1(fromObject) {
8486
- const toObject = {};
8487
- const fromParts = getValueByPath(fromObject, ['parts']);
8488
- if (fromParts != null) {
8489
- let transformedList = fromParts;
8490
- if (Array.isArray(transformedList)) {
8491
- transformedList = transformedList.map((item) => {
8492
- return partFromMldev$1(item);
8493
- });
8494
- }
8495
- setValueByPath(toObject, ['parts'], transformedList);
8496
- }
8497
- const fromRole = getValueByPath(fromObject, ['role']);
8498
- if (fromRole != null) {
8499
- setValueByPath(toObject, ['role'], fromRole);
8500
- }
8501
- return toObject;
8502
- }
8503
8862
  function contentFromVertex$1(fromObject) {
8504
8863
  const toObject = {};
8505
8864
  const fromParts = getValueByPath(fromObject, ['parts']);
@@ -8518,18 +8877,6 @@ function contentFromVertex$1(fromObject) {
8518
8877
  }
8519
8878
  return toObject;
8520
8879
  }
8521
- function transcriptionFromMldev(fromObject) {
8522
- const toObject = {};
8523
- const fromText = getValueByPath(fromObject, ['text']);
8524
- if (fromText != null) {
8525
- setValueByPath(toObject, ['text'], fromText);
8526
- }
8527
- const fromFinished = getValueByPath(fromObject, ['finished']);
8528
- if (fromFinished != null) {
8529
- setValueByPath(toObject, ['finished'], fromFinished);
8530
- }
8531
- return toObject;
8532
- }
8533
8880
  function transcriptionFromVertex(fromObject) {
8534
8881
  const toObject = {};
8535
8882
  const fromText = getValueByPath(fromObject, ['text']);
@@ -8542,80 +8889,6 @@ function transcriptionFromVertex(fromObject) {
8542
8889
  }
8543
8890
  return toObject;
8544
8891
  }
8545
- function urlMetadataFromMldev$1(fromObject) {
8546
- const toObject = {};
8547
- const fromRetrievedUrl = getValueByPath(fromObject, ['retrievedUrl']);
8548
- if (fromRetrievedUrl != null) {
8549
- setValueByPath(toObject, ['retrievedUrl'], fromRetrievedUrl);
8550
- }
8551
- const fromUrlRetrievalStatus = getValueByPath(fromObject, [
8552
- 'urlRetrievalStatus',
8553
- ]);
8554
- if (fromUrlRetrievalStatus != null) {
8555
- setValueByPath(toObject, ['urlRetrievalStatus'], fromUrlRetrievalStatus);
8556
- }
8557
- return toObject;
8558
- }
8559
- function urlContextMetadataFromMldev$1(fromObject) {
8560
- const toObject = {};
8561
- const fromUrlMetadata = getValueByPath(fromObject, ['urlMetadata']);
8562
- if (fromUrlMetadata != null) {
8563
- let transformedList = fromUrlMetadata;
8564
- if (Array.isArray(transformedList)) {
8565
- transformedList = transformedList.map((item) => {
8566
- return urlMetadataFromMldev$1(item);
8567
- });
8568
- }
8569
- setValueByPath(toObject, ['urlMetadata'], transformedList);
8570
- }
8571
- return toObject;
8572
- }
8573
- function liveServerContentFromMldev(fromObject) {
8574
- const toObject = {};
8575
- const fromModelTurn = getValueByPath(fromObject, ['modelTurn']);
8576
- if (fromModelTurn != null) {
8577
- setValueByPath(toObject, ['modelTurn'], contentFromMldev$1(fromModelTurn));
8578
- }
8579
- const fromTurnComplete = getValueByPath(fromObject, ['turnComplete']);
8580
- if (fromTurnComplete != null) {
8581
- setValueByPath(toObject, ['turnComplete'], fromTurnComplete);
8582
- }
8583
- const fromInterrupted = getValueByPath(fromObject, ['interrupted']);
8584
- if (fromInterrupted != null) {
8585
- setValueByPath(toObject, ['interrupted'], fromInterrupted);
8586
- }
8587
- const fromGroundingMetadata = getValueByPath(fromObject, [
8588
- 'groundingMetadata',
8589
- ]);
8590
- if (fromGroundingMetadata != null) {
8591
- setValueByPath(toObject, ['groundingMetadata'], fromGroundingMetadata);
8592
- }
8593
- const fromGenerationComplete = getValueByPath(fromObject, [
8594
- 'generationComplete',
8595
- ]);
8596
- if (fromGenerationComplete != null) {
8597
- setValueByPath(toObject, ['generationComplete'], fromGenerationComplete);
8598
- }
8599
- const fromInputTranscription = getValueByPath(fromObject, [
8600
- 'inputTranscription',
8601
- ]);
8602
- if (fromInputTranscription != null) {
8603
- setValueByPath(toObject, ['inputTranscription'], transcriptionFromMldev(fromInputTranscription));
8604
- }
8605
- const fromOutputTranscription = getValueByPath(fromObject, [
8606
- 'outputTranscription',
8607
- ]);
8608
- if (fromOutputTranscription != null) {
8609
- setValueByPath(toObject, ['outputTranscription'], transcriptionFromMldev(fromOutputTranscription));
8610
- }
8611
- const fromUrlContextMetadata = getValueByPath(fromObject, [
8612
- 'urlContextMetadata',
8613
- ]);
8614
- if (fromUrlContextMetadata != null) {
8615
- setValueByPath(toObject, ['urlContextMetadata'], urlContextMetadataFromMldev$1(fromUrlContextMetadata));
8616
- }
8617
- return toObject;
8618
- }
8619
8892
  function liveServerContentFromVertex(fromObject) {
8620
8893
  const toObject = {};
8621
8894
  const fromModelTurn = getValueByPath(fromObject, ['modelTurn']);
@@ -8656,22 +8929,6 @@ function liveServerContentFromVertex(fromObject) {
8656
8929
  }
8657
8930
  return toObject;
8658
8931
  }
8659
- function functionCallFromMldev(fromObject) {
8660
- const toObject = {};
8661
- const fromId = getValueByPath(fromObject, ['id']);
8662
- if (fromId != null) {
8663
- setValueByPath(toObject, ['id'], fromId);
8664
- }
8665
- const fromArgs = getValueByPath(fromObject, ['args']);
8666
- if (fromArgs != null) {
8667
- setValueByPath(toObject, ['args'], fromArgs);
8668
- }
8669
- const fromName = getValueByPath(fromObject, ['name']);
8670
- if (fromName != null) {
8671
- setValueByPath(toObject, ['name'], fromName);
8672
- }
8673
- return toObject;
8674
- }
8675
8932
  function functionCallFromVertex(fromObject) {
8676
8933
  const toObject = {};
8677
8934
  const fromArgs = getValueByPath(fromObject, ['args']);
@@ -8684,22 +8941,6 @@ function functionCallFromVertex(fromObject) {
8684
8941
  }
8685
8942
  return toObject;
8686
8943
  }
8687
- function liveServerToolCallFromMldev(fromObject) {
8688
- const toObject = {};
8689
- const fromFunctionCalls = getValueByPath(fromObject, [
8690
- 'functionCalls',
8691
- ]);
8692
- if (fromFunctionCalls != null) {
8693
- let transformedList = fromFunctionCalls;
8694
- if (Array.isArray(transformedList)) {
8695
- transformedList = transformedList.map((item) => {
8696
- return functionCallFromMldev(item);
8697
- });
8698
- }
8699
- setValueByPath(toObject, ['functionCalls'], transformedList);
8700
- }
8701
- return toObject;
8702
- }
8703
8944
  function liveServerToolCallFromVertex(fromObject) {
8704
8945
  const toObject = {};
8705
8946
  const fromFunctionCalls = getValueByPath(fromObject, [
@@ -8716,14 +8957,6 @@ function liveServerToolCallFromVertex(fromObject) {
8716
8957
  }
8717
8958
  return toObject;
8718
8959
  }
8719
- function liveServerToolCallCancellationFromMldev(fromObject) {
8720
- const toObject = {};
8721
- const fromIds = getValueByPath(fromObject, ['ids']);
8722
- if (fromIds != null) {
8723
- setValueByPath(toObject, ['ids'], fromIds);
8724
- }
8725
- return toObject;
8726
- }
8727
8960
  function liveServerToolCallCancellationFromVertex(fromObject) {
8728
8961
  const toObject = {};
8729
8962
  const fromIds = getValueByPath(fromObject, ['ids']);
@@ -8732,18 +8965,6 @@ function liveServerToolCallCancellationFromVertex(fromObject) {
8732
8965
  }
8733
8966
  return toObject;
8734
8967
  }
8735
- function modalityTokenCountFromMldev(fromObject) {
8736
- const toObject = {};
8737
- const fromModality = getValueByPath(fromObject, ['modality']);
8738
- if (fromModality != null) {
8739
- setValueByPath(toObject, ['modality'], fromModality);
8740
- }
8741
- const fromTokenCount = getValueByPath(fromObject, ['tokenCount']);
8742
- if (fromTokenCount != null) {
8743
- setValueByPath(toObject, ['tokenCount'], fromTokenCount);
8744
- }
8745
- return toObject;
8746
- }
8747
8968
  function modalityTokenCountFromVertex(fromObject) {
8748
8969
  const toObject = {};
8749
8970
  const fromModality = getValueByPath(fromObject, ['modality']);
@@ -8756,94 +8977,6 @@ function modalityTokenCountFromVertex(fromObject) {
8756
8977
  }
8757
8978
  return toObject;
8758
8979
  }
8759
- function usageMetadataFromMldev(fromObject) {
8760
- const toObject = {};
8761
- const fromPromptTokenCount = getValueByPath(fromObject, [
8762
- 'promptTokenCount',
8763
- ]);
8764
- if (fromPromptTokenCount != null) {
8765
- setValueByPath(toObject, ['promptTokenCount'], fromPromptTokenCount);
8766
- }
8767
- const fromCachedContentTokenCount = getValueByPath(fromObject, [
8768
- 'cachedContentTokenCount',
8769
- ]);
8770
- if (fromCachedContentTokenCount != null) {
8771
- setValueByPath(toObject, ['cachedContentTokenCount'], fromCachedContentTokenCount);
8772
- }
8773
- const fromResponseTokenCount = getValueByPath(fromObject, [
8774
- 'responseTokenCount',
8775
- ]);
8776
- if (fromResponseTokenCount != null) {
8777
- setValueByPath(toObject, ['responseTokenCount'], fromResponseTokenCount);
8778
- }
8779
- const fromToolUsePromptTokenCount = getValueByPath(fromObject, [
8780
- 'toolUsePromptTokenCount',
8781
- ]);
8782
- if (fromToolUsePromptTokenCount != null) {
8783
- setValueByPath(toObject, ['toolUsePromptTokenCount'], fromToolUsePromptTokenCount);
8784
- }
8785
- const fromThoughtsTokenCount = getValueByPath(fromObject, [
8786
- 'thoughtsTokenCount',
8787
- ]);
8788
- if (fromThoughtsTokenCount != null) {
8789
- setValueByPath(toObject, ['thoughtsTokenCount'], fromThoughtsTokenCount);
8790
- }
8791
- const fromTotalTokenCount = getValueByPath(fromObject, [
8792
- 'totalTokenCount',
8793
- ]);
8794
- if (fromTotalTokenCount != null) {
8795
- setValueByPath(toObject, ['totalTokenCount'], fromTotalTokenCount);
8796
- }
8797
- const fromPromptTokensDetails = getValueByPath(fromObject, [
8798
- 'promptTokensDetails',
8799
- ]);
8800
- if (fromPromptTokensDetails != null) {
8801
- let transformedList = fromPromptTokensDetails;
8802
- if (Array.isArray(transformedList)) {
8803
- transformedList = transformedList.map((item) => {
8804
- return modalityTokenCountFromMldev(item);
8805
- });
8806
- }
8807
- setValueByPath(toObject, ['promptTokensDetails'], transformedList);
8808
- }
8809
- const fromCacheTokensDetails = getValueByPath(fromObject, [
8810
- 'cacheTokensDetails',
8811
- ]);
8812
- if (fromCacheTokensDetails != null) {
8813
- let transformedList = fromCacheTokensDetails;
8814
- if (Array.isArray(transformedList)) {
8815
- transformedList = transformedList.map((item) => {
8816
- return modalityTokenCountFromMldev(item);
8817
- });
8818
- }
8819
- setValueByPath(toObject, ['cacheTokensDetails'], transformedList);
8820
- }
8821
- const fromResponseTokensDetails = getValueByPath(fromObject, [
8822
- 'responseTokensDetails',
8823
- ]);
8824
- if (fromResponseTokensDetails != null) {
8825
- let transformedList = fromResponseTokensDetails;
8826
- if (Array.isArray(transformedList)) {
8827
- transformedList = transformedList.map((item) => {
8828
- return modalityTokenCountFromMldev(item);
8829
- });
8830
- }
8831
- setValueByPath(toObject, ['responseTokensDetails'], transformedList);
8832
- }
8833
- const fromToolUsePromptTokensDetails = getValueByPath(fromObject, [
8834
- 'toolUsePromptTokensDetails',
8835
- ]);
8836
- if (fromToolUsePromptTokensDetails != null) {
8837
- let transformedList = fromToolUsePromptTokensDetails;
8838
- if (Array.isArray(transformedList)) {
8839
- transformedList = transformedList.map((item) => {
8840
- return modalityTokenCountFromMldev(item);
8841
- });
8842
- }
8843
- setValueByPath(toObject, ['toolUsePromptTokensDetails'], transformedList);
8844
- }
8845
- return toObject;
8846
- }
8847
8980
  function usageMetadataFromVertex(fromObject) {
8848
8981
  const toObject = {};
8849
8982
  const fromPromptTokenCount = getValueByPath(fromObject, [
@@ -8930,17 +9063,9 @@ function usageMetadataFromVertex(fromObject) {
8930
9063
  }
8931
9064
  setValueByPath(toObject, ['toolUsePromptTokensDetails'], transformedList);
8932
9065
  }
8933
- const fromTrafficType = getValueByPath(fromObject, ['trafficType']);
8934
- if (fromTrafficType != null) {
8935
- setValueByPath(toObject, ['trafficType'], fromTrafficType);
8936
- }
8937
- return toObject;
8938
- }
8939
- function liveServerGoAwayFromMldev(fromObject) {
8940
- const toObject = {};
8941
- const fromTimeLeft = getValueByPath(fromObject, ['timeLeft']);
8942
- if (fromTimeLeft != null) {
8943
- setValueByPath(toObject, ['timeLeft'], fromTimeLeft);
9066
+ const fromTrafficType = getValueByPath(fromObject, ['trafficType']);
9067
+ if (fromTrafficType != null) {
9068
+ setValueByPath(toObject, ['trafficType'], fromTrafficType);
8944
9069
  }
8945
9070
  return toObject;
8946
9071
  }
@@ -8952,24 +9077,6 @@ function liveServerGoAwayFromVertex(fromObject) {
8952
9077
  }
8953
9078
  return toObject;
8954
9079
  }
8955
- function liveServerSessionResumptionUpdateFromMldev(fromObject) {
8956
- const toObject = {};
8957
- const fromNewHandle = getValueByPath(fromObject, ['newHandle']);
8958
- if (fromNewHandle != null) {
8959
- setValueByPath(toObject, ['newHandle'], fromNewHandle);
8960
- }
8961
- const fromResumable = getValueByPath(fromObject, ['resumable']);
8962
- if (fromResumable != null) {
8963
- setValueByPath(toObject, ['resumable'], fromResumable);
8964
- }
8965
- const fromLastConsumedClientMessageIndex = getValueByPath(fromObject, [
8966
- 'lastConsumedClientMessageIndex',
8967
- ]);
8968
- if (fromLastConsumedClientMessageIndex != null) {
8969
- setValueByPath(toObject, ['lastConsumedClientMessageIndex'], fromLastConsumedClientMessageIndex);
8970
- }
8971
- return toObject;
8972
- }
8973
9080
  function liveServerSessionResumptionUpdateFromVertex(fromObject) {
8974
9081
  const toObject = {};
8975
9082
  const fromNewHandle = getValueByPath(fromObject, ['newHandle']);
@@ -8988,48 +9095,6 @@ function liveServerSessionResumptionUpdateFromVertex(fromObject) {
8988
9095
  }
8989
9096
  return toObject;
8990
9097
  }
8991
- function liveServerMessageFromMldev(fromObject) {
8992
- const toObject = {};
8993
- const fromSetupComplete = getValueByPath(fromObject, [
8994
- 'setupComplete',
8995
- ]);
8996
- if (fromSetupComplete != null) {
8997
- setValueByPath(toObject, ['setupComplete'], liveServerSetupCompleteFromMldev());
8998
- }
8999
- const fromServerContent = getValueByPath(fromObject, [
9000
- 'serverContent',
9001
- ]);
9002
- if (fromServerContent != null) {
9003
- setValueByPath(toObject, ['serverContent'], liveServerContentFromMldev(fromServerContent));
9004
- }
9005
- const fromToolCall = getValueByPath(fromObject, ['toolCall']);
9006
- if (fromToolCall != null) {
9007
- setValueByPath(toObject, ['toolCall'], liveServerToolCallFromMldev(fromToolCall));
9008
- }
9009
- const fromToolCallCancellation = getValueByPath(fromObject, [
9010
- 'toolCallCancellation',
9011
- ]);
9012
- if (fromToolCallCancellation != null) {
9013
- setValueByPath(toObject, ['toolCallCancellation'], liveServerToolCallCancellationFromMldev(fromToolCallCancellation));
9014
- }
9015
- const fromUsageMetadata = getValueByPath(fromObject, [
9016
- 'usageMetadata',
9017
- ]);
9018
- if (fromUsageMetadata != null) {
9019
- setValueByPath(toObject, ['usageMetadata'], usageMetadataFromMldev(fromUsageMetadata));
9020
- }
9021
- const fromGoAway = getValueByPath(fromObject, ['goAway']);
9022
- if (fromGoAway != null) {
9023
- setValueByPath(toObject, ['goAway'], liveServerGoAwayFromMldev(fromGoAway));
9024
- }
9025
- const fromSessionResumptionUpdate = getValueByPath(fromObject, [
9026
- 'sessionResumptionUpdate',
9027
- ]);
9028
- if (fromSessionResumptionUpdate != null) {
9029
- setValueByPath(toObject, ['sessionResumptionUpdate'], liveServerSessionResumptionUpdateFromMldev(fromSessionResumptionUpdate));
9030
- }
9031
- return toObject;
9032
- }
9033
9098
  function liveServerMessageFromVertex(fromObject) {
9034
9099
  const toObject = {};
9035
9100
  const fromSetupComplete = getValueByPath(fromObject, [
@@ -9072,172 +9137,6 @@ function liveServerMessageFromVertex(fromObject) {
9072
9137
  }
9073
9138
  return toObject;
9074
9139
  }
9075
- function liveMusicServerSetupCompleteFromMldev() {
9076
- const toObject = {};
9077
- return toObject;
9078
- }
9079
- function weightedPromptFromMldev(fromObject) {
9080
- const toObject = {};
9081
- const fromText = getValueByPath(fromObject, ['text']);
9082
- if (fromText != null) {
9083
- setValueByPath(toObject, ['text'], fromText);
9084
- }
9085
- const fromWeight = getValueByPath(fromObject, ['weight']);
9086
- if (fromWeight != null) {
9087
- setValueByPath(toObject, ['weight'], fromWeight);
9088
- }
9089
- return toObject;
9090
- }
9091
- function liveMusicClientContentFromMldev(fromObject) {
9092
- const toObject = {};
9093
- const fromWeightedPrompts = getValueByPath(fromObject, [
9094
- 'weightedPrompts',
9095
- ]);
9096
- if (fromWeightedPrompts != null) {
9097
- let transformedList = fromWeightedPrompts;
9098
- if (Array.isArray(transformedList)) {
9099
- transformedList = transformedList.map((item) => {
9100
- return weightedPromptFromMldev(item);
9101
- });
9102
- }
9103
- setValueByPath(toObject, ['weightedPrompts'], transformedList);
9104
- }
9105
- return toObject;
9106
- }
9107
- function liveMusicGenerationConfigFromMldev(fromObject) {
9108
- const toObject = {};
9109
- const fromTemperature = getValueByPath(fromObject, ['temperature']);
9110
- if (fromTemperature != null) {
9111
- setValueByPath(toObject, ['temperature'], fromTemperature);
9112
- }
9113
- const fromTopK = getValueByPath(fromObject, ['topK']);
9114
- if (fromTopK != null) {
9115
- setValueByPath(toObject, ['topK'], fromTopK);
9116
- }
9117
- const fromSeed = getValueByPath(fromObject, ['seed']);
9118
- if (fromSeed != null) {
9119
- setValueByPath(toObject, ['seed'], fromSeed);
9120
- }
9121
- const fromGuidance = getValueByPath(fromObject, ['guidance']);
9122
- if (fromGuidance != null) {
9123
- setValueByPath(toObject, ['guidance'], fromGuidance);
9124
- }
9125
- const fromBpm = getValueByPath(fromObject, ['bpm']);
9126
- if (fromBpm != null) {
9127
- setValueByPath(toObject, ['bpm'], fromBpm);
9128
- }
9129
- const fromDensity = getValueByPath(fromObject, ['density']);
9130
- if (fromDensity != null) {
9131
- setValueByPath(toObject, ['density'], fromDensity);
9132
- }
9133
- const fromBrightness = getValueByPath(fromObject, ['brightness']);
9134
- if (fromBrightness != null) {
9135
- setValueByPath(toObject, ['brightness'], fromBrightness);
9136
- }
9137
- const fromScale = getValueByPath(fromObject, ['scale']);
9138
- if (fromScale != null) {
9139
- setValueByPath(toObject, ['scale'], fromScale);
9140
- }
9141
- const fromMuteBass = getValueByPath(fromObject, ['muteBass']);
9142
- if (fromMuteBass != null) {
9143
- setValueByPath(toObject, ['muteBass'], fromMuteBass);
9144
- }
9145
- const fromMuteDrums = getValueByPath(fromObject, ['muteDrums']);
9146
- if (fromMuteDrums != null) {
9147
- setValueByPath(toObject, ['muteDrums'], fromMuteDrums);
9148
- }
9149
- const fromOnlyBassAndDrums = getValueByPath(fromObject, [
9150
- 'onlyBassAndDrums',
9151
- ]);
9152
- if (fromOnlyBassAndDrums != null) {
9153
- setValueByPath(toObject, ['onlyBassAndDrums'], fromOnlyBassAndDrums);
9154
- }
9155
- return toObject;
9156
- }
9157
- function liveMusicSourceMetadataFromMldev(fromObject) {
9158
- const toObject = {};
9159
- const fromClientContent = getValueByPath(fromObject, [
9160
- 'clientContent',
9161
- ]);
9162
- if (fromClientContent != null) {
9163
- setValueByPath(toObject, ['clientContent'], liveMusicClientContentFromMldev(fromClientContent));
9164
- }
9165
- const fromMusicGenerationConfig = getValueByPath(fromObject, [
9166
- 'musicGenerationConfig',
9167
- ]);
9168
- if (fromMusicGenerationConfig != null) {
9169
- setValueByPath(toObject, ['musicGenerationConfig'], liveMusicGenerationConfigFromMldev(fromMusicGenerationConfig));
9170
- }
9171
- return toObject;
9172
- }
9173
- function audioChunkFromMldev(fromObject) {
9174
- const toObject = {};
9175
- const fromData = getValueByPath(fromObject, ['data']);
9176
- if (fromData != null) {
9177
- setValueByPath(toObject, ['data'], fromData);
9178
- }
9179
- const fromMimeType = getValueByPath(fromObject, ['mimeType']);
9180
- if (fromMimeType != null) {
9181
- setValueByPath(toObject, ['mimeType'], fromMimeType);
9182
- }
9183
- const fromSourceMetadata = getValueByPath(fromObject, [
9184
- 'sourceMetadata',
9185
- ]);
9186
- if (fromSourceMetadata != null) {
9187
- setValueByPath(toObject, ['sourceMetadata'], liveMusicSourceMetadataFromMldev(fromSourceMetadata));
9188
- }
9189
- return toObject;
9190
- }
9191
- function liveMusicServerContentFromMldev(fromObject) {
9192
- const toObject = {};
9193
- const fromAudioChunks = getValueByPath(fromObject, ['audioChunks']);
9194
- if (fromAudioChunks != null) {
9195
- let transformedList = fromAudioChunks;
9196
- if (Array.isArray(transformedList)) {
9197
- transformedList = transformedList.map((item) => {
9198
- return audioChunkFromMldev(item);
9199
- });
9200
- }
9201
- setValueByPath(toObject, ['audioChunks'], transformedList);
9202
- }
9203
- return toObject;
9204
- }
9205
- function liveMusicFilteredPromptFromMldev(fromObject) {
9206
- const toObject = {};
9207
- const fromText = getValueByPath(fromObject, ['text']);
9208
- if (fromText != null) {
9209
- setValueByPath(toObject, ['text'], fromText);
9210
- }
9211
- const fromFilteredReason = getValueByPath(fromObject, [
9212
- 'filteredReason',
9213
- ]);
9214
- if (fromFilteredReason != null) {
9215
- setValueByPath(toObject, ['filteredReason'], fromFilteredReason);
9216
- }
9217
- return toObject;
9218
- }
9219
- function liveMusicServerMessageFromMldev(fromObject) {
9220
- const toObject = {};
9221
- const fromSetupComplete = getValueByPath(fromObject, [
9222
- 'setupComplete',
9223
- ]);
9224
- if (fromSetupComplete != null) {
9225
- setValueByPath(toObject, ['setupComplete'], liveMusicServerSetupCompleteFromMldev());
9226
- }
9227
- const fromServerContent = getValueByPath(fromObject, [
9228
- 'serverContent',
9229
- ]);
9230
- if (fromServerContent != null) {
9231
- setValueByPath(toObject, ['serverContent'], liveMusicServerContentFromMldev(fromServerContent));
9232
- }
9233
- const fromFilteredPrompt = getValueByPath(fromObject, [
9234
- 'filteredPrompt',
9235
- ]);
9236
- if (fromFilteredPrompt != null) {
9237
- setValueByPath(toObject, ['filteredPrompt'], liveMusicFilteredPromptFromMldev(fromFilteredPrompt));
9238
- }
9239
- return toObject;
9240
- }
9241
9140
 
9242
9141
  /**
9243
9142
  * @license
@@ -11318,6 +11217,10 @@ function editImageConfigToVertex(fromObject, parentObject) {
11318
11217
  if (parentObject !== undefined && fromOutputCompressionQuality != null) {
11319
11218
  setValueByPath(parentObject, ['parameters', 'outputOptions', 'compressionQuality'], fromOutputCompressionQuality);
11320
11219
  }
11220
+ const fromAddWatermark = getValueByPath(fromObject, ['addWatermark']);
11221
+ if (parentObject !== undefined && fromAddWatermark != null) {
11222
+ setValueByPath(parentObject, ['parameters', 'addWatermark'], fromAddWatermark);
11223
+ }
11321
11224
  const fromEditMode = getValueByPath(fromObject, ['editMode']);
11322
11225
  if (parentObject !== undefined && fromEditMode != null) {
11323
11226
  setValueByPath(parentObject, ['parameters', 'editMode'], fromEditMode);
@@ -11892,6 +11795,12 @@ function candidateFromMldev(fromObject) {
11892
11795
  }
11893
11796
  function generateContentResponseFromMldev(fromObject) {
11894
11797
  const toObject = {};
11798
+ const fromSdkHttpResponse = getValueByPath(fromObject, [
11799
+ 'sdkHttpResponse',
11800
+ ]);
11801
+ if (fromSdkHttpResponse != null) {
11802
+ setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
11803
+ }
11895
11804
  const fromCandidates = getValueByPath(fromObject, ['candidates']);
11896
11805
  if (fromCandidates != null) {
11897
11806
  let transformedList = fromCandidates;
@@ -12418,6 +12327,12 @@ function candidateFromVertex(fromObject) {
12418
12327
  }
12419
12328
  function generateContentResponseFromVertex(fromObject) {
12420
12329
  const toObject = {};
12330
+ const fromSdkHttpResponse = getValueByPath(fromObject, [
12331
+ 'sdkHttpResponse',
12332
+ ]);
12333
+ if (fromSdkHttpResponse != null) {
12334
+ setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
12335
+ }
12421
12336
  const fromCandidates = getValueByPath(fromObject, ['candidates']);
12422
12337
  if (fromCandidates != null) {
12423
12338
  let transformedList = fromCandidates;
@@ -12854,7 +12769,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
12854
12769
  const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
12855
12770
  const USER_AGENT_HEADER = 'User-Agent';
12856
12771
  const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
12857
- const SDK_VERSION = '1.8.0'; // x-release-please-version
12772
+ const SDK_VERSION = '1.10.0'; // x-release-please-version
12858
12773
  const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
12859
12774
  const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
12860
12775
  const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';
@@ -13085,7 +13000,14 @@ class ApiClient {
13085
13000
  const abortController = new AbortController();
13086
13001
  const signal = abortController.signal;
13087
13002
  if (httpOptions.timeout && (httpOptions === null || httpOptions === void 0 ? void 0 : httpOptions.timeout) > 0) {
13088
- setTimeout(() => abortController.abort(), httpOptions.timeout);
13003
+ const timeoutHandle = setTimeout(() => abortController.abort(), httpOptions.timeout);
13004
+ if (timeoutHandle &&
13005
+ typeof timeoutHandle.unref ===
13006
+ 'function') {
13007
+ // call unref to prevent nodejs process from hanging, see
13008
+ // https://nodejs.org/api/timers.html#timeoutunref
13009
+ timeoutHandle.unref();
13010
+ }
13089
13011
  }
13090
13012
  if (abortSignal) {
13091
13013
  abortSignal.addEventListener('abort', () => {
@@ -13148,7 +13070,7 @@ class ApiClient {
13148
13070
  }
13149
13071
  break;
13150
13072
  }
13151
- const chunkString = decoder.decode(value);
13073
+ const chunkString = decoder.decode(value, { stream: true });
13152
13074
  // Parse and throw an error if the chunk contains an error.
13153
13075
  try {
13154
13076
  const chunkJson = JSON.parse(chunkString);
@@ -13419,6 +13341,9 @@ function includeExtraBodyToRequestInit(requestInit, extraBody) {
13419
13341
  */
13420
13342
  // TODO: b/416041229 - Determine how to retrieve the MCP package version.
13421
13343
  const MCP_LABEL = 'mcp_used/unknown';
13344
+ // Whether MCP tool usage is detected from mcpToTool. This is used for
13345
+ // telemetry.
13346
+ let hasMcpToolUsageFromMcpToTool = false;
13422
13347
  // Checks whether the list of tools contains any MCP tools.
13423
13348
  function hasMcpToolUsage(tools) {
13424
13349
  for (const tool of tools) {
@@ -13429,7 +13354,7 @@ function hasMcpToolUsage(tools) {
13429
13354
  return true;
13430
13355
  }
13431
13356
  }
13432
- return false;
13357
+ return hasMcpToolUsageFromMcpToTool;
13433
13358
  }
13434
13359
  // Sets the MCP version label in the Google API client header.
13435
13360
  function setMcpUsageHeader(headers) {
@@ -13586,6 +13511,8 @@ function isMcpClient(client) {
13586
13511
  * versions.
13587
13512
  */
13588
13513
  function mcpToTool(...args) {
13514
+ // Set MCP usage for telemetry.
13515
+ hasMcpToolUsageFromMcpToTool = true;
13589
13516
  if (args.length === 0) {
13590
13517
  throw new Error('No MCP clients provided');
13591
13518
  }
@@ -13905,7 +13832,7 @@ class Live {
13905
13832
  if (GOOGLE_GENAI_USE_VERTEXAI) {
13906
13833
  model = 'gemini-2.0-flash-live-preview-04-09';
13907
13834
  } else {
13908
- model = 'gemini-2.0-flash-live-001';
13835
+ model = 'gemini-live-2.5-flash-preview';
13909
13836
  }
13910
13837
  const session = await ai.live.connect({
13911
13838
  model: model,
@@ -13931,6 +13858,12 @@ class Live {
13931
13858
  */
13932
13859
  async connect(params) {
13933
13860
  var _a, _b, _c, _d, _e, _f;
13861
+ // TODO: b/404946746 - Support per request HTTP options.
13862
+ if (params.config && params.config.httpOptions) {
13863
+ throw new Error('The Live module does not support httpOptions at request-level in' +
13864
+ ' LiveConnectConfig yet. Please use the client-level httpOptions' +
13865
+ ' configuration instead.');
13866
+ }
13934
13867
  const websocketBaseUrl = this.apiClient.getWebsocketBaseUrl();
13935
13868
  const apiVersion = this.apiClient.getApiVersion();
13936
13869
  let url;
@@ -13951,6 +13884,9 @@ class Live {
13951
13884
  let keyName = 'key';
13952
13885
  if (apiKey === null || apiKey === void 0 ? void 0 : apiKey.startsWith('auth_tokens/')) {
13953
13886
  console.warn('Warning: Ephemeral token support is experimental and may change in future versions.');
13887
+ if (apiVersion !== 'v1alpha') {
13888
+ 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.");
13889
+ }
13954
13890
  method = 'BidiGenerateContentConstrained';
13955
13891
  keyName = 'access_token';
13956
13892
  }
@@ -14226,7 +14162,7 @@ class Session {
14226
14162
  if (GOOGLE_GENAI_USE_VERTEXAI) {
14227
14163
  model = 'gemini-2.0-flash-live-preview-04-09';
14228
14164
  } else {
14229
- model = 'gemini-2.0-flash-live-001';
14165
+ model = 'gemini-live-2.5-flash-preview';
14230
14166
  }
14231
14167
  const session = await ai.live.connect({
14232
14168
  model: model,
@@ -14355,6 +14291,7 @@ class Models extends BaseModule {
14355
14291
  this.generateContent = async (params) => {
14356
14292
  var _a, _b, _c, _d, _e;
14357
14293
  const transformedParams = await this.processParamsForMcpUsage(params);
14294
+ this.maybeMoveToResponseJsonSchem(params);
14358
14295
  if (!hasMcpClientTools(params) || shouldDisableAfc(params.config)) {
14359
14296
  return await this.generateContentInternal(transformedParams);
14360
14297
  }
@@ -14441,6 +14378,7 @@ class Models extends BaseModule {
14441
14378
  * ```
14442
14379
  */
14443
14380
  this.generateContentStream = async (params) => {
14381
+ this.maybeMoveToResponseJsonSchem(params);
14444
14382
  if (shouldDisableAfc(params.config)) {
14445
14383
  const transformedParams = await this.processParamsForMcpUsage(params);
14446
14384
  return await this.generateContentStreamInternal(transformedParams);
@@ -14592,6 +14530,24 @@ class Models extends BaseModule {
14592
14530
  return await this.upscaleImageInternal(apiParams);
14593
14531
  };
14594
14532
  }
14533
+ /**
14534
+ * This logic is needed for GenerateContentConfig only.
14535
+ * Previously we made GenerateContentConfig.responseSchema field to accept
14536
+ * unknown. Since v1.9.0, we switch to use backend JSON schema support.
14537
+ * To maintain backward compatibility, we move the data that was treated as
14538
+ * JSON schema from the responseSchema field to the responseJsonSchema field.
14539
+ */
14540
+ maybeMoveToResponseJsonSchem(params) {
14541
+ if (params.config && params.config.responseSchema) {
14542
+ if (!params.config.responseJsonSchema) {
14543
+ if (Object.keys(params.config.responseSchema).includes('$schema')) {
14544
+ params.config.responseJsonSchema = params.config.responseSchema;
14545
+ delete params.config.responseSchema;
14546
+ }
14547
+ }
14548
+ }
14549
+ return;
14550
+ }
14595
14551
  /**
14596
14552
  * Transforms the CallableTools in the parameters to be simply Tools, it
14597
14553
  * copies the params into a new object and replaces the tools, it does not
@@ -14753,7 +14709,13 @@ class Models extends BaseModule {
14753
14709
  abortSignal: (_b = params.config) === null || _b === void 0 ? void 0 : _b.abortSignal,
14754
14710
  })
14755
14711
  .then((httpResponse) => {
14756
- return httpResponse.json();
14712
+ return httpResponse.json().then((jsonResponse) => {
14713
+ const response = jsonResponse;
14714
+ response.sdkHttpResponse = {
14715
+ headers: httpResponse.headers,
14716
+ };
14717
+ return response;
14718
+ });
14757
14719
  });
14758
14720
  return response.then((apiResponse) => {
14759
14721
  const resp = generateContentResponseFromVertex(apiResponse);
@@ -14779,7 +14741,13 @@ class Models extends BaseModule {
14779
14741
  abortSignal: (_d = params.config) === null || _d === void 0 ? void 0 : _d.abortSignal,
14780
14742
  })
14781
14743
  .then((httpResponse) => {
14782
- return httpResponse.json();
14744
+ return httpResponse.json().then((jsonResponse) => {
14745
+ const response = jsonResponse;
14746
+ response.sdkHttpResponse = {
14747
+ headers: httpResponse.headers,
14748
+ };
14749
+ return response;
14750
+ });
14783
14751
  });
14784
14752
  return response.then((apiResponse) => {
14785
14753
  const resp = generateContentResponseFromMldev(apiResponse);
@@ -14819,6 +14787,9 @@ class Models extends BaseModule {
14819
14787
  _d = false;
14820
14788
  const chunk = _c;
14821
14789
  const resp = generateContentResponseFromVertex((yield __await(chunk.json())));
14790
+ resp['sdkHttpResponse'] = {
14791
+ headers: chunk.headers,
14792
+ };
14822
14793
  const typedResp = new GenerateContentResponse();
14823
14794
  Object.assign(typedResp, resp);
14824
14795
  yield yield __await(typedResp);
@@ -14859,6 +14830,9 @@ class Models extends BaseModule {
14859
14830
  _d = false;
14860
14831
  const chunk = _c;
14861
14832
  const resp = generateContentResponseFromMldev((yield __await(chunk.json())));
14833
+ resp['sdkHttpResponse'] = {
14834
+ headers: chunk.headers,
14835
+ };
14862
14836
  const typedResp = new GenerateContentResponse();
14863
14837
  Object.assign(typedResp, resp);
14864
14838
  yield yield __await(typedResp);
@@ -16652,14 +16626,20 @@ class Tokens extends BaseModule {
16652
16626
  * @experimental
16653
16627
  *
16654
16628
  * @remarks
16655
- * Ephermeral auth tokens is only supported in the Gemini Developer API.
16629
+ * Ephemeral auth tokens is only supported in the Gemini Developer API.
16656
16630
  * It can be used for the session connection to the Live constrained API.
16631
+ * Support in v1alpha only.
16657
16632
  *
16658
16633
  * @param params - The parameters for the create request.
16659
16634
  * @return The created auth token.
16660
16635
  *
16661
16636
  * @example
16662
16637
  * ```ts
16638
+ * const ai = new GoogleGenAI({
16639
+ * apiKey: token.name,
16640
+ * httpOptions: { apiVersion: 'v1alpha' } // Support in v1alpha only.
16641
+ * });
16642
+ *
16663
16643
  * // Case 1: If LiveEphemeralParameters is unset, unlock LiveConnectConfig
16664
16644
  * // when using the token in Live API sessions. Each session connection can
16665
16645
  * // use a different configuration.
@@ -17313,7 +17293,7 @@ function listTuningJobsResponseFromMldev(fromObject) {
17313
17293
  }
17314
17294
  return toObject;
17315
17295
  }
17316
- function operationFromMldev(fromObject) {
17296
+ function tuningOperationFromMldev(fromObject) {
17317
17297
  const toObject = {};
17318
17298
  const fromName = getValueByPath(fromObject, ['name']);
17319
17299
  if (fromName != null) {
@@ -17740,7 +17720,7 @@ class Tunings extends BaseModule {
17740
17720
  return httpResponse.json();
17741
17721
  });
17742
17722
  return response.then((apiResponse) => {
17743
- const resp = operationFromMldev(apiResponse);
17723
+ const resp = tuningOperationFromMldev(apiResponse);
17744
17724
  return resp;
17745
17725
  });
17746
17726
  }