@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.
package/dist/index.mjs CHANGED
@@ -1,5 +1,3 @@
1
- import { z } from 'zod';
2
-
3
1
  /**
4
2
  * @license
5
3
  * Copyright 2025 Google LLC
@@ -761,11 +759,38 @@ var PersonGeneration;
761
759
  /** Enum that specifies the language of the text in the prompt. */
762
760
  var ImagePromptLanguage;
763
761
  (function (ImagePromptLanguage) {
762
+ /**
763
+ * Auto-detect the language.
764
+ */
764
765
  ImagePromptLanguage["auto"] = "auto";
766
+ /**
767
+ * English
768
+ */
765
769
  ImagePromptLanguage["en"] = "en";
770
+ /**
771
+ * Japanese
772
+ */
766
773
  ImagePromptLanguage["ja"] = "ja";
774
+ /**
775
+ * Korean
776
+ */
767
777
  ImagePromptLanguage["ko"] = "ko";
778
+ /**
779
+ * Hindi
780
+ */
768
781
  ImagePromptLanguage["hi"] = "hi";
782
+ /**
783
+ * Chinese
784
+ */
785
+ ImagePromptLanguage["zh"] = "zh";
786
+ /**
787
+ * Portuguese
788
+ */
789
+ ImagePromptLanguage["pt"] = "pt";
790
+ /**
791
+ * Spanish
792
+ */
793
+ ImagePromptLanguage["es"] = "es";
769
794
  })(ImagePromptLanguage || (ImagePromptLanguage = {}));
770
795
  /** Enum representing the mask mode of a mask reference image. */
771
796
  var MaskReferenceMode;
@@ -1866,133 +1891,12 @@ function tContents(origin) {
1866
1891
  }
1867
1892
  return result;
1868
1893
  }
1869
- // The fields that are supported by JSONSchema. Must be kept in sync with the
1870
- // JSONSchema interface above.
1871
- const supportedJsonSchemaFields = new Set([
1872
- 'type',
1873
- 'format',
1874
- 'title',
1875
- 'description',
1876
- 'default',
1877
- 'items',
1878
- 'minItems',
1879
- 'maxItems',
1880
- 'enum',
1881
- 'properties',
1882
- 'required',
1883
- 'minProperties',
1884
- 'maxProperties',
1885
- 'minimum',
1886
- 'maximum',
1887
- 'minLength',
1888
- 'maxLength',
1889
- 'pattern',
1890
- 'anyOf',
1891
- 'propertyOrdering',
1892
- ]);
1893
- const jsonSchemaTypeValidator = z.enum([
1894
- 'string',
1895
- 'number',
1896
- 'integer',
1897
- 'object',
1898
- 'array',
1899
- 'boolean',
1900
- 'null',
1901
- ]);
1902
- // Handles all types and arrays of all types.
1903
- const schemaTypeUnion = z.union([
1904
- jsonSchemaTypeValidator,
1905
- z.array(jsonSchemaTypeValidator),
1906
- ]);
1907
- /**
1908
- * Creates a zod validator for JSONSchema.
1909
- *
1910
- * @param strictMode Whether to enable strict mode, default to true. When
1911
- * strict mode is enabled, the zod validator will throw error if there
1912
- * are unrecognized fields in the input data. If strict mode is
1913
- * disabled, the zod validator will ignore the unrecognized fields, only
1914
- * populate the fields that are listed in the JSONSchema. Regardless of
1915
- * the mode the type mismatch will always result in an error, for example
1916
- * items field should be a single JSONSchema, but for tuple type it would
1917
- * be an array of JSONSchema, this will always result in an error.
1918
- * @return The zod validator for JSONSchema.
1919
- */
1920
- function createJsonSchemaValidator(strictMode = true) {
1921
- const jsonSchemaValidator = z.lazy(() => {
1922
- // Define the base object shape *inside* the z.lazy callback
1923
- const baseShape = z.object({
1924
- // --- Type ---
1925
- type: schemaTypeUnion.optional(),
1926
- // --- Annotations ---
1927
- format: z.string().optional(),
1928
- title: z.string().optional(),
1929
- description: z.string().optional(),
1930
- default: z.unknown().optional(),
1931
- // --- Array Validations ---
1932
- items: jsonSchemaValidator.optional(),
1933
- minItems: z.coerce.string().optional(),
1934
- maxItems: z.coerce.string().optional(),
1935
- // --- Generic Validations ---
1936
- enum: z.array(z.unknown()).optional(),
1937
- // --- Object Validations ---
1938
- properties: z.record(z.string(), jsonSchemaValidator).optional(),
1939
- required: z.array(z.string()).optional(),
1940
- minProperties: z.coerce.string().optional(),
1941
- maxProperties: z.coerce.string().optional(),
1942
- propertyOrdering: z.array(z.string()).optional(),
1943
- // --- Numeric Validations ---
1944
- minimum: z.number().optional(),
1945
- maximum: z.number().optional(),
1946
- // --- String Validations ---
1947
- minLength: z.coerce.string().optional(),
1948
- maxLength: z.coerce.string().optional(),
1949
- pattern: z.string().optional(),
1950
- // --- Schema Composition ---
1951
- anyOf: z.array(jsonSchemaValidator).optional(),
1952
- // --- Additional Properties --- This field is not included in the
1953
- // JSONSchema, will not be communicated to the model, it is here purely
1954
- // for enabling the zod validation strict mode.
1955
- additionalProperties: z.boolean().optional(),
1956
- });
1957
- // Conditionally apply .strict() based on the flag
1958
- return strictMode ? baseShape.strict() : baseShape;
1959
- });
1960
- return jsonSchemaValidator;
1961
- }
1962
1894
  /*
1963
- Handle type field:
1964
- The resulted type field in JSONSchema form zod_to_json_schema can be either
1965
- an array consist of primitive types or a single primitive type.
1966
- This is due to the optimization of zod_to_json_schema, when the types in the
1967
- union are primitive types without any additional specifications,
1968
- zod_to_json_schema will squash the types into an array instead of put them
1969
- in anyOf fields. Otherwise, it will put the types in anyOf fields.
1970
- See the following link for more details:
1971
- https://github.com/zodjs/zod-to-json-schema/blob/main/src/index.ts#L101
1972
- The logic here is trying to undo that optimization, flattening the array of
1973
- types to anyOf fields.
1974
- type field
1975
- |
1976
- ___________________________
1977
- / \
1978
- / \
1979
- / \
1980
- Array Type.*
1981
- / \ |
1982
- Include null. Not included null type = Type.*.
1983
- [null, Type.*, Type.*] multiple types.
1984
- [null, Type.*] [Type.*, Type.*]
1985
- / \
1986
- remove null \
1987
- add nullable = true \
1988
- / \ \
1989
- [Type.*] [Type.*, Type.*] \
1990
- only one type left multiple types left \
1991
- add type = Type.*. \ /
1992
- \ /
1993
- not populate the type field in final result
1994
- and make the types into anyOf fields
1995
- anyOf:[{type: 'Type.*'}, {type: 'Type.*'}];
1895
+ Transform the type field from an array of types to an array of anyOf fields.
1896
+ Example:
1897
+ {type: ['STRING', 'NUMBER']}
1898
+ will be transformed to
1899
+ {anyOf: [{type: 'STRING'}, {type: 'NUMBER'}]}
1996
1900
  */
1997
1901
  function flattenTypeArrayToAnyOf(typeList, resultingSchema) {
1998
1902
  if (typeList.includes('null')) {
@@ -2138,15 +2042,11 @@ function processJsonSchema(_jsonSchema) {
2138
2042
  // https://github.com/StefanTerdell/zod-to-json-schema/blob/70525efe555cd226691e093d171370a3b10921d1/src/zodToJsonSchema.ts#L7
2139
2043
  // typebox can return unknown, see details in
2140
2044
  // https://github.com/sinclairzx81/typebox/blob/5a5431439f7d5ca6b494d0d18fbfd7b1a356d67c/src/type/create/type.ts#L35
2045
+ // Note: proper json schemas with the $schema field set never arrive to this
2046
+ // transformer. Schemas with $schema are routed to the equivalent API json
2047
+ // schema field.
2141
2048
  function tSchema(schema) {
2142
- if (Object.keys(schema).includes('$schema')) {
2143
- delete schema['$schema'];
2144
- const validatedJsonSchema = createJsonSchemaValidator().parse(schema);
2145
- return processJsonSchema(validatedJsonSchema);
2146
- }
2147
- else {
2148
- return processJsonSchema(schema);
2149
- }
2049
+ return processJsonSchema(schema);
2150
2050
  }
2151
2051
  function tSpeechConfig(speechConfig) {
2152
2052
  if (typeof speechConfig === 'object') {
@@ -2175,10 +2075,28 @@ function tTool(tool) {
2175
2075
  if (tool.functionDeclarations) {
2176
2076
  for (const functionDeclaration of tool.functionDeclarations) {
2177
2077
  if (functionDeclaration.parameters) {
2178
- functionDeclaration.parameters = tSchema(functionDeclaration.parameters);
2078
+ if (!Object.keys(functionDeclaration.parameters).includes('$schema')) {
2079
+ functionDeclaration.parameters = processJsonSchema(functionDeclaration.parameters);
2080
+ }
2081
+ else {
2082
+ if (!functionDeclaration.parametersJsonSchema) {
2083
+ functionDeclaration.parametersJsonSchema =
2084
+ functionDeclaration.parameters;
2085
+ delete functionDeclaration.parameters;
2086
+ }
2087
+ }
2179
2088
  }
2180
2089
  if (functionDeclaration.response) {
2181
- functionDeclaration.response = tSchema(functionDeclaration.response);
2090
+ if (!Object.keys(functionDeclaration.response).includes('$schema')) {
2091
+ functionDeclaration.response = processJsonSchema(functionDeclaration.response);
2092
+ }
2093
+ else {
2094
+ if (!functionDeclaration.responseJsonSchema) {
2095
+ functionDeclaration.responseJsonSchema =
2096
+ functionDeclaration.response;
2097
+ delete functionDeclaration.response;
2098
+ }
2099
+ }
2182
2100
  }
2183
2101
  }
2184
2102
  }
@@ -2383,7 +2301,7 @@ function mcpToGeminiTool(mcpTool, config = {}) {
2383
2301
  const functionDeclaration = {
2384
2302
  name: mcpToolSchema['name'],
2385
2303
  description: mcpToolSchema['description'],
2386
- parameters: processJsonSchema(filterToJsonSchema(mcpToolSchema['inputSchema'])),
2304
+ parametersJsonSchema: mcpToolSchema['inputSchema'],
2387
2305
  };
2388
2306
  if (config.behavior) {
2389
2307
  functionDeclaration['behavior'] = config.behavior;
@@ -2415,53 +2333,6 @@ function mcpToolsToGeminiTool(mcpTools, config = {}) {
2415
2333
  }
2416
2334
  return { functionDeclarations: functionDeclarations };
2417
2335
  }
2418
- // Filters the list schema field to only include fields that are supported by
2419
- // JSONSchema.
2420
- function filterListSchemaField(fieldValue) {
2421
- const listSchemaFieldValue = [];
2422
- for (const listFieldValue of fieldValue) {
2423
- listSchemaFieldValue.push(filterToJsonSchema(listFieldValue));
2424
- }
2425
- return listSchemaFieldValue;
2426
- }
2427
- // Filters the dict schema field to only include fields that are supported by
2428
- // JSONSchema.
2429
- function filterDictSchemaField(fieldValue) {
2430
- const dictSchemaFieldValue = {};
2431
- for (const [key, value] of Object.entries(fieldValue)) {
2432
- const valueRecord = value;
2433
- dictSchemaFieldValue[key] = filterToJsonSchema(valueRecord);
2434
- }
2435
- return dictSchemaFieldValue;
2436
- }
2437
- // Filters the schema to only include fields that are supported by JSONSchema.
2438
- function filterToJsonSchema(schema) {
2439
- const schemaFieldNames = new Set(['items']); // 'additional_properties' to come
2440
- const listSchemaFieldNames = new Set(['anyOf']); // 'one_of', 'all_of', 'not' to come
2441
- const dictSchemaFieldNames = new Set(['properties']); // 'defs' to come
2442
- const filteredSchema = {};
2443
- for (const [fieldName, fieldValue] of Object.entries(schema)) {
2444
- if (schemaFieldNames.has(fieldName)) {
2445
- filteredSchema[fieldName] = filterToJsonSchema(fieldValue);
2446
- }
2447
- else if (listSchemaFieldNames.has(fieldName)) {
2448
- filteredSchema[fieldName] = filterListSchemaField(fieldValue);
2449
- }
2450
- else if (dictSchemaFieldNames.has(fieldName)) {
2451
- filteredSchema[fieldName] = filterDictSchemaField(fieldValue);
2452
- }
2453
- else if (fieldName === 'type') {
2454
- const typeValue = fieldValue.toUpperCase();
2455
- filteredSchema[fieldName] = Object.values(Type).includes(typeValue)
2456
- ? typeValue
2457
- : Type.TYPE_UNSPECIFIED;
2458
- }
2459
- else if (supportedJsonSchemaFields.has(fieldName)) {
2460
- filteredSchema[fieldName] = fieldValue;
2461
- }
2462
- }
2463
- return filteredSchema;
2464
- }
2465
2336
  // Transforms a source input into a BatchJobSource object with validation.
2466
2337
  function tBatchJobSource(apiClient, src) {
2467
2338
  if (typeof src !== 'string' && !Array.isArray(src)) {
@@ -2510,6 +2381,9 @@ function tBatchJobSource(apiClient, src) {
2510
2381
  throw new Error(`Unsupported source: ${src}`);
2511
2382
  }
2512
2383
  function tBatchJobDestination(dest) {
2384
+ if (typeof dest !== 'string') {
2385
+ return dest;
2386
+ }
2513
2387
  const destString = dest;
2514
2388
  if (destString.startsWith('gs://')) {
2515
2389
  return {
@@ -3495,10 +3369,6 @@ function deleteBatchJobParametersToVertex(apiClient, fromObject) {
3495
3369
  }
3496
3370
  return toObject;
3497
3371
  }
3498
- function jobErrorFromMldev() {
3499
- const toObject = {};
3500
- return toObject;
3501
- }
3502
3372
  function videoMetadataFromMldev$2(fromObject) {
3503
3373
  const toObject = {};
3504
3374
  const fromFps = getValueByPath(fromObject, ['fps']);
@@ -3703,6 +3573,12 @@ function candidateFromMldev$1(fromObject) {
3703
3573
  }
3704
3574
  function generateContentResponseFromMldev$1(fromObject) {
3705
3575
  const toObject = {};
3576
+ const fromSdkHttpResponse = getValueByPath(fromObject, [
3577
+ 'sdkHttpResponse',
3578
+ ]);
3579
+ if (fromSdkHttpResponse != null) {
3580
+ setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
3581
+ }
3706
3582
  const fromCandidates = getValueByPath(fromObject, ['candidates']);
3707
3583
  if (fromCandidates != null) {
3708
3584
  let transformedList = fromCandidates;
@@ -3731,6 +3607,22 @@ function generateContentResponseFromMldev$1(fromObject) {
3731
3607
  }
3732
3608
  return toObject;
3733
3609
  }
3610
+ function jobErrorFromMldev(fromObject) {
3611
+ const toObject = {};
3612
+ const fromDetails = getValueByPath(fromObject, ['details']);
3613
+ if (fromDetails != null) {
3614
+ setValueByPath(toObject, ['details'], fromDetails);
3615
+ }
3616
+ const fromCode = getValueByPath(fromObject, ['code']);
3617
+ if (fromCode != null) {
3618
+ setValueByPath(toObject, ['code'], fromCode);
3619
+ }
3620
+ const fromMessage = getValueByPath(fromObject, ['message']);
3621
+ if (fromMessage != null) {
3622
+ setValueByPath(toObject, ['message'], fromMessage);
3623
+ }
3624
+ return toObject;
3625
+ }
3734
3626
  function inlinedResponseFromMldev(fromObject) {
3735
3627
  const toObject = {};
3736
3628
  const fromResponse = getValueByPath(fromObject, ['response']);
@@ -3739,7 +3631,7 @@ function inlinedResponseFromMldev(fromObject) {
3739
3631
  }
3740
3632
  const fromError = getValueByPath(fromObject, ['error']);
3741
3633
  if (fromError != null) {
3742
- setValueByPath(toObject, ['error'], jobErrorFromMldev());
3634
+ setValueByPath(toObject, ['error'], jobErrorFromMldev(fromError));
3743
3635
  }
3744
3636
  return toObject;
3745
3637
  }
@@ -3844,7 +3736,7 @@ function deleteResourceJobFromMldev(fromObject) {
3844
3736
  }
3845
3737
  const fromError = getValueByPath(fromObject, ['error']);
3846
3738
  if (fromError != null) {
3847
- setValueByPath(toObject, ['error'], jobErrorFromMldev());
3739
+ setValueByPath(toObject, ['error'], jobErrorFromMldev(fromError));
3848
3740
  }
3849
3741
  return toObject;
3850
3742
  }
@@ -6377,7 +6269,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
6377
6269
  const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
6378
6270
  const USER_AGENT_HEADER = 'User-Agent';
6379
6271
  const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
6380
- const SDK_VERSION = '1.8.0'; // x-release-please-version
6272
+ const SDK_VERSION = '1.10.0'; // x-release-please-version
6381
6273
  const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
6382
6274
  const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
6383
6275
  const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';
@@ -6608,7 +6500,14 @@ class ApiClient {
6608
6500
  const abortController = new AbortController();
6609
6501
  const signal = abortController.signal;
6610
6502
  if (httpOptions.timeout && (httpOptions === null || httpOptions === void 0 ? void 0 : httpOptions.timeout) > 0) {
6611
- setTimeout(() => abortController.abort(), httpOptions.timeout);
6503
+ const timeoutHandle = setTimeout(() => abortController.abort(), httpOptions.timeout);
6504
+ if (timeoutHandle &&
6505
+ typeof timeoutHandle.unref ===
6506
+ 'function') {
6507
+ // call unref to prevent nodejs process from hanging, see
6508
+ // https://nodejs.org/api/timers.html#timeoutunref
6509
+ timeoutHandle.unref();
6510
+ }
6612
6511
  }
6613
6512
  if (abortSignal) {
6614
6513
  abortSignal.addEventListener('abort', () => {
@@ -6671,7 +6570,7 @@ class ApiClient {
6671
6570
  }
6672
6571
  break;
6673
6572
  }
6674
- const chunkString = decoder.decode(value);
6573
+ const chunkString = decoder.decode(value, { stream: true });
6675
6574
  // Parse and throw an error if the chunk contains an error.
6676
6575
  try {
6677
6576
  const chunkJson = JSON.parse(chunkString);
@@ -7300,8 +7199,14 @@ function listFilesResponseFromMldev(fromObject) {
7300
7199
  }
7301
7200
  return toObject;
7302
7201
  }
7303
- function createFileResponseFromMldev() {
7202
+ function createFileResponseFromMldev(fromObject) {
7304
7203
  const toObject = {};
7204
+ const fromSdkHttpResponse = getValueByPath(fromObject, [
7205
+ 'sdkHttpResponse',
7206
+ ]);
7207
+ if (fromSdkHttpResponse != null) {
7208
+ setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
7209
+ }
7305
7210
  return toObject;
7306
7211
  }
7307
7212
  function deleteFileResponseFromMldev() {
@@ -7474,8 +7379,8 @@ class Files extends BaseModule {
7474
7379
  .then((httpResponse) => {
7475
7380
  return httpResponse.json();
7476
7381
  });
7477
- return response.then(() => {
7478
- const resp = createFileResponseFromMldev();
7382
+ return response.then((apiResponse) => {
7383
+ const resp = createFileResponseFromMldev(apiResponse);
7479
7384
  const typedResp = new CreateFileResponse();
7480
7385
  Object.assign(typedResp, resp);
7481
7386
  return typedResp;
@@ -7593,14 +7498,6 @@ function prebuiltVoiceConfigToMldev$2(fromObject) {
7593
7498
  }
7594
7499
  return toObject;
7595
7500
  }
7596
- function prebuiltVoiceConfigToVertex$1(fromObject) {
7597
- const toObject = {};
7598
- const fromVoiceName = getValueByPath(fromObject, ['voiceName']);
7599
- if (fromVoiceName != null) {
7600
- setValueByPath(toObject, ['voiceName'], fromVoiceName);
7601
- }
7602
- return toObject;
7603
- }
7604
7501
  function voiceConfigToMldev$2(fromObject) {
7605
7502
  const toObject = {};
7606
7503
  const fromPrebuiltVoiceConfig = getValueByPath(fromObject, [
@@ -7611,16 +7508,6 @@ function voiceConfigToMldev$2(fromObject) {
7611
7508
  }
7612
7509
  return toObject;
7613
7510
  }
7614
- function voiceConfigToVertex$1(fromObject) {
7615
- const toObject = {};
7616
- const fromPrebuiltVoiceConfig = getValueByPath(fromObject, [
7617
- 'prebuiltVoiceConfig',
7618
- ]);
7619
- if (fromPrebuiltVoiceConfig != null) {
7620
- setValueByPath(toObject, ['prebuiltVoiceConfig'], prebuiltVoiceConfigToVertex$1(fromPrebuiltVoiceConfig));
7621
- }
7622
- return toObject;
7623
- }
7624
7511
  function speakerVoiceConfigToMldev$2(fromObject) {
7625
7512
  const toObject = {};
7626
7513
  const fromSpeaker = getValueByPath(fromObject, ['speaker']);
@@ -7667,21 +7554,6 @@ function speechConfigToMldev$2(fromObject) {
7667
7554
  }
7668
7555
  return toObject;
7669
7556
  }
7670
- function speechConfigToVertex$1(fromObject) {
7671
- const toObject = {};
7672
- const fromVoiceConfig = getValueByPath(fromObject, ['voiceConfig']);
7673
- if (fromVoiceConfig != null) {
7674
- setValueByPath(toObject, ['voiceConfig'], voiceConfigToVertex$1(fromVoiceConfig));
7675
- }
7676
- if (getValueByPath(fromObject, ['multiSpeakerVoiceConfig']) !== undefined) {
7677
- throw new Error('multiSpeakerVoiceConfig parameter is not supported in Vertex AI.');
7678
- }
7679
- const fromLanguageCode = getValueByPath(fromObject, ['languageCode']);
7680
- if (fromLanguageCode != null) {
7681
- setValueByPath(toObject, ['languageCode'], fromLanguageCode);
7682
- }
7683
- return toObject;
7684
- }
7685
7557
  function videoMetadataToMldev$2(fromObject) {
7686
7558
  const toObject = {};
7687
7559
  const fromFps = getValueByPath(fromObject, ['fps']);
@@ -7698,22 +7570,6 @@ function videoMetadataToMldev$2(fromObject) {
7698
7570
  }
7699
7571
  return toObject;
7700
7572
  }
7701
- function videoMetadataToVertex$1(fromObject) {
7702
- const toObject = {};
7703
- const fromFps = getValueByPath(fromObject, ['fps']);
7704
- if (fromFps != null) {
7705
- setValueByPath(toObject, ['fps'], fromFps);
7706
- }
7707
- const fromEndOffset = getValueByPath(fromObject, ['endOffset']);
7708
- if (fromEndOffset != null) {
7709
- setValueByPath(toObject, ['endOffset'], fromEndOffset);
7710
- }
7711
- const fromStartOffset = getValueByPath(fromObject, ['startOffset']);
7712
- if (fromStartOffset != null) {
7713
- setValueByPath(toObject, ['startOffset'], fromStartOffset);
7714
- }
7715
- return toObject;
7716
- }
7717
7573
  function blobToMldev$2(fromObject) {
7718
7574
  const toObject = {};
7719
7575
  if (getValueByPath(fromObject, ['displayName']) !== undefined) {
@@ -7729,22 +7585,6 @@ function blobToMldev$2(fromObject) {
7729
7585
  }
7730
7586
  return toObject;
7731
7587
  }
7732
- function blobToVertex$1(fromObject) {
7733
- const toObject = {};
7734
- const fromDisplayName = getValueByPath(fromObject, ['displayName']);
7735
- if (fromDisplayName != null) {
7736
- setValueByPath(toObject, ['displayName'], fromDisplayName);
7737
- }
7738
- const fromData = getValueByPath(fromObject, ['data']);
7739
- if (fromData != null) {
7740
- setValueByPath(toObject, ['data'], fromData);
7741
- }
7742
- const fromMimeType = getValueByPath(fromObject, ['mimeType']);
7743
- if (fromMimeType != null) {
7744
- setValueByPath(toObject, ['mimeType'], fromMimeType);
7745
- }
7746
- return toObject;
7747
- }
7748
7588
  function fileDataToMldev$2(fromObject) {
7749
7589
  const toObject = {};
7750
7590
  if (getValueByPath(fromObject, ['displayName']) !== undefined) {
@@ -7760,22 +7600,6 @@ function fileDataToMldev$2(fromObject) {
7760
7600
  }
7761
7601
  return toObject;
7762
7602
  }
7763
- function fileDataToVertex$1(fromObject) {
7764
- const toObject = {};
7765
- const fromDisplayName = getValueByPath(fromObject, ['displayName']);
7766
- if (fromDisplayName != null) {
7767
- setValueByPath(toObject, ['displayName'], fromDisplayName);
7768
- }
7769
- const fromFileUri = getValueByPath(fromObject, ['fileUri']);
7770
- if (fromFileUri != null) {
7771
- setValueByPath(toObject, ['fileUri'], fromFileUri);
7772
- }
7773
- const fromMimeType = getValueByPath(fromObject, ['mimeType']);
7774
- if (fromMimeType != null) {
7775
- setValueByPath(toObject, ['mimeType'], fromMimeType);
7776
- }
7777
- return toObject;
7778
- }
7779
7603
  function partToMldev$2(fromObject) {
7780
7604
  const toObject = {};
7781
7605
  const fromVideoMetadata = getValueByPath(fromObject, [
@@ -7830,60 +7654,6 @@ function partToMldev$2(fromObject) {
7830
7654
  }
7831
7655
  return toObject;
7832
7656
  }
7833
- function partToVertex$1(fromObject) {
7834
- const toObject = {};
7835
- const fromVideoMetadata = getValueByPath(fromObject, [
7836
- 'videoMetadata',
7837
- ]);
7838
- if (fromVideoMetadata != null) {
7839
- setValueByPath(toObject, ['videoMetadata'], videoMetadataToVertex$1(fromVideoMetadata));
7840
- }
7841
- const fromThought = getValueByPath(fromObject, ['thought']);
7842
- if (fromThought != null) {
7843
- setValueByPath(toObject, ['thought'], fromThought);
7844
- }
7845
- const fromInlineData = getValueByPath(fromObject, ['inlineData']);
7846
- if (fromInlineData != null) {
7847
- setValueByPath(toObject, ['inlineData'], blobToVertex$1(fromInlineData));
7848
- }
7849
- const fromFileData = getValueByPath(fromObject, ['fileData']);
7850
- if (fromFileData != null) {
7851
- setValueByPath(toObject, ['fileData'], fileDataToVertex$1(fromFileData));
7852
- }
7853
- const fromThoughtSignature = getValueByPath(fromObject, [
7854
- 'thoughtSignature',
7855
- ]);
7856
- if (fromThoughtSignature != null) {
7857
- setValueByPath(toObject, ['thoughtSignature'], fromThoughtSignature);
7858
- }
7859
- const fromCodeExecutionResult = getValueByPath(fromObject, [
7860
- 'codeExecutionResult',
7861
- ]);
7862
- if (fromCodeExecutionResult != null) {
7863
- setValueByPath(toObject, ['codeExecutionResult'], fromCodeExecutionResult);
7864
- }
7865
- const fromExecutableCode = getValueByPath(fromObject, [
7866
- 'executableCode',
7867
- ]);
7868
- if (fromExecutableCode != null) {
7869
- setValueByPath(toObject, ['executableCode'], fromExecutableCode);
7870
- }
7871
- const fromFunctionCall = getValueByPath(fromObject, ['functionCall']);
7872
- if (fromFunctionCall != null) {
7873
- setValueByPath(toObject, ['functionCall'], fromFunctionCall);
7874
- }
7875
- const fromFunctionResponse = getValueByPath(fromObject, [
7876
- 'functionResponse',
7877
- ]);
7878
- if (fromFunctionResponse != null) {
7879
- setValueByPath(toObject, ['functionResponse'], fromFunctionResponse);
7880
- }
7881
- const fromText = getValueByPath(fromObject, ['text']);
7882
- if (fromText != null) {
7883
- setValueByPath(toObject, ['text'], fromText);
7884
- }
7885
- return toObject;
7886
- }
7887
7657
  function contentToMldev$2(fromObject) {
7888
7658
  const toObject = {};
7889
7659
  const fromParts = getValueByPath(fromObject, ['parts']);
@@ -7902,24 +7672,6 @@ function contentToMldev$2(fromObject) {
7902
7672
  }
7903
7673
  return toObject;
7904
7674
  }
7905
- function contentToVertex$1(fromObject) {
7906
- const toObject = {};
7907
- const fromParts = getValueByPath(fromObject, ['parts']);
7908
- if (fromParts != null) {
7909
- let transformedList = fromParts;
7910
- if (Array.isArray(transformedList)) {
7911
- transformedList = transformedList.map((item) => {
7912
- return partToVertex$1(item);
7913
- });
7914
- }
7915
- setValueByPath(toObject, ['parts'], transformedList);
7916
- }
7917
- const fromRole = getValueByPath(fromObject, ['role']);
7918
- if (fromRole != null) {
7919
- setValueByPath(toObject, ['role'], fromRole);
7920
- }
7921
- return toObject;
7922
- }
7923
7675
  function functionDeclarationToMldev$2(fromObject) {
7924
7676
  const toObject = {};
7925
7677
  const fromBehavior = getValueByPath(fromObject, ['behavior']);
@@ -7956,41 +7708,6 @@ function functionDeclarationToMldev$2(fromObject) {
7956
7708
  }
7957
7709
  return toObject;
7958
7710
  }
7959
- function functionDeclarationToVertex$1(fromObject) {
7960
- const toObject = {};
7961
- if (getValueByPath(fromObject, ['behavior']) !== undefined) {
7962
- throw new Error('behavior parameter is not supported in Vertex AI.');
7963
- }
7964
- const fromDescription = getValueByPath(fromObject, ['description']);
7965
- if (fromDescription != null) {
7966
- setValueByPath(toObject, ['description'], fromDescription);
7967
- }
7968
- const fromName = getValueByPath(fromObject, ['name']);
7969
- if (fromName != null) {
7970
- setValueByPath(toObject, ['name'], fromName);
7971
- }
7972
- const fromParameters = getValueByPath(fromObject, ['parameters']);
7973
- if (fromParameters != null) {
7974
- setValueByPath(toObject, ['parameters'], fromParameters);
7975
- }
7976
- const fromParametersJsonSchema = getValueByPath(fromObject, [
7977
- 'parametersJsonSchema',
7978
- ]);
7979
- if (fromParametersJsonSchema != null) {
7980
- setValueByPath(toObject, ['parametersJsonSchema'], fromParametersJsonSchema);
7981
- }
7982
- const fromResponse = getValueByPath(fromObject, ['response']);
7983
- if (fromResponse != null) {
7984
- setValueByPath(toObject, ['response'], fromResponse);
7985
- }
7986
- const fromResponseJsonSchema = getValueByPath(fromObject, [
7987
- 'responseJsonSchema',
7988
- ]);
7989
- if (fromResponseJsonSchema != null) {
7990
- setValueByPath(toObject, ['responseJsonSchema'], fromResponseJsonSchema);
7991
- }
7992
- return toObject;
7993
- }
7994
7711
  function intervalToMldev$2(fromObject) {
7995
7712
  const toObject = {};
7996
7713
  const fromStartTime = getValueByPath(fromObject, ['startTime']);
@@ -8003,19 +7720,7 @@ function intervalToMldev$2(fromObject) {
8003
7720
  }
8004
7721
  return toObject;
8005
7722
  }
8006
- function intervalToVertex$1(fromObject) {
8007
- const toObject = {};
8008
- const fromStartTime = getValueByPath(fromObject, ['startTime']);
8009
- if (fromStartTime != null) {
8010
- setValueByPath(toObject, ['startTime'], fromStartTime);
8011
- }
8012
- const fromEndTime = getValueByPath(fromObject, ['endTime']);
8013
- if (fromEndTime != null) {
8014
- setValueByPath(toObject, ['endTime'], fromEndTime);
8015
- }
8016
- return toObject;
8017
- }
8018
- function googleSearchToMldev$2(fromObject) {
7723
+ function googleSearchToMldev$2(fromObject) {
8019
7724
  const toObject = {};
8020
7725
  const fromTimeRangeFilter = getValueByPath(fromObject, [
8021
7726
  'timeRangeFilter',
@@ -8025,16 +7730,6 @@ function googleSearchToMldev$2(fromObject) {
8025
7730
  }
8026
7731
  return toObject;
8027
7732
  }
8028
- function googleSearchToVertex$1(fromObject) {
8029
- const toObject = {};
8030
- const fromTimeRangeFilter = getValueByPath(fromObject, [
8031
- 'timeRangeFilter',
8032
- ]);
8033
- if (fromTimeRangeFilter != null) {
8034
- setValueByPath(toObject, ['timeRangeFilter'], intervalToVertex$1(fromTimeRangeFilter));
8035
- }
8036
- return toObject;
8037
- }
8038
7733
  function dynamicRetrievalConfigToMldev$2(fromObject) {
8039
7734
  const toObject = {};
8040
7735
  const fromMode = getValueByPath(fromObject, ['mode']);
@@ -8049,20 +7744,6 @@ function dynamicRetrievalConfigToMldev$2(fromObject) {
8049
7744
  }
8050
7745
  return toObject;
8051
7746
  }
8052
- function dynamicRetrievalConfigToVertex$1(fromObject) {
8053
- const toObject = {};
8054
- const fromMode = getValueByPath(fromObject, ['mode']);
8055
- if (fromMode != null) {
8056
- setValueByPath(toObject, ['mode'], fromMode);
8057
- }
8058
- const fromDynamicThreshold = getValueByPath(fromObject, [
8059
- 'dynamicThreshold',
8060
- ]);
8061
- if (fromDynamicThreshold != null) {
8062
- setValueByPath(toObject, ['dynamicThreshold'], fromDynamicThreshold);
8063
- }
8064
- return toObject;
8065
- }
8066
7747
  function googleSearchRetrievalToMldev$2(fromObject) {
8067
7748
  const toObject = {};
8068
7749
  const fromDynamicRetrievalConfig = getValueByPath(fromObject, [
@@ -8073,76 +7754,10 @@ function googleSearchRetrievalToMldev$2(fromObject) {
8073
7754
  }
8074
7755
  return toObject;
8075
7756
  }
8076
- function googleSearchRetrievalToVertex$1(fromObject) {
8077
- const toObject = {};
8078
- const fromDynamicRetrievalConfig = getValueByPath(fromObject, [
8079
- 'dynamicRetrievalConfig',
8080
- ]);
8081
- if (fromDynamicRetrievalConfig != null) {
8082
- setValueByPath(toObject, ['dynamicRetrievalConfig'], dynamicRetrievalConfigToVertex$1(fromDynamicRetrievalConfig));
8083
- }
8084
- return toObject;
8085
- }
8086
- function enterpriseWebSearchToVertex$1() {
8087
- const toObject = {};
8088
- return toObject;
8089
- }
8090
- function apiKeyConfigToVertex$1(fromObject) {
8091
- const toObject = {};
8092
- const fromApiKeyString = getValueByPath(fromObject, ['apiKeyString']);
8093
- if (fromApiKeyString != null) {
8094
- setValueByPath(toObject, ['apiKeyString'], fromApiKeyString);
8095
- }
8096
- return toObject;
8097
- }
8098
- function authConfigToVertex$1(fromObject) {
8099
- const toObject = {};
8100
- const fromApiKeyConfig = getValueByPath(fromObject, ['apiKeyConfig']);
8101
- if (fromApiKeyConfig != null) {
8102
- setValueByPath(toObject, ['apiKeyConfig'], apiKeyConfigToVertex$1(fromApiKeyConfig));
8103
- }
8104
- const fromAuthType = getValueByPath(fromObject, ['authType']);
8105
- if (fromAuthType != null) {
8106
- setValueByPath(toObject, ['authType'], fromAuthType);
8107
- }
8108
- const fromGoogleServiceAccountConfig = getValueByPath(fromObject, [
8109
- 'googleServiceAccountConfig',
8110
- ]);
8111
- if (fromGoogleServiceAccountConfig != null) {
8112
- setValueByPath(toObject, ['googleServiceAccountConfig'], fromGoogleServiceAccountConfig);
8113
- }
8114
- const fromHttpBasicAuthConfig = getValueByPath(fromObject, [
8115
- 'httpBasicAuthConfig',
8116
- ]);
8117
- if (fromHttpBasicAuthConfig != null) {
8118
- setValueByPath(toObject, ['httpBasicAuthConfig'], fromHttpBasicAuthConfig);
8119
- }
8120
- const fromOauthConfig = getValueByPath(fromObject, ['oauthConfig']);
8121
- if (fromOauthConfig != null) {
8122
- setValueByPath(toObject, ['oauthConfig'], fromOauthConfig);
8123
- }
8124
- const fromOidcConfig = getValueByPath(fromObject, ['oidcConfig']);
8125
- if (fromOidcConfig != null) {
8126
- setValueByPath(toObject, ['oidcConfig'], fromOidcConfig);
8127
- }
8128
- return toObject;
8129
- }
8130
- function googleMapsToVertex$1(fromObject) {
8131
- const toObject = {};
8132
- const fromAuthConfig = getValueByPath(fromObject, ['authConfig']);
8133
- if (fromAuthConfig != null) {
8134
- setValueByPath(toObject, ['authConfig'], authConfigToVertex$1(fromAuthConfig));
8135
- }
8136
- return toObject;
8137
- }
8138
7757
  function urlContextToMldev$2() {
8139
7758
  const toObject = {};
8140
7759
  return toObject;
8141
7760
  }
8142
- function urlContextToVertex$1() {
8143
- const toObject = {};
8144
- return toObject;
8145
- }
8146
7761
  function toolToMldev$2(fromObject) {
8147
7762
  const toObject = {};
8148
7763
  const fromFunctionDeclarations = getValueByPath(fromObject, [
@@ -8192,60 +7807,6 @@ function toolToMldev$2(fromObject) {
8192
7807
  }
8193
7808
  return toObject;
8194
7809
  }
8195
- function toolToVertex$1(fromObject) {
8196
- const toObject = {};
8197
- const fromFunctionDeclarations = getValueByPath(fromObject, [
8198
- 'functionDeclarations',
8199
- ]);
8200
- if (fromFunctionDeclarations != null) {
8201
- let transformedList = fromFunctionDeclarations;
8202
- if (Array.isArray(transformedList)) {
8203
- transformedList = transformedList.map((item) => {
8204
- return functionDeclarationToVertex$1(item);
8205
- });
8206
- }
8207
- setValueByPath(toObject, ['functionDeclarations'], transformedList);
8208
- }
8209
- const fromRetrieval = getValueByPath(fromObject, ['retrieval']);
8210
- if (fromRetrieval != null) {
8211
- setValueByPath(toObject, ['retrieval'], fromRetrieval);
8212
- }
8213
- const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
8214
- if (fromGoogleSearch != null) {
8215
- setValueByPath(toObject, ['googleSearch'], googleSearchToVertex$1(fromGoogleSearch));
8216
- }
8217
- const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
8218
- 'googleSearchRetrieval',
8219
- ]);
8220
- if (fromGoogleSearchRetrieval != null) {
8221
- setValueByPath(toObject, ['googleSearchRetrieval'], googleSearchRetrievalToVertex$1(fromGoogleSearchRetrieval));
8222
- }
8223
- const fromEnterpriseWebSearch = getValueByPath(fromObject, [
8224
- 'enterpriseWebSearch',
8225
- ]);
8226
- if (fromEnterpriseWebSearch != null) {
8227
- setValueByPath(toObject, ['enterpriseWebSearch'], enterpriseWebSearchToVertex$1());
8228
- }
8229
- const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
8230
- if (fromGoogleMaps != null) {
8231
- setValueByPath(toObject, ['googleMaps'], googleMapsToVertex$1(fromGoogleMaps));
8232
- }
8233
- const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
8234
- if (fromUrlContext != null) {
8235
- setValueByPath(toObject, ['urlContext'], urlContextToVertex$1());
8236
- }
8237
- const fromCodeExecution = getValueByPath(fromObject, [
8238
- 'codeExecution',
8239
- ]);
8240
- if (fromCodeExecution != null) {
8241
- setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
8242
- }
8243
- const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
8244
- if (fromComputerUse != null) {
8245
- setValueByPath(toObject, ['computerUse'], fromComputerUse);
8246
- }
8247
- return toObject;
8248
- }
8249
7810
  function sessionResumptionConfigToMldev$1(fromObject) {
8250
7811
  const toObject = {};
8251
7812
  const fromHandle = getValueByPath(fromObject, ['handle']);
@@ -8257,26 +7818,10 @@ function sessionResumptionConfigToMldev$1(fromObject) {
8257
7818
  }
8258
7819
  return toObject;
8259
7820
  }
8260
- function sessionResumptionConfigToVertex(fromObject) {
8261
- const toObject = {};
8262
- const fromHandle = getValueByPath(fromObject, ['handle']);
8263
- if (fromHandle != null) {
8264
- setValueByPath(toObject, ['handle'], fromHandle);
8265
- }
8266
- const fromTransparent = getValueByPath(fromObject, ['transparent']);
8267
- if (fromTransparent != null) {
8268
- setValueByPath(toObject, ['transparent'], fromTransparent);
8269
- }
8270
- return toObject;
8271
- }
8272
7821
  function audioTranscriptionConfigToMldev$1() {
8273
7822
  const toObject = {};
8274
7823
  return toObject;
8275
7824
  }
8276
- function audioTranscriptionConfigToVertex() {
8277
- const toObject = {};
8278
- return toObject;
8279
- }
8280
7825
  function automaticActivityDetectionToMldev$1(fromObject) {
8281
7826
  const toObject = {};
8282
7827
  const fromDisabled = getValueByPath(fromObject, ['disabled']);
@@ -8309,38 +7854,6 @@ function automaticActivityDetectionToMldev$1(fromObject) {
8309
7854
  }
8310
7855
  return toObject;
8311
7856
  }
8312
- function automaticActivityDetectionToVertex(fromObject) {
8313
- const toObject = {};
8314
- const fromDisabled = getValueByPath(fromObject, ['disabled']);
8315
- if (fromDisabled != null) {
8316
- setValueByPath(toObject, ['disabled'], fromDisabled);
8317
- }
8318
- const fromStartOfSpeechSensitivity = getValueByPath(fromObject, [
8319
- 'startOfSpeechSensitivity',
8320
- ]);
8321
- if (fromStartOfSpeechSensitivity != null) {
8322
- setValueByPath(toObject, ['startOfSpeechSensitivity'], fromStartOfSpeechSensitivity);
8323
- }
8324
- const fromEndOfSpeechSensitivity = getValueByPath(fromObject, [
8325
- 'endOfSpeechSensitivity',
8326
- ]);
8327
- if (fromEndOfSpeechSensitivity != null) {
8328
- setValueByPath(toObject, ['endOfSpeechSensitivity'], fromEndOfSpeechSensitivity);
8329
- }
8330
- const fromPrefixPaddingMs = getValueByPath(fromObject, [
8331
- 'prefixPaddingMs',
8332
- ]);
8333
- if (fromPrefixPaddingMs != null) {
8334
- setValueByPath(toObject, ['prefixPaddingMs'], fromPrefixPaddingMs);
8335
- }
8336
- const fromSilenceDurationMs = getValueByPath(fromObject, [
8337
- 'silenceDurationMs',
8338
- ]);
8339
- if (fromSilenceDurationMs != null) {
8340
- setValueByPath(toObject, ['silenceDurationMs'], fromSilenceDurationMs);
8341
- }
8342
- return toObject;
8343
- }
8344
7857
  function realtimeInputConfigToMldev$1(fromObject) {
8345
7858
  const toObject = {};
8346
7859
  const fromAutomaticActivityDetection = getValueByPath(fromObject, [
@@ -8361,26 +7874,6 @@ function realtimeInputConfigToMldev$1(fromObject) {
8361
7874
  }
8362
7875
  return toObject;
8363
7876
  }
8364
- function realtimeInputConfigToVertex(fromObject) {
8365
- const toObject = {};
8366
- const fromAutomaticActivityDetection = getValueByPath(fromObject, [
8367
- 'automaticActivityDetection',
8368
- ]);
8369
- if (fromAutomaticActivityDetection != null) {
8370
- setValueByPath(toObject, ['automaticActivityDetection'], automaticActivityDetectionToVertex(fromAutomaticActivityDetection));
8371
- }
8372
- const fromActivityHandling = getValueByPath(fromObject, [
8373
- 'activityHandling',
8374
- ]);
8375
- if (fromActivityHandling != null) {
8376
- setValueByPath(toObject, ['activityHandling'], fromActivityHandling);
8377
- }
8378
- const fromTurnCoverage = getValueByPath(fromObject, ['turnCoverage']);
8379
- if (fromTurnCoverage != null) {
8380
- setValueByPath(toObject, ['turnCoverage'], fromTurnCoverage);
8381
- }
8382
- return toObject;
8383
- }
8384
7877
  function slidingWindowToMldev$1(fromObject) {
8385
7878
  const toObject = {};
8386
7879
  const fromTargetTokens = getValueByPath(fromObject, ['targetTokens']);
@@ -8389,14 +7882,6 @@ function slidingWindowToMldev$1(fromObject) {
8389
7882
  }
8390
7883
  return toObject;
8391
7884
  }
8392
- function slidingWindowToVertex(fromObject) {
8393
- const toObject = {};
8394
- const fromTargetTokens = getValueByPath(fromObject, ['targetTokens']);
8395
- if (fromTargetTokens != null) {
8396
- setValueByPath(toObject, ['targetTokens'], fromTargetTokens);
8397
- }
8398
- return toObject;
8399
- }
8400
7885
  function contextWindowCompressionConfigToMldev$1(fromObject) {
8401
7886
  const toObject = {};
8402
7887
  const fromTriggerTokens = getValueByPath(fromObject, [
@@ -8413,22 +7898,6 @@ function contextWindowCompressionConfigToMldev$1(fromObject) {
8413
7898
  }
8414
7899
  return toObject;
8415
7900
  }
8416
- function contextWindowCompressionConfigToVertex(fromObject) {
8417
- const toObject = {};
8418
- const fromTriggerTokens = getValueByPath(fromObject, [
8419
- 'triggerTokens',
8420
- ]);
8421
- if (fromTriggerTokens != null) {
8422
- setValueByPath(toObject, ['triggerTokens'], fromTriggerTokens);
8423
- }
8424
- const fromSlidingWindow = getValueByPath(fromObject, [
8425
- 'slidingWindow',
8426
- ]);
8427
- if (fromSlidingWindow != null) {
8428
- setValueByPath(toObject, ['slidingWindow'], slidingWindowToVertex(fromSlidingWindow));
8429
- }
8430
- return toObject;
8431
- }
8432
7901
  function proactivityConfigToMldev$1(fromObject) {
8433
7902
  const toObject = {};
8434
7903
  const fromProactiveAudio = getValueByPath(fromObject, [
@@ -8439,20 +7908,10 @@ function proactivityConfigToMldev$1(fromObject) {
8439
7908
  }
8440
7909
  return toObject;
8441
7910
  }
8442
- function proactivityConfigToVertex(fromObject) {
7911
+ function liveConnectConfigToMldev$1(fromObject, parentObject) {
8443
7912
  const toObject = {};
8444
- const fromProactiveAudio = getValueByPath(fromObject, [
8445
- 'proactiveAudio',
8446
- ]);
8447
- if (fromProactiveAudio != null) {
8448
- setValueByPath(toObject, ['proactiveAudio'], fromProactiveAudio);
8449
- }
8450
- return toObject;
8451
- }
8452
- function liveConnectConfigToMldev$1(fromObject, parentObject) {
8453
- const toObject = {};
8454
- const fromGenerationConfig = getValueByPath(fromObject, [
8455
- 'generationConfig',
7913
+ const fromGenerationConfig = getValueByPath(fromObject, [
7914
+ 'generationConfig',
8456
7915
  ]);
8457
7916
  if (parentObject !== undefined && fromGenerationConfig != null) {
8458
7917
  setValueByPath(parentObject, ['setup', 'generationConfig'], fromGenerationConfig);
@@ -8553,110 +8012,6 @@ function liveConnectConfigToMldev$1(fromObject, parentObject) {
8553
8012
  }
8554
8013
  return toObject;
8555
8014
  }
8556
- function liveConnectConfigToVertex(fromObject, parentObject) {
8557
- const toObject = {};
8558
- const fromGenerationConfig = getValueByPath(fromObject, [
8559
- 'generationConfig',
8560
- ]);
8561
- if (parentObject !== undefined && fromGenerationConfig != null) {
8562
- setValueByPath(parentObject, ['setup', 'generationConfig'], fromGenerationConfig);
8563
- }
8564
- const fromResponseModalities = getValueByPath(fromObject, [
8565
- 'responseModalities',
8566
- ]);
8567
- if (parentObject !== undefined && fromResponseModalities != null) {
8568
- setValueByPath(parentObject, ['setup', 'generationConfig', 'responseModalities'], fromResponseModalities);
8569
- }
8570
- const fromTemperature = getValueByPath(fromObject, ['temperature']);
8571
- if (parentObject !== undefined && fromTemperature != null) {
8572
- setValueByPath(parentObject, ['setup', 'generationConfig', 'temperature'], fromTemperature);
8573
- }
8574
- const fromTopP = getValueByPath(fromObject, ['topP']);
8575
- if (parentObject !== undefined && fromTopP != null) {
8576
- setValueByPath(parentObject, ['setup', 'generationConfig', 'topP'], fromTopP);
8577
- }
8578
- const fromTopK = getValueByPath(fromObject, ['topK']);
8579
- if (parentObject !== undefined && fromTopK != null) {
8580
- setValueByPath(parentObject, ['setup', 'generationConfig', 'topK'], fromTopK);
8581
- }
8582
- const fromMaxOutputTokens = getValueByPath(fromObject, [
8583
- 'maxOutputTokens',
8584
- ]);
8585
- if (parentObject !== undefined && fromMaxOutputTokens != null) {
8586
- setValueByPath(parentObject, ['setup', 'generationConfig', 'maxOutputTokens'], fromMaxOutputTokens);
8587
- }
8588
- const fromMediaResolution = getValueByPath(fromObject, [
8589
- 'mediaResolution',
8590
- ]);
8591
- if (parentObject !== undefined && fromMediaResolution != null) {
8592
- setValueByPath(parentObject, ['setup', 'generationConfig', 'mediaResolution'], fromMediaResolution);
8593
- }
8594
- const fromSeed = getValueByPath(fromObject, ['seed']);
8595
- if (parentObject !== undefined && fromSeed != null) {
8596
- setValueByPath(parentObject, ['setup', 'generationConfig', 'seed'], fromSeed);
8597
- }
8598
- const fromSpeechConfig = getValueByPath(fromObject, ['speechConfig']);
8599
- if (parentObject !== undefined && fromSpeechConfig != null) {
8600
- setValueByPath(parentObject, ['setup', 'generationConfig', 'speechConfig'], speechConfigToVertex$1(tLiveSpeechConfig(fromSpeechConfig)));
8601
- }
8602
- const fromEnableAffectiveDialog = getValueByPath(fromObject, [
8603
- 'enableAffectiveDialog',
8604
- ]);
8605
- if (parentObject !== undefined && fromEnableAffectiveDialog != null) {
8606
- setValueByPath(parentObject, ['setup', 'generationConfig', 'enableAffectiveDialog'], fromEnableAffectiveDialog);
8607
- }
8608
- const fromSystemInstruction = getValueByPath(fromObject, [
8609
- 'systemInstruction',
8610
- ]);
8611
- if (parentObject !== undefined && fromSystemInstruction != null) {
8612
- setValueByPath(parentObject, ['setup', 'systemInstruction'], contentToVertex$1(tContent(fromSystemInstruction)));
8613
- }
8614
- const fromTools = getValueByPath(fromObject, ['tools']);
8615
- if (parentObject !== undefined && fromTools != null) {
8616
- let transformedList = tTools(fromTools);
8617
- if (Array.isArray(transformedList)) {
8618
- transformedList = transformedList.map((item) => {
8619
- return toolToVertex$1(tTool(item));
8620
- });
8621
- }
8622
- setValueByPath(parentObject, ['setup', 'tools'], transformedList);
8623
- }
8624
- const fromSessionResumption = getValueByPath(fromObject, [
8625
- 'sessionResumption',
8626
- ]);
8627
- if (parentObject !== undefined && fromSessionResumption != null) {
8628
- setValueByPath(parentObject, ['setup', 'sessionResumption'], sessionResumptionConfigToVertex(fromSessionResumption));
8629
- }
8630
- const fromInputAudioTranscription = getValueByPath(fromObject, [
8631
- 'inputAudioTranscription',
8632
- ]);
8633
- if (parentObject !== undefined && fromInputAudioTranscription != null) {
8634
- setValueByPath(parentObject, ['setup', 'inputAudioTranscription'], audioTranscriptionConfigToVertex());
8635
- }
8636
- const fromOutputAudioTranscription = getValueByPath(fromObject, [
8637
- 'outputAudioTranscription',
8638
- ]);
8639
- if (parentObject !== undefined && fromOutputAudioTranscription != null) {
8640
- setValueByPath(parentObject, ['setup', 'outputAudioTranscription'], audioTranscriptionConfigToVertex());
8641
- }
8642
- const fromRealtimeInputConfig = getValueByPath(fromObject, [
8643
- 'realtimeInputConfig',
8644
- ]);
8645
- if (parentObject !== undefined && fromRealtimeInputConfig != null) {
8646
- setValueByPath(parentObject, ['setup', 'realtimeInputConfig'], realtimeInputConfigToVertex(fromRealtimeInputConfig));
8647
- }
8648
- const fromContextWindowCompression = getValueByPath(fromObject, [
8649
- 'contextWindowCompression',
8650
- ]);
8651
- if (parentObject !== undefined && fromContextWindowCompression != null) {
8652
- setValueByPath(parentObject, ['setup', 'contextWindowCompression'], contextWindowCompressionConfigToVertex(fromContextWindowCompression));
8653
- }
8654
- const fromProactivity = getValueByPath(fromObject, ['proactivity']);
8655
- if (parentObject !== undefined && fromProactivity != null) {
8656
- setValueByPath(parentObject, ['setup', 'proactivity'], proactivityConfigToVertex(fromProactivity));
8657
- }
8658
- return toObject;
8659
- }
8660
8015
  function liveConnectParametersToMldev(apiClient, fromObject) {
8661
8016
  const toObject = {};
8662
8017
  const fromModel = getValueByPath(fromObject, ['model']);
@@ -8669,34 +8024,14 @@ function liveConnectParametersToMldev(apiClient, fromObject) {
8669
8024
  }
8670
8025
  return toObject;
8671
8026
  }
8672
- function liveConnectParametersToVertex(apiClient, fromObject) {
8673
- const toObject = {};
8674
- const fromModel = getValueByPath(fromObject, ['model']);
8675
- if (fromModel != null) {
8676
- setValueByPath(toObject, ['setup', 'model'], tModel(apiClient, fromModel));
8677
- }
8678
- const fromConfig = getValueByPath(fromObject, ['config']);
8679
- if (fromConfig != null) {
8680
- setValueByPath(toObject, ['config'], liveConnectConfigToVertex(fromConfig, toObject));
8681
- }
8682
- return toObject;
8683
- }
8684
8027
  function activityStartToMldev() {
8685
8028
  const toObject = {};
8686
8029
  return toObject;
8687
8030
  }
8688
- function activityStartToVertex() {
8689
- const toObject = {};
8690
- return toObject;
8691
- }
8692
8031
  function activityEndToMldev() {
8693
8032
  const toObject = {};
8694
8033
  return toObject;
8695
8034
  }
8696
- function activityEndToVertex() {
8697
- const toObject = {};
8698
- return toObject;
8699
- }
8700
8035
  function liveSendRealtimeInputParametersToMldev(fromObject) {
8701
8036
  const toObject = {};
8702
8037
  const fromMedia = getValueByPath(fromObject, ['media']);
@@ -8733,42 +8068,6 @@ function liveSendRealtimeInputParametersToMldev(fromObject) {
8733
8068
  }
8734
8069
  return toObject;
8735
8070
  }
8736
- function liveSendRealtimeInputParametersToVertex(fromObject) {
8737
- const toObject = {};
8738
- const fromMedia = getValueByPath(fromObject, ['media']);
8739
- if (fromMedia != null) {
8740
- setValueByPath(toObject, ['mediaChunks'], tBlobs(fromMedia));
8741
- }
8742
- const fromAudio = getValueByPath(fromObject, ['audio']);
8743
- if (fromAudio != null) {
8744
- setValueByPath(toObject, ['audio'], tAudioBlob(fromAudio));
8745
- }
8746
- const fromAudioStreamEnd = getValueByPath(fromObject, [
8747
- 'audioStreamEnd',
8748
- ]);
8749
- if (fromAudioStreamEnd != null) {
8750
- setValueByPath(toObject, ['audioStreamEnd'], fromAudioStreamEnd);
8751
- }
8752
- const fromVideo = getValueByPath(fromObject, ['video']);
8753
- if (fromVideo != null) {
8754
- setValueByPath(toObject, ['video'], tImageBlob(fromVideo));
8755
- }
8756
- const fromText = getValueByPath(fromObject, ['text']);
8757
- if (fromText != null) {
8758
- setValueByPath(toObject, ['text'], fromText);
8759
- }
8760
- const fromActivityStart = getValueByPath(fromObject, [
8761
- 'activityStart',
8762
- ]);
8763
- if (fromActivityStart != null) {
8764
- setValueByPath(toObject, ['activityStart'], activityStartToVertex());
8765
- }
8766
- const fromActivityEnd = getValueByPath(fromObject, ['activityEnd']);
8767
- if (fromActivityEnd != null) {
8768
- setValueByPath(toObject, ['activityEnd'], activityEndToVertex());
8769
- }
8770
- return toObject;
8771
- }
8772
8071
  function weightedPromptToMldev(fromObject) {
8773
8072
  const toObject = {};
8774
8073
  const fromText = getValueByPath(fromObject, ['text']);
@@ -8907,35 +8206,40 @@ function liveMusicClientMessageToMldev(fromObject) {
8907
8206
  }
8908
8207
  return toObject;
8909
8208
  }
8910
- function liveServerSetupCompleteFromMldev() {
8209
+ function prebuiltVoiceConfigToVertex$1(fromObject) {
8911
8210
  const toObject = {};
8211
+ const fromVoiceName = getValueByPath(fromObject, ['voiceName']);
8212
+ if (fromVoiceName != null) {
8213
+ setValueByPath(toObject, ['voiceName'], fromVoiceName);
8214
+ }
8912
8215
  return toObject;
8913
8216
  }
8914
- function liveServerSetupCompleteFromVertex(fromObject) {
8217
+ function voiceConfigToVertex$1(fromObject) {
8915
8218
  const toObject = {};
8916
- const fromSessionId = getValueByPath(fromObject, ['sessionId']);
8917
- if (fromSessionId != null) {
8918
- setValueByPath(toObject, ['sessionId'], fromSessionId);
8219
+ const fromPrebuiltVoiceConfig = getValueByPath(fromObject, [
8220
+ 'prebuiltVoiceConfig',
8221
+ ]);
8222
+ if (fromPrebuiltVoiceConfig != null) {
8223
+ setValueByPath(toObject, ['prebuiltVoiceConfig'], prebuiltVoiceConfigToVertex$1(fromPrebuiltVoiceConfig));
8919
8224
  }
8920
8225
  return toObject;
8921
8226
  }
8922
- function videoMetadataFromMldev$1(fromObject) {
8227
+ function speechConfigToVertex$1(fromObject) {
8923
8228
  const toObject = {};
8924
- const fromFps = getValueByPath(fromObject, ['fps']);
8925
- if (fromFps != null) {
8926
- setValueByPath(toObject, ['fps'], fromFps);
8229
+ const fromVoiceConfig = getValueByPath(fromObject, ['voiceConfig']);
8230
+ if (fromVoiceConfig != null) {
8231
+ setValueByPath(toObject, ['voiceConfig'], voiceConfigToVertex$1(fromVoiceConfig));
8927
8232
  }
8928
- const fromEndOffset = getValueByPath(fromObject, ['endOffset']);
8929
- if (fromEndOffset != null) {
8930
- setValueByPath(toObject, ['endOffset'], fromEndOffset);
8233
+ if (getValueByPath(fromObject, ['multiSpeakerVoiceConfig']) !== undefined) {
8234
+ throw new Error('multiSpeakerVoiceConfig parameter is not supported in Vertex AI.');
8931
8235
  }
8932
- const fromStartOffset = getValueByPath(fromObject, ['startOffset']);
8933
- if (fromStartOffset != null) {
8934
- setValueByPath(toObject, ['startOffset'], fromStartOffset);
8236
+ const fromLanguageCode = getValueByPath(fromObject, ['languageCode']);
8237
+ if (fromLanguageCode != null) {
8238
+ setValueByPath(toObject, ['languageCode'], fromLanguageCode);
8935
8239
  }
8936
8240
  return toObject;
8937
8241
  }
8938
- function videoMetadataFromVertex$1(fromObject) {
8242
+ function videoMetadataToVertex$1(fromObject) {
8939
8243
  const toObject = {};
8940
8244
  const fromFps = getValueByPath(fromObject, ['fps']);
8941
8245
  if (fromFps != null) {
@@ -8951,19 +8255,7 @@ function videoMetadataFromVertex$1(fromObject) {
8951
8255
  }
8952
8256
  return toObject;
8953
8257
  }
8954
- function blobFromMldev$1(fromObject) {
8955
- const toObject = {};
8956
- const fromData = getValueByPath(fromObject, ['data']);
8957
- if (fromData != null) {
8958
- setValueByPath(toObject, ['data'], fromData);
8959
- }
8960
- const fromMimeType = getValueByPath(fromObject, ['mimeType']);
8961
- if (fromMimeType != null) {
8962
- setValueByPath(toObject, ['mimeType'], fromMimeType);
8963
- }
8964
- return toObject;
8965
- }
8966
- function blobFromVertex$1(fromObject) {
8258
+ function blobToVertex$1(fromObject) {
8967
8259
  const toObject = {};
8968
8260
  const fromDisplayName = getValueByPath(fromObject, ['displayName']);
8969
8261
  if (fromDisplayName != null) {
@@ -8979,19 +8271,7 @@ function blobFromVertex$1(fromObject) {
8979
8271
  }
8980
8272
  return toObject;
8981
8273
  }
8982
- function fileDataFromMldev$1(fromObject) {
8983
- const toObject = {};
8984
- const fromFileUri = getValueByPath(fromObject, ['fileUri']);
8985
- if (fromFileUri != null) {
8986
- setValueByPath(toObject, ['fileUri'], fromFileUri);
8987
- }
8988
- const fromMimeType = getValueByPath(fromObject, ['mimeType']);
8989
- if (fromMimeType != null) {
8990
- setValueByPath(toObject, ['mimeType'], fromMimeType);
8991
- }
8992
- return toObject;
8993
- }
8994
- function fileDataFromVertex$1(fromObject) {
8274
+ function fileDataToVertex$1(fromObject) {
8995
8275
  const toObject = {};
8996
8276
  const fromDisplayName = getValueByPath(fromObject, ['displayName']);
8997
8277
  if (fromDisplayName != null) {
@@ -9007,13 +8287,13 @@ function fileDataFromVertex$1(fromObject) {
9007
8287
  }
9008
8288
  return toObject;
9009
8289
  }
9010
- function partFromMldev$1(fromObject) {
8290
+ function partToVertex$1(fromObject) {
9011
8291
  const toObject = {};
9012
8292
  const fromVideoMetadata = getValueByPath(fromObject, [
9013
8293
  'videoMetadata',
9014
8294
  ]);
9015
8295
  if (fromVideoMetadata != null) {
9016
- setValueByPath(toObject, ['videoMetadata'], videoMetadataFromMldev$1(fromVideoMetadata));
8296
+ setValueByPath(toObject, ['videoMetadata'], videoMetadataToVertex$1(fromVideoMetadata));
9017
8297
  }
9018
8298
  const fromThought = getValueByPath(fromObject, ['thought']);
9019
8299
  if (fromThought != null) {
@@ -9021,11 +8301,11 @@ function partFromMldev$1(fromObject) {
9021
8301
  }
9022
8302
  const fromInlineData = getValueByPath(fromObject, ['inlineData']);
9023
8303
  if (fromInlineData != null) {
9024
- setValueByPath(toObject, ['inlineData'], blobFromMldev$1(fromInlineData));
8304
+ setValueByPath(toObject, ['inlineData'], blobToVertex$1(fromInlineData));
9025
8305
  }
9026
8306
  const fromFileData = getValueByPath(fromObject, ['fileData']);
9027
8307
  if (fromFileData != null) {
9028
- setValueByPath(toObject, ['fileData'], fileDataFromMldev$1(fromFileData));
8308
+ setValueByPath(toObject, ['fileData'], fileDataToVertex$1(fromFileData));
9029
8309
  }
9030
8310
  const fromThoughtSignature = getValueByPath(fromObject, [
9031
8311
  'thoughtSignature',
@@ -9061,6 +8341,1109 @@ function partFromMldev$1(fromObject) {
9061
8341
  }
9062
8342
  return toObject;
9063
8343
  }
8344
+ function contentToVertex$1(fromObject) {
8345
+ const toObject = {};
8346
+ const fromParts = getValueByPath(fromObject, ['parts']);
8347
+ if (fromParts != null) {
8348
+ let transformedList = fromParts;
8349
+ if (Array.isArray(transformedList)) {
8350
+ transformedList = transformedList.map((item) => {
8351
+ return partToVertex$1(item);
8352
+ });
8353
+ }
8354
+ setValueByPath(toObject, ['parts'], transformedList);
8355
+ }
8356
+ const fromRole = getValueByPath(fromObject, ['role']);
8357
+ if (fromRole != null) {
8358
+ setValueByPath(toObject, ['role'], fromRole);
8359
+ }
8360
+ return toObject;
8361
+ }
8362
+ function functionDeclarationToVertex$1(fromObject) {
8363
+ const toObject = {};
8364
+ if (getValueByPath(fromObject, ['behavior']) !== undefined) {
8365
+ throw new Error('behavior parameter is not supported in Vertex AI.');
8366
+ }
8367
+ const fromDescription = getValueByPath(fromObject, ['description']);
8368
+ if (fromDescription != null) {
8369
+ setValueByPath(toObject, ['description'], fromDescription);
8370
+ }
8371
+ const fromName = getValueByPath(fromObject, ['name']);
8372
+ if (fromName != null) {
8373
+ setValueByPath(toObject, ['name'], fromName);
8374
+ }
8375
+ const fromParameters = getValueByPath(fromObject, ['parameters']);
8376
+ if (fromParameters != null) {
8377
+ setValueByPath(toObject, ['parameters'], fromParameters);
8378
+ }
8379
+ const fromParametersJsonSchema = getValueByPath(fromObject, [
8380
+ 'parametersJsonSchema',
8381
+ ]);
8382
+ if (fromParametersJsonSchema != null) {
8383
+ setValueByPath(toObject, ['parametersJsonSchema'], fromParametersJsonSchema);
8384
+ }
8385
+ const fromResponse = getValueByPath(fromObject, ['response']);
8386
+ if (fromResponse != null) {
8387
+ setValueByPath(toObject, ['response'], fromResponse);
8388
+ }
8389
+ const fromResponseJsonSchema = getValueByPath(fromObject, [
8390
+ 'responseJsonSchema',
8391
+ ]);
8392
+ if (fromResponseJsonSchema != null) {
8393
+ setValueByPath(toObject, ['responseJsonSchema'], fromResponseJsonSchema);
8394
+ }
8395
+ return toObject;
8396
+ }
8397
+ function intervalToVertex$1(fromObject) {
8398
+ const toObject = {};
8399
+ const fromStartTime = getValueByPath(fromObject, ['startTime']);
8400
+ if (fromStartTime != null) {
8401
+ setValueByPath(toObject, ['startTime'], fromStartTime);
8402
+ }
8403
+ const fromEndTime = getValueByPath(fromObject, ['endTime']);
8404
+ if (fromEndTime != null) {
8405
+ setValueByPath(toObject, ['endTime'], fromEndTime);
8406
+ }
8407
+ return toObject;
8408
+ }
8409
+ function googleSearchToVertex$1(fromObject) {
8410
+ const toObject = {};
8411
+ const fromTimeRangeFilter = getValueByPath(fromObject, [
8412
+ 'timeRangeFilter',
8413
+ ]);
8414
+ if (fromTimeRangeFilter != null) {
8415
+ setValueByPath(toObject, ['timeRangeFilter'], intervalToVertex$1(fromTimeRangeFilter));
8416
+ }
8417
+ return toObject;
8418
+ }
8419
+ function dynamicRetrievalConfigToVertex$1(fromObject) {
8420
+ const toObject = {};
8421
+ const fromMode = getValueByPath(fromObject, ['mode']);
8422
+ if (fromMode != null) {
8423
+ setValueByPath(toObject, ['mode'], fromMode);
8424
+ }
8425
+ const fromDynamicThreshold = getValueByPath(fromObject, [
8426
+ 'dynamicThreshold',
8427
+ ]);
8428
+ if (fromDynamicThreshold != null) {
8429
+ setValueByPath(toObject, ['dynamicThreshold'], fromDynamicThreshold);
8430
+ }
8431
+ return toObject;
8432
+ }
8433
+ function googleSearchRetrievalToVertex$1(fromObject) {
8434
+ const toObject = {};
8435
+ const fromDynamicRetrievalConfig = getValueByPath(fromObject, [
8436
+ 'dynamicRetrievalConfig',
8437
+ ]);
8438
+ if (fromDynamicRetrievalConfig != null) {
8439
+ setValueByPath(toObject, ['dynamicRetrievalConfig'], dynamicRetrievalConfigToVertex$1(fromDynamicRetrievalConfig));
8440
+ }
8441
+ return toObject;
8442
+ }
8443
+ function enterpriseWebSearchToVertex$1() {
8444
+ const toObject = {};
8445
+ return toObject;
8446
+ }
8447
+ function apiKeyConfigToVertex$1(fromObject) {
8448
+ const toObject = {};
8449
+ const fromApiKeyString = getValueByPath(fromObject, ['apiKeyString']);
8450
+ if (fromApiKeyString != null) {
8451
+ setValueByPath(toObject, ['apiKeyString'], fromApiKeyString);
8452
+ }
8453
+ return toObject;
8454
+ }
8455
+ function authConfigToVertex$1(fromObject) {
8456
+ const toObject = {};
8457
+ const fromApiKeyConfig = getValueByPath(fromObject, ['apiKeyConfig']);
8458
+ if (fromApiKeyConfig != null) {
8459
+ setValueByPath(toObject, ['apiKeyConfig'], apiKeyConfigToVertex$1(fromApiKeyConfig));
8460
+ }
8461
+ const fromAuthType = getValueByPath(fromObject, ['authType']);
8462
+ if (fromAuthType != null) {
8463
+ setValueByPath(toObject, ['authType'], fromAuthType);
8464
+ }
8465
+ const fromGoogleServiceAccountConfig = getValueByPath(fromObject, [
8466
+ 'googleServiceAccountConfig',
8467
+ ]);
8468
+ if (fromGoogleServiceAccountConfig != null) {
8469
+ setValueByPath(toObject, ['googleServiceAccountConfig'], fromGoogleServiceAccountConfig);
8470
+ }
8471
+ const fromHttpBasicAuthConfig = getValueByPath(fromObject, [
8472
+ 'httpBasicAuthConfig',
8473
+ ]);
8474
+ if (fromHttpBasicAuthConfig != null) {
8475
+ setValueByPath(toObject, ['httpBasicAuthConfig'], fromHttpBasicAuthConfig);
8476
+ }
8477
+ const fromOauthConfig = getValueByPath(fromObject, ['oauthConfig']);
8478
+ if (fromOauthConfig != null) {
8479
+ setValueByPath(toObject, ['oauthConfig'], fromOauthConfig);
8480
+ }
8481
+ const fromOidcConfig = getValueByPath(fromObject, ['oidcConfig']);
8482
+ if (fromOidcConfig != null) {
8483
+ setValueByPath(toObject, ['oidcConfig'], fromOidcConfig);
8484
+ }
8485
+ return toObject;
8486
+ }
8487
+ function googleMapsToVertex$1(fromObject) {
8488
+ const toObject = {};
8489
+ const fromAuthConfig = getValueByPath(fromObject, ['authConfig']);
8490
+ if (fromAuthConfig != null) {
8491
+ setValueByPath(toObject, ['authConfig'], authConfigToVertex$1(fromAuthConfig));
8492
+ }
8493
+ return toObject;
8494
+ }
8495
+ function urlContextToVertex$1() {
8496
+ const toObject = {};
8497
+ return toObject;
8498
+ }
8499
+ function toolToVertex$1(fromObject) {
8500
+ const toObject = {};
8501
+ const fromFunctionDeclarations = getValueByPath(fromObject, [
8502
+ 'functionDeclarations',
8503
+ ]);
8504
+ if (fromFunctionDeclarations != null) {
8505
+ let transformedList = fromFunctionDeclarations;
8506
+ if (Array.isArray(transformedList)) {
8507
+ transformedList = transformedList.map((item) => {
8508
+ return functionDeclarationToVertex$1(item);
8509
+ });
8510
+ }
8511
+ setValueByPath(toObject, ['functionDeclarations'], transformedList);
8512
+ }
8513
+ const fromRetrieval = getValueByPath(fromObject, ['retrieval']);
8514
+ if (fromRetrieval != null) {
8515
+ setValueByPath(toObject, ['retrieval'], fromRetrieval);
8516
+ }
8517
+ const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
8518
+ if (fromGoogleSearch != null) {
8519
+ setValueByPath(toObject, ['googleSearch'], googleSearchToVertex$1(fromGoogleSearch));
8520
+ }
8521
+ const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
8522
+ 'googleSearchRetrieval',
8523
+ ]);
8524
+ if (fromGoogleSearchRetrieval != null) {
8525
+ setValueByPath(toObject, ['googleSearchRetrieval'], googleSearchRetrievalToVertex$1(fromGoogleSearchRetrieval));
8526
+ }
8527
+ const fromEnterpriseWebSearch = getValueByPath(fromObject, [
8528
+ 'enterpriseWebSearch',
8529
+ ]);
8530
+ if (fromEnterpriseWebSearch != null) {
8531
+ setValueByPath(toObject, ['enterpriseWebSearch'], enterpriseWebSearchToVertex$1());
8532
+ }
8533
+ const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
8534
+ if (fromGoogleMaps != null) {
8535
+ setValueByPath(toObject, ['googleMaps'], googleMapsToVertex$1(fromGoogleMaps));
8536
+ }
8537
+ const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
8538
+ if (fromUrlContext != null) {
8539
+ setValueByPath(toObject, ['urlContext'], urlContextToVertex$1());
8540
+ }
8541
+ const fromCodeExecution = getValueByPath(fromObject, [
8542
+ 'codeExecution',
8543
+ ]);
8544
+ if (fromCodeExecution != null) {
8545
+ setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
8546
+ }
8547
+ const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
8548
+ if (fromComputerUse != null) {
8549
+ setValueByPath(toObject, ['computerUse'], fromComputerUse);
8550
+ }
8551
+ return toObject;
8552
+ }
8553
+ function sessionResumptionConfigToVertex(fromObject) {
8554
+ const toObject = {};
8555
+ const fromHandle = getValueByPath(fromObject, ['handle']);
8556
+ if (fromHandle != null) {
8557
+ setValueByPath(toObject, ['handle'], fromHandle);
8558
+ }
8559
+ const fromTransparent = getValueByPath(fromObject, ['transparent']);
8560
+ if (fromTransparent != null) {
8561
+ setValueByPath(toObject, ['transparent'], fromTransparent);
8562
+ }
8563
+ return toObject;
8564
+ }
8565
+ function audioTranscriptionConfigToVertex() {
8566
+ const toObject = {};
8567
+ return toObject;
8568
+ }
8569
+ function automaticActivityDetectionToVertex(fromObject) {
8570
+ const toObject = {};
8571
+ const fromDisabled = getValueByPath(fromObject, ['disabled']);
8572
+ if (fromDisabled != null) {
8573
+ setValueByPath(toObject, ['disabled'], fromDisabled);
8574
+ }
8575
+ const fromStartOfSpeechSensitivity = getValueByPath(fromObject, [
8576
+ 'startOfSpeechSensitivity',
8577
+ ]);
8578
+ if (fromStartOfSpeechSensitivity != null) {
8579
+ setValueByPath(toObject, ['startOfSpeechSensitivity'], fromStartOfSpeechSensitivity);
8580
+ }
8581
+ const fromEndOfSpeechSensitivity = getValueByPath(fromObject, [
8582
+ 'endOfSpeechSensitivity',
8583
+ ]);
8584
+ if (fromEndOfSpeechSensitivity != null) {
8585
+ setValueByPath(toObject, ['endOfSpeechSensitivity'], fromEndOfSpeechSensitivity);
8586
+ }
8587
+ const fromPrefixPaddingMs = getValueByPath(fromObject, [
8588
+ 'prefixPaddingMs',
8589
+ ]);
8590
+ if (fromPrefixPaddingMs != null) {
8591
+ setValueByPath(toObject, ['prefixPaddingMs'], fromPrefixPaddingMs);
8592
+ }
8593
+ const fromSilenceDurationMs = getValueByPath(fromObject, [
8594
+ 'silenceDurationMs',
8595
+ ]);
8596
+ if (fromSilenceDurationMs != null) {
8597
+ setValueByPath(toObject, ['silenceDurationMs'], fromSilenceDurationMs);
8598
+ }
8599
+ return toObject;
8600
+ }
8601
+ function realtimeInputConfigToVertex(fromObject) {
8602
+ const toObject = {};
8603
+ const fromAutomaticActivityDetection = getValueByPath(fromObject, [
8604
+ 'automaticActivityDetection',
8605
+ ]);
8606
+ if (fromAutomaticActivityDetection != null) {
8607
+ setValueByPath(toObject, ['automaticActivityDetection'], automaticActivityDetectionToVertex(fromAutomaticActivityDetection));
8608
+ }
8609
+ const fromActivityHandling = getValueByPath(fromObject, [
8610
+ 'activityHandling',
8611
+ ]);
8612
+ if (fromActivityHandling != null) {
8613
+ setValueByPath(toObject, ['activityHandling'], fromActivityHandling);
8614
+ }
8615
+ const fromTurnCoverage = getValueByPath(fromObject, ['turnCoverage']);
8616
+ if (fromTurnCoverage != null) {
8617
+ setValueByPath(toObject, ['turnCoverage'], fromTurnCoverage);
8618
+ }
8619
+ return toObject;
8620
+ }
8621
+ function slidingWindowToVertex(fromObject) {
8622
+ const toObject = {};
8623
+ const fromTargetTokens = getValueByPath(fromObject, ['targetTokens']);
8624
+ if (fromTargetTokens != null) {
8625
+ setValueByPath(toObject, ['targetTokens'], fromTargetTokens);
8626
+ }
8627
+ return toObject;
8628
+ }
8629
+ function contextWindowCompressionConfigToVertex(fromObject) {
8630
+ const toObject = {};
8631
+ const fromTriggerTokens = getValueByPath(fromObject, [
8632
+ 'triggerTokens',
8633
+ ]);
8634
+ if (fromTriggerTokens != null) {
8635
+ setValueByPath(toObject, ['triggerTokens'], fromTriggerTokens);
8636
+ }
8637
+ const fromSlidingWindow = getValueByPath(fromObject, [
8638
+ 'slidingWindow',
8639
+ ]);
8640
+ if (fromSlidingWindow != null) {
8641
+ setValueByPath(toObject, ['slidingWindow'], slidingWindowToVertex(fromSlidingWindow));
8642
+ }
8643
+ return toObject;
8644
+ }
8645
+ function proactivityConfigToVertex(fromObject) {
8646
+ const toObject = {};
8647
+ const fromProactiveAudio = getValueByPath(fromObject, [
8648
+ 'proactiveAudio',
8649
+ ]);
8650
+ if (fromProactiveAudio != null) {
8651
+ setValueByPath(toObject, ['proactiveAudio'], fromProactiveAudio);
8652
+ }
8653
+ return toObject;
8654
+ }
8655
+ function liveConnectConfigToVertex(fromObject, parentObject) {
8656
+ const toObject = {};
8657
+ const fromGenerationConfig = getValueByPath(fromObject, [
8658
+ 'generationConfig',
8659
+ ]);
8660
+ if (parentObject !== undefined && fromGenerationConfig != null) {
8661
+ setValueByPath(parentObject, ['setup', 'generationConfig'], fromGenerationConfig);
8662
+ }
8663
+ const fromResponseModalities = getValueByPath(fromObject, [
8664
+ 'responseModalities',
8665
+ ]);
8666
+ if (parentObject !== undefined && fromResponseModalities != null) {
8667
+ setValueByPath(parentObject, ['setup', 'generationConfig', 'responseModalities'], fromResponseModalities);
8668
+ }
8669
+ const fromTemperature = getValueByPath(fromObject, ['temperature']);
8670
+ if (parentObject !== undefined && fromTemperature != null) {
8671
+ setValueByPath(parentObject, ['setup', 'generationConfig', 'temperature'], fromTemperature);
8672
+ }
8673
+ const fromTopP = getValueByPath(fromObject, ['topP']);
8674
+ if (parentObject !== undefined && fromTopP != null) {
8675
+ setValueByPath(parentObject, ['setup', 'generationConfig', 'topP'], fromTopP);
8676
+ }
8677
+ const fromTopK = getValueByPath(fromObject, ['topK']);
8678
+ if (parentObject !== undefined && fromTopK != null) {
8679
+ setValueByPath(parentObject, ['setup', 'generationConfig', 'topK'], fromTopK);
8680
+ }
8681
+ const fromMaxOutputTokens = getValueByPath(fromObject, [
8682
+ 'maxOutputTokens',
8683
+ ]);
8684
+ if (parentObject !== undefined && fromMaxOutputTokens != null) {
8685
+ setValueByPath(parentObject, ['setup', 'generationConfig', 'maxOutputTokens'], fromMaxOutputTokens);
8686
+ }
8687
+ const fromMediaResolution = getValueByPath(fromObject, [
8688
+ 'mediaResolution',
8689
+ ]);
8690
+ if (parentObject !== undefined && fromMediaResolution != null) {
8691
+ setValueByPath(parentObject, ['setup', 'generationConfig', 'mediaResolution'], fromMediaResolution);
8692
+ }
8693
+ const fromSeed = getValueByPath(fromObject, ['seed']);
8694
+ if (parentObject !== undefined && fromSeed != null) {
8695
+ setValueByPath(parentObject, ['setup', 'generationConfig', 'seed'], fromSeed);
8696
+ }
8697
+ const fromSpeechConfig = getValueByPath(fromObject, ['speechConfig']);
8698
+ if (parentObject !== undefined && fromSpeechConfig != null) {
8699
+ setValueByPath(parentObject, ['setup', 'generationConfig', 'speechConfig'], speechConfigToVertex$1(tLiveSpeechConfig(fromSpeechConfig)));
8700
+ }
8701
+ const fromEnableAffectiveDialog = getValueByPath(fromObject, [
8702
+ 'enableAffectiveDialog',
8703
+ ]);
8704
+ if (parentObject !== undefined && fromEnableAffectiveDialog != null) {
8705
+ setValueByPath(parentObject, ['setup', 'generationConfig', 'enableAffectiveDialog'], fromEnableAffectiveDialog);
8706
+ }
8707
+ const fromSystemInstruction = getValueByPath(fromObject, [
8708
+ 'systemInstruction',
8709
+ ]);
8710
+ if (parentObject !== undefined && fromSystemInstruction != null) {
8711
+ setValueByPath(parentObject, ['setup', 'systemInstruction'], contentToVertex$1(tContent(fromSystemInstruction)));
8712
+ }
8713
+ const fromTools = getValueByPath(fromObject, ['tools']);
8714
+ if (parentObject !== undefined && fromTools != null) {
8715
+ let transformedList = tTools(fromTools);
8716
+ if (Array.isArray(transformedList)) {
8717
+ transformedList = transformedList.map((item) => {
8718
+ return toolToVertex$1(tTool(item));
8719
+ });
8720
+ }
8721
+ setValueByPath(parentObject, ['setup', 'tools'], transformedList);
8722
+ }
8723
+ const fromSessionResumption = getValueByPath(fromObject, [
8724
+ 'sessionResumption',
8725
+ ]);
8726
+ if (parentObject !== undefined && fromSessionResumption != null) {
8727
+ setValueByPath(parentObject, ['setup', 'sessionResumption'], sessionResumptionConfigToVertex(fromSessionResumption));
8728
+ }
8729
+ const fromInputAudioTranscription = getValueByPath(fromObject, [
8730
+ 'inputAudioTranscription',
8731
+ ]);
8732
+ if (parentObject !== undefined && fromInputAudioTranscription != null) {
8733
+ setValueByPath(parentObject, ['setup', 'inputAudioTranscription'], audioTranscriptionConfigToVertex());
8734
+ }
8735
+ const fromOutputAudioTranscription = getValueByPath(fromObject, [
8736
+ 'outputAudioTranscription',
8737
+ ]);
8738
+ if (parentObject !== undefined && fromOutputAudioTranscription != null) {
8739
+ setValueByPath(parentObject, ['setup', 'outputAudioTranscription'], audioTranscriptionConfigToVertex());
8740
+ }
8741
+ const fromRealtimeInputConfig = getValueByPath(fromObject, [
8742
+ 'realtimeInputConfig',
8743
+ ]);
8744
+ if (parentObject !== undefined && fromRealtimeInputConfig != null) {
8745
+ setValueByPath(parentObject, ['setup', 'realtimeInputConfig'], realtimeInputConfigToVertex(fromRealtimeInputConfig));
8746
+ }
8747
+ const fromContextWindowCompression = getValueByPath(fromObject, [
8748
+ 'contextWindowCompression',
8749
+ ]);
8750
+ if (parentObject !== undefined && fromContextWindowCompression != null) {
8751
+ setValueByPath(parentObject, ['setup', 'contextWindowCompression'], contextWindowCompressionConfigToVertex(fromContextWindowCompression));
8752
+ }
8753
+ const fromProactivity = getValueByPath(fromObject, ['proactivity']);
8754
+ if (parentObject !== undefined && fromProactivity != null) {
8755
+ setValueByPath(parentObject, ['setup', 'proactivity'], proactivityConfigToVertex(fromProactivity));
8756
+ }
8757
+ return toObject;
8758
+ }
8759
+ function liveConnectParametersToVertex(apiClient, fromObject) {
8760
+ const toObject = {};
8761
+ const fromModel = getValueByPath(fromObject, ['model']);
8762
+ if (fromModel != null) {
8763
+ setValueByPath(toObject, ['setup', 'model'], tModel(apiClient, fromModel));
8764
+ }
8765
+ const fromConfig = getValueByPath(fromObject, ['config']);
8766
+ if (fromConfig != null) {
8767
+ setValueByPath(toObject, ['config'], liveConnectConfigToVertex(fromConfig, toObject));
8768
+ }
8769
+ return toObject;
8770
+ }
8771
+ function activityStartToVertex() {
8772
+ const toObject = {};
8773
+ return toObject;
8774
+ }
8775
+ function activityEndToVertex() {
8776
+ const toObject = {};
8777
+ return toObject;
8778
+ }
8779
+ function liveSendRealtimeInputParametersToVertex(fromObject) {
8780
+ const toObject = {};
8781
+ const fromMedia = getValueByPath(fromObject, ['media']);
8782
+ if (fromMedia != null) {
8783
+ setValueByPath(toObject, ['mediaChunks'], tBlobs(fromMedia));
8784
+ }
8785
+ const fromAudio = getValueByPath(fromObject, ['audio']);
8786
+ if (fromAudio != null) {
8787
+ setValueByPath(toObject, ['audio'], tAudioBlob(fromAudio));
8788
+ }
8789
+ const fromAudioStreamEnd = getValueByPath(fromObject, [
8790
+ 'audioStreamEnd',
8791
+ ]);
8792
+ if (fromAudioStreamEnd != null) {
8793
+ setValueByPath(toObject, ['audioStreamEnd'], fromAudioStreamEnd);
8794
+ }
8795
+ const fromVideo = getValueByPath(fromObject, ['video']);
8796
+ if (fromVideo != null) {
8797
+ setValueByPath(toObject, ['video'], tImageBlob(fromVideo));
8798
+ }
8799
+ const fromText = getValueByPath(fromObject, ['text']);
8800
+ if (fromText != null) {
8801
+ setValueByPath(toObject, ['text'], fromText);
8802
+ }
8803
+ const fromActivityStart = getValueByPath(fromObject, [
8804
+ 'activityStart',
8805
+ ]);
8806
+ if (fromActivityStart != null) {
8807
+ setValueByPath(toObject, ['activityStart'], activityStartToVertex());
8808
+ }
8809
+ const fromActivityEnd = getValueByPath(fromObject, ['activityEnd']);
8810
+ if (fromActivityEnd != null) {
8811
+ setValueByPath(toObject, ['activityEnd'], activityEndToVertex());
8812
+ }
8813
+ return toObject;
8814
+ }
8815
+ function liveServerSetupCompleteFromMldev() {
8816
+ const toObject = {};
8817
+ return toObject;
8818
+ }
8819
+ function videoMetadataFromMldev$1(fromObject) {
8820
+ const toObject = {};
8821
+ const fromFps = getValueByPath(fromObject, ['fps']);
8822
+ if (fromFps != null) {
8823
+ setValueByPath(toObject, ['fps'], fromFps);
8824
+ }
8825
+ const fromEndOffset = getValueByPath(fromObject, ['endOffset']);
8826
+ if (fromEndOffset != null) {
8827
+ setValueByPath(toObject, ['endOffset'], fromEndOffset);
8828
+ }
8829
+ const fromStartOffset = getValueByPath(fromObject, ['startOffset']);
8830
+ if (fromStartOffset != null) {
8831
+ setValueByPath(toObject, ['startOffset'], fromStartOffset);
8832
+ }
8833
+ return toObject;
8834
+ }
8835
+ function blobFromMldev$1(fromObject) {
8836
+ const toObject = {};
8837
+ const fromData = getValueByPath(fromObject, ['data']);
8838
+ if (fromData != null) {
8839
+ setValueByPath(toObject, ['data'], fromData);
8840
+ }
8841
+ const fromMimeType = getValueByPath(fromObject, ['mimeType']);
8842
+ if (fromMimeType != null) {
8843
+ setValueByPath(toObject, ['mimeType'], fromMimeType);
8844
+ }
8845
+ return toObject;
8846
+ }
8847
+ function fileDataFromMldev$1(fromObject) {
8848
+ const toObject = {};
8849
+ const fromFileUri = getValueByPath(fromObject, ['fileUri']);
8850
+ if (fromFileUri != null) {
8851
+ setValueByPath(toObject, ['fileUri'], fromFileUri);
8852
+ }
8853
+ const fromMimeType = getValueByPath(fromObject, ['mimeType']);
8854
+ if (fromMimeType != null) {
8855
+ setValueByPath(toObject, ['mimeType'], fromMimeType);
8856
+ }
8857
+ return toObject;
8858
+ }
8859
+ function partFromMldev$1(fromObject) {
8860
+ const toObject = {};
8861
+ const fromVideoMetadata = getValueByPath(fromObject, [
8862
+ 'videoMetadata',
8863
+ ]);
8864
+ if (fromVideoMetadata != null) {
8865
+ setValueByPath(toObject, ['videoMetadata'], videoMetadataFromMldev$1(fromVideoMetadata));
8866
+ }
8867
+ const fromThought = getValueByPath(fromObject, ['thought']);
8868
+ if (fromThought != null) {
8869
+ setValueByPath(toObject, ['thought'], fromThought);
8870
+ }
8871
+ const fromInlineData = getValueByPath(fromObject, ['inlineData']);
8872
+ if (fromInlineData != null) {
8873
+ setValueByPath(toObject, ['inlineData'], blobFromMldev$1(fromInlineData));
8874
+ }
8875
+ const fromFileData = getValueByPath(fromObject, ['fileData']);
8876
+ if (fromFileData != null) {
8877
+ setValueByPath(toObject, ['fileData'], fileDataFromMldev$1(fromFileData));
8878
+ }
8879
+ const fromThoughtSignature = getValueByPath(fromObject, [
8880
+ 'thoughtSignature',
8881
+ ]);
8882
+ if (fromThoughtSignature != null) {
8883
+ setValueByPath(toObject, ['thoughtSignature'], fromThoughtSignature);
8884
+ }
8885
+ const fromCodeExecutionResult = getValueByPath(fromObject, [
8886
+ 'codeExecutionResult',
8887
+ ]);
8888
+ if (fromCodeExecutionResult != null) {
8889
+ setValueByPath(toObject, ['codeExecutionResult'], fromCodeExecutionResult);
8890
+ }
8891
+ const fromExecutableCode = getValueByPath(fromObject, [
8892
+ 'executableCode',
8893
+ ]);
8894
+ if (fromExecutableCode != null) {
8895
+ setValueByPath(toObject, ['executableCode'], fromExecutableCode);
8896
+ }
8897
+ const fromFunctionCall = getValueByPath(fromObject, ['functionCall']);
8898
+ if (fromFunctionCall != null) {
8899
+ setValueByPath(toObject, ['functionCall'], fromFunctionCall);
8900
+ }
8901
+ const fromFunctionResponse = getValueByPath(fromObject, [
8902
+ 'functionResponse',
8903
+ ]);
8904
+ if (fromFunctionResponse != null) {
8905
+ setValueByPath(toObject, ['functionResponse'], fromFunctionResponse);
8906
+ }
8907
+ const fromText = getValueByPath(fromObject, ['text']);
8908
+ if (fromText != null) {
8909
+ setValueByPath(toObject, ['text'], fromText);
8910
+ }
8911
+ return toObject;
8912
+ }
8913
+ function contentFromMldev$1(fromObject) {
8914
+ const toObject = {};
8915
+ const fromParts = getValueByPath(fromObject, ['parts']);
8916
+ if (fromParts != null) {
8917
+ let transformedList = fromParts;
8918
+ if (Array.isArray(transformedList)) {
8919
+ transformedList = transformedList.map((item) => {
8920
+ return partFromMldev$1(item);
8921
+ });
8922
+ }
8923
+ setValueByPath(toObject, ['parts'], transformedList);
8924
+ }
8925
+ const fromRole = getValueByPath(fromObject, ['role']);
8926
+ if (fromRole != null) {
8927
+ setValueByPath(toObject, ['role'], fromRole);
8928
+ }
8929
+ return toObject;
8930
+ }
8931
+ function transcriptionFromMldev(fromObject) {
8932
+ const toObject = {};
8933
+ const fromText = getValueByPath(fromObject, ['text']);
8934
+ if (fromText != null) {
8935
+ setValueByPath(toObject, ['text'], fromText);
8936
+ }
8937
+ const fromFinished = getValueByPath(fromObject, ['finished']);
8938
+ if (fromFinished != null) {
8939
+ setValueByPath(toObject, ['finished'], fromFinished);
8940
+ }
8941
+ return toObject;
8942
+ }
8943
+ function urlMetadataFromMldev$1(fromObject) {
8944
+ const toObject = {};
8945
+ const fromRetrievedUrl = getValueByPath(fromObject, ['retrievedUrl']);
8946
+ if (fromRetrievedUrl != null) {
8947
+ setValueByPath(toObject, ['retrievedUrl'], fromRetrievedUrl);
8948
+ }
8949
+ const fromUrlRetrievalStatus = getValueByPath(fromObject, [
8950
+ 'urlRetrievalStatus',
8951
+ ]);
8952
+ if (fromUrlRetrievalStatus != null) {
8953
+ setValueByPath(toObject, ['urlRetrievalStatus'], fromUrlRetrievalStatus);
8954
+ }
8955
+ return toObject;
8956
+ }
8957
+ function urlContextMetadataFromMldev$1(fromObject) {
8958
+ const toObject = {};
8959
+ const fromUrlMetadata = getValueByPath(fromObject, ['urlMetadata']);
8960
+ if (fromUrlMetadata != null) {
8961
+ let transformedList = fromUrlMetadata;
8962
+ if (Array.isArray(transformedList)) {
8963
+ transformedList = transformedList.map((item) => {
8964
+ return urlMetadataFromMldev$1(item);
8965
+ });
8966
+ }
8967
+ setValueByPath(toObject, ['urlMetadata'], transformedList);
8968
+ }
8969
+ return toObject;
8970
+ }
8971
+ function liveServerContentFromMldev(fromObject) {
8972
+ const toObject = {};
8973
+ const fromModelTurn = getValueByPath(fromObject, ['modelTurn']);
8974
+ if (fromModelTurn != null) {
8975
+ setValueByPath(toObject, ['modelTurn'], contentFromMldev$1(fromModelTurn));
8976
+ }
8977
+ const fromTurnComplete = getValueByPath(fromObject, ['turnComplete']);
8978
+ if (fromTurnComplete != null) {
8979
+ setValueByPath(toObject, ['turnComplete'], fromTurnComplete);
8980
+ }
8981
+ const fromInterrupted = getValueByPath(fromObject, ['interrupted']);
8982
+ if (fromInterrupted != null) {
8983
+ setValueByPath(toObject, ['interrupted'], fromInterrupted);
8984
+ }
8985
+ const fromGroundingMetadata = getValueByPath(fromObject, [
8986
+ 'groundingMetadata',
8987
+ ]);
8988
+ if (fromGroundingMetadata != null) {
8989
+ setValueByPath(toObject, ['groundingMetadata'], fromGroundingMetadata);
8990
+ }
8991
+ const fromGenerationComplete = getValueByPath(fromObject, [
8992
+ 'generationComplete',
8993
+ ]);
8994
+ if (fromGenerationComplete != null) {
8995
+ setValueByPath(toObject, ['generationComplete'], fromGenerationComplete);
8996
+ }
8997
+ const fromInputTranscription = getValueByPath(fromObject, [
8998
+ 'inputTranscription',
8999
+ ]);
9000
+ if (fromInputTranscription != null) {
9001
+ setValueByPath(toObject, ['inputTranscription'], transcriptionFromMldev(fromInputTranscription));
9002
+ }
9003
+ const fromOutputTranscription = getValueByPath(fromObject, [
9004
+ 'outputTranscription',
9005
+ ]);
9006
+ if (fromOutputTranscription != null) {
9007
+ setValueByPath(toObject, ['outputTranscription'], transcriptionFromMldev(fromOutputTranscription));
9008
+ }
9009
+ const fromUrlContextMetadata = getValueByPath(fromObject, [
9010
+ 'urlContextMetadata',
9011
+ ]);
9012
+ if (fromUrlContextMetadata != null) {
9013
+ setValueByPath(toObject, ['urlContextMetadata'], urlContextMetadataFromMldev$1(fromUrlContextMetadata));
9014
+ }
9015
+ return toObject;
9016
+ }
9017
+ function functionCallFromMldev(fromObject) {
9018
+ const toObject = {};
9019
+ const fromId = getValueByPath(fromObject, ['id']);
9020
+ if (fromId != null) {
9021
+ setValueByPath(toObject, ['id'], fromId);
9022
+ }
9023
+ const fromArgs = getValueByPath(fromObject, ['args']);
9024
+ if (fromArgs != null) {
9025
+ setValueByPath(toObject, ['args'], fromArgs);
9026
+ }
9027
+ const fromName = getValueByPath(fromObject, ['name']);
9028
+ if (fromName != null) {
9029
+ setValueByPath(toObject, ['name'], fromName);
9030
+ }
9031
+ return toObject;
9032
+ }
9033
+ function liveServerToolCallFromMldev(fromObject) {
9034
+ const toObject = {};
9035
+ const fromFunctionCalls = getValueByPath(fromObject, [
9036
+ 'functionCalls',
9037
+ ]);
9038
+ if (fromFunctionCalls != null) {
9039
+ let transformedList = fromFunctionCalls;
9040
+ if (Array.isArray(transformedList)) {
9041
+ transformedList = transformedList.map((item) => {
9042
+ return functionCallFromMldev(item);
9043
+ });
9044
+ }
9045
+ setValueByPath(toObject, ['functionCalls'], transformedList);
9046
+ }
9047
+ return toObject;
9048
+ }
9049
+ function liveServerToolCallCancellationFromMldev(fromObject) {
9050
+ const toObject = {};
9051
+ const fromIds = getValueByPath(fromObject, ['ids']);
9052
+ if (fromIds != null) {
9053
+ setValueByPath(toObject, ['ids'], fromIds);
9054
+ }
9055
+ return toObject;
9056
+ }
9057
+ function modalityTokenCountFromMldev(fromObject) {
9058
+ const toObject = {};
9059
+ const fromModality = getValueByPath(fromObject, ['modality']);
9060
+ if (fromModality != null) {
9061
+ setValueByPath(toObject, ['modality'], fromModality);
9062
+ }
9063
+ const fromTokenCount = getValueByPath(fromObject, ['tokenCount']);
9064
+ if (fromTokenCount != null) {
9065
+ setValueByPath(toObject, ['tokenCount'], fromTokenCount);
9066
+ }
9067
+ return toObject;
9068
+ }
9069
+ function usageMetadataFromMldev(fromObject) {
9070
+ const toObject = {};
9071
+ const fromPromptTokenCount = getValueByPath(fromObject, [
9072
+ 'promptTokenCount',
9073
+ ]);
9074
+ if (fromPromptTokenCount != null) {
9075
+ setValueByPath(toObject, ['promptTokenCount'], fromPromptTokenCount);
9076
+ }
9077
+ const fromCachedContentTokenCount = getValueByPath(fromObject, [
9078
+ 'cachedContentTokenCount',
9079
+ ]);
9080
+ if (fromCachedContentTokenCount != null) {
9081
+ setValueByPath(toObject, ['cachedContentTokenCount'], fromCachedContentTokenCount);
9082
+ }
9083
+ const fromResponseTokenCount = getValueByPath(fromObject, [
9084
+ 'responseTokenCount',
9085
+ ]);
9086
+ if (fromResponseTokenCount != null) {
9087
+ setValueByPath(toObject, ['responseTokenCount'], fromResponseTokenCount);
9088
+ }
9089
+ const fromToolUsePromptTokenCount = getValueByPath(fromObject, [
9090
+ 'toolUsePromptTokenCount',
9091
+ ]);
9092
+ if (fromToolUsePromptTokenCount != null) {
9093
+ setValueByPath(toObject, ['toolUsePromptTokenCount'], fromToolUsePromptTokenCount);
9094
+ }
9095
+ const fromThoughtsTokenCount = getValueByPath(fromObject, [
9096
+ 'thoughtsTokenCount',
9097
+ ]);
9098
+ if (fromThoughtsTokenCount != null) {
9099
+ setValueByPath(toObject, ['thoughtsTokenCount'], fromThoughtsTokenCount);
9100
+ }
9101
+ const fromTotalTokenCount = getValueByPath(fromObject, [
9102
+ 'totalTokenCount',
9103
+ ]);
9104
+ if (fromTotalTokenCount != null) {
9105
+ setValueByPath(toObject, ['totalTokenCount'], fromTotalTokenCount);
9106
+ }
9107
+ const fromPromptTokensDetails = getValueByPath(fromObject, [
9108
+ 'promptTokensDetails',
9109
+ ]);
9110
+ if (fromPromptTokensDetails != null) {
9111
+ let transformedList = fromPromptTokensDetails;
9112
+ if (Array.isArray(transformedList)) {
9113
+ transformedList = transformedList.map((item) => {
9114
+ return modalityTokenCountFromMldev(item);
9115
+ });
9116
+ }
9117
+ setValueByPath(toObject, ['promptTokensDetails'], transformedList);
9118
+ }
9119
+ const fromCacheTokensDetails = getValueByPath(fromObject, [
9120
+ 'cacheTokensDetails',
9121
+ ]);
9122
+ if (fromCacheTokensDetails != null) {
9123
+ let transformedList = fromCacheTokensDetails;
9124
+ if (Array.isArray(transformedList)) {
9125
+ transformedList = transformedList.map((item) => {
9126
+ return modalityTokenCountFromMldev(item);
9127
+ });
9128
+ }
9129
+ setValueByPath(toObject, ['cacheTokensDetails'], transformedList);
9130
+ }
9131
+ const fromResponseTokensDetails = getValueByPath(fromObject, [
9132
+ 'responseTokensDetails',
9133
+ ]);
9134
+ if (fromResponseTokensDetails != null) {
9135
+ let transformedList = fromResponseTokensDetails;
9136
+ if (Array.isArray(transformedList)) {
9137
+ transformedList = transformedList.map((item) => {
9138
+ return modalityTokenCountFromMldev(item);
9139
+ });
9140
+ }
9141
+ setValueByPath(toObject, ['responseTokensDetails'], transformedList);
9142
+ }
9143
+ const fromToolUsePromptTokensDetails = getValueByPath(fromObject, [
9144
+ 'toolUsePromptTokensDetails',
9145
+ ]);
9146
+ if (fromToolUsePromptTokensDetails != null) {
9147
+ let transformedList = fromToolUsePromptTokensDetails;
9148
+ if (Array.isArray(transformedList)) {
9149
+ transformedList = transformedList.map((item) => {
9150
+ return modalityTokenCountFromMldev(item);
9151
+ });
9152
+ }
9153
+ setValueByPath(toObject, ['toolUsePromptTokensDetails'], transformedList);
9154
+ }
9155
+ return toObject;
9156
+ }
9157
+ function liveServerGoAwayFromMldev(fromObject) {
9158
+ const toObject = {};
9159
+ const fromTimeLeft = getValueByPath(fromObject, ['timeLeft']);
9160
+ if (fromTimeLeft != null) {
9161
+ setValueByPath(toObject, ['timeLeft'], fromTimeLeft);
9162
+ }
9163
+ return toObject;
9164
+ }
9165
+ function liveServerSessionResumptionUpdateFromMldev(fromObject) {
9166
+ const toObject = {};
9167
+ const fromNewHandle = getValueByPath(fromObject, ['newHandle']);
9168
+ if (fromNewHandle != null) {
9169
+ setValueByPath(toObject, ['newHandle'], fromNewHandle);
9170
+ }
9171
+ const fromResumable = getValueByPath(fromObject, ['resumable']);
9172
+ if (fromResumable != null) {
9173
+ setValueByPath(toObject, ['resumable'], fromResumable);
9174
+ }
9175
+ const fromLastConsumedClientMessageIndex = getValueByPath(fromObject, [
9176
+ 'lastConsumedClientMessageIndex',
9177
+ ]);
9178
+ if (fromLastConsumedClientMessageIndex != null) {
9179
+ setValueByPath(toObject, ['lastConsumedClientMessageIndex'], fromLastConsumedClientMessageIndex);
9180
+ }
9181
+ return toObject;
9182
+ }
9183
+ function liveServerMessageFromMldev(fromObject) {
9184
+ const toObject = {};
9185
+ const fromSetupComplete = getValueByPath(fromObject, [
9186
+ 'setupComplete',
9187
+ ]);
9188
+ if (fromSetupComplete != null) {
9189
+ setValueByPath(toObject, ['setupComplete'], liveServerSetupCompleteFromMldev());
9190
+ }
9191
+ const fromServerContent = getValueByPath(fromObject, [
9192
+ 'serverContent',
9193
+ ]);
9194
+ if (fromServerContent != null) {
9195
+ setValueByPath(toObject, ['serverContent'], liveServerContentFromMldev(fromServerContent));
9196
+ }
9197
+ const fromToolCall = getValueByPath(fromObject, ['toolCall']);
9198
+ if (fromToolCall != null) {
9199
+ setValueByPath(toObject, ['toolCall'], liveServerToolCallFromMldev(fromToolCall));
9200
+ }
9201
+ const fromToolCallCancellation = getValueByPath(fromObject, [
9202
+ 'toolCallCancellation',
9203
+ ]);
9204
+ if (fromToolCallCancellation != null) {
9205
+ setValueByPath(toObject, ['toolCallCancellation'], liveServerToolCallCancellationFromMldev(fromToolCallCancellation));
9206
+ }
9207
+ const fromUsageMetadata = getValueByPath(fromObject, [
9208
+ 'usageMetadata',
9209
+ ]);
9210
+ if (fromUsageMetadata != null) {
9211
+ setValueByPath(toObject, ['usageMetadata'], usageMetadataFromMldev(fromUsageMetadata));
9212
+ }
9213
+ const fromGoAway = getValueByPath(fromObject, ['goAway']);
9214
+ if (fromGoAway != null) {
9215
+ setValueByPath(toObject, ['goAway'], liveServerGoAwayFromMldev(fromGoAway));
9216
+ }
9217
+ const fromSessionResumptionUpdate = getValueByPath(fromObject, [
9218
+ 'sessionResumptionUpdate',
9219
+ ]);
9220
+ if (fromSessionResumptionUpdate != null) {
9221
+ setValueByPath(toObject, ['sessionResumptionUpdate'], liveServerSessionResumptionUpdateFromMldev(fromSessionResumptionUpdate));
9222
+ }
9223
+ return toObject;
9224
+ }
9225
+ function liveMusicServerSetupCompleteFromMldev() {
9226
+ const toObject = {};
9227
+ return toObject;
9228
+ }
9229
+ function weightedPromptFromMldev(fromObject) {
9230
+ const toObject = {};
9231
+ const fromText = getValueByPath(fromObject, ['text']);
9232
+ if (fromText != null) {
9233
+ setValueByPath(toObject, ['text'], fromText);
9234
+ }
9235
+ const fromWeight = getValueByPath(fromObject, ['weight']);
9236
+ if (fromWeight != null) {
9237
+ setValueByPath(toObject, ['weight'], fromWeight);
9238
+ }
9239
+ return toObject;
9240
+ }
9241
+ function liveMusicClientContentFromMldev(fromObject) {
9242
+ const toObject = {};
9243
+ const fromWeightedPrompts = getValueByPath(fromObject, [
9244
+ 'weightedPrompts',
9245
+ ]);
9246
+ if (fromWeightedPrompts != null) {
9247
+ let transformedList = fromWeightedPrompts;
9248
+ if (Array.isArray(transformedList)) {
9249
+ transformedList = transformedList.map((item) => {
9250
+ return weightedPromptFromMldev(item);
9251
+ });
9252
+ }
9253
+ setValueByPath(toObject, ['weightedPrompts'], transformedList);
9254
+ }
9255
+ return toObject;
9256
+ }
9257
+ function liveMusicGenerationConfigFromMldev(fromObject) {
9258
+ const toObject = {};
9259
+ const fromTemperature = getValueByPath(fromObject, ['temperature']);
9260
+ if (fromTemperature != null) {
9261
+ setValueByPath(toObject, ['temperature'], fromTemperature);
9262
+ }
9263
+ const fromTopK = getValueByPath(fromObject, ['topK']);
9264
+ if (fromTopK != null) {
9265
+ setValueByPath(toObject, ['topK'], fromTopK);
9266
+ }
9267
+ const fromSeed = getValueByPath(fromObject, ['seed']);
9268
+ if (fromSeed != null) {
9269
+ setValueByPath(toObject, ['seed'], fromSeed);
9270
+ }
9271
+ const fromGuidance = getValueByPath(fromObject, ['guidance']);
9272
+ if (fromGuidance != null) {
9273
+ setValueByPath(toObject, ['guidance'], fromGuidance);
9274
+ }
9275
+ const fromBpm = getValueByPath(fromObject, ['bpm']);
9276
+ if (fromBpm != null) {
9277
+ setValueByPath(toObject, ['bpm'], fromBpm);
9278
+ }
9279
+ const fromDensity = getValueByPath(fromObject, ['density']);
9280
+ if (fromDensity != null) {
9281
+ setValueByPath(toObject, ['density'], fromDensity);
9282
+ }
9283
+ const fromBrightness = getValueByPath(fromObject, ['brightness']);
9284
+ if (fromBrightness != null) {
9285
+ setValueByPath(toObject, ['brightness'], fromBrightness);
9286
+ }
9287
+ const fromScale = getValueByPath(fromObject, ['scale']);
9288
+ if (fromScale != null) {
9289
+ setValueByPath(toObject, ['scale'], fromScale);
9290
+ }
9291
+ const fromMuteBass = getValueByPath(fromObject, ['muteBass']);
9292
+ if (fromMuteBass != null) {
9293
+ setValueByPath(toObject, ['muteBass'], fromMuteBass);
9294
+ }
9295
+ const fromMuteDrums = getValueByPath(fromObject, ['muteDrums']);
9296
+ if (fromMuteDrums != null) {
9297
+ setValueByPath(toObject, ['muteDrums'], fromMuteDrums);
9298
+ }
9299
+ const fromOnlyBassAndDrums = getValueByPath(fromObject, [
9300
+ 'onlyBassAndDrums',
9301
+ ]);
9302
+ if (fromOnlyBassAndDrums != null) {
9303
+ setValueByPath(toObject, ['onlyBassAndDrums'], fromOnlyBassAndDrums);
9304
+ }
9305
+ return toObject;
9306
+ }
9307
+ function liveMusicSourceMetadataFromMldev(fromObject) {
9308
+ const toObject = {};
9309
+ const fromClientContent = getValueByPath(fromObject, [
9310
+ 'clientContent',
9311
+ ]);
9312
+ if (fromClientContent != null) {
9313
+ setValueByPath(toObject, ['clientContent'], liveMusicClientContentFromMldev(fromClientContent));
9314
+ }
9315
+ const fromMusicGenerationConfig = getValueByPath(fromObject, [
9316
+ 'musicGenerationConfig',
9317
+ ]);
9318
+ if (fromMusicGenerationConfig != null) {
9319
+ setValueByPath(toObject, ['musicGenerationConfig'], liveMusicGenerationConfigFromMldev(fromMusicGenerationConfig));
9320
+ }
9321
+ return toObject;
9322
+ }
9323
+ function audioChunkFromMldev(fromObject) {
9324
+ const toObject = {};
9325
+ const fromData = getValueByPath(fromObject, ['data']);
9326
+ if (fromData != null) {
9327
+ setValueByPath(toObject, ['data'], fromData);
9328
+ }
9329
+ const fromMimeType = getValueByPath(fromObject, ['mimeType']);
9330
+ if (fromMimeType != null) {
9331
+ setValueByPath(toObject, ['mimeType'], fromMimeType);
9332
+ }
9333
+ const fromSourceMetadata = getValueByPath(fromObject, [
9334
+ 'sourceMetadata',
9335
+ ]);
9336
+ if (fromSourceMetadata != null) {
9337
+ setValueByPath(toObject, ['sourceMetadata'], liveMusicSourceMetadataFromMldev(fromSourceMetadata));
9338
+ }
9339
+ return toObject;
9340
+ }
9341
+ function liveMusicServerContentFromMldev(fromObject) {
9342
+ const toObject = {};
9343
+ const fromAudioChunks = getValueByPath(fromObject, ['audioChunks']);
9344
+ if (fromAudioChunks != null) {
9345
+ let transformedList = fromAudioChunks;
9346
+ if (Array.isArray(transformedList)) {
9347
+ transformedList = transformedList.map((item) => {
9348
+ return audioChunkFromMldev(item);
9349
+ });
9350
+ }
9351
+ setValueByPath(toObject, ['audioChunks'], transformedList);
9352
+ }
9353
+ return toObject;
9354
+ }
9355
+ function liveMusicFilteredPromptFromMldev(fromObject) {
9356
+ const toObject = {};
9357
+ const fromText = getValueByPath(fromObject, ['text']);
9358
+ if (fromText != null) {
9359
+ setValueByPath(toObject, ['text'], fromText);
9360
+ }
9361
+ const fromFilteredReason = getValueByPath(fromObject, [
9362
+ 'filteredReason',
9363
+ ]);
9364
+ if (fromFilteredReason != null) {
9365
+ setValueByPath(toObject, ['filteredReason'], fromFilteredReason);
9366
+ }
9367
+ return toObject;
9368
+ }
9369
+ function liveMusicServerMessageFromMldev(fromObject) {
9370
+ const toObject = {};
9371
+ const fromSetupComplete = getValueByPath(fromObject, [
9372
+ 'setupComplete',
9373
+ ]);
9374
+ if (fromSetupComplete != null) {
9375
+ setValueByPath(toObject, ['setupComplete'], liveMusicServerSetupCompleteFromMldev());
9376
+ }
9377
+ const fromServerContent = getValueByPath(fromObject, [
9378
+ 'serverContent',
9379
+ ]);
9380
+ if (fromServerContent != null) {
9381
+ setValueByPath(toObject, ['serverContent'], liveMusicServerContentFromMldev(fromServerContent));
9382
+ }
9383
+ const fromFilteredPrompt = getValueByPath(fromObject, [
9384
+ 'filteredPrompt',
9385
+ ]);
9386
+ if (fromFilteredPrompt != null) {
9387
+ setValueByPath(toObject, ['filteredPrompt'], liveMusicFilteredPromptFromMldev(fromFilteredPrompt));
9388
+ }
9389
+ return toObject;
9390
+ }
9391
+ function liveServerSetupCompleteFromVertex(fromObject) {
9392
+ const toObject = {};
9393
+ const fromSessionId = getValueByPath(fromObject, ['sessionId']);
9394
+ if (fromSessionId != null) {
9395
+ setValueByPath(toObject, ['sessionId'], fromSessionId);
9396
+ }
9397
+ return toObject;
9398
+ }
9399
+ function videoMetadataFromVertex$1(fromObject) {
9400
+ const toObject = {};
9401
+ const fromFps = getValueByPath(fromObject, ['fps']);
9402
+ if (fromFps != null) {
9403
+ setValueByPath(toObject, ['fps'], fromFps);
9404
+ }
9405
+ const fromEndOffset = getValueByPath(fromObject, ['endOffset']);
9406
+ if (fromEndOffset != null) {
9407
+ setValueByPath(toObject, ['endOffset'], fromEndOffset);
9408
+ }
9409
+ const fromStartOffset = getValueByPath(fromObject, ['startOffset']);
9410
+ if (fromStartOffset != null) {
9411
+ setValueByPath(toObject, ['startOffset'], fromStartOffset);
9412
+ }
9413
+ return toObject;
9414
+ }
9415
+ function blobFromVertex$1(fromObject) {
9416
+ const toObject = {};
9417
+ const fromDisplayName = getValueByPath(fromObject, ['displayName']);
9418
+ if (fromDisplayName != null) {
9419
+ setValueByPath(toObject, ['displayName'], fromDisplayName);
9420
+ }
9421
+ const fromData = getValueByPath(fromObject, ['data']);
9422
+ if (fromData != null) {
9423
+ setValueByPath(toObject, ['data'], fromData);
9424
+ }
9425
+ const fromMimeType = getValueByPath(fromObject, ['mimeType']);
9426
+ if (fromMimeType != null) {
9427
+ setValueByPath(toObject, ['mimeType'], fromMimeType);
9428
+ }
9429
+ return toObject;
9430
+ }
9431
+ function fileDataFromVertex$1(fromObject) {
9432
+ const toObject = {};
9433
+ const fromDisplayName = getValueByPath(fromObject, ['displayName']);
9434
+ if (fromDisplayName != null) {
9435
+ setValueByPath(toObject, ['displayName'], fromDisplayName);
9436
+ }
9437
+ const fromFileUri = getValueByPath(fromObject, ['fileUri']);
9438
+ if (fromFileUri != null) {
9439
+ setValueByPath(toObject, ['fileUri'], fromFileUri);
9440
+ }
9441
+ const fromMimeType = getValueByPath(fromObject, ['mimeType']);
9442
+ if (fromMimeType != null) {
9443
+ setValueByPath(toObject, ['mimeType'], fromMimeType);
9444
+ }
9445
+ return toObject;
9446
+ }
9064
9447
  function partFromVertex$1(fromObject) {
9065
9448
  const toObject = {};
9066
9449
  const fromVideoMetadata = getValueByPath(fromObject, [
@@ -9115,24 +9498,6 @@ function partFromVertex$1(fromObject) {
9115
9498
  }
9116
9499
  return toObject;
9117
9500
  }
9118
- function contentFromMldev$1(fromObject) {
9119
- const toObject = {};
9120
- const fromParts = getValueByPath(fromObject, ['parts']);
9121
- if (fromParts != null) {
9122
- let transformedList = fromParts;
9123
- if (Array.isArray(transformedList)) {
9124
- transformedList = transformedList.map((item) => {
9125
- return partFromMldev$1(item);
9126
- });
9127
- }
9128
- setValueByPath(toObject, ['parts'], transformedList);
9129
- }
9130
- const fromRole = getValueByPath(fromObject, ['role']);
9131
- if (fromRole != null) {
9132
- setValueByPath(toObject, ['role'], fromRole);
9133
- }
9134
- return toObject;
9135
- }
9136
9501
  function contentFromVertex$1(fromObject) {
9137
9502
  const toObject = {};
9138
9503
  const fromParts = getValueByPath(fromObject, ['parts']);
@@ -9151,18 +9516,6 @@ function contentFromVertex$1(fromObject) {
9151
9516
  }
9152
9517
  return toObject;
9153
9518
  }
9154
- function transcriptionFromMldev(fromObject) {
9155
- const toObject = {};
9156
- const fromText = getValueByPath(fromObject, ['text']);
9157
- if (fromText != null) {
9158
- setValueByPath(toObject, ['text'], fromText);
9159
- }
9160
- const fromFinished = getValueByPath(fromObject, ['finished']);
9161
- if (fromFinished != null) {
9162
- setValueByPath(toObject, ['finished'], fromFinished);
9163
- }
9164
- return toObject;
9165
- }
9166
9519
  function transcriptionFromVertex(fromObject) {
9167
9520
  const toObject = {};
9168
9521
  const fromText = getValueByPath(fromObject, ['text']);
@@ -9175,80 +9528,6 @@ function transcriptionFromVertex(fromObject) {
9175
9528
  }
9176
9529
  return toObject;
9177
9530
  }
9178
- function urlMetadataFromMldev$1(fromObject) {
9179
- const toObject = {};
9180
- const fromRetrievedUrl = getValueByPath(fromObject, ['retrievedUrl']);
9181
- if (fromRetrievedUrl != null) {
9182
- setValueByPath(toObject, ['retrievedUrl'], fromRetrievedUrl);
9183
- }
9184
- const fromUrlRetrievalStatus = getValueByPath(fromObject, [
9185
- 'urlRetrievalStatus',
9186
- ]);
9187
- if (fromUrlRetrievalStatus != null) {
9188
- setValueByPath(toObject, ['urlRetrievalStatus'], fromUrlRetrievalStatus);
9189
- }
9190
- return toObject;
9191
- }
9192
- function urlContextMetadataFromMldev$1(fromObject) {
9193
- const toObject = {};
9194
- const fromUrlMetadata = getValueByPath(fromObject, ['urlMetadata']);
9195
- if (fromUrlMetadata != null) {
9196
- let transformedList = fromUrlMetadata;
9197
- if (Array.isArray(transformedList)) {
9198
- transformedList = transformedList.map((item) => {
9199
- return urlMetadataFromMldev$1(item);
9200
- });
9201
- }
9202
- setValueByPath(toObject, ['urlMetadata'], transformedList);
9203
- }
9204
- return toObject;
9205
- }
9206
- function liveServerContentFromMldev(fromObject) {
9207
- const toObject = {};
9208
- const fromModelTurn = getValueByPath(fromObject, ['modelTurn']);
9209
- if (fromModelTurn != null) {
9210
- setValueByPath(toObject, ['modelTurn'], contentFromMldev$1(fromModelTurn));
9211
- }
9212
- const fromTurnComplete = getValueByPath(fromObject, ['turnComplete']);
9213
- if (fromTurnComplete != null) {
9214
- setValueByPath(toObject, ['turnComplete'], fromTurnComplete);
9215
- }
9216
- const fromInterrupted = getValueByPath(fromObject, ['interrupted']);
9217
- if (fromInterrupted != null) {
9218
- setValueByPath(toObject, ['interrupted'], fromInterrupted);
9219
- }
9220
- const fromGroundingMetadata = getValueByPath(fromObject, [
9221
- 'groundingMetadata',
9222
- ]);
9223
- if (fromGroundingMetadata != null) {
9224
- setValueByPath(toObject, ['groundingMetadata'], fromGroundingMetadata);
9225
- }
9226
- const fromGenerationComplete = getValueByPath(fromObject, [
9227
- 'generationComplete',
9228
- ]);
9229
- if (fromGenerationComplete != null) {
9230
- setValueByPath(toObject, ['generationComplete'], fromGenerationComplete);
9231
- }
9232
- const fromInputTranscription = getValueByPath(fromObject, [
9233
- 'inputTranscription',
9234
- ]);
9235
- if (fromInputTranscription != null) {
9236
- setValueByPath(toObject, ['inputTranscription'], transcriptionFromMldev(fromInputTranscription));
9237
- }
9238
- const fromOutputTranscription = getValueByPath(fromObject, [
9239
- 'outputTranscription',
9240
- ]);
9241
- if (fromOutputTranscription != null) {
9242
- setValueByPath(toObject, ['outputTranscription'], transcriptionFromMldev(fromOutputTranscription));
9243
- }
9244
- const fromUrlContextMetadata = getValueByPath(fromObject, [
9245
- 'urlContextMetadata',
9246
- ]);
9247
- if (fromUrlContextMetadata != null) {
9248
- setValueByPath(toObject, ['urlContextMetadata'], urlContextMetadataFromMldev$1(fromUrlContextMetadata));
9249
- }
9250
- return toObject;
9251
- }
9252
9531
  function liveServerContentFromVertex(fromObject) {
9253
9532
  const toObject = {};
9254
9533
  const fromModelTurn = getValueByPath(fromObject, ['modelTurn']);
@@ -9289,22 +9568,6 @@ function liveServerContentFromVertex(fromObject) {
9289
9568
  }
9290
9569
  return toObject;
9291
9570
  }
9292
- function functionCallFromMldev(fromObject) {
9293
- const toObject = {};
9294
- const fromId = getValueByPath(fromObject, ['id']);
9295
- if (fromId != null) {
9296
- setValueByPath(toObject, ['id'], fromId);
9297
- }
9298
- const fromArgs = getValueByPath(fromObject, ['args']);
9299
- if (fromArgs != null) {
9300
- setValueByPath(toObject, ['args'], fromArgs);
9301
- }
9302
- const fromName = getValueByPath(fromObject, ['name']);
9303
- if (fromName != null) {
9304
- setValueByPath(toObject, ['name'], fromName);
9305
- }
9306
- return toObject;
9307
- }
9308
9571
  function functionCallFromVertex(fromObject) {
9309
9572
  const toObject = {};
9310
9573
  const fromArgs = getValueByPath(fromObject, ['args']);
@@ -9317,22 +9580,6 @@ function functionCallFromVertex(fromObject) {
9317
9580
  }
9318
9581
  return toObject;
9319
9582
  }
9320
- function liveServerToolCallFromMldev(fromObject) {
9321
- const toObject = {};
9322
- const fromFunctionCalls = getValueByPath(fromObject, [
9323
- 'functionCalls',
9324
- ]);
9325
- if (fromFunctionCalls != null) {
9326
- let transformedList = fromFunctionCalls;
9327
- if (Array.isArray(transformedList)) {
9328
- transformedList = transformedList.map((item) => {
9329
- return functionCallFromMldev(item);
9330
- });
9331
- }
9332
- setValueByPath(toObject, ['functionCalls'], transformedList);
9333
- }
9334
- return toObject;
9335
- }
9336
9583
  function liveServerToolCallFromVertex(fromObject) {
9337
9584
  const toObject = {};
9338
9585
  const fromFunctionCalls = getValueByPath(fromObject, [
@@ -9349,14 +9596,6 @@ function liveServerToolCallFromVertex(fromObject) {
9349
9596
  }
9350
9597
  return toObject;
9351
9598
  }
9352
- function liveServerToolCallCancellationFromMldev(fromObject) {
9353
- const toObject = {};
9354
- const fromIds = getValueByPath(fromObject, ['ids']);
9355
- if (fromIds != null) {
9356
- setValueByPath(toObject, ['ids'], fromIds);
9357
- }
9358
- return toObject;
9359
- }
9360
9599
  function liveServerToolCallCancellationFromVertex(fromObject) {
9361
9600
  const toObject = {};
9362
9601
  const fromIds = getValueByPath(fromObject, ['ids']);
@@ -9365,18 +9604,6 @@ function liveServerToolCallCancellationFromVertex(fromObject) {
9365
9604
  }
9366
9605
  return toObject;
9367
9606
  }
9368
- function modalityTokenCountFromMldev(fromObject) {
9369
- const toObject = {};
9370
- const fromModality = getValueByPath(fromObject, ['modality']);
9371
- if (fromModality != null) {
9372
- setValueByPath(toObject, ['modality'], fromModality);
9373
- }
9374
- const fromTokenCount = getValueByPath(fromObject, ['tokenCount']);
9375
- if (fromTokenCount != null) {
9376
- setValueByPath(toObject, ['tokenCount'], fromTokenCount);
9377
- }
9378
- return toObject;
9379
- }
9380
9607
  function modalityTokenCountFromVertex(fromObject) {
9381
9608
  const toObject = {};
9382
9609
  const fromModality = getValueByPath(fromObject, ['modality']);
@@ -9389,94 +9616,6 @@ function modalityTokenCountFromVertex(fromObject) {
9389
9616
  }
9390
9617
  return toObject;
9391
9618
  }
9392
- function usageMetadataFromMldev(fromObject) {
9393
- const toObject = {};
9394
- const fromPromptTokenCount = getValueByPath(fromObject, [
9395
- 'promptTokenCount',
9396
- ]);
9397
- if (fromPromptTokenCount != null) {
9398
- setValueByPath(toObject, ['promptTokenCount'], fromPromptTokenCount);
9399
- }
9400
- const fromCachedContentTokenCount = getValueByPath(fromObject, [
9401
- 'cachedContentTokenCount',
9402
- ]);
9403
- if (fromCachedContentTokenCount != null) {
9404
- setValueByPath(toObject, ['cachedContentTokenCount'], fromCachedContentTokenCount);
9405
- }
9406
- const fromResponseTokenCount = getValueByPath(fromObject, [
9407
- 'responseTokenCount',
9408
- ]);
9409
- if (fromResponseTokenCount != null) {
9410
- setValueByPath(toObject, ['responseTokenCount'], fromResponseTokenCount);
9411
- }
9412
- const fromToolUsePromptTokenCount = getValueByPath(fromObject, [
9413
- 'toolUsePromptTokenCount',
9414
- ]);
9415
- if (fromToolUsePromptTokenCount != null) {
9416
- setValueByPath(toObject, ['toolUsePromptTokenCount'], fromToolUsePromptTokenCount);
9417
- }
9418
- const fromThoughtsTokenCount = getValueByPath(fromObject, [
9419
- 'thoughtsTokenCount',
9420
- ]);
9421
- if (fromThoughtsTokenCount != null) {
9422
- setValueByPath(toObject, ['thoughtsTokenCount'], fromThoughtsTokenCount);
9423
- }
9424
- const fromTotalTokenCount = getValueByPath(fromObject, [
9425
- 'totalTokenCount',
9426
- ]);
9427
- if (fromTotalTokenCount != null) {
9428
- setValueByPath(toObject, ['totalTokenCount'], fromTotalTokenCount);
9429
- }
9430
- const fromPromptTokensDetails = getValueByPath(fromObject, [
9431
- 'promptTokensDetails',
9432
- ]);
9433
- if (fromPromptTokensDetails != null) {
9434
- let transformedList = fromPromptTokensDetails;
9435
- if (Array.isArray(transformedList)) {
9436
- transformedList = transformedList.map((item) => {
9437
- return modalityTokenCountFromMldev(item);
9438
- });
9439
- }
9440
- setValueByPath(toObject, ['promptTokensDetails'], transformedList);
9441
- }
9442
- const fromCacheTokensDetails = getValueByPath(fromObject, [
9443
- 'cacheTokensDetails',
9444
- ]);
9445
- if (fromCacheTokensDetails != null) {
9446
- let transformedList = fromCacheTokensDetails;
9447
- if (Array.isArray(transformedList)) {
9448
- transformedList = transformedList.map((item) => {
9449
- return modalityTokenCountFromMldev(item);
9450
- });
9451
- }
9452
- setValueByPath(toObject, ['cacheTokensDetails'], transformedList);
9453
- }
9454
- const fromResponseTokensDetails = getValueByPath(fromObject, [
9455
- 'responseTokensDetails',
9456
- ]);
9457
- if (fromResponseTokensDetails != null) {
9458
- let transformedList = fromResponseTokensDetails;
9459
- if (Array.isArray(transformedList)) {
9460
- transformedList = transformedList.map((item) => {
9461
- return modalityTokenCountFromMldev(item);
9462
- });
9463
- }
9464
- setValueByPath(toObject, ['responseTokensDetails'], transformedList);
9465
- }
9466
- const fromToolUsePromptTokensDetails = getValueByPath(fromObject, [
9467
- 'toolUsePromptTokensDetails',
9468
- ]);
9469
- if (fromToolUsePromptTokensDetails != null) {
9470
- let transformedList = fromToolUsePromptTokensDetails;
9471
- if (Array.isArray(transformedList)) {
9472
- transformedList = transformedList.map((item) => {
9473
- return modalityTokenCountFromMldev(item);
9474
- });
9475
- }
9476
- setValueByPath(toObject, ['toolUsePromptTokensDetails'], transformedList);
9477
- }
9478
- return toObject;
9479
- }
9480
9619
  function usageMetadataFromVertex(fromObject) {
9481
9620
  const toObject = {};
9482
9621
  const fromPromptTokenCount = getValueByPath(fromObject, [
@@ -9563,18 +9702,10 @@ function usageMetadataFromVertex(fromObject) {
9563
9702
  }
9564
9703
  setValueByPath(toObject, ['toolUsePromptTokensDetails'], transformedList);
9565
9704
  }
9566
- const fromTrafficType = getValueByPath(fromObject, ['trafficType']);
9567
- if (fromTrafficType != null) {
9568
- setValueByPath(toObject, ['trafficType'], fromTrafficType);
9569
- }
9570
- return toObject;
9571
- }
9572
- function liveServerGoAwayFromMldev(fromObject) {
9573
- const toObject = {};
9574
- const fromTimeLeft = getValueByPath(fromObject, ['timeLeft']);
9575
- if (fromTimeLeft != null) {
9576
- setValueByPath(toObject, ['timeLeft'], fromTimeLeft);
9577
- }
9705
+ const fromTrafficType = getValueByPath(fromObject, ['trafficType']);
9706
+ if (fromTrafficType != null) {
9707
+ setValueByPath(toObject, ['trafficType'], fromTrafficType);
9708
+ }
9578
9709
  return toObject;
9579
9710
  }
9580
9711
  function liveServerGoAwayFromVertex(fromObject) {
@@ -9585,24 +9716,6 @@ function liveServerGoAwayFromVertex(fromObject) {
9585
9716
  }
9586
9717
  return toObject;
9587
9718
  }
9588
- function liveServerSessionResumptionUpdateFromMldev(fromObject) {
9589
- const toObject = {};
9590
- const fromNewHandle = getValueByPath(fromObject, ['newHandle']);
9591
- if (fromNewHandle != null) {
9592
- setValueByPath(toObject, ['newHandle'], fromNewHandle);
9593
- }
9594
- const fromResumable = getValueByPath(fromObject, ['resumable']);
9595
- if (fromResumable != null) {
9596
- setValueByPath(toObject, ['resumable'], fromResumable);
9597
- }
9598
- const fromLastConsumedClientMessageIndex = getValueByPath(fromObject, [
9599
- 'lastConsumedClientMessageIndex',
9600
- ]);
9601
- if (fromLastConsumedClientMessageIndex != null) {
9602
- setValueByPath(toObject, ['lastConsumedClientMessageIndex'], fromLastConsumedClientMessageIndex);
9603
- }
9604
- return toObject;
9605
- }
9606
9719
  function liveServerSessionResumptionUpdateFromVertex(fromObject) {
9607
9720
  const toObject = {};
9608
9721
  const fromNewHandle = getValueByPath(fromObject, ['newHandle']);
@@ -9621,48 +9734,6 @@ function liveServerSessionResumptionUpdateFromVertex(fromObject) {
9621
9734
  }
9622
9735
  return toObject;
9623
9736
  }
9624
- function liveServerMessageFromMldev(fromObject) {
9625
- const toObject = {};
9626
- const fromSetupComplete = getValueByPath(fromObject, [
9627
- 'setupComplete',
9628
- ]);
9629
- if (fromSetupComplete != null) {
9630
- setValueByPath(toObject, ['setupComplete'], liveServerSetupCompleteFromMldev());
9631
- }
9632
- const fromServerContent = getValueByPath(fromObject, [
9633
- 'serverContent',
9634
- ]);
9635
- if (fromServerContent != null) {
9636
- setValueByPath(toObject, ['serverContent'], liveServerContentFromMldev(fromServerContent));
9637
- }
9638
- const fromToolCall = getValueByPath(fromObject, ['toolCall']);
9639
- if (fromToolCall != null) {
9640
- setValueByPath(toObject, ['toolCall'], liveServerToolCallFromMldev(fromToolCall));
9641
- }
9642
- const fromToolCallCancellation = getValueByPath(fromObject, [
9643
- 'toolCallCancellation',
9644
- ]);
9645
- if (fromToolCallCancellation != null) {
9646
- setValueByPath(toObject, ['toolCallCancellation'], liveServerToolCallCancellationFromMldev(fromToolCallCancellation));
9647
- }
9648
- const fromUsageMetadata = getValueByPath(fromObject, [
9649
- 'usageMetadata',
9650
- ]);
9651
- if (fromUsageMetadata != null) {
9652
- setValueByPath(toObject, ['usageMetadata'], usageMetadataFromMldev(fromUsageMetadata));
9653
- }
9654
- const fromGoAway = getValueByPath(fromObject, ['goAway']);
9655
- if (fromGoAway != null) {
9656
- setValueByPath(toObject, ['goAway'], liveServerGoAwayFromMldev(fromGoAway));
9657
- }
9658
- const fromSessionResumptionUpdate = getValueByPath(fromObject, [
9659
- 'sessionResumptionUpdate',
9660
- ]);
9661
- if (fromSessionResumptionUpdate != null) {
9662
- setValueByPath(toObject, ['sessionResumptionUpdate'], liveServerSessionResumptionUpdateFromMldev(fromSessionResumptionUpdate));
9663
- }
9664
- return toObject;
9665
- }
9666
9737
  function liveServerMessageFromVertex(fromObject) {
9667
9738
  const toObject = {};
9668
9739
  const fromSetupComplete = getValueByPath(fromObject, [
@@ -9705,172 +9776,6 @@ function liveServerMessageFromVertex(fromObject) {
9705
9776
  }
9706
9777
  return toObject;
9707
9778
  }
9708
- function liveMusicServerSetupCompleteFromMldev() {
9709
- const toObject = {};
9710
- return toObject;
9711
- }
9712
- function weightedPromptFromMldev(fromObject) {
9713
- const toObject = {};
9714
- const fromText = getValueByPath(fromObject, ['text']);
9715
- if (fromText != null) {
9716
- setValueByPath(toObject, ['text'], fromText);
9717
- }
9718
- const fromWeight = getValueByPath(fromObject, ['weight']);
9719
- if (fromWeight != null) {
9720
- setValueByPath(toObject, ['weight'], fromWeight);
9721
- }
9722
- return toObject;
9723
- }
9724
- function liveMusicClientContentFromMldev(fromObject) {
9725
- const toObject = {};
9726
- const fromWeightedPrompts = getValueByPath(fromObject, [
9727
- 'weightedPrompts',
9728
- ]);
9729
- if (fromWeightedPrompts != null) {
9730
- let transformedList = fromWeightedPrompts;
9731
- if (Array.isArray(transformedList)) {
9732
- transformedList = transformedList.map((item) => {
9733
- return weightedPromptFromMldev(item);
9734
- });
9735
- }
9736
- setValueByPath(toObject, ['weightedPrompts'], transformedList);
9737
- }
9738
- return toObject;
9739
- }
9740
- function liveMusicGenerationConfigFromMldev(fromObject) {
9741
- const toObject = {};
9742
- const fromTemperature = getValueByPath(fromObject, ['temperature']);
9743
- if (fromTemperature != null) {
9744
- setValueByPath(toObject, ['temperature'], fromTemperature);
9745
- }
9746
- const fromTopK = getValueByPath(fromObject, ['topK']);
9747
- if (fromTopK != null) {
9748
- setValueByPath(toObject, ['topK'], fromTopK);
9749
- }
9750
- const fromSeed = getValueByPath(fromObject, ['seed']);
9751
- if (fromSeed != null) {
9752
- setValueByPath(toObject, ['seed'], fromSeed);
9753
- }
9754
- const fromGuidance = getValueByPath(fromObject, ['guidance']);
9755
- if (fromGuidance != null) {
9756
- setValueByPath(toObject, ['guidance'], fromGuidance);
9757
- }
9758
- const fromBpm = getValueByPath(fromObject, ['bpm']);
9759
- if (fromBpm != null) {
9760
- setValueByPath(toObject, ['bpm'], fromBpm);
9761
- }
9762
- const fromDensity = getValueByPath(fromObject, ['density']);
9763
- if (fromDensity != null) {
9764
- setValueByPath(toObject, ['density'], fromDensity);
9765
- }
9766
- const fromBrightness = getValueByPath(fromObject, ['brightness']);
9767
- if (fromBrightness != null) {
9768
- setValueByPath(toObject, ['brightness'], fromBrightness);
9769
- }
9770
- const fromScale = getValueByPath(fromObject, ['scale']);
9771
- if (fromScale != null) {
9772
- setValueByPath(toObject, ['scale'], fromScale);
9773
- }
9774
- const fromMuteBass = getValueByPath(fromObject, ['muteBass']);
9775
- if (fromMuteBass != null) {
9776
- setValueByPath(toObject, ['muteBass'], fromMuteBass);
9777
- }
9778
- const fromMuteDrums = getValueByPath(fromObject, ['muteDrums']);
9779
- if (fromMuteDrums != null) {
9780
- setValueByPath(toObject, ['muteDrums'], fromMuteDrums);
9781
- }
9782
- const fromOnlyBassAndDrums = getValueByPath(fromObject, [
9783
- 'onlyBassAndDrums',
9784
- ]);
9785
- if (fromOnlyBassAndDrums != null) {
9786
- setValueByPath(toObject, ['onlyBassAndDrums'], fromOnlyBassAndDrums);
9787
- }
9788
- return toObject;
9789
- }
9790
- function liveMusicSourceMetadataFromMldev(fromObject) {
9791
- const toObject = {};
9792
- const fromClientContent = getValueByPath(fromObject, [
9793
- 'clientContent',
9794
- ]);
9795
- if (fromClientContent != null) {
9796
- setValueByPath(toObject, ['clientContent'], liveMusicClientContentFromMldev(fromClientContent));
9797
- }
9798
- const fromMusicGenerationConfig = getValueByPath(fromObject, [
9799
- 'musicGenerationConfig',
9800
- ]);
9801
- if (fromMusicGenerationConfig != null) {
9802
- setValueByPath(toObject, ['musicGenerationConfig'], liveMusicGenerationConfigFromMldev(fromMusicGenerationConfig));
9803
- }
9804
- return toObject;
9805
- }
9806
- function audioChunkFromMldev(fromObject) {
9807
- const toObject = {};
9808
- const fromData = getValueByPath(fromObject, ['data']);
9809
- if (fromData != null) {
9810
- setValueByPath(toObject, ['data'], fromData);
9811
- }
9812
- const fromMimeType = getValueByPath(fromObject, ['mimeType']);
9813
- if (fromMimeType != null) {
9814
- setValueByPath(toObject, ['mimeType'], fromMimeType);
9815
- }
9816
- const fromSourceMetadata = getValueByPath(fromObject, [
9817
- 'sourceMetadata',
9818
- ]);
9819
- if (fromSourceMetadata != null) {
9820
- setValueByPath(toObject, ['sourceMetadata'], liveMusicSourceMetadataFromMldev(fromSourceMetadata));
9821
- }
9822
- return toObject;
9823
- }
9824
- function liveMusicServerContentFromMldev(fromObject) {
9825
- const toObject = {};
9826
- const fromAudioChunks = getValueByPath(fromObject, ['audioChunks']);
9827
- if (fromAudioChunks != null) {
9828
- let transformedList = fromAudioChunks;
9829
- if (Array.isArray(transformedList)) {
9830
- transformedList = transformedList.map((item) => {
9831
- return audioChunkFromMldev(item);
9832
- });
9833
- }
9834
- setValueByPath(toObject, ['audioChunks'], transformedList);
9835
- }
9836
- return toObject;
9837
- }
9838
- function liveMusicFilteredPromptFromMldev(fromObject) {
9839
- const toObject = {};
9840
- const fromText = getValueByPath(fromObject, ['text']);
9841
- if (fromText != null) {
9842
- setValueByPath(toObject, ['text'], fromText);
9843
- }
9844
- const fromFilteredReason = getValueByPath(fromObject, [
9845
- 'filteredReason',
9846
- ]);
9847
- if (fromFilteredReason != null) {
9848
- setValueByPath(toObject, ['filteredReason'], fromFilteredReason);
9849
- }
9850
- return toObject;
9851
- }
9852
- function liveMusicServerMessageFromMldev(fromObject) {
9853
- const toObject = {};
9854
- const fromSetupComplete = getValueByPath(fromObject, [
9855
- 'setupComplete',
9856
- ]);
9857
- if (fromSetupComplete != null) {
9858
- setValueByPath(toObject, ['setupComplete'], liveMusicServerSetupCompleteFromMldev());
9859
- }
9860
- const fromServerContent = getValueByPath(fromObject, [
9861
- 'serverContent',
9862
- ]);
9863
- if (fromServerContent != null) {
9864
- setValueByPath(toObject, ['serverContent'], liveMusicServerContentFromMldev(fromServerContent));
9865
- }
9866
- const fromFilteredPrompt = getValueByPath(fromObject, [
9867
- 'filteredPrompt',
9868
- ]);
9869
- if (fromFilteredPrompt != null) {
9870
- setValueByPath(toObject, ['filteredPrompt'], liveMusicFilteredPromptFromMldev(fromFilteredPrompt));
9871
- }
9872
- return toObject;
9873
- }
9874
9779
 
9875
9780
  /**
9876
9781
  * @license
@@ -11951,6 +11856,10 @@ function editImageConfigToVertex(fromObject, parentObject) {
11951
11856
  if (parentObject !== undefined && fromOutputCompressionQuality != null) {
11952
11857
  setValueByPath(parentObject, ['parameters', 'outputOptions', 'compressionQuality'], fromOutputCompressionQuality);
11953
11858
  }
11859
+ const fromAddWatermark = getValueByPath(fromObject, ['addWatermark']);
11860
+ if (parentObject !== undefined && fromAddWatermark != null) {
11861
+ setValueByPath(parentObject, ['parameters', 'addWatermark'], fromAddWatermark);
11862
+ }
11954
11863
  const fromEditMode = getValueByPath(fromObject, ['editMode']);
11955
11864
  if (parentObject !== undefined && fromEditMode != null) {
11956
11865
  setValueByPath(parentObject, ['parameters', 'editMode'], fromEditMode);
@@ -12525,6 +12434,12 @@ function candidateFromMldev(fromObject) {
12525
12434
  }
12526
12435
  function generateContentResponseFromMldev(fromObject) {
12527
12436
  const toObject = {};
12437
+ const fromSdkHttpResponse = getValueByPath(fromObject, [
12438
+ 'sdkHttpResponse',
12439
+ ]);
12440
+ if (fromSdkHttpResponse != null) {
12441
+ setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
12442
+ }
12528
12443
  const fromCandidates = getValueByPath(fromObject, ['candidates']);
12529
12444
  if (fromCandidates != null) {
12530
12445
  let transformedList = fromCandidates;
@@ -13051,6 +12966,12 @@ function candidateFromVertex(fromObject) {
13051
12966
  }
13052
12967
  function generateContentResponseFromVertex(fromObject) {
13053
12968
  const toObject = {};
12969
+ const fromSdkHttpResponse = getValueByPath(fromObject, [
12970
+ 'sdkHttpResponse',
12971
+ ]);
12972
+ if (fromSdkHttpResponse != null) {
12973
+ setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
12974
+ }
13054
12975
  const fromCandidates = getValueByPath(fromObject, ['candidates']);
13055
12976
  if (fromCandidates != null) {
13056
12977
  let transformedList = fromCandidates;
@@ -13485,6 +13406,9 @@ function generateVideosOperationFromVertex$1(fromObject) {
13485
13406
  */
13486
13407
  // TODO: b/416041229 - Determine how to retrieve the MCP package version.
13487
13408
  const MCP_LABEL = 'mcp_used/unknown';
13409
+ // Whether MCP tool usage is detected from mcpToTool. This is used for
13410
+ // telemetry.
13411
+ let hasMcpToolUsageFromMcpToTool = false;
13488
13412
  // Checks whether the list of tools contains any MCP tools.
13489
13413
  function hasMcpToolUsage(tools) {
13490
13414
  for (const tool of tools) {
@@ -13495,7 +13419,7 @@ function hasMcpToolUsage(tools) {
13495
13419
  return true;
13496
13420
  }
13497
13421
  }
13498
- return false;
13422
+ return hasMcpToolUsageFromMcpToTool;
13499
13423
  }
13500
13424
  // Sets the MCP version label in the Google API client header.
13501
13425
  function setMcpUsageHeader(headers) {
@@ -13652,6 +13576,8 @@ function isMcpClient(client) {
13652
13576
  * versions.
13653
13577
  */
13654
13578
  function mcpToTool(...args) {
13579
+ // Set MCP usage for telemetry.
13580
+ hasMcpToolUsageFromMcpToTool = true;
13655
13581
  if (args.length === 0) {
13656
13582
  throw new Error('No MCP clients provided');
13657
13583
  }
@@ -13971,7 +13897,7 @@ class Live {
13971
13897
  if (GOOGLE_GENAI_USE_VERTEXAI) {
13972
13898
  model = 'gemini-2.0-flash-live-preview-04-09';
13973
13899
  } else {
13974
- model = 'gemini-2.0-flash-live-001';
13900
+ model = 'gemini-live-2.5-flash-preview';
13975
13901
  }
13976
13902
  const session = await ai.live.connect({
13977
13903
  model: model,
@@ -13997,6 +13923,12 @@ class Live {
13997
13923
  */
13998
13924
  async connect(params) {
13999
13925
  var _a, _b, _c, _d, _e, _f;
13926
+ // TODO: b/404946746 - Support per request HTTP options.
13927
+ if (params.config && params.config.httpOptions) {
13928
+ throw new Error('The Live module does not support httpOptions at request-level in' +
13929
+ ' LiveConnectConfig yet. Please use the client-level httpOptions' +
13930
+ ' configuration instead.');
13931
+ }
14000
13932
  const websocketBaseUrl = this.apiClient.getWebsocketBaseUrl();
14001
13933
  const apiVersion = this.apiClient.getApiVersion();
14002
13934
  let url;
@@ -14017,6 +13949,9 @@ class Live {
14017
13949
  let keyName = 'key';
14018
13950
  if (apiKey === null || apiKey === void 0 ? void 0 : apiKey.startsWith('auth_tokens/')) {
14019
13951
  console.warn('Warning: Ephemeral token support is experimental and may change in future versions.');
13952
+ if (apiVersion !== 'v1alpha') {
13953
+ 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.");
13954
+ }
14020
13955
  method = 'BidiGenerateContentConstrained';
14021
13956
  keyName = 'access_token';
14022
13957
  }
@@ -14292,7 +14227,7 @@ class Session {
14292
14227
  if (GOOGLE_GENAI_USE_VERTEXAI) {
14293
14228
  model = 'gemini-2.0-flash-live-preview-04-09';
14294
14229
  } else {
14295
- model = 'gemini-2.0-flash-live-001';
14230
+ model = 'gemini-live-2.5-flash-preview';
14296
14231
  }
14297
14232
  const session = await ai.live.connect({
14298
14233
  model: model,
@@ -14421,6 +14356,7 @@ class Models extends BaseModule {
14421
14356
  this.generateContent = async (params) => {
14422
14357
  var _a, _b, _c, _d, _e;
14423
14358
  const transformedParams = await this.processParamsForMcpUsage(params);
14359
+ this.maybeMoveToResponseJsonSchem(params);
14424
14360
  if (!hasMcpClientTools(params) || shouldDisableAfc(params.config)) {
14425
14361
  return await this.generateContentInternal(transformedParams);
14426
14362
  }
@@ -14507,6 +14443,7 @@ class Models extends BaseModule {
14507
14443
  * ```
14508
14444
  */
14509
14445
  this.generateContentStream = async (params) => {
14446
+ this.maybeMoveToResponseJsonSchem(params);
14510
14447
  if (shouldDisableAfc(params.config)) {
14511
14448
  const transformedParams = await this.processParamsForMcpUsage(params);
14512
14449
  return await this.generateContentStreamInternal(transformedParams);
@@ -14658,6 +14595,24 @@ class Models extends BaseModule {
14658
14595
  return await this.upscaleImageInternal(apiParams);
14659
14596
  };
14660
14597
  }
14598
+ /**
14599
+ * This logic is needed for GenerateContentConfig only.
14600
+ * Previously we made GenerateContentConfig.responseSchema field to accept
14601
+ * unknown. Since v1.9.0, we switch to use backend JSON schema support.
14602
+ * To maintain backward compatibility, we move the data that was treated as
14603
+ * JSON schema from the responseSchema field to the responseJsonSchema field.
14604
+ */
14605
+ maybeMoveToResponseJsonSchem(params) {
14606
+ if (params.config && params.config.responseSchema) {
14607
+ if (!params.config.responseJsonSchema) {
14608
+ if (Object.keys(params.config.responseSchema).includes('$schema')) {
14609
+ params.config.responseJsonSchema = params.config.responseSchema;
14610
+ delete params.config.responseSchema;
14611
+ }
14612
+ }
14613
+ }
14614
+ return;
14615
+ }
14661
14616
  /**
14662
14617
  * Transforms the CallableTools in the parameters to be simply Tools, it
14663
14618
  * copies the params into a new object and replaces the tools, it does not
@@ -14819,7 +14774,13 @@ class Models extends BaseModule {
14819
14774
  abortSignal: (_b = params.config) === null || _b === void 0 ? void 0 : _b.abortSignal,
14820
14775
  })
14821
14776
  .then((httpResponse) => {
14822
- return httpResponse.json();
14777
+ return httpResponse.json().then((jsonResponse) => {
14778
+ const response = jsonResponse;
14779
+ response.sdkHttpResponse = {
14780
+ headers: httpResponse.headers,
14781
+ };
14782
+ return response;
14783
+ });
14823
14784
  });
14824
14785
  return response.then((apiResponse) => {
14825
14786
  const resp = generateContentResponseFromVertex(apiResponse);
@@ -14845,7 +14806,13 @@ class Models extends BaseModule {
14845
14806
  abortSignal: (_d = params.config) === null || _d === void 0 ? void 0 : _d.abortSignal,
14846
14807
  })
14847
14808
  .then((httpResponse) => {
14848
- return httpResponse.json();
14809
+ return httpResponse.json().then((jsonResponse) => {
14810
+ const response = jsonResponse;
14811
+ response.sdkHttpResponse = {
14812
+ headers: httpResponse.headers,
14813
+ };
14814
+ return response;
14815
+ });
14849
14816
  });
14850
14817
  return response.then((apiResponse) => {
14851
14818
  const resp = generateContentResponseFromMldev(apiResponse);
@@ -14885,6 +14852,9 @@ class Models extends BaseModule {
14885
14852
  _d = false;
14886
14853
  const chunk = _c;
14887
14854
  const resp = generateContentResponseFromVertex((yield __await(chunk.json())));
14855
+ resp['sdkHttpResponse'] = {
14856
+ headers: chunk.headers,
14857
+ };
14888
14858
  const typedResp = new GenerateContentResponse();
14889
14859
  Object.assign(typedResp, resp);
14890
14860
  yield yield __await(typedResp);
@@ -14925,6 +14895,9 @@ class Models extends BaseModule {
14925
14895
  _d = false;
14926
14896
  const chunk = _c;
14927
14897
  const resp = generateContentResponseFromMldev((yield __await(chunk.json())));
14898
+ resp['sdkHttpResponse'] = {
14899
+ headers: chunk.headers,
14900
+ };
14928
14901
  const typedResp = new GenerateContentResponse();
14929
14902
  Object.assign(typedResp, resp);
14930
14903
  yield yield __await(typedResp);
@@ -16718,14 +16691,20 @@ class Tokens extends BaseModule {
16718
16691
  * @experimental
16719
16692
  *
16720
16693
  * @remarks
16721
- * Ephermeral auth tokens is only supported in the Gemini Developer API.
16694
+ * Ephemeral auth tokens is only supported in the Gemini Developer API.
16722
16695
  * It can be used for the session connection to the Live constrained API.
16696
+ * Support in v1alpha only.
16723
16697
  *
16724
16698
  * @param params - The parameters for the create request.
16725
16699
  * @return The created auth token.
16726
16700
  *
16727
16701
  * @example
16728
16702
  * ```ts
16703
+ * const ai = new GoogleGenAI({
16704
+ * apiKey: token.name,
16705
+ * httpOptions: { apiVersion: 'v1alpha' } // Support in v1alpha only.
16706
+ * });
16707
+ *
16729
16708
  * // Case 1: If LiveEphemeralParameters is unset, unlock LiveConnectConfig
16730
16709
  * // when using the token in Live API sessions. Each session connection can
16731
16710
  * // use a different configuration.
@@ -17205,7 +17184,7 @@ function listTuningJobsResponseFromMldev(fromObject) {
17205
17184
  }
17206
17185
  return toObject;
17207
17186
  }
17208
- function operationFromMldev(fromObject) {
17187
+ function tuningOperationFromMldev(fromObject) {
17209
17188
  const toObject = {};
17210
17189
  const fromName = getValueByPath(fromObject, ['name']);
17211
17190
  if (fromName != null) {
@@ -17632,7 +17611,7 @@ class Tunings extends BaseModule {
17632
17611
  return httpResponse.json();
17633
17612
  });
17634
17613
  return response.then((apiResponse) => {
17635
- const resp = operationFromMldev(apiResponse);
17614
+ const resp = tuningOperationFromMldev(apiResponse);
17636
17615
  return resp;
17637
17616
  });
17638
17617
  }