@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/README.md +7 -12
- package/dist/genai.d.ts +73 -21
- package/dist/index.cjs +1323 -1344
- package/dist/index.mjs +1323 -1344
- package/dist/index.mjs.map +1 -1
- package/dist/node/index.cjs +1330 -1350
- package/dist/node/index.mjs +1330 -1350
- package/dist/node/index.mjs.map +1 -1
- package/dist/node/node.d.ts +73 -21
- package/dist/web/index.mjs +1329 -1350
- package/dist/web/index.mjs.map +1 -1
- package/dist/web/web.d.ts +73 -21
- package/package.json +5 -5
package/dist/node/index.mjs
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
1
|
import { GoogleAuth } from 'google-auth-library';
|
|
3
2
|
import { createWriteStream, writeFile } from 'fs';
|
|
4
3
|
import { Readable } from 'node:stream';
|
|
@@ -796,11 +795,38 @@ var PersonGeneration;
|
|
|
796
795
|
/** Enum that specifies the language of the text in the prompt. */
|
|
797
796
|
var ImagePromptLanguage;
|
|
798
797
|
(function (ImagePromptLanguage) {
|
|
798
|
+
/**
|
|
799
|
+
* Auto-detect the language.
|
|
800
|
+
*/
|
|
799
801
|
ImagePromptLanguage["auto"] = "auto";
|
|
802
|
+
/**
|
|
803
|
+
* English
|
|
804
|
+
*/
|
|
800
805
|
ImagePromptLanguage["en"] = "en";
|
|
806
|
+
/**
|
|
807
|
+
* Japanese
|
|
808
|
+
*/
|
|
801
809
|
ImagePromptLanguage["ja"] = "ja";
|
|
810
|
+
/**
|
|
811
|
+
* Korean
|
|
812
|
+
*/
|
|
802
813
|
ImagePromptLanguage["ko"] = "ko";
|
|
814
|
+
/**
|
|
815
|
+
* Hindi
|
|
816
|
+
*/
|
|
803
817
|
ImagePromptLanguage["hi"] = "hi";
|
|
818
|
+
/**
|
|
819
|
+
* Chinese
|
|
820
|
+
*/
|
|
821
|
+
ImagePromptLanguage["zh"] = "zh";
|
|
822
|
+
/**
|
|
823
|
+
* Portuguese
|
|
824
|
+
*/
|
|
825
|
+
ImagePromptLanguage["pt"] = "pt";
|
|
826
|
+
/**
|
|
827
|
+
* Spanish
|
|
828
|
+
*/
|
|
829
|
+
ImagePromptLanguage["es"] = "es";
|
|
804
830
|
})(ImagePromptLanguage || (ImagePromptLanguage = {}));
|
|
805
831
|
/** Enum representing the mask mode of a mask reference image. */
|
|
806
832
|
var MaskReferenceMode;
|
|
@@ -1901,133 +1927,12 @@ function tContents(origin) {
|
|
|
1901
1927
|
}
|
|
1902
1928
|
return result;
|
|
1903
1929
|
}
|
|
1904
|
-
// The fields that are supported by JSONSchema. Must be kept in sync with the
|
|
1905
|
-
// JSONSchema interface above.
|
|
1906
|
-
const supportedJsonSchemaFields = new Set([
|
|
1907
|
-
'type',
|
|
1908
|
-
'format',
|
|
1909
|
-
'title',
|
|
1910
|
-
'description',
|
|
1911
|
-
'default',
|
|
1912
|
-
'items',
|
|
1913
|
-
'minItems',
|
|
1914
|
-
'maxItems',
|
|
1915
|
-
'enum',
|
|
1916
|
-
'properties',
|
|
1917
|
-
'required',
|
|
1918
|
-
'minProperties',
|
|
1919
|
-
'maxProperties',
|
|
1920
|
-
'minimum',
|
|
1921
|
-
'maximum',
|
|
1922
|
-
'minLength',
|
|
1923
|
-
'maxLength',
|
|
1924
|
-
'pattern',
|
|
1925
|
-
'anyOf',
|
|
1926
|
-
'propertyOrdering',
|
|
1927
|
-
]);
|
|
1928
|
-
const jsonSchemaTypeValidator = z.enum([
|
|
1929
|
-
'string',
|
|
1930
|
-
'number',
|
|
1931
|
-
'integer',
|
|
1932
|
-
'object',
|
|
1933
|
-
'array',
|
|
1934
|
-
'boolean',
|
|
1935
|
-
'null',
|
|
1936
|
-
]);
|
|
1937
|
-
// Handles all types and arrays of all types.
|
|
1938
|
-
const schemaTypeUnion = z.union([
|
|
1939
|
-
jsonSchemaTypeValidator,
|
|
1940
|
-
z.array(jsonSchemaTypeValidator),
|
|
1941
|
-
]);
|
|
1942
|
-
/**
|
|
1943
|
-
* Creates a zod validator for JSONSchema.
|
|
1944
|
-
*
|
|
1945
|
-
* @param strictMode Whether to enable strict mode, default to true. When
|
|
1946
|
-
* strict mode is enabled, the zod validator will throw error if there
|
|
1947
|
-
* are unrecognized fields in the input data. If strict mode is
|
|
1948
|
-
* disabled, the zod validator will ignore the unrecognized fields, only
|
|
1949
|
-
* populate the fields that are listed in the JSONSchema. Regardless of
|
|
1950
|
-
* the mode the type mismatch will always result in an error, for example
|
|
1951
|
-
* items field should be a single JSONSchema, but for tuple type it would
|
|
1952
|
-
* be an array of JSONSchema, this will always result in an error.
|
|
1953
|
-
* @return The zod validator for JSONSchema.
|
|
1954
|
-
*/
|
|
1955
|
-
function createJsonSchemaValidator(strictMode = true) {
|
|
1956
|
-
const jsonSchemaValidator = z.lazy(() => {
|
|
1957
|
-
// Define the base object shape *inside* the z.lazy callback
|
|
1958
|
-
const baseShape = z.object({
|
|
1959
|
-
// --- Type ---
|
|
1960
|
-
type: schemaTypeUnion.optional(),
|
|
1961
|
-
// --- Annotations ---
|
|
1962
|
-
format: z.string().optional(),
|
|
1963
|
-
title: z.string().optional(),
|
|
1964
|
-
description: z.string().optional(),
|
|
1965
|
-
default: z.unknown().optional(),
|
|
1966
|
-
// --- Array Validations ---
|
|
1967
|
-
items: jsonSchemaValidator.optional(),
|
|
1968
|
-
minItems: z.coerce.string().optional(),
|
|
1969
|
-
maxItems: z.coerce.string().optional(),
|
|
1970
|
-
// --- Generic Validations ---
|
|
1971
|
-
enum: z.array(z.unknown()).optional(),
|
|
1972
|
-
// --- Object Validations ---
|
|
1973
|
-
properties: z.record(z.string(), jsonSchemaValidator).optional(),
|
|
1974
|
-
required: z.array(z.string()).optional(),
|
|
1975
|
-
minProperties: z.coerce.string().optional(),
|
|
1976
|
-
maxProperties: z.coerce.string().optional(),
|
|
1977
|
-
propertyOrdering: z.array(z.string()).optional(),
|
|
1978
|
-
// --- Numeric Validations ---
|
|
1979
|
-
minimum: z.number().optional(),
|
|
1980
|
-
maximum: z.number().optional(),
|
|
1981
|
-
// --- String Validations ---
|
|
1982
|
-
minLength: z.coerce.string().optional(),
|
|
1983
|
-
maxLength: z.coerce.string().optional(),
|
|
1984
|
-
pattern: z.string().optional(),
|
|
1985
|
-
// --- Schema Composition ---
|
|
1986
|
-
anyOf: z.array(jsonSchemaValidator).optional(),
|
|
1987
|
-
// --- Additional Properties --- This field is not included in the
|
|
1988
|
-
// JSONSchema, will not be communicated to the model, it is here purely
|
|
1989
|
-
// for enabling the zod validation strict mode.
|
|
1990
|
-
additionalProperties: z.boolean().optional(),
|
|
1991
|
-
});
|
|
1992
|
-
// Conditionally apply .strict() based on the flag
|
|
1993
|
-
return strictMode ? baseShape.strict() : baseShape;
|
|
1994
|
-
});
|
|
1995
|
-
return jsonSchemaValidator;
|
|
1996
|
-
}
|
|
1997
1930
|
/*
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
zod_to_json_schema will squash the types into an array instead of put them
|
|
2004
|
-
in anyOf fields. Otherwise, it will put the types in anyOf fields.
|
|
2005
|
-
See the following link for more details:
|
|
2006
|
-
https://github.com/zodjs/zod-to-json-schema/blob/main/src/index.ts#L101
|
|
2007
|
-
The logic here is trying to undo that optimization, flattening the array of
|
|
2008
|
-
types to anyOf fields.
|
|
2009
|
-
type field
|
|
2010
|
-
|
|
|
2011
|
-
___________________________
|
|
2012
|
-
/ \
|
|
2013
|
-
/ \
|
|
2014
|
-
/ \
|
|
2015
|
-
Array Type.*
|
|
2016
|
-
/ \ |
|
|
2017
|
-
Include null. Not included null type = Type.*.
|
|
2018
|
-
[null, Type.*, Type.*] multiple types.
|
|
2019
|
-
[null, Type.*] [Type.*, Type.*]
|
|
2020
|
-
/ \
|
|
2021
|
-
remove null \
|
|
2022
|
-
add nullable = true \
|
|
2023
|
-
/ \ \
|
|
2024
|
-
[Type.*] [Type.*, Type.*] \
|
|
2025
|
-
only one type left multiple types left \
|
|
2026
|
-
add type = Type.*. \ /
|
|
2027
|
-
\ /
|
|
2028
|
-
not populate the type field in final result
|
|
2029
|
-
and make the types into anyOf fields
|
|
2030
|
-
anyOf:[{type: 'Type.*'}, {type: 'Type.*'}];
|
|
1931
|
+
Transform the type field from an array of types to an array of anyOf fields.
|
|
1932
|
+
Example:
|
|
1933
|
+
{type: ['STRING', 'NUMBER']}
|
|
1934
|
+
will be transformed to
|
|
1935
|
+
{anyOf: [{type: 'STRING'}, {type: 'NUMBER'}]}
|
|
2031
1936
|
*/
|
|
2032
1937
|
function flattenTypeArrayToAnyOf(typeList, resultingSchema) {
|
|
2033
1938
|
if (typeList.includes('null')) {
|
|
@@ -2173,15 +2078,11 @@ function processJsonSchema(_jsonSchema) {
|
|
|
2173
2078
|
// https://github.com/StefanTerdell/zod-to-json-schema/blob/70525efe555cd226691e093d171370a3b10921d1/src/zodToJsonSchema.ts#L7
|
|
2174
2079
|
// typebox can return unknown, see details in
|
|
2175
2080
|
// https://github.com/sinclairzx81/typebox/blob/5a5431439f7d5ca6b494d0d18fbfd7b1a356d67c/src/type/create/type.ts#L35
|
|
2081
|
+
// Note: proper json schemas with the $schema field set never arrive to this
|
|
2082
|
+
// transformer. Schemas with $schema are routed to the equivalent API json
|
|
2083
|
+
// schema field.
|
|
2176
2084
|
function tSchema(schema) {
|
|
2177
|
-
|
|
2178
|
-
delete schema['$schema'];
|
|
2179
|
-
const validatedJsonSchema = createJsonSchemaValidator().parse(schema);
|
|
2180
|
-
return processJsonSchema(validatedJsonSchema);
|
|
2181
|
-
}
|
|
2182
|
-
else {
|
|
2183
|
-
return processJsonSchema(schema);
|
|
2184
|
-
}
|
|
2085
|
+
return processJsonSchema(schema);
|
|
2185
2086
|
}
|
|
2186
2087
|
function tSpeechConfig(speechConfig) {
|
|
2187
2088
|
if (typeof speechConfig === 'object') {
|
|
@@ -2210,10 +2111,28 @@ function tTool(tool) {
|
|
|
2210
2111
|
if (tool.functionDeclarations) {
|
|
2211
2112
|
for (const functionDeclaration of tool.functionDeclarations) {
|
|
2212
2113
|
if (functionDeclaration.parameters) {
|
|
2213
|
-
|
|
2114
|
+
if (!Object.keys(functionDeclaration.parameters).includes('$schema')) {
|
|
2115
|
+
functionDeclaration.parameters = processJsonSchema(functionDeclaration.parameters);
|
|
2116
|
+
}
|
|
2117
|
+
else {
|
|
2118
|
+
if (!functionDeclaration.parametersJsonSchema) {
|
|
2119
|
+
functionDeclaration.parametersJsonSchema =
|
|
2120
|
+
functionDeclaration.parameters;
|
|
2121
|
+
delete functionDeclaration.parameters;
|
|
2122
|
+
}
|
|
2123
|
+
}
|
|
2214
2124
|
}
|
|
2215
2125
|
if (functionDeclaration.response) {
|
|
2216
|
-
|
|
2126
|
+
if (!Object.keys(functionDeclaration.response).includes('$schema')) {
|
|
2127
|
+
functionDeclaration.response = processJsonSchema(functionDeclaration.response);
|
|
2128
|
+
}
|
|
2129
|
+
else {
|
|
2130
|
+
if (!functionDeclaration.responseJsonSchema) {
|
|
2131
|
+
functionDeclaration.responseJsonSchema =
|
|
2132
|
+
functionDeclaration.response;
|
|
2133
|
+
delete functionDeclaration.response;
|
|
2134
|
+
}
|
|
2135
|
+
}
|
|
2217
2136
|
}
|
|
2218
2137
|
}
|
|
2219
2138
|
}
|
|
@@ -2418,7 +2337,7 @@ function mcpToGeminiTool(mcpTool, config = {}) {
|
|
|
2418
2337
|
const functionDeclaration = {
|
|
2419
2338
|
name: mcpToolSchema['name'],
|
|
2420
2339
|
description: mcpToolSchema['description'],
|
|
2421
|
-
|
|
2340
|
+
parametersJsonSchema: mcpToolSchema['inputSchema'],
|
|
2422
2341
|
};
|
|
2423
2342
|
if (config.behavior) {
|
|
2424
2343
|
functionDeclaration['behavior'] = config.behavior;
|
|
@@ -2450,53 +2369,6 @@ function mcpToolsToGeminiTool(mcpTools, config = {}) {
|
|
|
2450
2369
|
}
|
|
2451
2370
|
return { functionDeclarations: functionDeclarations };
|
|
2452
2371
|
}
|
|
2453
|
-
// Filters the list schema field to only include fields that are supported by
|
|
2454
|
-
// JSONSchema.
|
|
2455
|
-
function filterListSchemaField(fieldValue) {
|
|
2456
|
-
const listSchemaFieldValue = [];
|
|
2457
|
-
for (const listFieldValue of fieldValue) {
|
|
2458
|
-
listSchemaFieldValue.push(filterToJsonSchema(listFieldValue));
|
|
2459
|
-
}
|
|
2460
|
-
return listSchemaFieldValue;
|
|
2461
|
-
}
|
|
2462
|
-
// Filters the dict schema field to only include fields that are supported by
|
|
2463
|
-
// JSONSchema.
|
|
2464
|
-
function filterDictSchemaField(fieldValue) {
|
|
2465
|
-
const dictSchemaFieldValue = {};
|
|
2466
|
-
for (const [key, value] of Object.entries(fieldValue)) {
|
|
2467
|
-
const valueRecord = value;
|
|
2468
|
-
dictSchemaFieldValue[key] = filterToJsonSchema(valueRecord);
|
|
2469
|
-
}
|
|
2470
|
-
return dictSchemaFieldValue;
|
|
2471
|
-
}
|
|
2472
|
-
// Filters the schema to only include fields that are supported by JSONSchema.
|
|
2473
|
-
function filterToJsonSchema(schema) {
|
|
2474
|
-
const schemaFieldNames = new Set(['items']); // 'additional_properties' to come
|
|
2475
|
-
const listSchemaFieldNames = new Set(['anyOf']); // 'one_of', 'all_of', 'not' to come
|
|
2476
|
-
const dictSchemaFieldNames = new Set(['properties']); // 'defs' to come
|
|
2477
|
-
const filteredSchema = {};
|
|
2478
|
-
for (const [fieldName, fieldValue] of Object.entries(schema)) {
|
|
2479
|
-
if (schemaFieldNames.has(fieldName)) {
|
|
2480
|
-
filteredSchema[fieldName] = filterToJsonSchema(fieldValue);
|
|
2481
|
-
}
|
|
2482
|
-
else if (listSchemaFieldNames.has(fieldName)) {
|
|
2483
|
-
filteredSchema[fieldName] = filterListSchemaField(fieldValue);
|
|
2484
|
-
}
|
|
2485
|
-
else if (dictSchemaFieldNames.has(fieldName)) {
|
|
2486
|
-
filteredSchema[fieldName] = filterDictSchemaField(fieldValue);
|
|
2487
|
-
}
|
|
2488
|
-
else if (fieldName === 'type') {
|
|
2489
|
-
const typeValue = fieldValue.toUpperCase();
|
|
2490
|
-
filteredSchema[fieldName] = Object.values(Type).includes(typeValue)
|
|
2491
|
-
? typeValue
|
|
2492
|
-
: Type.TYPE_UNSPECIFIED;
|
|
2493
|
-
}
|
|
2494
|
-
else if (supportedJsonSchemaFields.has(fieldName)) {
|
|
2495
|
-
filteredSchema[fieldName] = fieldValue;
|
|
2496
|
-
}
|
|
2497
|
-
}
|
|
2498
|
-
return filteredSchema;
|
|
2499
|
-
}
|
|
2500
2372
|
// Transforms a source input into a BatchJobSource object with validation.
|
|
2501
2373
|
function tBatchJobSource(apiClient, src) {
|
|
2502
2374
|
if (typeof src !== 'string' && !Array.isArray(src)) {
|
|
@@ -2545,6 +2417,9 @@ function tBatchJobSource(apiClient, src) {
|
|
|
2545
2417
|
throw new Error(`Unsupported source: ${src}`);
|
|
2546
2418
|
}
|
|
2547
2419
|
function tBatchJobDestination(dest) {
|
|
2420
|
+
if (typeof dest !== 'string') {
|
|
2421
|
+
return dest;
|
|
2422
|
+
}
|
|
2548
2423
|
const destString = dest;
|
|
2549
2424
|
if (destString.startsWith('gs://')) {
|
|
2550
2425
|
return {
|
|
@@ -3530,10 +3405,6 @@ function deleteBatchJobParametersToVertex(apiClient, fromObject) {
|
|
|
3530
3405
|
}
|
|
3531
3406
|
return toObject;
|
|
3532
3407
|
}
|
|
3533
|
-
function jobErrorFromMldev() {
|
|
3534
|
-
const toObject = {};
|
|
3535
|
-
return toObject;
|
|
3536
|
-
}
|
|
3537
3408
|
function videoMetadataFromMldev$2(fromObject) {
|
|
3538
3409
|
const toObject = {};
|
|
3539
3410
|
const fromFps = getValueByPath(fromObject, ['fps']);
|
|
@@ -3738,6 +3609,12 @@ function candidateFromMldev$1(fromObject) {
|
|
|
3738
3609
|
}
|
|
3739
3610
|
function generateContentResponseFromMldev$1(fromObject) {
|
|
3740
3611
|
const toObject = {};
|
|
3612
|
+
const fromSdkHttpResponse = getValueByPath(fromObject, [
|
|
3613
|
+
'sdkHttpResponse',
|
|
3614
|
+
]);
|
|
3615
|
+
if (fromSdkHttpResponse != null) {
|
|
3616
|
+
setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
|
|
3617
|
+
}
|
|
3741
3618
|
const fromCandidates = getValueByPath(fromObject, ['candidates']);
|
|
3742
3619
|
if (fromCandidates != null) {
|
|
3743
3620
|
let transformedList = fromCandidates;
|
|
@@ -3766,6 +3643,22 @@ function generateContentResponseFromMldev$1(fromObject) {
|
|
|
3766
3643
|
}
|
|
3767
3644
|
return toObject;
|
|
3768
3645
|
}
|
|
3646
|
+
function jobErrorFromMldev(fromObject) {
|
|
3647
|
+
const toObject = {};
|
|
3648
|
+
const fromDetails = getValueByPath(fromObject, ['details']);
|
|
3649
|
+
if (fromDetails != null) {
|
|
3650
|
+
setValueByPath(toObject, ['details'], fromDetails);
|
|
3651
|
+
}
|
|
3652
|
+
const fromCode = getValueByPath(fromObject, ['code']);
|
|
3653
|
+
if (fromCode != null) {
|
|
3654
|
+
setValueByPath(toObject, ['code'], fromCode);
|
|
3655
|
+
}
|
|
3656
|
+
const fromMessage = getValueByPath(fromObject, ['message']);
|
|
3657
|
+
if (fromMessage != null) {
|
|
3658
|
+
setValueByPath(toObject, ['message'], fromMessage);
|
|
3659
|
+
}
|
|
3660
|
+
return toObject;
|
|
3661
|
+
}
|
|
3769
3662
|
function inlinedResponseFromMldev(fromObject) {
|
|
3770
3663
|
const toObject = {};
|
|
3771
3664
|
const fromResponse = getValueByPath(fromObject, ['response']);
|
|
@@ -3774,7 +3667,7 @@ function inlinedResponseFromMldev(fromObject) {
|
|
|
3774
3667
|
}
|
|
3775
3668
|
const fromError = getValueByPath(fromObject, ['error']);
|
|
3776
3669
|
if (fromError != null) {
|
|
3777
|
-
setValueByPath(toObject, ['error'], jobErrorFromMldev());
|
|
3670
|
+
setValueByPath(toObject, ['error'], jobErrorFromMldev(fromError));
|
|
3778
3671
|
}
|
|
3779
3672
|
return toObject;
|
|
3780
3673
|
}
|
|
@@ -3879,7 +3772,7 @@ function deleteResourceJobFromMldev(fromObject) {
|
|
|
3879
3772
|
}
|
|
3880
3773
|
const fromError = getValueByPath(fromObject, ['error']);
|
|
3881
3774
|
if (fromError != null) {
|
|
3882
|
-
setValueByPath(toObject, ['error'], jobErrorFromMldev());
|
|
3775
|
+
setValueByPath(toObject, ['error'], jobErrorFromMldev(fromError));
|
|
3883
3776
|
}
|
|
3884
3777
|
return toObject;
|
|
3885
3778
|
}
|
|
@@ -6645,8 +6538,14 @@ function listFilesResponseFromMldev(fromObject) {
|
|
|
6645
6538
|
}
|
|
6646
6539
|
return toObject;
|
|
6647
6540
|
}
|
|
6648
|
-
function createFileResponseFromMldev() {
|
|
6541
|
+
function createFileResponseFromMldev(fromObject) {
|
|
6649
6542
|
const toObject = {};
|
|
6543
|
+
const fromSdkHttpResponse = getValueByPath(fromObject, [
|
|
6544
|
+
'sdkHttpResponse',
|
|
6545
|
+
]);
|
|
6546
|
+
if (fromSdkHttpResponse != null) {
|
|
6547
|
+
setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
|
|
6548
|
+
}
|
|
6650
6549
|
return toObject;
|
|
6651
6550
|
}
|
|
6652
6551
|
function deleteFileResponseFromMldev() {
|
|
@@ -6819,8 +6718,8 @@ class Files extends BaseModule {
|
|
|
6819
6718
|
.then((httpResponse) => {
|
|
6820
6719
|
return httpResponse.json();
|
|
6821
6720
|
});
|
|
6822
|
-
return response.then(() => {
|
|
6823
|
-
const resp = createFileResponseFromMldev();
|
|
6721
|
+
return response.then((apiResponse) => {
|
|
6722
|
+
const resp = createFileResponseFromMldev(apiResponse);
|
|
6824
6723
|
const typedResp = new CreateFileResponse();
|
|
6825
6724
|
Object.assign(typedResp, resp);
|
|
6826
6725
|
return typedResp;
|
|
@@ -6938,14 +6837,6 @@ function prebuiltVoiceConfigToMldev$2(fromObject) {
|
|
|
6938
6837
|
}
|
|
6939
6838
|
return toObject;
|
|
6940
6839
|
}
|
|
6941
|
-
function prebuiltVoiceConfigToVertex$1(fromObject) {
|
|
6942
|
-
const toObject = {};
|
|
6943
|
-
const fromVoiceName = getValueByPath(fromObject, ['voiceName']);
|
|
6944
|
-
if (fromVoiceName != null) {
|
|
6945
|
-
setValueByPath(toObject, ['voiceName'], fromVoiceName);
|
|
6946
|
-
}
|
|
6947
|
-
return toObject;
|
|
6948
|
-
}
|
|
6949
6840
|
function voiceConfigToMldev$2(fromObject) {
|
|
6950
6841
|
const toObject = {};
|
|
6951
6842
|
const fromPrebuiltVoiceConfig = getValueByPath(fromObject, [
|
|
@@ -6956,16 +6847,6 @@ function voiceConfigToMldev$2(fromObject) {
|
|
|
6956
6847
|
}
|
|
6957
6848
|
return toObject;
|
|
6958
6849
|
}
|
|
6959
|
-
function voiceConfigToVertex$1(fromObject) {
|
|
6960
|
-
const toObject = {};
|
|
6961
|
-
const fromPrebuiltVoiceConfig = getValueByPath(fromObject, [
|
|
6962
|
-
'prebuiltVoiceConfig',
|
|
6963
|
-
]);
|
|
6964
|
-
if (fromPrebuiltVoiceConfig != null) {
|
|
6965
|
-
setValueByPath(toObject, ['prebuiltVoiceConfig'], prebuiltVoiceConfigToVertex$1(fromPrebuiltVoiceConfig));
|
|
6966
|
-
}
|
|
6967
|
-
return toObject;
|
|
6968
|
-
}
|
|
6969
6850
|
function speakerVoiceConfigToMldev$2(fromObject) {
|
|
6970
6851
|
const toObject = {};
|
|
6971
6852
|
const fromSpeaker = getValueByPath(fromObject, ['speaker']);
|
|
@@ -7012,21 +6893,6 @@ function speechConfigToMldev$2(fromObject) {
|
|
|
7012
6893
|
}
|
|
7013
6894
|
return toObject;
|
|
7014
6895
|
}
|
|
7015
|
-
function speechConfigToVertex$1(fromObject) {
|
|
7016
|
-
const toObject = {};
|
|
7017
|
-
const fromVoiceConfig = getValueByPath(fromObject, ['voiceConfig']);
|
|
7018
|
-
if (fromVoiceConfig != null) {
|
|
7019
|
-
setValueByPath(toObject, ['voiceConfig'], voiceConfigToVertex$1(fromVoiceConfig));
|
|
7020
|
-
}
|
|
7021
|
-
if (getValueByPath(fromObject, ['multiSpeakerVoiceConfig']) !== undefined) {
|
|
7022
|
-
throw new Error('multiSpeakerVoiceConfig parameter is not supported in Vertex AI.');
|
|
7023
|
-
}
|
|
7024
|
-
const fromLanguageCode = getValueByPath(fromObject, ['languageCode']);
|
|
7025
|
-
if (fromLanguageCode != null) {
|
|
7026
|
-
setValueByPath(toObject, ['languageCode'], fromLanguageCode);
|
|
7027
|
-
}
|
|
7028
|
-
return toObject;
|
|
7029
|
-
}
|
|
7030
6896
|
function videoMetadataToMldev$2(fromObject) {
|
|
7031
6897
|
const toObject = {};
|
|
7032
6898
|
const fromFps = getValueByPath(fromObject, ['fps']);
|
|
@@ -7043,22 +6909,6 @@ function videoMetadataToMldev$2(fromObject) {
|
|
|
7043
6909
|
}
|
|
7044
6910
|
return toObject;
|
|
7045
6911
|
}
|
|
7046
|
-
function videoMetadataToVertex$1(fromObject) {
|
|
7047
|
-
const toObject = {};
|
|
7048
|
-
const fromFps = getValueByPath(fromObject, ['fps']);
|
|
7049
|
-
if (fromFps != null) {
|
|
7050
|
-
setValueByPath(toObject, ['fps'], fromFps);
|
|
7051
|
-
}
|
|
7052
|
-
const fromEndOffset = getValueByPath(fromObject, ['endOffset']);
|
|
7053
|
-
if (fromEndOffset != null) {
|
|
7054
|
-
setValueByPath(toObject, ['endOffset'], fromEndOffset);
|
|
7055
|
-
}
|
|
7056
|
-
const fromStartOffset = getValueByPath(fromObject, ['startOffset']);
|
|
7057
|
-
if (fromStartOffset != null) {
|
|
7058
|
-
setValueByPath(toObject, ['startOffset'], fromStartOffset);
|
|
7059
|
-
}
|
|
7060
|
-
return toObject;
|
|
7061
|
-
}
|
|
7062
6912
|
function blobToMldev$2(fromObject) {
|
|
7063
6913
|
const toObject = {};
|
|
7064
6914
|
if (getValueByPath(fromObject, ['displayName']) !== undefined) {
|
|
@@ -7074,22 +6924,6 @@ function blobToMldev$2(fromObject) {
|
|
|
7074
6924
|
}
|
|
7075
6925
|
return toObject;
|
|
7076
6926
|
}
|
|
7077
|
-
function blobToVertex$1(fromObject) {
|
|
7078
|
-
const toObject = {};
|
|
7079
|
-
const fromDisplayName = getValueByPath(fromObject, ['displayName']);
|
|
7080
|
-
if (fromDisplayName != null) {
|
|
7081
|
-
setValueByPath(toObject, ['displayName'], fromDisplayName);
|
|
7082
|
-
}
|
|
7083
|
-
const fromData = getValueByPath(fromObject, ['data']);
|
|
7084
|
-
if (fromData != null) {
|
|
7085
|
-
setValueByPath(toObject, ['data'], fromData);
|
|
7086
|
-
}
|
|
7087
|
-
const fromMimeType = getValueByPath(fromObject, ['mimeType']);
|
|
7088
|
-
if (fromMimeType != null) {
|
|
7089
|
-
setValueByPath(toObject, ['mimeType'], fromMimeType);
|
|
7090
|
-
}
|
|
7091
|
-
return toObject;
|
|
7092
|
-
}
|
|
7093
6927
|
function fileDataToMldev$2(fromObject) {
|
|
7094
6928
|
const toObject = {};
|
|
7095
6929
|
if (getValueByPath(fromObject, ['displayName']) !== undefined) {
|
|
@@ -7105,22 +6939,6 @@ function fileDataToMldev$2(fromObject) {
|
|
|
7105
6939
|
}
|
|
7106
6940
|
return toObject;
|
|
7107
6941
|
}
|
|
7108
|
-
function fileDataToVertex$1(fromObject) {
|
|
7109
|
-
const toObject = {};
|
|
7110
|
-
const fromDisplayName = getValueByPath(fromObject, ['displayName']);
|
|
7111
|
-
if (fromDisplayName != null) {
|
|
7112
|
-
setValueByPath(toObject, ['displayName'], fromDisplayName);
|
|
7113
|
-
}
|
|
7114
|
-
const fromFileUri = getValueByPath(fromObject, ['fileUri']);
|
|
7115
|
-
if (fromFileUri != null) {
|
|
7116
|
-
setValueByPath(toObject, ['fileUri'], fromFileUri);
|
|
7117
|
-
}
|
|
7118
|
-
const fromMimeType = getValueByPath(fromObject, ['mimeType']);
|
|
7119
|
-
if (fromMimeType != null) {
|
|
7120
|
-
setValueByPath(toObject, ['mimeType'], fromMimeType);
|
|
7121
|
-
}
|
|
7122
|
-
return toObject;
|
|
7123
|
-
}
|
|
7124
6942
|
function partToMldev$2(fromObject) {
|
|
7125
6943
|
const toObject = {};
|
|
7126
6944
|
const fromVideoMetadata = getValueByPath(fromObject, [
|
|
@@ -7175,60 +6993,6 @@ function partToMldev$2(fromObject) {
|
|
|
7175
6993
|
}
|
|
7176
6994
|
return toObject;
|
|
7177
6995
|
}
|
|
7178
|
-
function partToVertex$1(fromObject) {
|
|
7179
|
-
const toObject = {};
|
|
7180
|
-
const fromVideoMetadata = getValueByPath(fromObject, [
|
|
7181
|
-
'videoMetadata',
|
|
7182
|
-
]);
|
|
7183
|
-
if (fromVideoMetadata != null) {
|
|
7184
|
-
setValueByPath(toObject, ['videoMetadata'], videoMetadataToVertex$1(fromVideoMetadata));
|
|
7185
|
-
}
|
|
7186
|
-
const fromThought = getValueByPath(fromObject, ['thought']);
|
|
7187
|
-
if (fromThought != null) {
|
|
7188
|
-
setValueByPath(toObject, ['thought'], fromThought);
|
|
7189
|
-
}
|
|
7190
|
-
const fromInlineData = getValueByPath(fromObject, ['inlineData']);
|
|
7191
|
-
if (fromInlineData != null) {
|
|
7192
|
-
setValueByPath(toObject, ['inlineData'], blobToVertex$1(fromInlineData));
|
|
7193
|
-
}
|
|
7194
|
-
const fromFileData = getValueByPath(fromObject, ['fileData']);
|
|
7195
|
-
if (fromFileData != null) {
|
|
7196
|
-
setValueByPath(toObject, ['fileData'], fileDataToVertex$1(fromFileData));
|
|
7197
|
-
}
|
|
7198
|
-
const fromThoughtSignature = getValueByPath(fromObject, [
|
|
7199
|
-
'thoughtSignature',
|
|
7200
|
-
]);
|
|
7201
|
-
if (fromThoughtSignature != null) {
|
|
7202
|
-
setValueByPath(toObject, ['thoughtSignature'], fromThoughtSignature);
|
|
7203
|
-
}
|
|
7204
|
-
const fromCodeExecutionResult = getValueByPath(fromObject, [
|
|
7205
|
-
'codeExecutionResult',
|
|
7206
|
-
]);
|
|
7207
|
-
if (fromCodeExecutionResult != null) {
|
|
7208
|
-
setValueByPath(toObject, ['codeExecutionResult'], fromCodeExecutionResult);
|
|
7209
|
-
}
|
|
7210
|
-
const fromExecutableCode = getValueByPath(fromObject, [
|
|
7211
|
-
'executableCode',
|
|
7212
|
-
]);
|
|
7213
|
-
if (fromExecutableCode != null) {
|
|
7214
|
-
setValueByPath(toObject, ['executableCode'], fromExecutableCode);
|
|
7215
|
-
}
|
|
7216
|
-
const fromFunctionCall = getValueByPath(fromObject, ['functionCall']);
|
|
7217
|
-
if (fromFunctionCall != null) {
|
|
7218
|
-
setValueByPath(toObject, ['functionCall'], fromFunctionCall);
|
|
7219
|
-
}
|
|
7220
|
-
const fromFunctionResponse = getValueByPath(fromObject, [
|
|
7221
|
-
'functionResponse',
|
|
7222
|
-
]);
|
|
7223
|
-
if (fromFunctionResponse != null) {
|
|
7224
|
-
setValueByPath(toObject, ['functionResponse'], fromFunctionResponse);
|
|
7225
|
-
}
|
|
7226
|
-
const fromText = getValueByPath(fromObject, ['text']);
|
|
7227
|
-
if (fromText != null) {
|
|
7228
|
-
setValueByPath(toObject, ['text'], fromText);
|
|
7229
|
-
}
|
|
7230
|
-
return toObject;
|
|
7231
|
-
}
|
|
7232
6996
|
function contentToMldev$2(fromObject) {
|
|
7233
6997
|
const toObject = {};
|
|
7234
6998
|
const fromParts = getValueByPath(fromObject, ['parts']);
|
|
@@ -7247,24 +7011,6 @@ function contentToMldev$2(fromObject) {
|
|
|
7247
7011
|
}
|
|
7248
7012
|
return toObject;
|
|
7249
7013
|
}
|
|
7250
|
-
function contentToVertex$1(fromObject) {
|
|
7251
|
-
const toObject = {};
|
|
7252
|
-
const fromParts = getValueByPath(fromObject, ['parts']);
|
|
7253
|
-
if (fromParts != null) {
|
|
7254
|
-
let transformedList = fromParts;
|
|
7255
|
-
if (Array.isArray(transformedList)) {
|
|
7256
|
-
transformedList = transformedList.map((item) => {
|
|
7257
|
-
return partToVertex$1(item);
|
|
7258
|
-
});
|
|
7259
|
-
}
|
|
7260
|
-
setValueByPath(toObject, ['parts'], transformedList);
|
|
7261
|
-
}
|
|
7262
|
-
const fromRole = getValueByPath(fromObject, ['role']);
|
|
7263
|
-
if (fromRole != null) {
|
|
7264
|
-
setValueByPath(toObject, ['role'], fromRole);
|
|
7265
|
-
}
|
|
7266
|
-
return toObject;
|
|
7267
|
-
}
|
|
7268
7014
|
function functionDeclarationToMldev$2(fromObject) {
|
|
7269
7015
|
const toObject = {};
|
|
7270
7016
|
const fromBehavior = getValueByPath(fromObject, ['behavior']);
|
|
@@ -7301,41 +7047,6 @@ function functionDeclarationToMldev$2(fromObject) {
|
|
|
7301
7047
|
}
|
|
7302
7048
|
return toObject;
|
|
7303
7049
|
}
|
|
7304
|
-
function functionDeclarationToVertex$1(fromObject) {
|
|
7305
|
-
const toObject = {};
|
|
7306
|
-
if (getValueByPath(fromObject, ['behavior']) !== undefined) {
|
|
7307
|
-
throw new Error('behavior parameter is not supported in Vertex AI.');
|
|
7308
|
-
}
|
|
7309
|
-
const fromDescription = getValueByPath(fromObject, ['description']);
|
|
7310
|
-
if (fromDescription != null) {
|
|
7311
|
-
setValueByPath(toObject, ['description'], fromDescription);
|
|
7312
|
-
}
|
|
7313
|
-
const fromName = getValueByPath(fromObject, ['name']);
|
|
7314
|
-
if (fromName != null) {
|
|
7315
|
-
setValueByPath(toObject, ['name'], fromName);
|
|
7316
|
-
}
|
|
7317
|
-
const fromParameters = getValueByPath(fromObject, ['parameters']);
|
|
7318
|
-
if (fromParameters != null) {
|
|
7319
|
-
setValueByPath(toObject, ['parameters'], fromParameters);
|
|
7320
|
-
}
|
|
7321
|
-
const fromParametersJsonSchema = getValueByPath(fromObject, [
|
|
7322
|
-
'parametersJsonSchema',
|
|
7323
|
-
]);
|
|
7324
|
-
if (fromParametersJsonSchema != null) {
|
|
7325
|
-
setValueByPath(toObject, ['parametersJsonSchema'], fromParametersJsonSchema);
|
|
7326
|
-
}
|
|
7327
|
-
const fromResponse = getValueByPath(fromObject, ['response']);
|
|
7328
|
-
if (fromResponse != null) {
|
|
7329
|
-
setValueByPath(toObject, ['response'], fromResponse);
|
|
7330
|
-
}
|
|
7331
|
-
const fromResponseJsonSchema = getValueByPath(fromObject, [
|
|
7332
|
-
'responseJsonSchema',
|
|
7333
|
-
]);
|
|
7334
|
-
if (fromResponseJsonSchema != null) {
|
|
7335
|
-
setValueByPath(toObject, ['responseJsonSchema'], fromResponseJsonSchema);
|
|
7336
|
-
}
|
|
7337
|
-
return toObject;
|
|
7338
|
-
}
|
|
7339
7050
|
function intervalToMldev$2(fromObject) {
|
|
7340
7051
|
const toObject = {};
|
|
7341
7052
|
const fromStartTime = getValueByPath(fromObject, ['startTime']);
|
|
@@ -7348,19 +7059,7 @@ function intervalToMldev$2(fromObject) {
|
|
|
7348
7059
|
}
|
|
7349
7060
|
return toObject;
|
|
7350
7061
|
}
|
|
7351
|
-
function
|
|
7352
|
-
const toObject = {};
|
|
7353
|
-
const fromStartTime = getValueByPath(fromObject, ['startTime']);
|
|
7354
|
-
if (fromStartTime != null) {
|
|
7355
|
-
setValueByPath(toObject, ['startTime'], fromStartTime);
|
|
7356
|
-
}
|
|
7357
|
-
const fromEndTime = getValueByPath(fromObject, ['endTime']);
|
|
7358
|
-
if (fromEndTime != null) {
|
|
7359
|
-
setValueByPath(toObject, ['endTime'], fromEndTime);
|
|
7360
|
-
}
|
|
7361
|
-
return toObject;
|
|
7362
|
-
}
|
|
7363
|
-
function googleSearchToMldev$2(fromObject) {
|
|
7062
|
+
function googleSearchToMldev$2(fromObject) {
|
|
7364
7063
|
const toObject = {};
|
|
7365
7064
|
const fromTimeRangeFilter = getValueByPath(fromObject, [
|
|
7366
7065
|
'timeRangeFilter',
|
|
@@ -7370,16 +7069,6 @@ function googleSearchToMldev$2(fromObject) {
|
|
|
7370
7069
|
}
|
|
7371
7070
|
return toObject;
|
|
7372
7071
|
}
|
|
7373
|
-
function googleSearchToVertex$1(fromObject) {
|
|
7374
|
-
const toObject = {};
|
|
7375
|
-
const fromTimeRangeFilter = getValueByPath(fromObject, [
|
|
7376
|
-
'timeRangeFilter',
|
|
7377
|
-
]);
|
|
7378
|
-
if (fromTimeRangeFilter != null) {
|
|
7379
|
-
setValueByPath(toObject, ['timeRangeFilter'], intervalToVertex$1(fromTimeRangeFilter));
|
|
7380
|
-
}
|
|
7381
|
-
return toObject;
|
|
7382
|
-
}
|
|
7383
7072
|
function dynamicRetrievalConfigToMldev$2(fromObject) {
|
|
7384
7073
|
const toObject = {};
|
|
7385
7074
|
const fromMode = getValueByPath(fromObject, ['mode']);
|
|
@@ -7394,20 +7083,6 @@ function dynamicRetrievalConfigToMldev$2(fromObject) {
|
|
|
7394
7083
|
}
|
|
7395
7084
|
return toObject;
|
|
7396
7085
|
}
|
|
7397
|
-
function dynamicRetrievalConfigToVertex$1(fromObject) {
|
|
7398
|
-
const toObject = {};
|
|
7399
|
-
const fromMode = getValueByPath(fromObject, ['mode']);
|
|
7400
|
-
if (fromMode != null) {
|
|
7401
|
-
setValueByPath(toObject, ['mode'], fromMode);
|
|
7402
|
-
}
|
|
7403
|
-
const fromDynamicThreshold = getValueByPath(fromObject, [
|
|
7404
|
-
'dynamicThreshold',
|
|
7405
|
-
]);
|
|
7406
|
-
if (fromDynamicThreshold != null) {
|
|
7407
|
-
setValueByPath(toObject, ['dynamicThreshold'], fromDynamicThreshold);
|
|
7408
|
-
}
|
|
7409
|
-
return toObject;
|
|
7410
|
-
}
|
|
7411
7086
|
function googleSearchRetrievalToMldev$2(fromObject) {
|
|
7412
7087
|
const toObject = {};
|
|
7413
7088
|
const fromDynamicRetrievalConfig = getValueByPath(fromObject, [
|
|
@@ -7418,76 +7093,10 @@ function googleSearchRetrievalToMldev$2(fromObject) {
|
|
|
7418
7093
|
}
|
|
7419
7094
|
return toObject;
|
|
7420
7095
|
}
|
|
7421
|
-
function googleSearchRetrievalToVertex$1(fromObject) {
|
|
7422
|
-
const toObject = {};
|
|
7423
|
-
const fromDynamicRetrievalConfig = getValueByPath(fromObject, [
|
|
7424
|
-
'dynamicRetrievalConfig',
|
|
7425
|
-
]);
|
|
7426
|
-
if (fromDynamicRetrievalConfig != null) {
|
|
7427
|
-
setValueByPath(toObject, ['dynamicRetrievalConfig'], dynamicRetrievalConfigToVertex$1(fromDynamicRetrievalConfig));
|
|
7428
|
-
}
|
|
7429
|
-
return toObject;
|
|
7430
|
-
}
|
|
7431
|
-
function enterpriseWebSearchToVertex$1() {
|
|
7432
|
-
const toObject = {};
|
|
7433
|
-
return toObject;
|
|
7434
|
-
}
|
|
7435
|
-
function apiKeyConfigToVertex$1(fromObject) {
|
|
7436
|
-
const toObject = {};
|
|
7437
|
-
const fromApiKeyString = getValueByPath(fromObject, ['apiKeyString']);
|
|
7438
|
-
if (fromApiKeyString != null) {
|
|
7439
|
-
setValueByPath(toObject, ['apiKeyString'], fromApiKeyString);
|
|
7440
|
-
}
|
|
7441
|
-
return toObject;
|
|
7442
|
-
}
|
|
7443
|
-
function authConfigToVertex$1(fromObject) {
|
|
7444
|
-
const toObject = {};
|
|
7445
|
-
const fromApiKeyConfig = getValueByPath(fromObject, ['apiKeyConfig']);
|
|
7446
|
-
if (fromApiKeyConfig != null) {
|
|
7447
|
-
setValueByPath(toObject, ['apiKeyConfig'], apiKeyConfigToVertex$1(fromApiKeyConfig));
|
|
7448
|
-
}
|
|
7449
|
-
const fromAuthType = getValueByPath(fromObject, ['authType']);
|
|
7450
|
-
if (fromAuthType != null) {
|
|
7451
|
-
setValueByPath(toObject, ['authType'], fromAuthType);
|
|
7452
|
-
}
|
|
7453
|
-
const fromGoogleServiceAccountConfig = getValueByPath(fromObject, [
|
|
7454
|
-
'googleServiceAccountConfig',
|
|
7455
|
-
]);
|
|
7456
|
-
if (fromGoogleServiceAccountConfig != null) {
|
|
7457
|
-
setValueByPath(toObject, ['googleServiceAccountConfig'], fromGoogleServiceAccountConfig);
|
|
7458
|
-
}
|
|
7459
|
-
const fromHttpBasicAuthConfig = getValueByPath(fromObject, [
|
|
7460
|
-
'httpBasicAuthConfig',
|
|
7461
|
-
]);
|
|
7462
|
-
if (fromHttpBasicAuthConfig != null) {
|
|
7463
|
-
setValueByPath(toObject, ['httpBasicAuthConfig'], fromHttpBasicAuthConfig);
|
|
7464
|
-
}
|
|
7465
|
-
const fromOauthConfig = getValueByPath(fromObject, ['oauthConfig']);
|
|
7466
|
-
if (fromOauthConfig != null) {
|
|
7467
|
-
setValueByPath(toObject, ['oauthConfig'], fromOauthConfig);
|
|
7468
|
-
}
|
|
7469
|
-
const fromOidcConfig = getValueByPath(fromObject, ['oidcConfig']);
|
|
7470
|
-
if (fromOidcConfig != null) {
|
|
7471
|
-
setValueByPath(toObject, ['oidcConfig'], fromOidcConfig);
|
|
7472
|
-
}
|
|
7473
|
-
return toObject;
|
|
7474
|
-
}
|
|
7475
|
-
function googleMapsToVertex$1(fromObject) {
|
|
7476
|
-
const toObject = {};
|
|
7477
|
-
const fromAuthConfig = getValueByPath(fromObject, ['authConfig']);
|
|
7478
|
-
if (fromAuthConfig != null) {
|
|
7479
|
-
setValueByPath(toObject, ['authConfig'], authConfigToVertex$1(fromAuthConfig));
|
|
7480
|
-
}
|
|
7481
|
-
return toObject;
|
|
7482
|
-
}
|
|
7483
7096
|
function urlContextToMldev$2() {
|
|
7484
7097
|
const toObject = {};
|
|
7485
7098
|
return toObject;
|
|
7486
7099
|
}
|
|
7487
|
-
function urlContextToVertex$1() {
|
|
7488
|
-
const toObject = {};
|
|
7489
|
-
return toObject;
|
|
7490
|
-
}
|
|
7491
7100
|
function toolToMldev$2(fromObject) {
|
|
7492
7101
|
const toObject = {};
|
|
7493
7102
|
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
@@ -7537,60 +7146,6 @@ function toolToMldev$2(fromObject) {
|
|
|
7537
7146
|
}
|
|
7538
7147
|
return toObject;
|
|
7539
7148
|
}
|
|
7540
|
-
function toolToVertex$1(fromObject) {
|
|
7541
|
-
const toObject = {};
|
|
7542
|
-
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
7543
|
-
'functionDeclarations',
|
|
7544
|
-
]);
|
|
7545
|
-
if (fromFunctionDeclarations != null) {
|
|
7546
|
-
let transformedList = fromFunctionDeclarations;
|
|
7547
|
-
if (Array.isArray(transformedList)) {
|
|
7548
|
-
transformedList = transformedList.map((item) => {
|
|
7549
|
-
return functionDeclarationToVertex$1(item);
|
|
7550
|
-
});
|
|
7551
|
-
}
|
|
7552
|
-
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
7553
|
-
}
|
|
7554
|
-
const fromRetrieval = getValueByPath(fromObject, ['retrieval']);
|
|
7555
|
-
if (fromRetrieval != null) {
|
|
7556
|
-
setValueByPath(toObject, ['retrieval'], fromRetrieval);
|
|
7557
|
-
}
|
|
7558
|
-
const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
|
|
7559
|
-
if (fromGoogleSearch != null) {
|
|
7560
|
-
setValueByPath(toObject, ['googleSearch'], googleSearchToVertex$1(fromGoogleSearch));
|
|
7561
|
-
}
|
|
7562
|
-
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
7563
|
-
'googleSearchRetrieval',
|
|
7564
|
-
]);
|
|
7565
|
-
if (fromGoogleSearchRetrieval != null) {
|
|
7566
|
-
setValueByPath(toObject, ['googleSearchRetrieval'], googleSearchRetrievalToVertex$1(fromGoogleSearchRetrieval));
|
|
7567
|
-
}
|
|
7568
|
-
const fromEnterpriseWebSearch = getValueByPath(fromObject, [
|
|
7569
|
-
'enterpriseWebSearch',
|
|
7570
|
-
]);
|
|
7571
|
-
if (fromEnterpriseWebSearch != null) {
|
|
7572
|
-
setValueByPath(toObject, ['enterpriseWebSearch'], enterpriseWebSearchToVertex$1());
|
|
7573
|
-
}
|
|
7574
|
-
const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
|
|
7575
|
-
if (fromGoogleMaps != null) {
|
|
7576
|
-
setValueByPath(toObject, ['googleMaps'], googleMapsToVertex$1(fromGoogleMaps));
|
|
7577
|
-
}
|
|
7578
|
-
const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
|
|
7579
|
-
if (fromUrlContext != null) {
|
|
7580
|
-
setValueByPath(toObject, ['urlContext'], urlContextToVertex$1());
|
|
7581
|
-
}
|
|
7582
|
-
const fromCodeExecution = getValueByPath(fromObject, [
|
|
7583
|
-
'codeExecution',
|
|
7584
|
-
]);
|
|
7585
|
-
if (fromCodeExecution != null) {
|
|
7586
|
-
setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
|
|
7587
|
-
}
|
|
7588
|
-
const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
|
|
7589
|
-
if (fromComputerUse != null) {
|
|
7590
|
-
setValueByPath(toObject, ['computerUse'], fromComputerUse);
|
|
7591
|
-
}
|
|
7592
|
-
return toObject;
|
|
7593
|
-
}
|
|
7594
7149
|
function sessionResumptionConfigToMldev$1(fromObject) {
|
|
7595
7150
|
const toObject = {};
|
|
7596
7151
|
const fromHandle = getValueByPath(fromObject, ['handle']);
|
|
@@ -7602,26 +7157,10 @@ function sessionResumptionConfigToMldev$1(fromObject) {
|
|
|
7602
7157
|
}
|
|
7603
7158
|
return toObject;
|
|
7604
7159
|
}
|
|
7605
|
-
function sessionResumptionConfigToVertex(fromObject) {
|
|
7606
|
-
const toObject = {};
|
|
7607
|
-
const fromHandle = getValueByPath(fromObject, ['handle']);
|
|
7608
|
-
if (fromHandle != null) {
|
|
7609
|
-
setValueByPath(toObject, ['handle'], fromHandle);
|
|
7610
|
-
}
|
|
7611
|
-
const fromTransparent = getValueByPath(fromObject, ['transparent']);
|
|
7612
|
-
if (fromTransparent != null) {
|
|
7613
|
-
setValueByPath(toObject, ['transparent'], fromTransparent);
|
|
7614
|
-
}
|
|
7615
|
-
return toObject;
|
|
7616
|
-
}
|
|
7617
7160
|
function audioTranscriptionConfigToMldev$1() {
|
|
7618
7161
|
const toObject = {};
|
|
7619
7162
|
return toObject;
|
|
7620
7163
|
}
|
|
7621
|
-
function audioTranscriptionConfigToVertex() {
|
|
7622
|
-
const toObject = {};
|
|
7623
|
-
return toObject;
|
|
7624
|
-
}
|
|
7625
7164
|
function automaticActivityDetectionToMldev$1(fromObject) {
|
|
7626
7165
|
const toObject = {};
|
|
7627
7166
|
const fromDisabled = getValueByPath(fromObject, ['disabled']);
|
|
@@ -7654,38 +7193,6 @@ function automaticActivityDetectionToMldev$1(fromObject) {
|
|
|
7654
7193
|
}
|
|
7655
7194
|
return toObject;
|
|
7656
7195
|
}
|
|
7657
|
-
function automaticActivityDetectionToVertex(fromObject) {
|
|
7658
|
-
const toObject = {};
|
|
7659
|
-
const fromDisabled = getValueByPath(fromObject, ['disabled']);
|
|
7660
|
-
if (fromDisabled != null) {
|
|
7661
|
-
setValueByPath(toObject, ['disabled'], fromDisabled);
|
|
7662
|
-
}
|
|
7663
|
-
const fromStartOfSpeechSensitivity = getValueByPath(fromObject, [
|
|
7664
|
-
'startOfSpeechSensitivity',
|
|
7665
|
-
]);
|
|
7666
|
-
if (fromStartOfSpeechSensitivity != null) {
|
|
7667
|
-
setValueByPath(toObject, ['startOfSpeechSensitivity'], fromStartOfSpeechSensitivity);
|
|
7668
|
-
}
|
|
7669
|
-
const fromEndOfSpeechSensitivity = getValueByPath(fromObject, [
|
|
7670
|
-
'endOfSpeechSensitivity',
|
|
7671
|
-
]);
|
|
7672
|
-
if (fromEndOfSpeechSensitivity != null) {
|
|
7673
|
-
setValueByPath(toObject, ['endOfSpeechSensitivity'], fromEndOfSpeechSensitivity);
|
|
7674
|
-
}
|
|
7675
|
-
const fromPrefixPaddingMs = getValueByPath(fromObject, [
|
|
7676
|
-
'prefixPaddingMs',
|
|
7677
|
-
]);
|
|
7678
|
-
if (fromPrefixPaddingMs != null) {
|
|
7679
|
-
setValueByPath(toObject, ['prefixPaddingMs'], fromPrefixPaddingMs);
|
|
7680
|
-
}
|
|
7681
|
-
const fromSilenceDurationMs = getValueByPath(fromObject, [
|
|
7682
|
-
'silenceDurationMs',
|
|
7683
|
-
]);
|
|
7684
|
-
if (fromSilenceDurationMs != null) {
|
|
7685
|
-
setValueByPath(toObject, ['silenceDurationMs'], fromSilenceDurationMs);
|
|
7686
|
-
}
|
|
7687
|
-
return toObject;
|
|
7688
|
-
}
|
|
7689
7196
|
function realtimeInputConfigToMldev$1(fromObject) {
|
|
7690
7197
|
const toObject = {};
|
|
7691
7198
|
const fromAutomaticActivityDetection = getValueByPath(fromObject, [
|
|
@@ -7706,26 +7213,6 @@ function realtimeInputConfigToMldev$1(fromObject) {
|
|
|
7706
7213
|
}
|
|
7707
7214
|
return toObject;
|
|
7708
7215
|
}
|
|
7709
|
-
function realtimeInputConfigToVertex(fromObject) {
|
|
7710
|
-
const toObject = {};
|
|
7711
|
-
const fromAutomaticActivityDetection = getValueByPath(fromObject, [
|
|
7712
|
-
'automaticActivityDetection',
|
|
7713
|
-
]);
|
|
7714
|
-
if (fromAutomaticActivityDetection != null) {
|
|
7715
|
-
setValueByPath(toObject, ['automaticActivityDetection'], automaticActivityDetectionToVertex(fromAutomaticActivityDetection));
|
|
7716
|
-
}
|
|
7717
|
-
const fromActivityHandling = getValueByPath(fromObject, [
|
|
7718
|
-
'activityHandling',
|
|
7719
|
-
]);
|
|
7720
|
-
if (fromActivityHandling != null) {
|
|
7721
|
-
setValueByPath(toObject, ['activityHandling'], fromActivityHandling);
|
|
7722
|
-
}
|
|
7723
|
-
const fromTurnCoverage = getValueByPath(fromObject, ['turnCoverage']);
|
|
7724
|
-
if (fromTurnCoverage != null) {
|
|
7725
|
-
setValueByPath(toObject, ['turnCoverage'], fromTurnCoverage);
|
|
7726
|
-
}
|
|
7727
|
-
return toObject;
|
|
7728
|
-
}
|
|
7729
7216
|
function slidingWindowToMldev$1(fromObject) {
|
|
7730
7217
|
const toObject = {};
|
|
7731
7218
|
const fromTargetTokens = getValueByPath(fromObject, ['targetTokens']);
|
|
@@ -7734,14 +7221,6 @@ function slidingWindowToMldev$1(fromObject) {
|
|
|
7734
7221
|
}
|
|
7735
7222
|
return toObject;
|
|
7736
7223
|
}
|
|
7737
|
-
function slidingWindowToVertex(fromObject) {
|
|
7738
|
-
const toObject = {};
|
|
7739
|
-
const fromTargetTokens = getValueByPath(fromObject, ['targetTokens']);
|
|
7740
|
-
if (fromTargetTokens != null) {
|
|
7741
|
-
setValueByPath(toObject, ['targetTokens'], fromTargetTokens);
|
|
7742
|
-
}
|
|
7743
|
-
return toObject;
|
|
7744
|
-
}
|
|
7745
7224
|
function contextWindowCompressionConfigToMldev$1(fromObject) {
|
|
7746
7225
|
const toObject = {};
|
|
7747
7226
|
const fromTriggerTokens = getValueByPath(fromObject, [
|
|
@@ -7758,22 +7237,6 @@ function contextWindowCompressionConfigToMldev$1(fromObject) {
|
|
|
7758
7237
|
}
|
|
7759
7238
|
return toObject;
|
|
7760
7239
|
}
|
|
7761
|
-
function contextWindowCompressionConfigToVertex(fromObject) {
|
|
7762
|
-
const toObject = {};
|
|
7763
|
-
const fromTriggerTokens = getValueByPath(fromObject, [
|
|
7764
|
-
'triggerTokens',
|
|
7765
|
-
]);
|
|
7766
|
-
if (fromTriggerTokens != null) {
|
|
7767
|
-
setValueByPath(toObject, ['triggerTokens'], fromTriggerTokens);
|
|
7768
|
-
}
|
|
7769
|
-
const fromSlidingWindow = getValueByPath(fromObject, [
|
|
7770
|
-
'slidingWindow',
|
|
7771
|
-
]);
|
|
7772
|
-
if (fromSlidingWindow != null) {
|
|
7773
|
-
setValueByPath(toObject, ['slidingWindow'], slidingWindowToVertex(fromSlidingWindow));
|
|
7774
|
-
}
|
|
7775
|
-
return toObject;
|
|
7776
|
-
}
|
|
7777
7240
|
function proactivityConfigToMldev$1(fromObject) {
|
|
7778
7241
|
const toObject = {};
|
|
7779
7242
|
const fromProactiveAudio = getValueByPath(fromObject, [
|
|
@@ -7784,16 +7247,6 @@ function proactivityConfigToMldev$1(fromObject) {
|
|
|
7784
7247
|
}
|
|
7785
7248
|
return toObject;
|
|
7786
7249
|
}
|
|
7787
|
-
function proactivityConfigToVertex(fromObject) {
|
|
7788
|
-
const toObject = {};
|
|
7789
|
-
const fromProactiveAudio = getValueByPath(fromObject, [
|
|
7790
|
-
'proactiveAudio',
|
|
7791
|
-
]);
|
|
7792
|
-
if (fromProactiveAudio != null) {
|
|
7793
|
-
setValueByPath(toObject, ['proactiveAudio'], fromProactiveAudio);
|
|
7794
|
-
}
|
|
7795
|
-
return toObject;
|
|
7796
|
-
}
|
|
7797
7250
|
function liveConnectConfigToMldev$1(fromObject, parentObject) {
|
|
7798
7251
|
const toObject = {};
|
|
7799
7252
|
const fromGenerationConfig = getValueByPath(fromObject, [
|
|
@@ -7898,110 +7351,6 @@ function liveConnectConfigToMldev$1(fromObject, parentObject) {
|
|
|
7898
7351
|
}
|
|
7899
7352
|
return toObject;
|
|
7900
7353
|
}
|
|
7901
|
-
function liveConnectConfigToVertex(fromObject, parentObject) {
|
|
7902
|
-
const toObject = {};
|
|
7903
|
-
const fromGenerationConfig = getValueByPath(fromObject, [
|
|
7904
|
-
'generationConfig',
|
|
7905
|
-
]);
|
|
7906
|
-
if (parentObject !== undefined && fromGenerationConfig != null) {
|
|
7907
|
-
setValueByPath(parentObject, ['setup', 'generationConfig'], fromGenerationConfig);
|
|
7908
|
-
}
|
|
7909
|
-
const fromResponseModalities = getValueByPath(fromObject, [
|
|
7910
|
-
'responseModalities',
|
|
7911
|
-
]);
|
|
7912
|
-
if (parentObject !== undefined && fromResponseModalities != null) {
|
|
7913
|
-
setValueByPath(parentObject, ['setup', 'generationConfig', 'responseModalities'], fromResponseModalities);
|
|
7914
|
-
}
|
|
7915
|
-
const fromTemperature = getValueByPath(fromObject, ['temperature']);
|
|
7916
|
-
if (parentObject !== undefined && fromTemperature != null) {
|
|
7917
|
-
setValueByPath(parentObject, ['setup', 'generationConfig', 'temperature'], fromTemperature);
|
|
7918
|
-
}
|
|
7919
|
-
const fromTopP = getValueByPath(fromObject, ['topP']);
|
|
7920
|
-
if (parentObject !== undefined && fromTopP != null) {
|
|
7921
|
-
setValueByPath(parentObject, ['setup', 'generationConfig', 'topP'], fromTopP);
|
|
7922
|
-
}
|
|
7923
|
-
const fromTopK = getValueByPath(fromObject, ['topK']);
|
|
7924
|
-
if (parentObject !== undefined && fromTopK != null) {
|
|
7925
|
-
setValueByPath(parentObject, ['setup', 'generationConfig', 'topK'], fromTopK);
|
|
7926
|
-
}
|
|
7927
|
-
const fromMaxOutputTokens = getValueByPath(fromObject, [
|
|
7928
|
-
'maxOutputTokens',
|
|
7929
|
-
]);
|
|
7930
|
-
if (parentObject !== undefined && fromMaxOutputTokens != null) {
|
|
7931
|
-
setValueByPath(parentObject, ['setup', 'generationConfig', 'maxOutputTokens'], fromMaxOutputTokens);
|
|
7932
|
-
}
|
|
7933
|
-
const fromMediaResolution = getValueByPath(fromObject, [
|
|
7934
|
-
'mediaResolution',
|
|
7935
|
-
]);
|
|
7936
|
-
if (parentObject !== undefined && fromMediaResolution != null) {
|
|
7937
|
-
setValueByPath(parentObject, ['setup', 'generationConfig', 'mediaResolution'], fromMediaResolution);
|
|
7938
|
-
}
|
|
7939
|
-
const fromSeed = getValueByPath(fromObject, ['seed']);
|
|
7940
|
-
if (parentObject !== undefined && fromSeed != null) {
|
|
7941
|
-
setValueByPath(parentObject, ['setup', 'generationConfig', 'seed'], fromSeed);
|
|
7942
|
-
}
|
|
7943
|
-
const fromSpeechConfig = getValueByPath(fromObject, ['speechConfig']);
|
|
7944
|
-
if (parentObject !== undefined && fromSpeechConfig != null) {
|
|
7945
|
-
setValueByPath(parentObject, ['setup', 'generationConfig', 'speechConfig'], speechConfigToVertex$1(tLiveSpeechConfig(fromSpeechConfig)));
|
|
7946
|
-
}
|
|
7947
|
-
const fromEnableAffectiveDialog = getValueByPath(fromObject, [
|
|
7948
|
-
'enableAffectiveDialog',
|
|
7949
|
-
]);
|
|
7950
|
-
if (parentObject !== undefined && fromEnableAffectiveDialog != null) {
|
|
7951
|
-
setValueByPath(parentObject, ['setup', 'generationConfig', 'enableAffectiveDialog'], fromEnableAffectiveDialog);
|
|
7952
|
-
}
|
|
7953
|
-
const fromSystemInstruction = getValueByPath(fromObject, [
|
|
7954
|
-
'systemInstruction',
|
|
7955
|
-
]);
|
|
7956
|
-
if (parentObject !== undefined && fromSystemInstruction != null) {
|
|
7957
|
-
setValueByPath(parentObject, ['setup', 'systemInstruction'], contentToVertex$1(tContent(fromSystemInstruction)));
|
|
7958
|
-
}
|
|
7959
|
-
const fromTools = getValueByPath(fromObject, ['tools']);
|
|
7960
|
-
if (parentObject !== undefined && fromTools != null) {
|
|
7961
|
-
let transformedList = tTools(fromTools);
|
|
7962
|
-
if (Array.isArray(transformedList)) {
|
|
7963
|
-
transformedList = transformedList.map((item) => {
|
|
7964
|
-
return toolToVertex$1(tTool(item));
|
|
7965
|
-
});
|
|
7966
|
-
}
|
|
7967
|
-
setValueByPath(parentObject, ['setup', 'tools'], transformedList);
|
|
7968
|
-
}
|
|
7969
|
-
const fromSessionResumption = getValueByPath(fromObject, [
|
|
7970
|
-
'sessionResumption',
|
|
7971
|
-
]);
|
|
7972
|
-
if (parentObject !== undefined && fromSessionResumption != null) {
|
|
7973
|
-
setValueByPath(parentObject, ['setup', 'sessionResumption'], sessionResumptionConfigToVertex(fromSessionResumption));
|
|
7974
|
-
}
|
|
7975
|
-
const fromInputAudioTranscription = getValueByPath(fromObject, [
|
|
7976
|
-
'inputAudioTranscription',
|
|
7977
|
-
]);
|
|
7978
|
-
if (parentObject !== undefined && fromInputAudioTranscription != null) {
|
|
7979
|
-
setValueByPath(parentObject, ['setup', 'inputAudioTranscription'], audioTranscriptionConfigToVertex());
|
|
7980
|
-
}
|
|
7981
|
-
const fromOutputAudioTranscription = getValueByPath(fromObject, [
|
|
7982
|
-
'outputAudioTranscription',
|
|
7983
|
-
]);
|
|
7984
|
-
if (parentObject !== undefined && fromOutputAudioTranscription != null) {
|
|
7985
|
-
setValueByPath(parentObject, ['setup', 'outputAudioTranscription'], audioTranscriptionConfigToVertex());
|
|
7986
|
-
}
|
|
7987
|
-
const fromRealtimeInputConfig = getValueByPath(fromObject, [
|
|
7988
|
-
'realtimeInputConfig',
|
|
7989
|
-
]);
|
|
7990
|
-
if (parentObject !== undefined && fromRealtimeInputConfig != null) {
|
|
7991
|
-
setValueByPath(parentObject, ['setup', 'realtimeInputConfig'], realtimeInputConfigToVertex(fromRealtimeInputConfig));
|
|
7992
|
-
}
|
|
7993
|
-
const fromContextWindowCompression = getValueByPath(fromObject, [
|
|
7994
|
-
'contextWindowCompression',
|
|
7995
|
-
]);
|
|
7996
|
-
if (parentObject !== undefined && fromContextWindowCompression != null) {
|
|
7997
|
-
setValueByPath(parentObject, ['setup', 'contextWindowCompression'], contextWindowCompressionConfigToVertex(fromContextWindowCompression));
|
|
7998
|
-
}
|
|
7999
|
-
const fromProactivity = getValueByPath(fromObject, ['proactivity']);
|
|
8000
|
-
if (parentObject !== undefined && fromProactivity != null) {
|
|
8001
|
-
setValueByPath(parentObject, ['setup', 'proactivity'], proactivityConfigToVertex(fromProactivity));
|
|
8002
|
-
}
|
|
8003
|
-
return toObject;
|
|
8004
|
-
}
|
|
8005
7354
|
function liveConnectParametersToMldev(apiClient, fromObject) {
|
|
8006
7355
|
const toObject = {};
|
|
8007
7356
|
const fromModel = getValueByPath(fromObject, ['model']);
|
|
@@ -8014,34 +7363,14 @@ function liveConnectParametersToMldev(apiClient, fromObject) {
|
|
|
8014
7363
|
}
|
|
8015
7364
|
return toObject;
|
|
8016
7365
|
}
|
|
8017
|
-
function liveConnectParametersToVertex(apiClient, fromObject) {
|
|
8018
|
-
const toObject = {};
|
|
8019
|
-
const fromModel = getValueByPath(fromObject, ['model']);
|
|
8020
|
-
if (fromModel != null) {
|
|
8021
|
-
setValueByPath(toObject, ['setup', 'model'], tModel(apiClient, fromModel));
|
|
8022
|
-
}
|
|
8023
|
-
const fromConfig = getValueByPath(fromObject, ['config']);
|
|
8024
|
-
if (fromConfig != null) {
|
|
8025
|
-
setValueByPath(toObject, ['config'], liveConnectConfigToVertex(fromConfig, toObject));
|
|
8026
|
-
}
|
|
8027
|
-
return toObject;
|
|
8028
|
-
}
|
|
8029
7366
|
function activityStartToMldev() {
|
|
8030
7367
|
const toObject = {};
|
|
8031
7368
|
return toObject;
|
|
8032
7369
|
}
|
|
8033
|
-
function activityStartToVertex() {
|
|
8034
|
-
const toObject = {};
|
|
8035
|
-
return toObject;
|
|
8036
|
-
}
|
|
8037
7370
|
function activityEndToMldev() {
|
|
8038
7371
|
const toObject = {};
|
|
8039
7372
|
return toObject;
|
|
8040
7373
|
}
|
|
8041
|
-
function activityEndToVertex() {
|
|
8042
|
-
const toObject = {};
|
|
8043
|
-
return toObject;
|
|
8044
|
-
}
|
|
8045
7374
|
function liveSendRealtimeInputParametersToMldev(fromObject) {
|
|
8046
7375
|
const toObject = {};
|
|
8047
7376
|
const fromMedia = getValueByPath(fromObject, ['media']);
|
|
@@ -8078,42 +7407,6 @@ function liveSendRealtimeInputParametersToMldev(fromObject) {
|
|
|
8078
7407
|
}
|
|
8079
7408
|
return toObject;
|
|
8080
7409
|
}
|
|
8081
|
-
function liveSendRealtimeInputParametersToVertex(fromObject) {
|
|
8082
|
-
const toObject = {};
|
|
8083
|
-
const fromMedia = getValueByPath(fromObject, ['media']);
|
|
8084
|
-
if (fromMedia != null) {
|
|
8085
|
-
setValueByPath(toObject, ['mediaChunks'], tBlobs(fromMedia));
|
|
8086
|
-
}
|
|
8087
|
-
const fromAudio = getValueByPath(fromObject, ['audio']);
|
|
8088
|
-
if (fromAudio != null) {
|
|
8089
|
-
setValueByPath(toObject, ['audio'], tAudioBlob(fromAudio));
|
|
8090
|
-
}
|
|
8091
|
-
const fromAudioStreamEnd = getValueByPath(fromObject, [
|
|
8092
|
-
'audioStreamEnd',
|
|
8093
|
-
]);
|
|
8094
|
-
if (fromAudioStreamEnd != null) {
|
|
8095
|
-
setValueByPath(toObject, ['audioStreamEnd'], fromAudioStreamEnd);
|
|
8096
|
-
}
|
|
8097
|
-
const fromVideo = getValueByPath(fromObject, ['video']);
|
|
8098
|
-
if (fromVideo != null) {
|
|
8099
|
-
setValueByPath(toObject, ['video'], tImageBlob(fromVideo));
|
|
8100
|
-
}
|
|
8101
|
-
const fromText = getValueByPath(fromObject, ['text']);
|
|
8102
|
-
if (fromText != null) {
|
|
8103
|
-
setValueByPath(toObject, ['text'], fromText);
|
|
8104
|
-
}
|
|
8105
|
-
const fromActivityStart = getValueByPath(fromObject, [
|
|
8106
|
-
'activityStart',
|
|
8107
|
-
]);
|
|
8108
|
-
if (fromActivityStart != null) {
|
|
8109
|
-
setValueByPath(toObject, ['activityStart'], activityStartToVertex());
|
|
8110
|
-
}
|
|
8111
|
-
const fromActivityEnd = getValueByPath(fromObject, ['activityEnd']);
|
|
8112
|
-
if (fromActivityEnd != null) {
|
|
8113
|
-
setValueByPath(toObject, ['activityEnd'], activityEndToVertex());
|
|
8114
|
-
}
|
|
8115
|
-
return toObject;
|
|
8116
|
-
}
|
|
8117
7410
|
function weightedPromptToMldev(fromObject) {
|
|
8118
7411
|
const toObject = {};
|
|
8119
7412
|
const fromText = getValueByPath(fromObject, ['text']);
|
|
@@ -8252,35 +7545,40 @@ function liveMusicClientMessageToMldev(fromObject) {
|
|
|
8252
7545
|
}
|
|
8253
7546
|
return toObject;
|
|
8254
7547
|
}
|
|
8255
|
-
function
|
|
7548
|
+
function prebuiltVoiceConfigToVertex$1(fromObject) {
|
|
8256
7549
|
const toObject = {};
|
|
7550
|
+
const fromVoiceName = getValueByPath(fromObject, ['voiceName']);
|
|
7551
|
+
if (fromVoiceName != null) {
|
|
7552
|
+
setValueByPath(toObject, ['voiceName'], fromVoiceName);
|
|
7553
|
+
}
|
|
8257
7554
|
return toObject;
|
|
8258
7555
|
}
|
|
8259
|
-
function
|
|
7556
|
+
function voiceConfigToVertex$1(fromObject) {
|
|
8260
7557
|
const toObject = {};
|
|
8261
|
-
const
|
|
8262
|
-
|
|
8263
|
-
|
|
7558
|
+
const fromPrebuiltVoiceConfig = getValueByPath(fromObject, [
|
|
7559
|
+
'prebuiltVoiceConfig',
|
|
7560
|
+
]);
|
|
7561
|
+
if (fromPrebuiltVoiceConfig != null) {
|
|
7562
|
+
setValueByPath(toObject, ['prebuiltVoiceConfig'], prebuiltVoiceConfigToVertex$1(fromPrebuiltVoiceConfig));
|
|
8264
7563
|
}
|
|
8265
7564
|
return toObject;
|
|
8266
7565
|
}
|
|
8267
|
-
function
|
|
7566
|
+
function speechConfigToVertex$1(fromObject) {
|
|
8268
7567
|
const toObject = {};
|
|
8269
|
-
const
|
|
8270
|
-
if (
|
|
8271
|
-
setValueByPath(toObject, ['
|
|
7568
|
+
const fromVoiceConfig = getValueByPath(fromObject, ['voiceConfig']);
|
|
7569
|
+
if (fromVoiceConfig != null) {
|
|
7570
|
+
setValueByPath(toObject, ['voiceConfig'], voiceConfigToVertex$1(fromVoiceConfig));
|
|
8272
7571
|
}
|
|
8273
|
-
|
|
8274
|
-
|
|
8275
|
-
setValueByPath(toObject, ['endOffset'], fromEndOffset);
|
|
7572
|
+
if (getValueByPath(fromObject, ['multiSpeakerVoiceConfig']) !== undefined) {
|
|
7573
|
+
throw new Error('multiSpeakerVoiceConfig parameter is not supported in Vertex AI.');
|
|
8276
7574
|
}
|
|
8277
|
-
const
|
|
8278
|
-
if (
|
|
8279
|
-
setValueByPath(toObject, ['
|
|
7575
|
+
const fromLanguageCode = getValueByPath(fromObject, ['languageCode']);
|
|
7576
|
+
if (fromLanguageCode != null) {
|
|
7577
|
+
setValueByPath(toObject, ['languageCode'], fromLanguageCode);
|
|
8280
7578
|
}
|
|
8281
7579
|
return toObject;
|
|
8282
7580
|
}
|
|
8283
|
-
function
|
|
7581
|
+
function videoMetadataToVertex$1(fromObject) {
|
|
8284
7582
|
const toObject = {};
|
|
8285
7583
|
const fromFps = getValueByPath(fromObject, ['fps']);
|
|
8286
7584
|
if (fromFps != null) {
|
|
@@ -8296,19 +7594,7 @@ function videoMetadataFromVertex$1(fromObject) {
|
|
|
8296
7594
|
}
|
|
8297
7595
|
return toObject;
|
|
8298
7596
|
}
|
|
8299
|
-
function
|
|
8300
|
-
const toObject = {};
|
|
8301
|
-
const fromData = getValueByPath(fromObject, ['data']);
|
|
8302
|
-
if (fromData != null) {
|
|
8303
|
-
setValueByPath(toObject, ['data'], fromData);
|
|
8304
|
-
}
|
|
8305
|
-
const fromMimeType = getValueByPath(fromObject, ['mimeType']);
|
|
8306
|
-
if (fromMimeType != null) {
|
|
8307
|
-
setValueByPath(toObject, ['mimeType'], fromMimeType);
|
|
8308
|
-
}
|
|
8309
|
-
return toObject;
|
|
8310
|
-
}
|
|
8311
|
-
function blobFromVertex$1(fromObject) {
|
|
7597
|
+
function blobToVertex$1(fromObject) {
|
|
8312
7598
|
const toObject = {};
|
|
8313
7599
|
const fromDisplayName = getValueByPath(fromObject, ['displayName']);
|
|
8314
7600
|
if (fromDisplayName != null) {
|
|
@@ -8324,19 +7610,7 @@ function blobFromVertex$1(fromObject) {
|
|
|
8324
7610
|
}
|
|
8325
7611
|
return toObject;
|
|
8326
7612
|
}
|
|
8327
|
-
function
|
|
8328
|
-
const toObject = {};
|
|
8329
|
-
const fromFileUri = getValueByPath(fromObject, ['fileUri']);
|
|
8330
|
-
if (fromFileUri != null) {
|
|
8331
|
-
setValueByPath(toObject, ['fileUri'], fromFileUri);
|
|
8332
|
-
}
|
|
8333
|
-
const fromMimeType = getValueByPath(fromObject, ['mimeType']);
|
|
8334
|
-
if (fromMimeType != null) {
|
|
8335
|
-
setValueByPath(toObject, ['mimeType'], fromMimeType);
|
|
8336
|
-
}
|
|
8337
|
-
return toObject;
|
|
8338
|
-
}
|
|
8339
|
-
function fileDataFromVertex$1(fromObject) {
|
|
7613
|
+
function fileDataToVertex$1(fromObject) {
|
|
8340
7614
|
const toObject = {};
|
|
8341
7615
|
const fromDisplayName = getValueByPath(fromObject, ['displayName']);
|
|
8342
7616
|
if (fromDisplayName != null) {
|
|
@@ -8352,13 +7626,13 @@ function fileDataFromVertex$1(fromObject) {
|
|
|
8352
7626
|
}
|
|
8353
7627
|
return toObject;
|
|
8354
7628
|
}
|
|
8355
|
-
function
|
|
7629
|
+
function partToVertex$1(fromObject) {
|
|
8356
7630
|
const toObject = {};
|
|
8357
7631
|
const fromVideoMetadata = getValueByPath(fromObject, [
|
|
8358
7632
|
'videoMetadata',
|
|
8359
7633
|
]);
|
|
8360
7634
|
if (fromVideoMetadata != null) {
|
|
8361
|
-
setValueByPath(toObject, ['videoMetadata'],
|
|
7635
|
+
setValueByPath(toObject, ['videoMetadata'], videoMetadataToVertex$1(fromVideoMetadata));
|
|
8362
7636
|
}
|
|
8363
7637
|
const fromThought = getValueByPath(fromObject, ['thought']);
|
|
8364
7638
|
if (fromThought != null) {
|
|
@@ -8366,11 +7640,11 @@ function partFromMldev$1(fromObject) {
|
|
|
8366
7640
|
}
|
|
8367
7641
|
const fromInlineData = getValueByPath(fromObject, ['inlineData']);
|
|
8368
7642
|
if (fromInlineData != null) {
|
|
8369
|
-
setValueByPath(toObject, ['inlineData'],
|
|
7643
|
+
setValueByPath(toObject, ['inlineData'], blobToVertex$1(fromInlineData));
|
|
8370
7644
|
}
|
|
8371
7645
|
const fromFileData = getValueByPath(fromObject, ['fileData']);
|
|
8372
7646
|
if (fromFileData != null) {
|
|
8373
|
-
setValueByPath(toObject, ['fileData'],
|
|
7647
|
+
setValueByPath(toObject, ['fileData'], fileDataToVertex$1(fromFileData));
|
|
8374
7648
|
}
|
|
8375
7649
|
const fromThoughtSignature = getValueByPath(fromObject, [
|
|
8376
7650
|
'thoughtSignature',
|
|
@@ -8406,20 +7680,1123 @@ function partFromMldev$1(fromObject) {
|
|
|
8406
7680
|
}
|
|
8407
7681
|
return toObject;
|
|
8408
7682
|
}
|
|
8409
|
-
function
|
|
7683
|
+
function contentToVertex$1(fromObject) {
|
|
8410
7684
|
const toObject = {};
|
|
8411
|
-
const
|
|
8412
|
-
|
|
8413
|
-
|
|
8414
|
-
|
|
8415
|
-
|
|
7685
|
+
const fromParts = getValueByPath(fromObject, ['parts']);
|
|
7686
|
+
if (fromParts != null) {
|
|
7687
|
+
let transformedList = fromParts;
|
|
7688
|
+
if (Array.isArray(transformedList)) {
|
|
7689
|
+
transformedList = transformedList.map((item) => {
|
|
7690
|
+
return partToVertex$1(item);
|
|
7691
|
+
});
|
|
7692
|
+
}
|
|
7693
|
+
setValueByPath(toObject, ['parts'], transformedList);
|
|
8416
7694
|
}
|
|
8417
|
-
const
|
|
8418
|
-
if (
|
|
8419
|
-
setValueByPath(toObject, ['
|
|
7695
|
+
const fromRole = getValueByPath(fromObject, ['role']);
|
|
7696
|
+
if (fromRole != null) {
|
|
7697
|
+
setValueByPath(toObject, ['role'], fromRole);
|
|
8420
7698
|
}
|
|
8421
|
-
|
|
8422
|
-
|
|
7699
|
+
return toObject;
|
|
7700
|
+
}
|
|
7701
|
+
function functionDeclarationToVertex$1(fromObject) {
|
|
7702
|
+
const toObject = {};
|
|
7703
|
+
if (getValueByPath(fromObject, ['behavior']) !== undefined) {
|
|
7704
|
+
throw new Error('behavior parameter is not supported in Vertex AI.');
|
|
7705
|
+
}
|
|
7706
|
+
const fromDescription = getValueByPath(fromObject, ['description']);
|
|
7707
|
+
if (fromDescription != null) {
|
|
7708
|
+
setValueByPath(toObject, ['description'], fromDescription);
|
|
7709
|
+
}
|
|
7710
|
+
const fromName = getValueByPath(fromObject, ['name']);
|
|
7711
|
+
if (fromName != null) {
|
|
7712
|
+
setValueByPath(toObject, ['name'], fromName);
|
|
7713
|
+
}
|
|
7714
|
+
const fromParameters = getValueByPath(fromObject, ['parameters']);
|
|
7715
|
+
if (fromParameters != null) {
|
|
7716
|
+
setValueByPath(toObject, ['parameters'], fromParameters);
|
|
7717
|
+
}
|
|
7718
|
+
const fromParametersJsonSchema = getValueByPath(fromObject, [
|
|
7719
|
+
'parametersJsonSchema',
|
|
7720
|
+
]);
|
|
7721
|
+
if (fromParametersJsonSchema != null) {
|
|
7722
|
+
setValueByPath(toObject, ['parametersJsonSchema'], fromParametersJsonSchema);
|
|
7723
|
+
}
|
|
7724
|
+
const fromResponse = getValueByPath(fromObject, ['response']);
|
|
7725
|
+
if (fromResponse != null) {
|
|
7726
|
+
setValueByPath(toObject, ['response'], fromResponse);
|
|
7727
|
+
}
|
|
7728
|
+
const fromResponseJsonSchema = getValueByPath(fromObject, [
|
|
7729
|
+
'responseJsonSchema',
|
|
7730
|
+
]);
|
|
7731
|
+
if (fromResponseJsonSchema != null) {
|
|
7732
|
+
setValueByPath(toObject, ['responseJsonSchema'], fromResponseJsonSchema);
|
|
7733
|
+
}
|
|
7734
|
+
return toObject;
|
|
7735
|
+
}
|
|
7736
|
+
function intervalToVertex$1(fromObject) {
|
|
7737
|
+
const toObject = {};
|
|
7738
|
+
const fromStartTime = getValueByPath(fromObject, ['startTime']);
|
|
7739
|
+
if (fromStartTime != null) {
|
|
7740
|
+
setValueByPath(toObject, ['startTime'], fromStartTime);
|
|
7741
|
+
}
|
|
7742
|
+
const fromEndTime = getValueByPath(fromObject, ['endTime']);
|
|
7743
|
+
if (fromEndTime != null) {
|
|
7744
|
+
setValueByPath(toObject, ['endTime'], fromEndTime);
|
|
7745
|
+
}
|
|
7746
|
+
return toObject;
|
|
7747
|
+
}
|
|
7748
|
+
function googleSearchToVertex$1(fromObject) {
|
|
7749
|
+
const toObject = {};
|
|
7750
|
+
const fromTimeRangeFilter = getValueByPath(fromObject, [
|
|
7751
|
+
'timeRangeFilter',
|
|
7752
|
+
]);
|
|
7753
|
+
if (fromTimeRangeFilter != null) {
|
|
7754
|
+
setValueByPath(toObject, ['timeRangeFilter'], intervalToVertex$1(fromTimeRangeFilter));
|
|
7755
|
+
}
|
|
7756
|
+
return toObject;
|
|
7757
|
+
}
|
|
7758
|
+
function dynamicRetrievalConfigToVertex$1(fromObject) {
|
|
7759
|
+
const toObject = {};
|
|
7760
|
+
const fromMode = getValueByPath(fromObject, ['mode']);
|
|
7761
|
+
if (fromMode != null) {
|
|
7762
|
+
setValueByPath(toObject, ['mode'], fromMode);
|
|
7763
|
+
}
|
|
7764
|
+
const fromDynamicThreshold = getValueByPath(fromObject, [
|
|
7765
|
+
'dynamicThreshold',
|
|
7766
|
+
]);
|
|
7767
|
+
if (fromDynamicThreshold != null) {
|
|
7768
|
+
setValueByPath(toObject, ['dynamicThreshold'], fromDynamicThreshold);
|
|
7769
|
+
}
|
|
7770
|
+
return toObject;
|
|
7771
|
+
}
|
|
7772
|
+
function googleSearchRetrievalToVertex$1(fromObject) {
|
|
7773
|
+
const toObject = {};
|
|
7774
|
+
const fromDynamicRetrievalConfig = getValueByPath(fromObject, [
|
|
7775
|
+
'dynamicRetrievalConfig',
|
|
7776
|
+
]);
|
|
7777
|
+
if (fromDynamicRetrievalConfig != null) {
|
|
7778
|
+
setValueByPath(toObject, ['dynamicRetrievalConfig'], dynamicRetrievalConfigToVertex$1(fromDynamicRetrievalConfig));
|
|
7779
|
+
}
|
|
7780
|
+
return toObject;
|
|
7781
|
+
}
|
|
7782
|
+
function enterpriseWebSearchToVertex$1() {
|
|
7783
|
+
const toObject = {};
|
|
7784
|
+
return toObject;
|
|
7785
|
+
}
|
|
7786
|
+
function apiKeyConfigToVertex$1(fromObject) {
|
|
7787
|
+
const toObject = {};
|
|
7788
|
+
const fromApiKeyString = getValueByPath(fromObject, ['apiKeyString']);
|
|
7789
|
+
if (fromApiKeyString != null) {
|
|
7790
|
+
setValueByPath(toObject, ['apiKeyString'], fromApiKeyString);
|
|
7791
|
+
}
|
|
7792
|
+
return toObject;
|
|
7793
|
+
}
|
|
7794
|
+
function authConfigToVertex$1(fromObject) {
|
|
7795
|
+
const toObject = {};
|
|
7796
|
+
const fromApiKeyConfig = getValueByPath(fromObject, ['apiKeyConfig']);
|
|
7797
|
+
if (fromApiKeyConfig != null) {
|
|
7798
|
+
setValueByPath(toObject, ['apiKeyConfig'], apiKeyConfigToVertex$1(fromApiKeyConfig));
|
|
7799
|
+
}
|
|
7800
|
+
const fromAuthType = getValueByPath(fromObject, ['authType']);
|
|
7801
|
+
if (fromAuthType != null) {
|
|
7802
|
+
setValueByPath(toObject, ['authType'], fromAuthType);
|
|
7803
|
+
}
|
|
7804
|
+
const fromGoogleServiceAccountConfig = getValueByPath(fromObject, [
|
|
7805
|
+
'googleServiceAccountConfig',
|
|
7806
|
+
]);
|
|
7807
|
+
if (fromGoogleServiceAccountConfig != null) {
|
|
7808
|
+
setValueByPath(toObject, ['googleServiceAccountConfig'], fromGoogleServiceAccountConfig);
|
|
7809
|
+
}
|
|
7810
|
+
const fromHttpBasicAuthConfig = getValueByPath(fromObject, [
|
|
7811
|
+
'httpBasicAuthConfig',
|
|
7812
|
+
]);
|
|
7813
|
+
if (fromHttpBasicAuthConfig != null) {
|
|
7814
|
+
setValueByPath(toObject, ['httpBasicAuthConfig'], fromHttpBasicAuthConfig);
|
|
7815
|
+
}
|
|
7816
|
+
const fromOauthConfig = getValueByPath(fromObject, ['oauthConfig']);
|
|
7817
|
+
if (fromOauthConfig != null) {
|
|
7818
|
+
setValueByPath(toObject, ['oauthConfig'], fromOauthConfig);
|
|
7819
|
+
}
|
|
7820
|
+
const fromOidcConfig = getValueByPath(fromObject, ['oidcConfig']);
|
|
7821
|
+
if (fromOidcConfig != null) {
|
|
7822
|
+
setValueByPath(toObject, ['oidcConfig'], fromOidcConfig);
|
|
7823
|
+
}
|
|
7824
|
+
return toObject;
|
|
7825
|
+
}
|
|
7826
|
+
function googleMapsToVertex$1(fromObject) {
|
|
7827
|
+
const toObject = {};
|
|
7828
|
+
const fromAuthConfig = getValueByPath(fromObject, ['authConfig']);
|
|
7829
|
+
if (fromAuthConfig != null) {
|
|
7830
|
+
setValueByPath(toObject, ['authConfig'], authConfigToVertex$1(fromAuthConfig));
|
|
7831
|
+
}
|
|
7832
|
+
return toObject;
|
|
7833
|
+
}
|
|
7834
|
+
function urlContextToVertex$1() {
|
|
7835
|
+
const toObject = {};
|
|
7836
|
+
return toObject;
|
|
7837
|
+
}
|
|
7838
|
+
function toolToVertex$1(fromObject) {
|
|
7839
|
+
const toObject = {};
|
|
7840
|
+
const fromFunctionDeclarations = getValueByPath(fromObject, [
|
|
7841
|
+
'functionDeclarations',
|
|
7842
|
+
]);
|
|
7843
|
+
if (fromFunctionDeclarations != null) {
|
|
7844
|
+
let transformedList = fromFunctionDeclarations;
|
|
7845
|
+
if (Array.isArray(transformedList)) {
|
|
7846
|
+
transformedList = transformedList.map((item) => {
|
|
7847
|
+
return functionDeclarationToVertex$1(item);
|
|
7848
|
+
});
|
|
7849
|
+
}
|
|
7850
|
+
setValueByPath(toObject, ['functionDeclarations'], transformedList);
|
|
7851
|
+
}
|
|
7852
|
+
const fromRetrieval = getValueByPath(fromObject, ['retrieval']);
|
|
7853
|
+
if (fromRetrieval != null) {
|
|
7854
|
+
setValueByPath(toObject, ['retrieval'], fromRetrieval);
|
|
7855
|
+
}
|
|
7856
|
+
const fromGoogleSearch = getValueByPath(fromObject, ['googleSearch']);
|
|
7857
|
+
if (fromGoogleSearch != null) {
|
|
7858
|
+
setValueByPath(toObject, ['googleSearch'], googleSearchToVertex$1(fromGoogleSearch));
|
|
7859
|
+
}
|
|
7860
|
+
const fromGoogleSearchRetrieval = getValueByPath(fromObject, [
|
|
7861
|
+
'googleSearchRetrieval',
|
|
7862
|
+
]);
|
|
7863
|
+
if (fromGoogleSearchRetrieval != null) {
|
|
7864
|
+
setValueByPath(toObject, ['googleSearchRetrieval'], googleSearchRetrievalToVertex$1(fromGoogleSearchRetrieval));
|
|
7865
|
+
}
|
|
7866
|
+
const fromEnterpriseWebSearch = getValueByPath(fromObject, [
|
|
7867
|
+
'enterpriseWebSearch',
|
|
7868
|
+
]);
|
|
7869
|
+
if (fromEnterpriseWebSearch != null) {
|
|
7870
|
+
setValueByPath(toObject, ['enterpriseWebSearch'], enterpriseWebSearchToVertex$1());
|
|
7871
|
+
}
|
|
7872
|
+
const fromGoogleMaps = getValueByPath(fromObject, ['googleMaps']);
|
|
7873
|
+
if (fromGoogleMaps != null) {
|
|
7874
|
+
setValueByPath(toObject, ['googleMaps'], googleMapsToVertex$1(fromGoogleMaps));
|
|
7875
|
+
}
|
|
7876
|
+
const fromUrlContext = getValueByPath(fromObject, ['urlContext']);
|
|
7877
|
+
if (fromUrlContext != null) {
|
|
7878
|
+
setValueByPath(toObject, ['urlContext'], urlContextToVertex$1());
|
|
7879
|
+
}
|
|
7880
|
+
const fromCodeExecution = getValueByPath(fromObject, [
|
|
7881
|
+
'codeExecution',
|
|
7882
|
+
]);
|
|
7883
|
+
if (fromCodeExecution != null) {
|
|
7884
|
+
setValueByPath(toObject, ['codeExecution'], fromCodeExecution);
|
|
7885
|
+
}
|
|
7886
|
+
const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
|
|
7887
|
+
if (fromComputerUse != null) {
|
|
7888
|
+
setValueByPath(toObject, ['computerUse'], fromComputerUse);
|
|
7889
|
+
}
|
|
7890
|
+
return toObject;
|
|
7891
|
+
}
|
|
7892
|
+
function sessionResumptionConfigToVertex(fromObject) {
|
|
7893
|
+
const toObject = {};
|
|
7894
|
+
const fromHandle = getValueByPath(fromObject, ['handle']);
|
|
7895
|
+
if (fromHandle != null) {
|
|
7896
|
+
setValueByPath(toObject, ['handle'], fromHandle);
|
|
7897
|
+
}
|
|
7898
|
+
const fromTransparent = getValueByPath(fromObject, ['transparent']);
|
|
7899
|
+
if (fromTransparent != null) {
|
|
7900
|
+
setValueByPath(toObject, ['transparent'], fromTransparent);
|
|
7901
|
+
}
|
|
7902
|
+
return toObject;
|
|
7903
|
+
}
|
|
7904
|
+
function audioTranscriptionConfigToVertex() {
|
|
7905
|
+
const toObject = {};
|
|
7906
|
+
return toObject;
|
|
7907
|
+
}
|
|
7908
|
+
function automaticActivityDetectionToVertex(fromObject) {
|
|
7909
|
+
const toObject = {};
|
|
7910
|
+
const fromDisabled = getValueByPath(fromObject, ['disabled']);
|
|
7911
|
+
if (fromDisabled != null) {
|
|
7912
|
+
setValueByPath(toObject, ['disabled'], fromDisabled);
|
|
7913
|
+
}
|
|
7914
|
+
const fromStartOfSpeechSensitivity = getValueByPath(fromObject, [
|
|
7915
|
+
'startOfSpeechSensitivity',
|
|
7916
|
+
]);
|
|
7917
|
+
if (fromStartOfSpeechSensitivity != null) {
|
|
7918
|
+
setValueByPath(toObject, ['startOfSpeechSensitivity'], fromStartOfSpeechSensitivity);
|
|
7919
|
+
}
|
|
7920
|
+
const fromEndOfSpeechSensitivity = getValueByPath(fromObject, [
|
|
7921
|
+
'endOfSpeechSensitivity',
|
|
7922
|
+
]);
|
|
7923
|
+
if (fromEndOfSpeechSensitivity != null) {
|
|
7924
|
+
setValueByPath(toObject, ['endOfSpeechSensitivity'], fromEndOfSpeechSensitivity);
|
|
7925
|
+
}
|
|
7926
|
+
const fromPrefixPaddingMs = getValueByPath(fromObject, [
|
|
7927
|
+
'prefixPaddingMs',
|
|
7928
|
+
]);
|
|
7929
|
+
if (fromPrefixPaddingMs != null) {
|
|
7930
|
+
setValueByPath(toObject, ['prefixPaddingMs'], fromPrefixPaddingMs);
|
|
7931
|
+
}
|
|
7932
|
+
const fromSilenceDurationMs = getValueByPath(fromObject, [
|
|
7933
|
+
'silenceDurationMs',
|
|
7934
|
+
]);
|
|
7935
|
+
if (fromSilenceDurationMs != null) {
|
|
7936
|
+
setValueByPath(toObject, ['silenceDurationMs'], fromSilenceDurationMs);
|
|
7937
|
+
}
|
|
7938
|
+
return toObject;
|
|
7939
|
+
}
|
|
7940
|
+
function realtimeInputConfigToVertex(fromObject) {
|
|
7941
|
+
const toObject = {};
|
|
7942
|
+
const fromAutomaticActivityDetection = getValueByPath(fromObject, [
|
|
7943
|
+
'automaticActivityDetection',
|
|
7944
|
+
]);
|
|
7945
|
+
if (fromAutomaticActivityDetection != null) {
|
|
7946
|
+
setValueByPath(toObject, ['automaticActivityDetection'], automaticActivityDetectionToVertex(fromAutomaticActivityDetection));
|
|
7947
|
+
}
|
|
7948
|
+
const fromActivityHandling = getValueByPath(fromObject, [
|
|
7949
|
+
'activityHandling',
|
|
7950
|
+
]);
|
|
7951
|
+
if (fromActivityHandling != null) {
|
|
7952
|
+
setValueByPath(toObject, ['activityHandling'], fromActivityHandling);
|
|
7953
|
+
}
|
|
7954
|
+
const fromTurnCoverage = getValueByPath(fromObject, ['turnCoverage']);
|
|
7955
|
+
if (fromTurnCoverage != null) {
|
|
7956
|
+
setValueByPath(toObject, ['turnCoverage'], fromTurnCoverage);
|
|
7957
|
+
}
|
|
7958
|
+
return toObject;
|
|
7959
|
+
}
|
|
7960
|
+
function slidingWindowToVertex(fromObject) {
|
|
7961
|
+
const toObject = {};
|
|
7962
|
+
const fromTargetTokens = getValueByPath(fromObject, ['targetTokens']);
|
|
7963
|
+
if (fromTargetTokens != null) {
|
|
7964
|
+
setValueByPath(toObject, ['targetTokens'], fromTargetTokens);
|
|
7965
|
+
}
|
|
7966
|
+
return toObject;
|
|
7967
|
+
}
|
|
7968
|
+
function contextWindowCompressionConfigToVertex(fromObject) {
|
|
7969
|
+
const toObject = {};
|
|
7970
|
+
const fromTriggerTokens = getValueByPath(fromObject, [
|
|
7971
|
+
'triggerTokens',
|
|
7972
|
+
]);
|
|
7973
|
+
if (fromTriggerTokens != null) {
|
|
7974
|
+
setValueByPath(toObject, ['triggerTokens'], fromTriggerTokens);
|
|
7975
|
+
}
|
|
7976
|
+
const fromSlidingWindow = getValueByPath(fromObject, [
|
|
7977
|
+
'slidingWindow',
|
|
7978
|
+
]);
|
|
7979
|
+
if (fromSlidingWindow != null) {
|
|
7980
|
+
setValueByPath(toObject, ['slidingWindow'], slidingWindowToVertex(fromSlidingWindow));
|
|
7981
|
+
}
|
|
7982
|
+
return toObject;
|
|
7983
|
+
}
|
|
7984
|
+
function proactivityConfigToVertex(fromObject) {
|
|
7985
|
+
const toObject = {};
|
|
7986
|
+
const fromProactiveAudio = getValueByPath(fromObject, [
|
|
7987
|
+
'proactiveAudio',
|
|
7988
|
+
]);
|
|
7989
|
+
if (fromProactiveAudio != null) {
|
|
7990
|
+
setValueByPath(toObject, ['proactiveAudio'], fromProactiveAudio);
|
|
7991
|
+
}
|
|
7992
|
+
return toObject;
|
|
7993
|
+
}
|
|
7994
|
+
function liveConnectConfigToVertex(fromObject, parentObject) {
|
|
7995
|
+
const toObject = {};
|
|
7996
|
+
const fromGenerationConfig = getValueByPath(fromObject, [
|
|
7997
|
+
'generationConfig',
|
|
7998
|
+
]);
|
|
7999
|
+
if (parentObject !== undefined && fromGenerationConfig != null) {
|
|
8000
|
+
setValueByPath(parentObject, ['setup', 'generationConfig'], fromGenerationConfig);
|
|
8001
|
+
}
|
|
8002
|
+
const fromResponseModalities = getValueByPath(fromObject, [
|
|
8003
|
+
'responseModalities',
|
|
8004
|
+
]);
|
|
8005
|
+
if (parentObject !== undefined && fromResponseModalities != null) {
|
|
8006
|
+
setValueByPath(parentObject, ['setup', 'generationConfig', 'responseModalities'], fromResponseModalities);
|
|
8007
|
+
}
|
|
8008
|
+
const fromTemperature = getValueByPath(fromObject, ['temperature']);
|
|
8009
|
+
if (parentObject !== undefined && fromTemperature != null) {
|
|
8010
|
+
setValueByPath(parentObject, ['setup', 'generationConfig', 'temperature'], fromTemperature);
|
|
8011
|
+
}
|
|
8012
|
+
const fromTopP = getValueByPath(fromObject, ['topP']);
|
|
8013
|
+
if (parentObject !== undefined && fromTopP != null) {
|
|
8014
|
+
setValueByPath(parentObject, ['setup', 'generationConfig', 'topP'], fromTopP);
|
|
8015
|
+
}
|
|
8016
|
+
const fromTopK = getValueByPath(fromObject, ['topK']);
|
|
8017
|
+
if (parentObject !== undefined && fromTopK != null) {
|
|
8018
|
+
setValueByPath(parentObject, ['setup', 'generationConfig', 'topK'], fromTopK);
|
|
8019
|
+
}
|
|
8020
|
+
const fromMaxOutputTokens = getValueByPath(fromObject, [
|
|
8021
|
+
'maxOutputTokens',
|
|
8022
|
+
]);
|
|
8023
|
+
if (parentObject !== undefined && fromMaxOutputTokens != null) {
|
|
8024
|
+
setValueByPath(parentObject, ['setup', 'generationConfig', 'maxOutputTokens'], fromMaxOutputTokens);
|
|
8025
|
+
}
|
|
8026
|
+
const fromMediaResolution = getValueByPath(fromObject, [
|
|
8027
|
+
'mediaResolution',
|
|
8028
|
+
]);
|
|
8029
|
+
if (parentObject !== undefined && fromMediaResolution != null) {
|
|
8030
|
+
setValueByPath(parentObject, ['setup', 'generationConfig', 'mediaResolution'], fromMediaResolution);
|
|
8031
|
+
}
|
|
8032
|
+
const fromSeed = getValueByPath(fromObject, ['seed']);
|
|
8033
|
+
if (parentObject !== undefined && fromSeed != null) {
|
|
8034
|
+
setValueByPath(parentObject, ['setup', 'generationConfig', 'seed'], fromSeed);
|
|
8035
|
+
}
|
|
8036
|
+
const fromSpeechConfig = getValueByPath(fromObject, ['speechConfig']);
|
|
8037
|
+
if (parentObject !== undefined && fromSpeechConfig != null) {
|
|
8038
|
+
setValueByPath(parentObject, ['setup', 'generationConfig', 'speechConfig'], speechConfigToVertex$1(tLiveSpeechConfig(fromSpeechConfig)));
|
|
8039
|
+
}
|
|
8040
|
+
const fromEnableAffectiveDialog = getValueByPath(fromObject, [
|
|
8041
|
+
'enableAffectiveDialog',
|
|
8042
|
+
]);
|
|
8043
|
+
if (parentObject !== undefined && fromEnableAffectiveDialog != null) {
|
|
8044
|
+
setValueByPath(parentObject, ['setup', 'generationConfig', 'enableAffectiveDialog'], fromEnableAffectiveDialog);
|
|
8045
|
+
}
|
|
8046
|
+
const fromSystemInstruction = getValueByPath(fromObject, [
|
|
8047
|
+
'systemInstruction',
|
|
8048
|
+
]);
|
|
8049
|
+
if (parentObject !== undefined && fromSystemInstruction != null) {
|
|
8050
|
+
setValueByPath(parentObject, ['setup', 'systemInstruction'], contentToVertex$1(tContent(fromSystemInstruction)));
|
|
8051
|
+
}
|
|
8052
|
+
const fromTools = getValueByPath(fromObject, ['tools']);
|
|
8053
|
+
if (parentObject !== undefined && fromTools != null) {
|
|
8054
|
+
let transformedList = tTools(fromTools);
|
|
8055
|
+
if (Array.isArray(transformedList)) {
|
|
8056
|
+
transformedList = transformedList.map((item) => {
|
|
8057
|
+
return toolToVertex$1(tTool(item));
|
|
8058
|
+
});
|
|
8059
|
+
}
|
|
8060
|
+
setValueByPath(parentObject, ['setup', 'tools'], transformedList);
|
|
8061
|
+
}
|
|
8062
|
+
const fromSessionResumption = getValueByPath(fromObject, [
|
|
8063
|
+
'sessionResumption',
|
|
8064
|
+
]);
|
|
8065
|
+
if (parentObject !== undefined && fromSessionResumption != null) {
|
|
8066
|
+
setValueByPath(parentObject, ['setup', 'sessionResumption'], sessionResumptionConfigToVertex(fromSessionResumption));
|
|
8067
|
+
}
|
|
8068
|
+
const fromInputAudioTranscription = getValueByPath(fromObject, [
|
|
8069
|
+
'inputAudioTranscription',
|
|
8070
|
+
]);
|
|
8071
|
+
if (parentObject !== undefined && fromInputAudioTranscription != null) {
|
|
8072
|
+
setValueByPath(parentObject, ['setup', 'inputAudioTranscription'], audioTranscriptionConfigToVertex());
|
|
8073
|
+
}
|
|
8074
|
+
const fromOutputAudioTranscription = getValueByPath(fromObject, [
|
|
8075
|
+
'outputAudioTranscription',
|
|
8076
|
+
]);
|
|
8077
|
+
if (parentObject !== undefined && fromOutputAudioTranscription != null) {
|
|
8078
|
+
setValueByPath(parentObject, ['setup', 'outputAudioTranscription'], audioTranscriptionConfigToVertex());
|
|
8079
|
+
}
|
|
8080
|
+
const fromRealtimeInputConfig = getValueByPath(fromObject, [
|
|
8081
|
+
'realtimeInputConfig',
|
|
8082
|
+
]);
|
|
8083
|
+
if (parentObject !== undefined && fromRealtimeInputConfig != null) {
|
|
8084
|
+
setValueByPath(parentObject, ['setup', 'realtimeInputConfig'], realtimeInputConfigToVertex(fromRealtimeInputConfig));
|
|
8085
|
+
}
|
|
8086
|
+
const fromContextWindowCompression = getValueByPath(fromObject, [
|
|
8087
|
+
'contextWindowCompression',
|
|
8088
|
+
]);
|
|
8089
|
+
if (parentObject !== undefined && fromContextWindowCompression != null) {
|
|
8090
|
+
setValueByPath(parentObject, ['setup', 'contextWindowCompression'], contextWindowCompressionConfigToVertex(fromContextWindowCompression));
|
|
8091
|
+
}
|
|
8092
|
+
const fromProactivity = getValueByPath(fromObject, ['proactivity']);
|
|
8093
|
+
if (parentObject !== undefined && fromProactivity != null) {
|
|
8094
|
+
setValueByPath(parentObject, ['setup', 'proactivity'], proactivityConfigToVertex(fromProactivity));
|
|
8095
|
+
}
|
|
8096
|
+
return toObject;
|
|
8097
|
+
}
|
|
8098
|
+
function liveConnectParametersToVertex(apiClient, fromObject) {
|
|
8099
|
+
const toObject = {};
|
|
8100
|
+
const fromModel = getValueByPath(fromObject, ['model']);
|
|
8101
|
+
if (fromModel != null) {
|
|
8102
|
+
setValueByPath(toObject, ['setup', 'model'], tModel(apiClient, fromModel));
|
|
8103
|
+
}
|
|
8104
|
+
const fromConfig = getValueByPath(fromObject, ['config']);
|
|
8105
|
+
if (fromConfig != null) {
|
|
8106
|
+
setValueByPath(toObject, ['config'], liveConnectConfigToVertex(fromConfig, toObject));
|
|
8107
|
+
}
|
|
8108
|
+
return toObject;
|
|
8109
|
+
}
|
|
8110
|
+
function activityStartToVertex() {
|
|
8111
|
+
const toObject = {};
|
|
8112
|
+
return toObject;
|
|
8113
|
+
}
|
|
8114
|
+
function activityEndToVertex() {
|
|
8115
|
+
const toObject = {};
|
|
8116
|
+
return toObject;
|
|
8117
|
+
}
|
|
8118
|
+
function liveSendRealtimeInputParametersToVertex(fromObject) {
|
|
8119
|
+
const toObject = {};
|
|
8120
|
+
const fromMedia = getValueByPath(fromObject, ['media']);
|
|
8121
|
+
if (fromMedia != null) {
|
|
8122
|
+
setValueByPath(toObject, ['mediaChunks'], tBlobs(fromMedia));
|
|
8123
|
+
}
|
|
8124
|
+
const fromAudio = getValueByPath(fromObject, ['audio']);
|
|
8125
|
+
if (fromAudio != null) {
|
|
8126
|
+
setValueByPath(toObject, ['audio'], tAudioBlob(fromAudio));
|
|
8127
|
+
}
|
|
8128
|
+
const fromAudioStreamEnd = getValueByPath(fromObject, [
|
|
8129
|
+
'audioStreamEnd',
|
|
8130
|
+
]);
|
|
8131
|
+
if (fromAudioStreamEnd != null) {
|
|
8132
|
+
setValueByPath(toObject, ['audioStreamEnd'], fromAudioStreamEnd);
|
|
8133
|
+
}
|
|
8134
|
+
const fromVideo = getValueByPath(fromObject, ['video']);
|
|
8135
|
+
if (fromVideo != null) {
|
|
8136
|
+
setValueByPath(toObject, ['video'], tImageBlob(fromVideo));
|
|
8137
|
+
}
|
|
8138
|
+
const fromText = getValueByPath(fromObject, ['text']);
|
|
8139
|
+
if (fromText != null) {
|
|
8140
|
+
setValueByPath(toObject, ['text'], fromText);
|
|
8141
|
+
}
|
|
8142
|
+
const fromActivityStart = getValueByPath(fromObject, [
|
|
8143
|
+
'activityStart',
|
|
8144
|
+
]);
|
|
8145
|
+
if (fromActivityStart != null) {
|
|
8146
|
+
setValueByPath(toObject, ['activityStart'], activityStartToVertex());
|
|
8147
|
+
}
|
|
8148
|
+
const fromActivityEnd = getValueByPath(fromObject, ['activityEnd']);
|
|
8149
|
+
if (fromActivityEnd != null) {
|
|
8150
|
+
setValueByPath(toObject, ['activityEnd'], activityEndToVertex());
|
|
8151
|
+
}
|
|
8152
|
+
return toObject;
|
|
8153
|
+
}
|
|
8154
|
+
function liveServerSetupCompleteFromMldev() {
|
|
8155
|
+
const toObject = {};
|
|
8156
|
+
return toObject;
|
|
8157
|
+
}
|
|
8158
|
+
function videoMetadataFromMldev$1(fromObject) {
|
|
8159
|
+
const toObject = {};
|
|
8160
|
+
const fromFps = getValueByPath(fromObject, ['fps']);
|
|
8161
|
+
if (fromFps != null) {
|
|
8162
|
+
setValueByPath(toObject, ['fps'], fromFps);
|
|
8163
|
+
}
|
|
8164
|
+
const fromEndOffset = getValueByPath(fromObject, ['endOffset']);
|
|
8165
|
+
if (fromEndOffset != null) {
|
|
8166
|
+
setValueByPath(toObject, ['endOffset'], fromEndOffset);
|
|
8167
|
+
}
|
|
8168
|
+
const fromStartOffset = getValueByPath(fromObject, ['startOffset']);
|
|
8169
|
+
if (fromStartOffset != null) {
|
|
8170
|
+
setValueByPath(toObject, ['startOffset'], fromStartOffset);
|
|
8171
|
+
}
|
|
8172
|
+
return toObject;
|
|
8173
|
+
}
|
|
8174
|
+
function blobFromMldev$1(fromObject) {
|
|
8175
|
+
const toObject = {};
|
|
8176
|
+
const fromData = getValueByPath(fromObject, ['data']);
|
|
8177
|
+
if (fromData != null) {
|
|
8178
|
+
setValueByPath(toObject, ['data'], fromData);
|
|
8179
|
+
}
|
|
8180
|
+
const fromMimeType = getValueByPath(fromObject, ['mimeType']);
|
|
8181
|
+
if (fromMimeType != null) {
|
|
8182
|
+
setValueByPath(toObject, ['mimeType'], fromMimeType);
|
|
8183
|
+
}
|
|
8184
|
+
return toObject;
|
|
8185
|
+
}
|
|
8186
|
+
function fileDataFromMldev$1(fromObject) {
|
|
8187
|
+
const toObject = {};
|
|
8188
|
+
const fromFileUri = getValueByPath(fromObject, ['fileUri']);
|
|
8189
|
+
if (fromFileUri != null) {
|
|
8190
|
+
setValueByPath(toObject, ['fileUri'], fromFileUri);
|
|
8191
|
+
}
|
|
8192
|
+
const fromMimeType = getValueByPath(fromObject, ['mimeType']);
|
|
8193
|
+
if (fromMimeType != null) {
|
|
8194
|
+
setValueByPath(toObject, ['mimeType'], fromMimeType);
|
|
8195
|
+
}
|
|
8196
|
+
return toObject;
|
|
8197
|
+
}
|
|
8198
|
+
function partFromMldev$1(fromObject) {
|
|
8199
|
+
const toObject = {};
|
|
8200
|
+
const fromVideoMetadata = getValueByPath(fromObject, [
|
|
8201
|
+
'videoMetadata',
|
|
8202
|
+
]);
|
|
8203
|
+
if (fromVideoMetadata != null) {
|
|
8204
|
+
setValueByPath(toObject, ['videoMetadata'], videoMetadataFromMldev$1(fromVideoMetadata));
|
|
8205
|
+
}
|
|
8206
|
+
const fromThought = getValueByPath(fromObject, ['thought']);
|
|
8207
|
+
if (fromThought != null) {
|
|
8208
|
+
setValueByPath(toObject, ['thought'], fromThought);
|
|
8209
|
+
}
|
|
8210
|
+
const fromInlineData = getValueByPath(fromObject, ['inlineData']);
|
|
8211
|
+
if (fromInlineData != null) {
|
|
8212
|
+
setValueByPath(toObject, ['inlineData'], blobFromMldev$1(fromInlineData));
|
|
8213
|
+
}
|
|
8214
|
+
const fromFileData = getValueByPath(fromObject, ['fileData']);
|
|
8215
|
+
if (fromFileData != null) {
|
|
8216
|
+
setValueByPath(toObject, ['fileData'], fileDataFromMldev$1(fromFileData));
|
|
8217
|
+
}
|
|
8218
|
+
const fromThoughtSignature = getValueByPath(fromObject, [
|
|
8219
|
+
'thoughtSignature',
|
|
8220
|
+
]);
|
|
8221
|
+
if (fromThoughtSignature != null) {
|
|
8222
|
+
setValueByPath(toObject, ['thoughtSignature'], fromThoughtSignature);
|
|
8223
|
+
}
|
|
8224
|
+
const fromCodeExecutionResult = getValueByPath(fromObject, [
|
|
8225
|
+
'codeExecutionResult',
|
|
8226
|
+
]);
|
|
8227
|
+
if (fromCodeExecutionResult != null) {
|
|
8228
|
+
setValueByPath(toObject, ['codeExecutionResult'], fromCodeExecutionResult);
|
|
8229
|
+
}
|
|
8230
|
+
const fromExecutableCode = getValueByPath(fromObject, [
|
|
8231
|
+
'executableCode',
|
|
8232
|
+
]);
|
|
8233
|
+
if (fromExecutableCode != null) {
|
|
8234
|
+
setValueByPath(toObject, ['executableCode'], fromExecutableCode);
|
|
8235
|
+
}
|
|
8236
|
+
const fromFunctionCall = getValueByPath(fromObject, ['functionCall']);
|
|
8237
|
+
if (fromFunctionCall != null) {
|
|
8238
|
+
setValueByPath(toObject, ['functionCall'], fromFunctionCall);
|
|
8239
|
+
}
|
|
8240
|
+
const fromFunctionResponse = getValueByPath(fromObject, [
|
|
8241
|
+
'functionResponse',
|
|
8242
|
+
]);
|
|
8243
|
+
if (fromFunctionResponse != null) {
|
|
8244
|
+
setValueByPath(toObject, ['functionResponse'], fromFunctionResponse);
|
|
8245
|
+
}
|
|
8246
|
+
const fromText = getValueByPath(fromObject, ['text']);
|
|
8247
|
+
if (fromText != null) {
|
|
8248
|
+
setValueByPath(toObject, ['text'], fromText);
|
|
8249
|
+
}
|
|
8250
|
+
return toObject;
|
|
8251
|
+
}
|
|
8252
|
+
function contentFromMldev$1(fromObject) {
|
|
8253
|
+
const toObject = {};
|
|
8254
|
+
const fromParts = getValueByPath(fromObject, ['parts']);
|
|
8255
|
+
if (fromParts != null) {
|
|
8256
|
+
let transformedList = fromParts;
|
|
8257
|
+
if (Array.isArray(transformedList)) {
|
|
8258
|
+
transformedList = transformedList.map((item) => {
|
|
8259
|
+
return partFromMldev$1(item);
|
|
8260
|
+
});
|
|
8261
|
+
}
|
|
8262
|
+
setValueByPath(toObject, ['parts'], transformedList);
|
|
8263
|
+
}
|
|
8264
|
+
const fromRole = getValueByPath(fromObject, ['role']);
|
|
8265
|
+
if (fromRole != null) {
|
|
8266
|
+
setValueByPath(toObject, ['role'], fromRole);
|
|
8267
|
+
}
|
|
8268
|
+
return toObject;
|
|
8269
|
+
}
|
|
8270
|
+
function transcriptionFromMldev(fromObject) {
|
|
8271
|
+
const toObject = {};
|
|
8272
|
+
const fromText = getValueByPath(fromObject, ['text']);
|
|
8273
|
+
if (fromText != null) {
|
|
8274
|
+
setValueByPath(toObject, ['text'], fromText);
|
|
8275
|
+
}
|
|
8276
|
+
const fromFinished = getValueByPath(fromObject, ['finished']);
|
|
8277
|
+
if (fromFinished != null) {
|
|
8278
|
+
setValueByPath(toObject, ['finished'], fromFinished);
|
|
8279
|
+
}
|
|
8280
|
+
return toObject;
|
|
8281
|
+
}
|
|
8282
|
+
function urlMetadataFromMldev$1(fromObject) {
|
|
8283
|
+
const toObject = {};
|
|
8284
|
+
const fromRetrievedUrl = getValueByPath(fromObject, ['retrievedUrl']);
|
|
8285
|
+
if (fromRetrievedUrl != null) {
|
|
8286
|
+
setValueByPath(toObject, ['retrievedUrl'], fromRetrievedUrl);
|
|
8287
|
+
}
|
|
8288
|
+
const fromUrlRetrievalStatus = getValueByPath(fromObject, [
|
|
8289
|
+
'urlRetrievalStatus',
|
|
8290
|
+
]);
|
|
8291
|
+
if (fromUrlRetrievalStatus != null) {
|
|
8292
|
+
setValueByPath(toObject, ['urlRetrievalStatus'], fromUrlRetrievalStatus);
|
|
8293
|
+
}
|
|
8294
|
+
return toObject;
|
|
8295
|
+
}
|
|
8296
|
+
function urlContextMetadataFromMldev$1(fromObject) {
|
|
8297
|
+
const toObject = {};
|
|
8298
|
+
const fromUrlMetadata = getValueByPath(fromObject, ['urlMetadata']);
|
|
8299
|
+
if (fromUrlMetadata != null) {
|
|
8300
|
+
let transformedList = fromUrlMetadata;
|
|
8301
|
+
if (Array.isArray(transformedList)) {
|
|
8302
|
+
transformedList = transformedList.map((item) => {
|
|
8303
|
+
return urlMetadataFromMldev$1(item);
|
|
8304
|
+
});
|
|
8305
|
+
}
|
|
8306
|
+
setValueByPath(toObject, ['urlMetadata'], transformedList);
|
|
8307
|
+
}
|
|
8308
|
+
return toObject;
|
|
8309
|
+
}
|
|
8310
|
+
function liveServerContentFromMldev(fromObject) {
|
|
8311
|
+
const toObject = {};
|
|
8312
|
+
const fromModelTurn = getValueByPath(fromObject, ['modelTurn']);
|
|
8313
|
+
if (fromModelTurn != null) {
|
|
8314
|
+
setValueByPath(toObject, ['modelTurn'], contentFromMldev$1(fromModelTurn));
|
|
8315
|
+
}
|
|
8316
|
+
const fromTurnComplete = getValueByPath(fromObject, ['turnComplete']);
|
|
8317
|
+
if (fromTurnComplete != null) {
|
|
8318
|
+
setValueByPath(toObject, ['turnComplete'], fromTurnComplete);
|
|
8319
|
+
}
|
|
8320
|
+
const fromInterrupted = getValueByPath(fromObject, ['interrupted']);
|
|
8321
|
+
if (fromInterrupted != null) {
|
|
8322
|
+
setValueByPath(toObject, ['interrupted'], fromInterrupted);
|
|
8323
|
+
}
|
|
8324
|
+
const fromGroundingMetadata = getValueByPath(fromObject, [
|
|
8325
|
+
'groundingMetadata',
|
|
8326
|
+
]);
|
|
8327
|
+
if (fromGroundingMetadata != null) {
|
|
8328
|
+
setValueByPath(toObject, ['groundingMetadata'], fromGroundingMetadata);
|
|
8329
|
+
}
|
|
8330
|
+
const fromGenerationComplete = getValueByPath(fromObject, [
|
|
8331
|
+
'generationComplete',
|
|
8332
|
+
]);
|
|
8333
|
+
if (fromGenerationComplete != null) {
|
|
8334
|
+
setValueByPath(toObject, ['generationComplete'], fromGenerationComplete);
|
|
8335
|
+
}
|
|
8336
|
+
const fromInputTranscription = getValueByPath(fromObject, [
|
|
8337
|
+
'inputTranscription',
|
|
8338
|
+
]);
|
|
8339
|
+
if (fromInputTranscription != null) {
|
|
8340
|
+
setValueByPath(toObject, ['inputTranscription'], transcriptionFromMldev(fromInputTranscription));
|
|
8341
|
+
}
|
|
8342
|
+
const fromOutputTranscription = getValueByPath(fromObject, [
|
|
8343
|
+
'outputTranscription',
|
|
8344
|
+
]);
|
|
8345
|
+
if (fromOutputTranscription != null) {
|
|
8346
|
+
setValueByPath(toObject, ['outputTranscription'], transcriptionFromMldev(fromOutputTranscription));
|
|
8347
|
+
}
|
|
8348
|
+
const fromUrlContextMetadata = getValueByPath(fromObject, [
|
|
8349
|
+
'urlContextMetadata',
|
|
8350
|
+
]);
|
|
8351
|
+
if (fromUrlContextMetadata != null) {
|
|
8352
|
+
setValueByPath(toObject, ['urlContextMetadata'], urlContextMetadataFromMldev$1(fromUrlContextMetadata));
|
|
8353
|
+
}
|
|
8354
|
+
return toObject;
|
|
8355
|
+
}
|
|
8356
|
+
function functionCallFromMldev(fromObject) {
|
|
8357
|
+
const toObject = {};
|
|
8358
|
+
const fromId = getValueByPath(fromObject, ['id']);
|
|
8359
|
+
if (fromId != null) {
|
|
8360
|
+
setValueByPath(toObject, ['id'], fromId);
|
|
8361
|
+
}
|
|
8362
|
+
const fromArgs = getValueByPath(fromObject, ['args']);
|
|
8363
|
+
if (fromArgs != null) {
|
|
8364
|
+
setValueByPath(toObject, ['args'], fromArgs);
|
|
8365
|
+
}
|
|
8366
|
+
const fromName = getValueByPath(fromObject, ['name']);
|
|
8367
|
+
if (fromName != null) {
|
|
8368
|
+
setValueByPath(toObject, ['name'], fromName);
|
|
8369
|
+
}
|
|
8370
|
+
return toObject;
|
|
8371
|
+
}
|
|
8372
|
+
function liveServerToolCallFromMldev(fromObject) {
|
|
8373
|
+
const toObject = {};
|
|
8374
|
+
const fromFunctionCalls = getValueByPath(fromObject, [
|
|
8375
|
+
'functionCalls',
|
|
8376
|
+
]);
|
|
8377
|
+
if (fromFunctionCalls != null) {
|
|
8378
|
+
let transformedList = fromFunctionCalls;
|
|
8379
|
+
if (Array.isArray(transformedList)) {
|
|
8380
|
+
transformedList = transformedList.map((item) => {
|
|
8381
|
+
return functionCallFromMldev(item);
|
|
8382
|
+
});
|
|
8383
|
+
}
|
|
8384
|
+
setValueByPath(toObject, ['functionCalls'], transformedList);
|
|
8385
|
+
}
|
|
8386
|
+
return toObject;
|
|
8387
|
+
}
|
|
8388
|
+
function liveServerToolCallCancellationFromMldev(fromObject) {
|
|
8389
|
+
const toObject = {};
|
|
8390
|
+
const fromIds = getValueByPath(fromObject, ['ids']);
|
|
8391
|
+
if (fromIds != null) {
|
|
8392
|
+
setValueByPath(toObject, ['ids'], fromIds);
|
|
8393
|
+
}
|
|
8394
|
+
return toObject;
|
|
8395
|
+
}
|
|
8396
|
+
function modalityTokenCountFromMldev(fromObject) {
|
|
8397
|
+
const toObject = {};
|
|
8398
|
+
const fromModality = getValueByPath(fromObject, ['modality']);
|
|
8399
|
+
if (fromModality != null) {
|
|
8400
|
+
setValueByPath(toObject, ['modality'], fromModality);
|
|
8401
|
+
}
|
|
8402
|
+
const fromTokenCount = getValueByPath(fromObject, ['tokenCount']);
|
|
8403
|
+
if (fromTokenCount != null) {
|
|
8404
|
+
setValueByPath(toObject, ['tokenCount'], fromTokenCount);
|
|
8405
|
+
}
|
|
8406
|
+
return toObject;
|
|
8407
|
+
}
|
|
8408
|
+
function usageMetadataFromMldev(fromObject) {
|
|
8409
|
+
const toObject = {};
|
|
8410
|
+
const fromPromptTokenCount = getValueByPath(fromObject, [
|
|
8411
|
+
'promptTokenCount',
|
|
8412
|
+
]);
|
|
8413
|
+
if (fromPromptTokenCount != null) {
|
|
8414
|
+
setValueByPath(toObject, ['promptTokenCount'], fromPromptTokenCount);
|
|
8415
|
+
}
|
|
8416
|
+
const fromCachedContentTokenCount = getValueByPath(fromObject, [
|
|
8417
|
+
'cachedContentTokenCount',
|
|
8418
|
+
]);
|
|
8419
|
+
if (fromCachedContentTokenCount != null) {
|
|
8420
|
+
setValueByPath(toObject, ['cachedContentTokenCount'], fromCachedContentTokenCount);
|
|
8421
|
+
}
|
|
8422
|
+
const fromResponseTokenCount = getValueByPath(fromObject, [
|
|
8423
|
+
'responseTokenCount',
|
|
8424
|
+
]);
|
|
8425
|
+
if (fromResponseTokenCount != null) {
|
|
8426
|
+
setValueByPath(toObject, ['responseTokenCount'], fromResponseTokenCount);
|
|
8427
|
+
}
|
|
8428
|
+
const fromToolUsePromptTokenCount = getValueByPath(fromObject, [
|
|
8429
|
+
'toolUsePromptTokenCount',
|
|
8430
|
+
]);
|
|
8431
|
+
if (fromToolUsePromptTokenCount != null) {
|
|
8432
|
+
setValueByPath(toObject, ['toolUsePromptTokenCount'], fromToolUsePromptTokenCount);
|
|
8433
|
+
}
|
|
8434
|
+
const fromThoughtsTokenCount = getValueByPath(fromObject, [
|
|
8435
|
+
'thoughtsTokenCount',
|
|
8436
|
+
]);
|
|
8437
|
+
if (fromThoughtsTokenCount != null) {
|
|
8438
|
+
setValueByPath(toObject, ['thoughtsTokenCount'], fromThoughtsTokenCount);
|
|
8439
|
+
}
|
|
8440
|
+
const fromTotalTokenCount = getValueByPath(fromObject, [
|
|
8441
|
+
'totalTokenCount',
|
|
8442
|
+
]);
|
|
8443
|
+
if (fromTotalTokenCount != null) {
|
|
8444
|
+
setValueByPath(toObject, ['totalTokenCount'], fromTotalTokenCount);
|
|
8445
|
+
}
|
|
8446
|
+
const fromPromptTokensDetails = getValueByPath(fromObject, [
|
|
8447
|
+
'promptTokensDetails',
|
|
8448
|
+
]);
|
|
8449
|
+
if (fromPromptTokensDetails != null) {
|
|
8450
|
+
let transformedList = fromPromptTokensDetails;
|
|
8451
|
+
if (Array.isArray(transformedList)) {
|
|
8452
|
+
transformedList = transformedList.map((item) => {
|
|
8453
|
+
return modalityTokenCountFromMldev(item);
|
|
8454
|
+
});
|
|
8455
|
+
}
|
|
8456
|
+
setValueByPath(toObject, ['promptTokensDetails'], transformedList);
|
|
8457
|
+
}
|
|
8458
|
+
const fromCacheTokensDetails = getValueByPath(fromObject, [
|
|
8459
|
+
'cacheTokensDetails',
|
|
8460
|
+
]);
|
|
8461
|
+
if (fromCacheTokensDetails != null) {
|
|
8462
|
+
let transformedList = fromCacheTokensDetails;
|
|
8463
|
+
if (Array.isArray(transformedList)) {
|
|
8464
|
+
transformedList = transformedList.map((item) => {
|
|
8465
|
+
return modalityTokenCountFromMldev(item);
|
|
8466
|
+
});
|
|
8467
|
+
}
|
|
8468
|
+
setValueByPath(toObject, ['cacheTokensDetails'], transformedList);
|
|
8469
|
+
}
|
|
8470
|
+
const fromResponseTokensDetails = getValueByPath(fromObject, [
|
|
8471
|
+
'responseTokensDetails',
|
|
8472
|
+
]);
|
|
8473
|
+
if (fromResponseTokensDetails != null) {
|
|
8474
|
+
let transformedList = fromResponseTokensDetails;
|
|
8475
|
+
if (Array.isArray(transformedList)) {
|
|
8476
|
+
transformedList = transformedList.map((item) => {
|
|
8477
|
+
return modalityTokenCountFromMldev(item);
|
|
8478
|
+
});
|
|
8479
|
+
}
|
|
8480
|
+
setValueByPath(toObject, ['responseTokensDetails'], transformedList);
|
|
8481
|
+
}
|
|
8482
|
+
const fromToolUsePromptTokensDetails = getValueByPath(fromObject, [
|
|
8483
|
+
'toolUsePromptTokensDetails',
|
|
8484
|
+
]);
|
|
8485
|
+
if (fromToolUsePromptTokensDetails != null) {
|
|
8486
|
+
let transformedList = fromToolUsePromptTokensDetails;
|
|
8487
|
+
if (Array.isArray(transformedList)) {
|
|
8488
|
+
transformedList = transformedList.map((item) => {
|
|
8489
|
+
return modalityTokenCountFromMldev(item);
|
|
8490
|
+
});
|
|
8491
|
+
}
|
|
8492
|
+
setValueByPath(toObject, ['toolUsePromptTokensDetails'], transformedList);
|
|
8493
|
+
}
|
|
8494
|
+
return toObject;
|
|
8495
|
+
}
|
|
8496
|
+
function liveServerGoAwayFromMldev(fromObject) {
|
|
8497
|
+
const toObject = {};
|
|
8498
|
+
const fromTimeLeft = getValueByPath(fromObject, ['timeLeft']);
|
|
8499
|
+
if (fromTimeLeft != null) {
|
|
8500
|
+
setValueByPath(toObject, ['timeLeft'], fromTimeLeft);
|
|
8501
|
+
}
|
|
8502
|
+
return toObject;
|
|
8503
|
+
}
|
|
8504
|
+
function liveServerSessionResumptionUpdateFromMldev(fromObject) {
|
|
8505
|
+
const toObject = {};
|
|
8506
|
+
const fromNewHandle = getValueByPath(fromObject, ['newHandle']);
|
|
8507
|
+
if (fromNewHandle != null) {
|
|
8508
|
+
setValueByPath(toObject, ['newHandle'], fromNewHandle);
|
|
8509
|
+
}
|
|
8510
|
+
const fromResumable = getValueByPath(fromObject, ['resumable']);
|
|
8511
|
+
if (fromResumable != null) {
|
|
8512
|
+
setValueByPath(toObject, ['resumable'], fromResumable);
|
|
8513
|
+
}
|
|
8514
|
+
const fromLastConsumedClientMessageIndex = getValueByPath(fromObject, [
|
|
8515
|
+
'lastConsumedClientMessageIndex',
|
|
8516
|
+
]);
|
|
8517
|
+
if (fromLastConsumedClientMessageIndex != null) {
|
|
8518
|
+
setValueByPath(toObject, ['lastConsumedClientMessageIndex'], fromLastConsumedClientMessageIndex);
|
|
8519
|
+
}
|
|
8520
|
+
return toObject;
|
|
8521
|
+
}
|
|
8522
|
+
function liveServerMessageFromMldev(fromObject) {
|
|
8523
|
+
const toObject = {};
|
|
8524
|
+
const fromSetupComplete = getValueByPath(fromObject, [
|
|
8525
|
+
'setupComplete',
|
|
8526
|
+
]);
|
|
8527
|
+
if (fromSetupComplete != null) {
|
|
8528
|
+
setValueByPath(toObject, ['setupComplete'], liveServerSetupCompleteFromMldev());
|
|
8529
|
+
}
|
|
8530
|
+
const fromServerContent = getValueByPath(fromObject, [
|
|
8531
|
+
'serverContent',
|
|
8532
|
+
]);
|
|
8533
|
+
if (fromServerContent != null) {
|
|
8534
|
+
setValueByPath(toObject, ['serverContent'], liveServerContentFromMldev(fromServerContent));
|
|
8535
|
+
}
|
|
8536
|
+
const fromToolCall = getValueByPath(fromObject, ['toolCall']);
|
|
8537
|
+
if (fromToolCall != null) {
|
|
8538
|
+
setValueByPath(toObject, ['toolCall'], liveServerToolCallFromMldev(fromToolCall));
|
|
8539
|
+
}
|
|
8540
|
+
const fromToolCallCancellation = getValueByPath(fromObject, [
|
|
8541
|
+
'toolCallCancellation',
|
|
8542
|
+
]);
|
|
8543
|
+
if (fromToolCallCancellation != null) {
|
|
8544
|
+
setValueByPath(toObject, ['toolCallCancellation'], liveServerToolCallCancellationFromMldev(fromToolCallCancellation));
|
|
8545
|
+
}
|
|
8546
|
+
const fromUsageMetadata = getValueByPath(fromObject, [
|
|
8547
|
+
'usageMetadata',
|
|
8548
|
+
]);
|
|
8549
|
+
if (fromUsageMetadata != null) {
|
|
8550
|
+
setValueByPath(toObject, ['usageMetadata'], usageMetadataFromMldev(fromUsageMetadata));
|
|
8551
|
+
}
|
|
8552
|
+
const fromGoAway = getValueByPath(fromObject, ['goAway']);
|
|
8553
|
+
if (fromGoAway != null) {
|
|
8554
|
+
setValueByPath(toObject, ['goAway'], liveServerGoAwayFromMldev(fromGoAway));
|
|
8555
|
+
}
|
|
8556
|
+
const fromSessionResumptionUpdate = getValueByPath(fromObject, [
|
|
8557
|
+
'sessionResumptionUpdate',
|
|
8558
|
+
]);
|
|
8559
|
+
if (fromSessionResumptionUpdate != null) {
|
|
8560
|
+
setValueByPath(toObject, ['sessionResumptionUpdate'], liveServerSessionResumptionUpdateFromMldev(fromSessionResumptionUpdate));
|
|
8561
|
+
}
|
|
8562
|
+
return toObject;
|
|
8563
|
+
}
|
|
8564
|
+
function liveMusicServerSetupCompleteFromMldev() {
|
|
8565
|
+
const toObject = {};
|
|
8566
|
+
return toObject;
|
|
8567
|
+
}
|
|
8568
|
+
function weightedPromptFromMldev(fromObject) {
|
|
8569
|
+
const toObject = {};
|
|
8570
|
+
const fromText = getValueByPath(fromObject, ['text']);
|
|
8571
|
+
if (fromText != null) {
|
|
8572
|
+
setValueByPath(toObject, ['text'], fromText);
|
|
8573
|
+
}
|
|
8574
|
+
const fromWeight = getValueByPath(fromObject, ['weight']);
|
|
8575
|
+
if (fromWeight != null) {
|
|
8576
|
+
setValueByPath(toObject, ['weight'], fromWeight);
|
|
8577
|
+
}
|
|
8578
|
+
return toObject;
|
|
8579
|
+
}
|
|
8580
|
+
function liveMusicClientContentFromMldev(fromObject) {
|
|
8581
|
+
const toObject = {};
|
|
8582
|
+
const fromWeightedPrompts = getValueByPath(fromObject, [
|
|
8583
|
+
'weightedPrompts',
|
|
8584
|
+
]);
|
|
8585
|
+
if (fromWeightedPrompts != null) {
|
|
8586
|
+
let transformedList = fromWeightedPrompts;
|
|
8587
|
+
if (Array.isArray(transformedList)) {
|
|
8588
|
+
transformedList = transformedList.map((item) => {
|
|
8589
|
+
return weightedPromptFromMldev(item);
|
|
8590
|
+
});
|
|
8591
|
+
}
|
|
8592
|
+
setValueByPath(toObject, ['weightedPrompts'], transformedList);
|
|
8593
|
+
}
|
|
8594
|
+
return toObject;
|
|
8595
|
+
}
|
|
8596
|
+
function liveMusicGenerationConfigFromMldev(fromObject) {
|
|
8597
|
+
const toObject = {};
|
|
8598
|
+
const fromTemperature = getValueByPath(fromObject, ['temperature']);
|
|
8599
|
+
if (fromTemperature != null) {
|
|
8600
|
+
setValueByPath(toObject, ['temperature'], fromTemperature);
|
|
8601
|
+
}
|
|
8602
|
+
const fromTopK = getValueByPath(fromObject, ['topK']);
|
|
8603
|
+
if (fromTopK != null) {
|
|
8604
|
+
setValueByPath(toObject, ['topK'], fromTopK);
|
|
8605
|
+
}
|
|
8606
|
+
const fromSeed = getValueByPath(fromObject, ['seed']);
|
|
8607
|
+
if (fromSeed != null) {
|
|
8608
|
+
setValueByPath(toObject, ['seed'], fromSeed);
|
|
8609
|
+
}
|
|
8610
|
+
const fromGuidance = getValueByPath(fromObject, ['guidance']);
|
|
8611
|
+
if (fromGuidance != null) {
|
|
8612
|
+
setValueByPath(toObject, ['guidance'], fromGuidance);
|
|
8613
|
+
}
|
|
8614
|
+
const fromBpm = getValueByPath(fromObject, ['bpm']);
|
|
8615
|
+
if (fromBpm != null) {
|
|
8616
|
+
setValueByPath(toObject, ['bpm'], fromBpm);
|
|
8617
|
+
}
|
|
8618
|
+
const fromDensity = getValueByPath(fromObject, ['density']);
|
|
8619
|
+
if (fromDensity != null) {
|
|
8620
|
+
setValueByPath(toObject, ['density'], fromDensity);
|
|
8621
|
+
}
|
|
8622
|
+
const fromBrightness = getValueByPath(fromObject, ['brightness']);
|
|
8623
|
+
if (fromBrightness != null) {
|
|
8624
|
+
setValueByPath(toObject, ['brightness'], fromBrightness);
|
|
8625
|
+
}
|
|
8626
|
+
const fromScale = getValueByPath(fromObject, ['scale']);
|
|
8627
|
+
if (fromScale != null) {
|
|
8628
|
+
setValueByPath(toObject, ['scale'], fromScale);
|
|
8629
|
+
}
|
|
8630
|
+
const fromMuteBass = getValueByPath(fromObject, ['muteBass']);
|
|
8631
|
+
if (fromMuteBass != null) {
|
|
8632
|
+
setValueByPath(toObject, ['muteBass'], fromMuteBass);
|
|
8633
|
+
}
|
|
8634
|
+
const fromMuteDrums = getValueByPath(fromObject, ['muteDrums']);
|
|
8635
|
+
if (fromMuteDrums != null) {
|
|
8636
|
+
setValueByPath(toObject, ['muteDrums'], fromMuteDrums);
|
|
8637
|
+
}
|
|
8638
|
+
const fromOnlyBassAndDrums = getValueByPath(fromObject, [
|
|
8639
|
+
'onlyBassAndDrums',
|
|
8640
|
+
]);
|
|
8641
|
+
if (fromOnlyBassAndDrums != null) {
|
|
8642
|
+
setValueByPath(toObject, ['onlyBassAndDrums'], fromOnlyBassAndDrums);
|
|
8643
|
+
}
|
|
8644
|
+
return toObject;
|
|
8645
|
+
}
|
|
8646
|
+
function liveMusicSourceMetadataFromMldev(fromObject) {
|
|
8647
|
+
const toObject = {};
|
|
8648
|
+
const fromClientContent = getValueByPath(fromObject, [
|
|
8649
|
+
'clientContent',
|
|
8650
|
+
]);
|
|
8651
|
+
if (fromClientContent != null) {
|
|
8652
|
+
setValueByPath(toObject, ['clientContent'], liveMusicClientContentFromMldev(fromClientContent));
|
|
8653
|
+
}
|
|
8654
|
+
const fromMusicGenerationConfig = getValueByPath(fromObject, [
|
|
8655
|
+
'musicGenerationConfig',
|
|
8656
|
+
]);
|
|
8657
|
+
if (fromMusicGenerationConfig != null) {
|
|
8658
|
+
setValueByPath(toObject, ['musicGenerationConfig'], liveMusicGenerationConfigFromMldev(fromMusicGenerationConfig));
|
|
8659
|
+
}
|
|
8660
|
+
return toObject;
|
|
8661
|
+
}
|
|
8662
|
+
function audioChunkFromMldev(fromObject) {
|
|
8663
|
+
const toObject = {};
|
|
8664
|
+
const fromData = getValueByPath(fromObject, ['data']);
|
|
8665
|
+
if (fromData != null) {
|
|
8666
|
+
setValueByPath(toObject, ['data'], fromData);
|
|
8667
|
+
}
|
|
8668
|
+
const fromMimeType = getValueByPath(fromObject, ['mimeType']);
|
|
8669
|
+
if (fromMimeType != null) {
|
|
8670
|
+
setValueByPath(toObject, ['mimeType'], fromMimeType);
|
|
8671
|
+
}
|
|
8672
|
+
const fromSourceMetadata = getValueByPath(fromObject, [
|
|
8673
|
+
'sourceMetadata',
|
|
8674
|
+
]);
|
|
8675
|
+
if (fromSourceMetadata != null) {
|
|
8676
|
+
setValueByPath(toObject, ['sourceMetadata'], liveMusicSourceMetadataFromMldev(fromSourceMetadata));
|
|
8677
|
+
}
|
|
8678
|
+
return toObject;
|
|
8679
|
+
}
|
|
8680
|
+
function liveMusicServerContentFromMldev(fromObject) {
|
|
8681
|
+
const toObject = {};
|
|
8682
|
+
const fromAudioChunks = getValueByPath(fromObject, ['audioChunks']);
|
|
8683
|
+
if (fromAudioChunks != null) {
|
|
8684
|
+
let transformedList = fromAudioChunks;
|
|
8685
|
+
if (Array.isArray(transformedList)) {
|
|
8686
|
+
transformedList = transformedList.map((item) => {
|
|
8687
|
+
return audioChunkFromMldev(item);
|
|
8688
|
+
});
|
|
8689
|
+
}
|
|
8690
|
+
setValueByPath(toObject, ['audioChunks'], transformedList);
|
|
8691
|
+
}
|
|
8692
|
+
return toObject;
|
|
8693
|
+
}
|
|
8694
|
+
function liveMusicFilteredPromptFromMldev(fromObject) {
|
|
8695
|
+
const toObject = {};
|
|
8696
|
+
const fromText = getValueByPath(fromObject, ['text']);
|
|
8697
|
+
if (fromText != null) {
|
|
8698
|
+
setValueByPath(toObject, ['text'], fromText);
|
|
8699
|
+
}
|
|
8700
|
+
const fromFilteredReason = getValueByPath(fromObject, [
|
|
8701
|
+
'filteredReason',
|
|
8702
|
+
]);
|
|
8703
|
+
if (fromFilteredReason != null) {
|
|
8704
|
+
setValueByPath(toObject, ['filteredReason'], fromFilteredReason);
|
|
8705
|
+
}
|
|
8706
|
+
return toObject;
|
|
8707
|
+
}
|
|
8708
|
+
function liveMusicServerMessageFromMldev(fromObject) {
|
|
8709
|
+
const toObject = {};
|
|
8710
|
+
const fromSetupComplete = getValueByPath(fromObject, [
|
|
8711
|
+
'setupComplete',
|
|
8712
|
+
]);
|
|
8713
|
+
if (fromSetupComplete != null) {
|
|
8714
|
+
setValueByPath(toObject, ['setupComplete'], liveMusicServerSetupCompleteFromMldev());
|
|
8715
|
+
}
|
|
8716
|
+
const fromServerContent = getValueByPath(fromObject, [
|
|
8717
|
+
'serverContent',
|
|
8718
|
+
]);
|
|
8719
|
+
if (fromServerContent != null) {
|
|
8720
|
+
setValueByPath(toObject, ['serverContent'], liveMusicServerContentFromMldev(fromServerContent));
|
|
8721
|
+
}
|
|
8722
|
+
const fromFilteredPrompt = getValueByPath(fromObject, [
|
|
8723
|
+
'filteredPrompt',
|
|
8724
|
+
]);
|
|
8725
|
+
if (fromFilteredPrompt != null) {
|
|
8726
|
+
setValueByPath(toObject, ['filteredPrompt'], liveMusicFilteredPromptFromMldev(fromFilteredPrompt));
|
|
8727
|
+
}
|
|
8728
|
+
return toObject;
|
|
8729
|
+
}
|
|
8730
|
+
function liveServerSetupCompleteFromVertex(fromObject) {
|
|
8731
|
+
const toObject = {};
|
|
8732
|
+
const fromSessionId = getValueByPath(fromObject, ['sessionId']);
|
|
8733
|
+
if (fromSessionId != null) {
|
|
8734
|
+
setValueByPath(toObject, ['sessionId'], fromSessionId);
|
|
8735
|
+
}
|
|
8736
|
+
return toObject;
|
|
8737
|
+
}
|
|
8738
|
+
function videoMetadataFromVertex$1(fromObject) {
|
|
8739
|
+
const toObject = {};
|
|
8740
|
+
const fromFps = getValueByPath(fromObject, ['fps']);
|
|
8741
|
+
if (fromFps != null) {
|
|
8742
|
+
setValueByPath(toObject, ['fps'], fromFps);
|
|
8743
|
+
}
|
|
8744
|
+
const fromEndOffset = getValueByPath(fromObject, ['endOffset']);
|
|
8745
|
+
if (fromEndOffset != null) {
|
|
8746
|
+
setValueByPath(toObject, ['endOffset'], fromEndOffset);
|
|
8747
|
+
}
|
|
8748
|
+
const fromStartOffset = getValueByPath(fromObject, ['startOffset']);
|
|
8749
|
+
if (fromStartOffset != null) {
|
|
8750
|
+
setValueByPath(toObject, ['startOffset'], fromStartOffset);
|
|
8751
|
+
}
|
|
8752
|
+
return toObject;
|
|
8753
|
+
}
|
|
8754
|
+
function blobFromVertex$1(fromObject) {
|
|
8755
|
+
const toObject = {};
|
|
8756
|
+
const fromDisplayName = getValueByPath(fromObject, ['displayName']);
|
|
8757
|
+
if (fromDisplayName != null) {
|
|
8758
|
+
setValueByPath(toObject, ['displayName'], fromDisplayName);
|
|
8759
|
+
}
|
|
8760
|
+
const fromData = getValueByPath(fromObject, ['data']);
|
|
8761
|
+
if (fromData != null) {
|
|
8762
|
+
setValueByPath(toObject, ['data'], fromData);
|
|
8763
|
+
}
|
|
8764
|
+
const fromMimeType = getValueByPath(fromObject, ['mimeType']);
|
|
8765
|
+
if (fromMimeType != null) {
|
|
8766
|
+
setValueByPath(toObject, ['mimeType'], fromMimeType);
|
|
8767
|
+
}
|
|
8768
|
+
return toObject;
|
|
8769
|
+
}
|
|
8770
|
+
function fileDataFromVertex$1(fromObject) {
|
|
8771
|
+
const toObject = {};
|
|
8772
|
+
const fromDisplayName = getValueByPath(fromObject, ['displayName']);
|
|
8773
|
+
if (fromDisplayName != null) {
|
|
8774
|
+
setValueByPath(toObject, ['displayName'], fromDisplayName);
|
|
8775
|
+
}
|
|
8776
|
+
const fromFileUri = getValueByPath(fromObject, ['fileUri']);
|
|
8777
|
+
if (fromFileUri != null) {
|
|
8778
|
+
setValueByPath(toObject, ['fileUri'], fromFileUri);
|
|
8779
|
+
}
|
|
8780
|
+
const fromMimeType = getValueByPath(fromObject, ['mimeType']);
|
|
8781
|
+
if (fromMimeType != null) {
|
|
8782
|
+
setValueByPath(toObject, ['mimeType'], fromMimeType);
|
|
8783
|
+
}
|
|
8784
|
+
return toObject;
|
|
8785
|
+
}
|
|
8786
|
+
function partFromVertex$1(fromObject) {
|
|
8787
|
+
const toObject = {};
|
|
8788
|
+
const fromVideoMetadata = getValueByPath(fromObject, [
|
|
8789
|
+
'videoMetadata',
|
|
8790
|
+
]);
|
|
8791
|
+
if (fromVideoMetadata != null) {
|
|
8792
|
+
setValueByPath(toObject, ['videoMetadata'], videoMetadataFromVertex$1(fromVideoMetadata));
|
|
8793
|
+
}
|
|
8794
|
+
const fromThought = getValueByPath(fromObject, ['thought']);
|
|
8795
|
+
if (fromThought != null) {
|
|
8796
|
+
setValueByPath(toObject, ['thought'], fromThought);
|
|
8797
|
+
}
|
|
8798
|
+
const fromInlineData = getValueByPath(fromObject, ['inlineData']);
|
|
8799
|
+
if (fromInlineData != null) {
|
|
8423
8800
|
setValueByPath(toObject, ['inlineData'], blobFromVertex$1(fromInlineData));
|
|
8424
8801
|
}
|
|
8425
8802
|
const fromFileData = getValueByPath(fromObject, ['fileData']);
|
|
@@ -8460,24 +8837,6 @@ function partFromVertex$1(fromObject) {
|
|
|
8460
8837
|
}
|
|
8461
8838
|
return toObject;
|
|
8462
8839
|
}
|
|
8463
|
-
function contentFromMldev$1(fromObject) {
|
|
8464
|
-
const toObject = {};
|
|
8465
|
-
const fromParts = getValueByPath(fromObject, ['parts']);
|
|
8466
|
-
if (fromParts != null) {
|
|
8467
|
-
let transformedList = fromParts;
|
|
8468
|
-
if (Array.isArray(transformedList)) {
|
|
8469
|
-
transformedList = transformedList.map((item) => {
|
|
8470
|
-
return partFromMldev$1(item);
|
|
8471
|
-
});
|
|
8472
|
-
}
|
|
8473
|
-
setValueByPath(toObject, ['parts'], transformedList);
|
|
8474
|
-
}
|
|
8475
|
-
const fromRole = getValueByPath(fromObject, ['role']);
|
|
8476
|
-
if (fromRole != null) {
|
|
8477
|
-
setValueByPath(toObject, ['role'], fromRole);
|
|
8478
|
-
}
|
|
8479
|
-
return toObject;
|
|
8480
|
-
}
|
|
8481
8840
|
function contentFromVertex$1(fromObject) {
|
|
8482
8841
|
const toObject = {};
|
|
8483
8842
|
const fromParts = getValueByPath(fromObject, ['parts']);
|
|
@@ -8496,18 +8855,6 @@ function contentFromVertex$1(fromObject) {
|
|
|
8496
8855
|
}
|
|
8497
8856
|
return toObject;
|
|
8498
8857
|
}
|
|
8499
|
-
function transcriptionFromMldev(fromObject) {
|
|
8500
|
-
const toObject = {};
|
|
8501
|
-
const fromText = getValueByPath(fromObject, ['text']);
|
|
8502
|
-
if (fromText != null) {
|
|
8503
|
-
setValueByPath(toObject, ['text'], fromText);
|
|
8504
|
-
}
|
|
8505
|
-
const fromFinished = getValueByPath(fromObject, ['finished']);
|
|
8506
|
-
if (fromFinished != null) {
|
|
8507
|
-
setValueByPath(toObject, ['finished'], fromFinished);
|
|
8508
|
-
}
|
|
8509
|
-
return toObject;
|
|
8510
|
-
}
|
|
8511
8858
|
function transcriptionFromVertex(fromObject) {
|
|
8512
8859
|
const toObject = {};
|
|
8513
8860
|
const fromText = getValueByPath(fromObject, ['text']);
|
|
@@ -8520,80 +8867,6 @@ function transcriptionFromVertex(fromObject) {
|
|
|
8520
8867
|
}
|
|
8521
8868
|
return toObject;
|
|
8522
8869
|
}
|
|
8523
|
-
function urlMetadataFromMldev$1(fromObject) {
|
|
8524
|
-
const toObject = {};
|
|
8525
|
-
const fromRetrievedUrl = getValueByPath(fromObject, ['retrievedUrl']);
|
|
8526
|
-
if (fromRetrievedUrl != null) {
|
|
8527
|
-
setValueByPath(toObject, ['retrievedUrl'], fromRetrievedUrl);
|
|
8528
|
-
}
|
|
8529
|
-
const fromUrlRetrievalStatus = getValueByPath(fromObject, [
|
|
8530
|
-
'urlRetrievalStatus',
|
|
8531
|
-
]);
|
|
8532
|
-
if (fromUrlRetrievalStatus != null) {
|
|
8533
|
-
setValueByPath(toObject, ['urlRetrievalStatus'], fromUrlRetrievalStatus);
|
|
8534
|
-
}
|
|
8535
|
-
return toObject;
|
|
8536
|
-
}
|
|
8537
|
-
function urlContextMetadataFromMldev$1(fromObject) {
|
|
8538
|
-
const toObject = {};
|
|
8539
|
-
const fromUrlMetadata = getValueByPath(fromObject, ['urlMetadata']);
|
|
8540
|
-
if (fromUrlMetadata != null) {
|
|
8541
|
-
let transformedList = fromUrlMetadata;
|
|
8542
|
-
if (Array.isArray(transformedList)) {
|
|
8543
|
-
transformedList = transformedList.map((item) => {
|
|
8544
|
-
return urlMetadataFromMldev$1(item);
|
|
8545
|
-
});
|
|
8546
|
-
}
|
|
8547
|
-
setValueByPath(toObject, ['urlMetadata'], transformedList);
|
|
8548
|
-
}
|
|
8549
|
-
return toObject;
|
|
8550
|
-
}
|
|
8551
|
-
function liveServerContentFromMldev(fromObject) {
|
|
8552
|
-
const toObject = {};
|
|
8553
|
-
const fromModelTurn = getValueByPath(fromObject, ['modelTurn']);
|
|
8554
|
-
if (fromModelTurn != null) {
|
|
8555
|
-
setValueByPath(toObject, ['modelTurn'], contentFromMldev$1(fromModelTurn));
|
|
8556
|
-
}
|
|
8557
|
-
const fromTurnComplete = getValueByPath(fromObject, ['turnComplete']);
|
|
8558
|
-
if (fromTurnComplete != null) {
|
|
8559
|
-
setValueByPath(toObject, ['turnComplete'], fromTurnComplete);
|
|
8560
|
-
}
|
|
8561
|
-
const fromInterrupted = getValueByPath(fromObject, ['interrupted']);
|
|
8562
|
-
if (fromInterrupted != null) {
|
|
8563
|
-
setValueByPath(toObject, ['interrupted'], fromInterrupted);
|
|
8564
|
-
}
|
|
8565
|
-
const fromGroundingMetadata = getValueByPath(fromObject, [
|
|
8566
|
-
'groundingMetadata',
|
|
8567
|
-
]);
|
|
8568
|
-
if (fromGroundingMetadata != null) {
|
|
8569
|
-
setValueByPath(toObject, ['groundingMetadata'], fromGroundingMetadata);
|
|
8570
|
-
}
|
|
8571
|
-
const fromGenerationComplete = getValueByPath(fromObject, [
|
|
8572
|
-
'generationComplete',
|
|
8573
|
-
]);
|
|
8574
|
-
if (fromGenerationComplete != null) {
|
|
8575
|
-
setValueByPath(toObject, ['generationComplete'], fromGenerationComplete);
|
|
8576
|
-
}
|
|
8577
|
-
const fromInputTranscription = getValueByPath(fromObject, [
|
|
8578
|
-
'inputTranscription',
|
|
8579
|
-
]);
|
|
8580
|
-
if (fromInputTranscription != null) {
|
|
8581
|
-
setValueByPath(toObject, ['inputTranscription'], transcriptionFromMldev(fromInputTranscription));
|
|
8582
|
-
}
|
|
8583
|
-
const fromOutputTranscription = getValueByPath(fromObject, [
|
|
8584
|
-
'outputTranscription',
|
|
8585
|
-
]);
|
|
8586
|
-
if (fromOutputTranscription != null) {
|
|
8587
|
-
setValueByPath(toObject, ['outputTranscription'], transcriptionFromMldev(fromOutputTranscription));
|
|
8588
|
-
}
|
|
8589
|
-
const fromUrlContextMetadata = getValueByPath(fromObject, [
|
|
8590
|
-
'urlContextMetadata',
|
|
8591
|
-
]);
|
|
8592
|
-
if (fromUrlContextMetadata != null) {
|
|
8593
|
-
setValueByPath(toObject, ['urlContextMetadata'], urlContextMetadataFromMldev$1(fromUrlContextMetadata));
|
|
8594
|
-
}
|
|
8595
|
-
return toObject;
|
|
8596
|
-
}
|
|
8597
8870
|
function liveServerContentFromVertex(fromObject) {
|
|
8598
8871
|
const toObject = {};
|
|
8599
8872
|
const fromModelTurn = getValueByPath(fromObject, ['modelTurn']);
|
|
@@ -8634,22 +8907,6 @@ function liveServerContentFromVertex(fromObject) {
|
|
|
8634
8907
|
}
|
|
8635
8908
|
return toObject;
|
|
8636
8909
|
}
|
|
8637
|
-
function functionCallFromMldev(fromObject) {
|
|
8638
|
-
const toObject = {};
|
|
8639
|
-
const fromId = getValueByPath(fromObject, ['id']);
|
|
8640
|
-
if (fromId != null) {
|
|
8641
|
-
setValueByPath(toObject, ['id'], fromId);
|
|
8642
|
-
}
|
|
8643
|
-
const fromArgs = getValueByPath(fromObject, ['args']);
|
|
8644
|
-
if (fromArgs != null) {
|
|
8645
|
-
setValueByPath(toObject, ['args'], fromArgs);
|
|
8646
|
-
}
|
|
8647
|
-
const fromName = getValueByPath(fromObject, ['name']);
|
|
8648
|
-
if (fromName != null) {
|
|
8649
|
-
setValueByPath(toObject, ['name'], fromName);
|
|
8650
|
-
}
|
|
8651
|
-
return toObject;
|
|
8652
|
-
}
|
|
8653
8910
|
function functionCallFromVertex(fromObject) {
|
|
8654
8911
|
const toObject = {};
|
|
8655
8912
|
const fromArgs = getValueByPath(fromObject, ['args']);
|
|
@@ -8662,22 +8919,6 @@ function functionCallFromVertex(fromObject) {
|
|
|
8662
8919
|
}
|
|
8663
8920
|
return toObject;
|
|
8664
8921
|
}
|
|
8665
|
-
function liveServerToolCallFromMldev(fromObject) {
|
|
8666
|
-
const toObject = {};
|
|
8667
|
-
const fromFunctionCalls = getValueByPath(fromObject, [
|
|
8668
|
-
'functionCalls',
|
|
8669
|
-
]);
|
|
8670
|
-
if (fromFunctionCalls != null) {
|
|
8671
|
-
let transformedList = fromFunctionCalls;
|
|
8672
|
-
if (Array.isArray(transformedList)) {
|
|
8673
|
-
transformedList = transformedList.map((item) => {
|
|
8674
|
-
return functionCallFromMldev(item);
|
|
8675
|
-
});
|
|
8676
|
-
}
|
|
8677
|
-
setValueByPath(toObject, ['functionCalls'], transformedList);
|
|
8678
|
-
}
|
|
8679
|
-
return toObject;
|
|
8680
|
-
}
|
|
8681
8922
|
function liveServerToolCallFromVertex(fromObject) {
|
|
8682
8923
|
const toObject = {};
|
|
8683
8924
|
const fromFunctionCalls = getValueByPath(fromObject, [
|
|
@@ -8694,14 +8935,6 @@ function liveServerToolCallFromVertex(fromObject) {
|
|
|
8694
8935
|
}
|
|
8695
8936
|
return toObject;
|
|
8696
8937
|
}
|
|
8697
|
-
function liveServerToolCallCancellationFromMldev(fromObject) {
|
|
8698
|
-
const toObject = {};
|
|
8699
|
-
const fromIds = getValueByPath(fromObject, ['ids']);
|
|
8700
|
-
if (fromIds != null) {
|
|
8701
|
-
setValueByPath(toObject, ['ids'], fromIds);
|
|
8702
|
-
}
|
|
8703
|
-
return toObject;
|
|
8704
|
-
}
|
|
8705
8938
|
function liveServerToolCallCancellationFromVertex(fromObject) {
|
|
8706
8939
|
const toObject = {};
|
|
8707
8940
|
const fromIds = getValueByPath(fromObject, ['ids']);
|
|
@@ -8710,18 +8943,6 @@ function liveServerToolCallCancellationFromVertex(fromObject) {
|
|
|
8710
8943
|
}
|
|
8711
8944
|
return toObject;
|
|
8712
8945
|
}
|
|
8713
|
-
function modalityTokenCountFromMldev(fromObject) {
|
|
8714
|
-
const toObject = {};
|
|
8715
|
-
const fromModality = getValueByPath(fromObject, ['modality']);
|
|
8716
|
-
if (fromModality != null) {
|
|
8717
|
-
setValueByPath(toObject, ['modality'], fromModality);
|
|
8718
|
-
}
|
|
8719
|
-
const fromTokenCount = getValueByPath(fromObject, ['tokenCount']);
|
|
8720
|
-
if (fromTokenCount != null) {
|
|
8721
|
-
setValueByPath(toObject, ['tokenCount'], fromTokenCount);
|
|
8722
|
-
}
|
|
8723
|
-
return toObject;
|
|
8724
|
-
}
|
|
8725
8946
|
function modalityTokenCountFromVertex(fromObject) {
|
|
8726
8947
|
const toObject = {};
|
|
8727
8948
|
const fromModality = getValueByPath(fromObject, ['modality']);
|
|
@@ -8734,94 +8955,6 @@ function modalityTokenCountFromVertex(fromObject) {
|
|
|
8734
8955
|
}
|
|
8735
8956
|
return toObject;
|
|
8736
8957
|
}
|
|
8737
|
-
function usageMetadataFromMldev(fromObject) {
|
|
8738
|
-
const toObject = {};
|
|
8739
|
-
const fromPromptTokenCount = getValueByPath(fromObject, [
|
|
8740
|
-
'promptTokenCount',
|
|
8741
|
-
]);
|
|
8742
|
-
if (fromPromptTokenCount != null) {
|
|
8743
|
-
setValueByPath(toObject, ['promptTokenCount'], fromPromptTokenCount);
|
|
8744
|
-
}
|
|
8745
|
-
const fromCachedContentTokenCount = getValueByPath(fromObject, [
|
|
8746
|
-
'cachedContentTokenCount',
|
|
8747
|
-
]);
|
|
8748
|
-
if (fromCachedContentTokenCount != null) {
|
|
8749
|
-
setValueByPath(toObject, ['cachedContentTokenCount'], fromCachedContentTokenCount);
|
|
8750
|
-
}
|
|
8751
|
-
const fromResponseTokenCount = getValueByPath(fromObject, [
|
|
8752
|
-
'responseTokenCount',
|
|
8753
|
-
]);
|
|
8754
|
-
if (fromResponseTokenCount != null) {
|
|
8755
|
-
setValueByPath(toObject, ['responseTokenCount'], fromResponseTokenCount);
|
|
8756
|
-
}
|
|
8757
|
-
const fromToolUsePromptTokenCount = getValueByPath(fromObject, [
|
|
8758
|
-
'toolUsePromptTokenCount',
|
|
8759
|
-
]);
|
|
8760
|
-
if (fromToolUsePromptTokenCount != null) {
|
|
8761
|
-
setValueByPath(toObject, ['toolUsePromptTokenCount'], fromToolUsePromptTokenCount);
|
|
8762
|
-
}
|
|
8763
|
-
const fromThoughtsTokenCount = getValueByPath(fromObject, [
|
|
8764
|
-
'thoughtsTokenCount',
|
|
8765
|
-
]);
|
|
8766
|
-
if (fromThoughtsTokenCount != null) {
|
|
8767
|
-
setValueByPath(toObject, ['thoughtsTokenCount'], fromThoughtsTokenCount);
|
|
8768
|
-
}
|
|
8769
|
-
const fromTotalTokenCount = getValueByPath(fromObject, [
|
|
8770
|
-
'totalTokenCount',
|
|
8771
|
-
]);
|
|
8772
|
-
if (fromTotalTokenCount != null) {
|
|
8773
|
-
setValueByPath(toObject, ['totalTokenCount'], fromTotalTokenCount);
|
|
8774
|
-
}
|
|
8775
|
-
const fromPromptTokensDetails = getValueByPath(fromObject, [
|
|
8776
|
-
'promptTokensDetails',
|
|
8777
|
-
]);
|
|
8778
|
-
if (fromPromptTokensDetails != null) {
|
|
8779
|
-
let transformedList = fromPromptTokensDetails;
|
|
8780
|
-
if (Array.isArray(transformedList)) {
|
|
8781
|
-
transformedList = transformedList.map((item) => {
|
|
8782
|
-
return modalityTokenCountFromMldev(item);
|
|
8783
|
-
});
|
|
8784
|
-
}
|
|
8785
|
-
setValueByPath(toObject, ['promptTokensDetails'], transformedList);
|
|
8786
|
-
}
|
|
8787
|
-
const fromCacheTokensDetails = getValueByPath(fromObject, [
|
|
8788
|
-
'cacheTokensDetails',
|
|
8789
|
-
]);
|
|
8790
|
-
if (fromCacheTokensDetails != null) {
|
|
8791
|
-
let transformedList = fromCacheTokensDetails;
|
|
8792
|
-
if (Array.isArray(transformedList)) {
|
|
8793
|
-
transformedList = transformedList.map((item) => {
|
|
8794
|
-
return modalityTokenCountFromMldev(item);
|
|
8795
|
-
});
|
|
8796
|
-
}
|
|
8797
|
-
setValueByPath(toObject, ['cacheTokensDetails'], transformedList);
|
|
8798
|
-
}
|
|
8799
|
-
const fromResponseTokensDetails = getValueByPath(fromObject, [
|
|
8800
|
-
'responseTokensDetails',
|
|
8801
|
-
]);
|
|
8802
|
-
if (fromResponseTokensDetails != null) {
|
|
8803
|
-
let transformedList = fromResponseTokensDetails;
|
|
8804
|
-
if (Array.isArray(transformedList)) {
|
|
8805
|
-
transformedList = transformedList.map((item) => {
|
|
8806
|
-
return modalityTokenCountFromMldev(item);
|
|
8807
|
-
});
|
|
8808
|
-
}
|
|
8809
|
-
setValueByPath(toObject, ['responseTokensDetails'], transformedList);
|
|
8810
|
-
}
|
|
8811
|
-
const fromToolUsePromptTokensDetails = getValueByPath(fromObject, [
|
|
8812
|
-
'toolUsePromptTokensDetails',
|
|
8813
|
-
]);
|
|
8814
|
-
if (fromToolUsePromptTokensDetails != null) {
|
|
8815
|
-
let transformedList = fromToolUsePromptTokensDetails;
|
|
8816
|
-
if (Array.isArray(transformedList)) {
|
|
8817
|
-
transformedList = transformedList.map((item) => {
|
|
8818
|
-
return modalityTokenCountFromMldev(item);
|
|
8819
|
-
});
|
|
8820
|
-
}
|
|
8821
|
-
setValueByPath(toObject, ['toolUsePromptTokensDetails'], transformedList);
|
|
8822
|
-
}
|
|
8823
|
-
return toObject;
|
|
8824
|
-
}
|
|
8825
8958
|
function usageMetadataFromVertex(fromObject) {
|
|
8826
8959
|
const toObject = {};
|
|
8827
8960
|
const fromPromptTokenCount = getValueByPath(fromObject, [
|
|
@@ -8908,17 +9041,9 @@ function usageMetadataFromVertex(fromObject) {
|
|
|
8908
9041
|
}
|
|
8909
9042
|
setValueByPath(toObject, ['toolUsePromptTokensDetails'], transformedList);
|
|
8910
9043
|
}
|
|
8911
|
-
const fromTrafficType = getValueByPath(fromObject, ['trafficType']);
|
|
8912
|
-
if (fromTrafficType != null) {
|
|
8913
|
-
setValueByPath(toObject, ['trafficType'], fromTrafficType);
|
|
8914
|
-
}
|
|
8915
|
-
return toObject;
|
|
8916
|
-
}
|
|
8917
|
-
function liveServerGoAwayFromMldev(fromObject) {
|
|
8918
|
-
const toObject = {};
|
|
8919
|
-
const fromTimeLeft = getValueByPath(fromObject, ['timeLeft']);
|
|
8920
|
-
if (fromTimeLeft != null) {
|
|
8921
|
-
setValueByPath(toObject, ['timeLeft'], fromTimeLeft);
|
|
9044
|
+
const fromTrafficType = getValueByPath(fromObject, ['trafficType']);
|
|
9045
|
+
if (fromTrafficType != null) {
|
|
9046
|
+
setValueByPath(toObject, ['trafficType'], fromTrafficType);
|
|
8922
9047
|
}
|
|
8923
9048
|
return toObject;
|
|
8924
9049
|
}
|
|
@@ -8930,24 +9055,6 @@ function liveServerGoAwayFromVertex(fromObject) {
|
|
|
8930
9055
|
}
|
|
8931
9056
|
return toObject;
|
|
8932
9057
|
}
|
|
8933
|
-
function liveServerSessionResumptionUpdateFromMldev(fromObject) {
|
|
8934
|
-
const toObject = {};
|
|
8935
|
-
const fromNewHandle = getValueByPath(fromObject, ['newHandle']);
|
|
8936
|
-
if (fromNewHandle != null) {
|
|
8937
|
-
setValueByPath(toObject, ['newHandle'], fromNewHandle);
|
|
8938
|
-
}
|
|
8939
|
-
const fromResumable = getValueByPath(fromObject, ['resumable']);
|
|
8940
|
-
if (fromResumable != null) {
|
|
8941
|
-
setValueByPath(toObject, ['resumable'], fromResumable);
|
|
8942
|
-
}
|
|
8943
|
-
const fromLastConsumedClientMessageIndex = getValueByPath(fromObject, [
|
|
8944
|
-
'lastConsumedClientMessageIndex',
|
|
8945
|
-
]);
|
|
8946
|
-
if (fromLastConsumedClientMessageIndex != null) {
|
|
8947
|
-
setValueByPath(toObject, ['lastConsumedClientMessageIndex'], fromLastConsumedClientMessageIndex);
|
|
8948
|
-
}
|
|
8949
|
-
return toObject;
|
|
8950
|
-
}
|
|
8951
9058
|
function liveServerSessionResumptionUpdateFromVertex(fromObject) {
|
|
8952
9059
|
const toObject = {};
|
|
8953
9060
|
const fromNewHandle = getValueByPath(fromObject, ['newHandle']);
|
|
@@ -8966,48 +9073,6 @@ function liveServerSessionResumptionUpdateFromVertex(fromObject) {
|
|
|
8966
9073
|
}
|
|
8967
9074
|
return toObject;
|
|
8968
9075
|
}
|
|
8969
|
-
function liveServerMessageFromMldev(fromObject) {
|
|
8970
|
-
const toObject = {};
|
|
8971
|
-
const fromSetupComplete = getValueByPath(fromObject, [
|
|
8972
|
-
'setupComplete',
|
|
8973
|
-
]);
|
|
8974
|
-
if (fromSetupComplete != null) {
|
|
8975
|
-
setValueByPath(toObject, ['setupComplete'], liveServerSetupCompleteFromMldev());
|
|
8976
|
-
}
|
|
8977
|
-
const fromServerContent = getValueByPath(fromObject, [
|
|
8978
|
-
'serverContent',
|
|
8979
|
-
]);
|
|
8980
|
-
if (fromServerContent != null) {
|
|
8981
|
-
setValueByPath(toObject, ['serverContent'], liveServerContentFromMldev(fromServerContent));
|
|
8982
|
-
}
|
|
8983
|
-
const fromToolCall = getValueByPath(fromObject, ['toolCall']);
|
|
8984
|
-
if (fromToolCall != null) {
|
|
8985
|
-
setValueByPath(toObject, ['toolCall'], liveServerToolCallFromMldev(fromToolCall));
|
|
8986
|
-
}
|
|
8987
|
-
const fromToolCallCancellation = getValueByPath(fromObject, [
|
|
8988
|
-
'toolCallCancellation',
|
|
8989
|
-
]);
|
|
8990
|
-
if (fromToolCallCancellation != null) {
|
|
8991
|
-
setValueByPath(toObject, ['toolCallCancellation'], liveServerToolCallCancellationFromMldev(fromToolCallCancellation));
|
|
8992
|
-
}
|
|
8993
|
-
const fromUsageMetadata = getValueByPath(fromObject, [
|
|
8994
|
-
'usageMetadata',
|
|
8995
|
-
]);
|
|
8996
|
-
if (fromUsageMetadata != null) {
|
|
8997
|
-
setValueByPath(toObject, ['usageMetadata'], usageMetadataFromMldev(fromUsageMetadata));
|
|
8998
|
-
}
|
|
8999
|
-
const fromGoAway = getValueByPath(fromObject, ['goAway']);
|
|
9000
|
-
if (fromGoAway != null) {
|
|
9001
|
-
setValueByPath(toObject, ['goAway'], liveServerGoAwayFromMldev(fromGoAway));
|
|
9002
|
-
}
|
|
9003
|
-
const fromSessionResumptionUpdate = getValueByPath(fromObject, [
|
|
9004
|
-
'sessionResumptionUpdate',
|
|
9005
|
-
]);
|
|
9006
|
-
if (fromSessionResumptionUpdate != null) {
|
|
9007
|
-
setValueByPath(toObject, ['sessionResumptionUpdate'], liveServerSessionResumptionUpdateFromMldev(fromSessionResumptionUpdate));
|
|
9008
|
-
}
|
|
9009
|
-
return toObject;
|
|
9010
|
-
}
|
|
9011
9076
|
function liveServerMessageFromVertex(fromObject) {
|
|
9012
9077
|
const toObject = {};
|
|
9013
9078
|
const fromSetupComplete = getValueByPath(fromObject, [
|
|
@@ -9050,172 +9115,6 @@ function liveServerMessageFromVertex(fromObject) {
|
|
|
9050
9115
|
}
|
|
9051
9116
|
return toObject;
|
|
9052
9117
|
}
|
|
9053
|
-
function liveMusicServerSetupCompleteFromMldev() {
|
|
9054
|
-
const toObject = {};
|
|
9055
|
-
return toObject;
|
|
9056
|
-
}
|
|
9057
|
-
function weightedPromptFromMldev(fromObject) {
|
|
9058
|
-
const toObject = {};
|
|
9059
|
-
const fromText = getValueByPath(fromObject, ['text']);
|
|
9060
|
-
if (fromText != null) {
|
|
9061
|
-
setValueByPath(toObject, ['text'], fromText);
|
|
9062
|
-
}
|
|
9063
|
-
const fromWeight = getValueByPath(fromObject, ['weight']);
|
|
9064
|
-
if (fromWeight != null) {
|
|
9065
|
-
setValueByPath(toObject, ['weight'], fromWeight);
|
|
9066
|
-
}
|
|
9067
|
-
return toObject;
|
|
9068
|
-
}
|
|
9069
|
-
function liveMusicClientContentFromMldev(fromObject) {
|
|
9070
|
-
const toObject = {};
|
|
9071
|
-
const fromWeightedPrompts = getValueByPath(fromObject, [
|
|
9072
|
-
'weightedPrompts',
|
|
9073
|
-
]);
|
|
9074
|
-
if (fromWeightedPrompts != null) {
|
|
9075
|
-
let transformedList = fromWeightedPrompts;
|
|
9076
|
-
if (Array.isArray(transformedList)) {
|
|
9077
|
-
transformedList = transformedList.map((item) => {
|
|
9078
|
-
return weightedPromptFromMldev(item);
|
|
9079
|
-
});
|
|
9080
|
-
}
|
|
9081
|
-
setValueByPath(toObject, ['weightedPrompts'], transformedList);
|
|
9082
|
-
}
|
|
9083
|
-
return toObject;
|
|
9084
|
-
}
|
|
9085
|
-
function liveMusicGenerationConfigFromMldev(fromObject) {
|
|
9086
|
-
const toObject = {};
|
|
9087
|
-
const fromTemperature = getValueByPath(fromObject, ['temperature']);
|
|
9088
|
-
if (fromTemperature != null) {
|
|
9089
|
-
setValueByPath(toObject, ['temperature'], fromTemperature);
|
|
9090
|
-
}
|
|
9091
|
-
const fromTopK = getValueByPath(fromObject, ['topK']);
|
|
9092
|
-
if (fromTopK != null) {
|
|
9093
|
-
setValueByPath(toObject, ['topK'], fromTopK);
|
|
9094
|
-
}
|
|
9095
|
-
const fromSeed = getValueByPath(fromObject, ['seed']);
|
|
9096
|
-
if (fromSeed != null) {
|
|
9097
|
-
setValueByPath(toObject, ['seed'], fromSeed);
|
|
9098
|
-
}
|
|
9099
|
-
const fromGuidance = getValueByPath(fromObject, ['guidance']);
|
|
9100
|
-
if (fromGuidance != null) {
|
|
9101
|
-
setValueByPath(toObject, ['guidance'], fromGuidance);
|
|
9102
|
-
}
|
|
9103
|
-
const fromBpm = getValueByPath(fromObject, ['bpm']);
|
|
9104
|
-
if (fromBpm != null) {
|
|
9105
|
-
setValueByPath(toObject, ['bpm'], fromBpm);
|
|
9106
|
-
}
|
|
9107
|
-
const fromDensity = getValueByPath(fromObject, ['density']);
|
|
9108
|
-
if (fromDensity != null) {
|
|
9109
|
-
setValueByPath(toObject, ['density'], fromDensity);
|
|
9110
|
-
}
|
|
9111
|
-
const fromBrightness = getValueByPath(fromObject, ['brightness']);
|
|
9112
|
-
if (fromBrightness != null) {
|
|
9113
|
-
setValueByPath(toObject, ['brightness'], fromBrightness);
|
|
9114
|
-
}
|
|
9115
|
-
const fromScale = getValueByPath(fromObject, ['scale']);
|
|
9116
|
-
if (fromScale != null) {
|
|
9117
|
-
setValueByPath(toObject, ['scale'], fromScale);
|
|
9118
|
-
}
|
|
9119
|
-
const fromMuteBass = getValueByPath(fromObject, ['muteBass']);
|
|
9120
|
-
if (fromMuteBass != null) {
|
|
9121
|
-
setValueByPath(toObject, ['muteBass'], fromMuteBass);
|
|
9122
|
-
}
|
|
9123
|
-
const fromMuteDrums = getValueByPath(fromObject, ['muteDrums']);
|
|
9124
|
-
if (fromMuteDrums != null) {
|
|
9125
|
-
setValueByPath(toObject, ['muteDrums'], fromMuteDrums);
|
|
9126
|
-
}
|
|
9127
|
-
const fromOnlyBassAndDrums = getValueByPath(fromObject, [
|
|
9128
|
-
'onlyBassAndDrums',
|
|
9129
|
-
]);
|
|
9130
|
-
if (fromOnlyBassAndDrums != null) {
|
|
9131
|
-
setValueByPath(toObject, ['onlyBassAndDrums'], fromOnlyBassAndDrums);
|
|
9132
|
-
}
|
|
9133
|
-
return toObject;
|
|
9134
|
-
}
|
|
9135
|
-
function liveMusicSourceMetadataFromMldev(fromObject) {
|
|
9136
|
-
const toObject = {};
|
|
9137
|
-
const fromClientContent = getValueByPath(fromObject, [
|
|
9138
|
-
'clientContent',
|
|
9139
|
-
]);
|
|
9140
|
-
if (fromClientContent != null) {
|
|
9141
|
-
setValueByPath(toObject, ['clientContent'], liveMusicClientContentFromMldev(fromClientContent));
|
|
9142
|
-
}
|
|
9143
|
-
const fromMusicGenerationConfig = getValueByPath(fromObject, [
|
|
9144
|
-
'musicGenerationConfig',
|
|
9145
|
-
]);
|
|
9146
|
-
if (fromMusicGenerationConfig != null) {
|
|
9147
|
-
setValueByPath(toObject, ['musicGenerationConfig'], liveMusicGenerationConfigFromMldev(fromMusicGenerationConfig));
|
|
9148
|
-
}
|
|
9149
|
-
return toObject;
|
|
9150
|
-
}
|
|
9151
|
-
function audioChunkFromMldev(fromObject) {
|
|
9152
|
-
const toObject = {};
|
|
9153
|
-
const fromData = getValueByPath(fromObject, ['data']);
|
|
9154
|
-
if (fromData != null) {
|
|
9155
|
-
setValueByPath(toObject, ['data'], fromData);
|
|
9156
|
-
}
|
|
9157
|
-
const fromMimeType = getValueByPath(fromObject, ['mimeType']);
|
|
9158
|
-
if (fromMimeType != null) {
|
|
9159
|
-
setValueByPath(toObject, ['mimeType'], fromMimeType);
|
|
9160
|
-
}
|
|
9161
|
-
const fromSourceMetadata = getValueByPath(fromObject, [
|
|
9162
|
-
'sourceMetadata',
|
|
9163
|
-
]);
|
|
9164
|
-
if (fromSourceMetadata != null) {
|
|
9165
|
-
setValueByPath(toObject, ['sourceMetadata'], liveMusicSourceMetadataFromMldev(fromSourceMetadata));
|
|
9166
|
-
}
|
|
9167
|
-
return toObject;
|
|
9168
|
-
}
|
|
9169
|
-
function liveMusicServerContentFromMldev(fromObject) {
|
|
9170
|
-
const toObject = {};
|
|
9171
|
-
const fromAudioChunks = getValueByPath(fromObject, ['audioChunks']);
|
|
9172
|
-
if (fromAudioChunks != null) {
|
|
9173
|
-
let transformedList = fromAudioChunks;
|
|
9174
|
-
if (Array.isArray(transformedList)) {
|
|
9175
|
-
transformedList = transformedList.map((item) => {
|
|
9176
|
-
return audioChunkFromMldev(item);
|
|
9177
|
-
});
|
|
9178
|
-
}
|
|
9179
|
-
setValueByPath(toObject, ['audioChunks'], transformedList);
|
|
9180
|
-
}
|
|
9181
|
-
return toObject;
|
|
9182
|
-
}
|
|
9183
|
-
function liveMusicFilteredPromptFromMldev(fromObject) {
|
|
9184
|
-
const toObject = {};
|
|
9185
|
-
const fromText = getValueByPath(fromObject, ['text']);
|
|
9186
|
-
if (fromText != null) {
|
|
9187
|
-
setValueByPath(toObject, ['text'], fromText);
|
|
9188
|
-
}
|
|
9189
|
-
const fromFilteredReason = getValueByPath(fromObject, [
|
|
9190
|
-
'filteredReason',
|
|
9191
|
-
]);
|
|
9192
|
-
if (fromFilteredReason != null) {
|
|
9193
|
-
setValueByPath(toObject, ['filteredReason'], fromFilteredReason);
|
|
9194
|
-
}
|
|
9195
|
-
return toObject;
|
|
9196
|
-
}
|
|
9197
|
-
function liveMusicServerMessageFromMldev(fromObject) {
|
|
9198
|
-
const toObject = {};
|
|
9199
|
-
const fromSetupComplete = getValueByPath(fromObject, [
|
|
9200
|
-
'setupComplete',
|
|
9201
|
-
]);
|
|
9202
|
-
if (fromSetupComplete != null) {
|
|
9203
|
-
setValueByPath(toObject, ['setupComplete'], liveMusicServerSetupCompleteFromMldev());
|
|
9204
|
-
}
|
|
9205
|
-
const fromServerContent = getValueByPath(fromObject, [
|
|
9206
|
-
'serverContent',
|
|
9207
|
-
]);
|
|
9208
|
-
if (fromServerContent != null) {
|
|
9209
|
-
setValueByPath(toObject, ['serverContent'], liveMusicServerContentFromMldev(fromServerContent));
|
|
9210
|
-
}
|
|
9211
|
-
const fromFilteredPrompt = getValueByPath(fromObject, [
|
|
9212
|
-
'filteredPrompt',
|
|
9213
|
-
]);
|
|
9214
|
-
if (fromFilteredPrompt != null) {
|
|
9215
|
-
setValueByPath(toObject, ['filteredPrompt'], liveMusicFilteredPromptFromMldev(fromFilteredPrompt));
|
|
9216
|
-
}
|
|
9217
|
-
return toObject;
|
|
9218
|
-
}
|
|
9219
9118
|
|
|
9220
9119
|
/**
|
|
9221
9120
|
* @license
|
|
@@ -11296,6 +11195,10 @@ function editImageConfigToVertex(fromObject, parentObject) {
|
|
|
11296
11195
|
if (parentObject !== undefined && fromOutputCompressionQuality != null) {
|
|
11297
11196
|
setValueByPath(parentObject, ['parameters', 'outputOptions', 'compressionQuality'], fromOutputCompressionQuality);
|
|
11298
11197
|
}
|
|
11198
|
+
const fromAddWatermark = getValueByPath(fromObject, ['addWatermark']);
|
|
11199
|
+
if (parentObject !== undefined && fromAddWatermark != null) {
|
|
11200
|
+
setValueByPath(parentObject, ['parameters', 'addWatermark'], fromAddWatermark);
|
|
11201
|
+
}
|
|
11299
11202
|
const fromEditMode = getValueByPath(fromObject, ['editMode']);
|
|
11300
11203
|
if (parentObject !== undefined && fromEditMode != null) {
|
|
11301
11204
|
setValueByPath(parentObject, ['parameters', 'editMode'], fromEditMode);
|
|
@@ -11870,6 +11773,12 @@ function candidateFromMldev(fromObject) {
|
|
|
11870
11773
|
}
|
|
11871
11774
|
function generateContentResponseFromMldev(fromObject) {
|
|
11872
11775
|
const toObject = {};
|
|
11776
|
+
const fromSdkHttpResponse = getValueByPath(fromObject, [
|
|
11777
|
+
'sdkHttpResponse',
|
|
11778
|
+
]);
|
|
11779
|
+
if (fromSdkHttpResponse != null) {
|
|
11780
|
+
setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
|
|
11781
|
+
}
|
|
11873
11782
|
const fromCandidates = getValueByPath(fromObject, ['candidates']);
|
|
11874
11783
|
if (fromCandidates != null) {
|
|
11875
11784
|
let transformedList = fromCandidates;
|
|
@@ -12396,6 +12305,12 @@ function candidateFromVertex(fromObject) {
|
|
|
12396
12305
|
}
|
|
12397
12306
|
function generateContentResponseFromVertex(fromObject) {
|
|
12398
12307
|
const toObject = {};
|
|
12308
|
+
const fromSdkHttpResponse = getValueByPath(fromObject, [
|
|
12309
|
+
'sdkHttpResponse',
|
|
12310
|
+
]);
|
|
12311
|
+
if (fromSdkHttpResponse != null) {
|
|
12312
|
+
setValueByPath(toObject, ['sdkHttpResponse'], fromSdkHttpResponse);
|
|
12313
|
+
}
|
|
12399
12314
|
const fromCandidates = getValueByPath(fromObject, ['candidates']);
|
|
12400
12315
|
if (fromCandidates != null) {
|
|
12401
12316
|
let transformedList = fromCandidates;
|
|
@@ -12832,7 +12747,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
|
|
|
12832
12747
|
const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
|
|
12833
12748
|
const USER_AGENT_HEADER = 'User-Agent';
|
|
12834
12749
|
const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
|
|
12835
|
-
const SDK_VERSION = '1.
|
|
12750
|
+
const SDK_VERSION = '1.10.0'; // x-release-please-version
|
|
12836
12751
|
const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
|
|
12837
12752
|
const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
|
|
12838
12753
|
const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';
|
|
@@ -13063,7 +12978,14 @@ class ApiClient {
|
|
|
13063
12978
|
const abortController = new AbortController();
|
|
13064
12979
|
const signal = abortController.signal;
|
|
13065
12980
|
if (httpOptions.timeout && (httpOptions === null || httpOptions === void 0 ? void 0 : httpOptions.timeout) > 0) {
|
|
13066
|
-
setTimeout(() => abortController.abort(), httpOptions.timeout);
|
|
12981
|
+
const timeoutHandle = setTimeout(() => abortController.abort(), httpOptions.timeout);
|
|
12982
|
+
if (timeoutHandle &&
|
|
12983
|
+
typeof timeoutHandle.unref ===
|
|
12984
|
+
'function') {
|
|
12985
|
+
// call unref to prevent nodejs process from hanging, see
|
|
12986
|
+
// https://nodejs.org/api/timers.html#timeoutunref
|
|
12987
|
+
timeoutHandle.unref();
|
|
12988
|
+
}
|
|
13067
12989
|
}
|
|
13068
12990
|
if (abortSignal) {
|
|
13069
12991
|
abortSignal.addEventListener('abort', () => {
|
|
@@ -13126,7 +13048,7 @@ class ApiClient {
|
|
|
13126
13048
|
}
|
|
13127
13049
|
break;
|
|
13128
13050
|
}
|
|
13129
|
-
const chunkString = decoder.decode(value);
|
|
13051
|
+
const chunkString = decoder.decode(value, { stream: true });
|
|
13130
13052
|
// Parse and throw an error if the chunk contains an error.
|
|
13131
13053
|
try {
|
|
13132
13054
|
const chunkJson = JSON.parse(chunkString);
|
|
@@ -13397,6 +13319,9 @@ function includeExtraBodyToRequestInit(requestInit, extraBody) {
|
|
|
13397
13319
|
*/
|
|
13398
13320
|
// TODO: b/416041229 - Determine how to retrieve the MCP package version.
|
|
13399
13321
|
const MCP_LABEL = 'mcp_used/unknown';
|
|
13322
|
+
// Whether MCP tool usage is detected from mcpToTool. This is used for
|
|
13323
|
+
// telemetry.
|
|
13324
|
+
let hasMcpToolUsageFromMcpToTool = false;
|
|
13400
13325
|
// Checks whether the list of tools contains any MCP tools.
|
|
13401
13326
|
function hasMcpToolUsage(tools) {
|
|
13402
13327
|
for (const tool of tools) {
|
|
@@ -13407,7 +13332,7 @@ function hasMcpToolUsage(tools) {
|
|
|
13407
13332
|
return true;
|
|
13408
13333
|
}
|
|
13409
13334
|
}
|
|
13410
|
-
return
|
|
13335
|
+
return hasMcpToolUsageFromMcpToTool;
|
|
13411
13336
|
}
|
|
13412
13337
|
// Sets the MCP version label in the Google API client header.
|
|
13413
13338
|
function setMcpUsageHeader(headers) {
|
|
@@ -13564,6 +13489,8 @@ function isMcpClient(client) {
|
|
|
13564
13489
|
* versions.
|
|
13565
13490
|
*/
|
|
13566
13491
|
function mcpToTool(...args) {
|
|
13492
|
+
// Set MCP usage for telemetry.
|
|
13493
|
+
hasMcpToolUsageFromMcpToTool = true;
|
|
13567
13494
|
if (args.length === 0) {
|
|
13568
13495
|
throw new Error('No MCP clients provided');
|
|
13569
13496
|
}
|
|
@@ -13883,7 +13810,7 @@ class Live {
|
|
|
13883
13810
|
if (GOOGLE_GENAI_USE_VERTEXAI) {
|
|
13884
13811
|
model = 'gemini-2.0-flash-live-preview-04-09';
|
|
13885
13812
|
} else {
|
|
13886
|
-
model = 'gemini-2.
|
|
13813
|
+
model = 'gemini-live-2.5-flash-preview';
|
|
13887
13814
|
}
|
|
13888
13815
|
const session = await ai.live.connect({
|
|
13889
13816
|
model: model,
|
|
@@ -13909,6 +13836,12 @@ class Live {
|
|
|
13909
13836
|
*/
|
|
13910
13837
|
async connect(params) {
|
|
13911
13838
|
var _a, _b, _c, _d, _e, _f;
|
|
13839
|
+
// TODO: b/404946746 - Support per request HTTP options.
|
|
13840
|
+
if (params.config && params.config.httpOptions) {
|
|
13841
|
+
throw new Error('The Live module does not support httpOptions at request-level in' +
|
|
13842
|
+
' LiveConnectConfig yet. Please use the client-level httpOptions' +
|
|
13843
|
+
' configuration instead.');
|
|
13844
|
+
}
|
|
13912
13845
|
const websocketBaseUrl = this.apiClient.getWebsocketBaseUrl();
|
|
13913
13846
|
const apiVersion = this.apiClient.getApiVersion();
|
|
13914
13847
|
let url;
|
|
@@ -13929,6 +13862,9 @@ class Live {
|
|
|
13929
13862
|
let keyName = 'key';
|
|
13930
13863
|
if (apiKey === null || apiKey === void 0 ? void 0 : apiKey.startsWith('auth_tokens/')) {
|
|
13931
13864
|
console.warn('Warning: Ephemeral token support is experimental and may change in future versions.');
|
|
13865
|
+
if (apiVersion !== 'v1alpha') {
|
|
13866
|
+
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.");
|
|
13867
|
+
}
|
|
13932
13868
|
method = 'BidiGenerateContentConstrained';
|
|
13933
13869
|
keyName = 'access_token';
|
|
13934
13870
|
}
|
|
@@ -14204,7 +14140,7 @@ class Session {
|
|
|
14204
14140
|
if (GOOGLE_GENAI_USE_VERTEXAI) {
|
|
14205
14141
|
model = 'gemini-2.0-flash-live-preview-04-09';
|
|
14206
14142
|
} else {
|
|
14207
|
-
model = 'gemini-2.
|
|
14143
|
+
model = 'gemini-live-2.5-flash-preview';
|
|
14208
14144
|
}
|
|
14209
14145
|
const session = await ai.live.connect({
|
|
14210
14146
|
model: model,
|
|
@@ -14333,6 +14269,7 @@ class Models extends BaseModule {
|
|
|
14333
14269
|
this.generateContent = async (params) => {
|
|
14334
14270
|
var _a, _b, _c, _d, _e;
|
|
14335
14271
|
const transformedParams = await this.processParamsForMcpUsage(params);
|
|
14272
|
+
this.maybeMoveToResponseJsonSchem(params);
|
|
14336
14273
|
if (!hasMcpClientTools(params) || shouldDisableAfc(params.config)) {
|
|
14337
14274
|
return await this.generateContentInternal(transformedParams);
|
|
14338
14275
|
}
|
|
@@ -14419,6 +14356,7 @@ class Models extends BaseModule {
|
|
|
14419
14356
|
* ```
|
|
14420
14357
|
*/
|
|
14421
14358
|
this.generateContentStream = async (params) => {
|
|
14359
|
+
this.maybeMoveToResponseJsonSchem(params);
|
|
14422
14360
|
if (shouldDisableAfc(params.config)) {
|
|
14423
14361
|
const transformedParams = await this.processParamsForMcpUsage(params);
|
|
14424
14362
|
return await this.generateContentStreamInternal(transformedParams);
|
|
@@ -14570,6 +14508,24 @@ class Models extends BaseModule {
|
|
|
14570
14508
|
return await this.upscaleImageInternal(apiParams);
|
|
14571
14509
|
};
|
|
14572
14510
|
}
|
|
14511
|
+
/**
|
|
14512
|
+
* This logic is needed for GenerateContentConfig only.
|
|
14513
|
+
* Previously we made GenerateContentConfig.responseSchema field to accept
|
|
14514
|
+
* unknown. Since v1.9.0, we switch to use backend JSON schema support.
|
|
14515
|
+
* To maintain backward compatibility, we move the data that was treated as
|
|
14516
|
+
* JSON schema from the responseSchema field to the responseJsonSchema field.
|
|
14517
|
+
*/
|
|
14518
|
+
maybeMoveToResponseJsonSchem(params) {
|
|
14519
|
+
if (params.config && params.config.responseSchema) {
|
|
14520
|
+
if (!params.config.responseJsonSchema) {
|
|
14521
|
+
if (Object.keys(params.config.responseSchema).includes('$schema')) {
|
|
14522
|
+
params.config.responseJsonSchema = params.config.responseSchema;
|
|
14523
|
+
delete params.config.responseSchema;
|
|
14524
|
+
}
|
|
14525
|
+
}
|
|
14526
|
+
}
|
|
14527
|
+
return;
|
|
14528
|
+
}
|
|
14573
14529
|
/**
|
|
14574
14530
|
* Transforms the CallableTools in the parameters to be simply Tools, it
|
|
14575
14531
|
* copies the params into a new object and replaces the tools, it does not
|
|
@@ -14731,7 +14687,13 @@ class Models extends BaseModule {
|
|
|
14731
14687
|
abortSignal: (_b = params.config) === null || _b === void 0 ? void 0 : _b.abortSignal,
|
|
14732
14688
|
})
|
|
14733
14689
|
.then((httpResponse) => {
|
|
14734
|
-
return httpResponse.json()
|
|
14690
|
+
return httpResponse.json().then((jsonResponse) => {
|
|
14691
|
+
const response = jsonResponse;
|
|
14692
|
+
response.sdkHttpResponse = {
|
|
14693
|
+
headers: httpResponse.headers,
|
|
14694
|
+
};
|
|
14695
|
+
return response;
|
|
14696
|
+
});
|
|
14735
14697
|
});
|
|
14736
14698
|
return response.then((apiResponse) => {
|
|
14737
14699
|
const resp = generateContentResponseFromVertex(apiResponse);
|
|
@@ -14757,7 +14719,13 @@ class Models extends BaseModule {
|
|
|
14757
14719
|
abortSignal: (_d = params.config) === null || _d === void 0 ? void 0 : _d.abortSignal,
|
|
14758
14720
|
})
|
|
14759
14721
|
.then((httpResponse) => {
|
|
14760
|
-
return httpResponse.json()
|
|
14722
|
+
return httpResponse.json().then((jsonResponse) => {
|
|
14723
|
+
const response = jsonResponse;
|
|
14724
|
+
response.sdkHttpResponse = {
|
|
14725
|
+
headers: httpResponse.headers,
|
|
14726
|
+
};
|
|
14727
|
+
return response;
|
|
14728
|
+
});
|
|
14761
14729
|
});
|
|
14762
14730
|
return response.then((apiResponse) => {
|
|
14763
14731
|
const resp = generateContentResponseFromMldev(apiResponse);
|
|
@@ -14797,6 +14765,9 @@ class Models extends BaseModule {
|
|
|
14797
14765
|
_d = false;
|
|
14798
14766
|
const chunk = _c;
|
|
14799
14767
|
const resp = generateContentResponseFromVertex((yield __await(chunk.json())));
|
|
14768
|
+
resp['sdkHttpResponse'] = {
|
|
14769
|
+
headers: chunk.headers,
|
|
14770
|
+
};
|
|
14800
14771
|
const typedResp = new GenerateContentResponse();
|
|
14801
14772
|
Object.assign(typedResp, resp);
|
|
14802
14773
|
yield yield __await(typedResp);
|
|
@@ -14837,6 +14808,9 @@ class Models extends BaseModule {
|
|
|
14837
14808
|
_d = false;
|
|
14838
14809
|
const chunk = _c;
|
|
14839
14810
|
const resp = generateContentResponseFromMldev((yield __await(chunk.json())));
|
|
14811
|
+
resp['sdkHttpResponse'] = {
|
|
14812
|
+
headers: chunk.headers,
|
|
14813
|
+
};
|
|
14840
14814
|
const typedResp = new GenerateContentResponse();
|
|
14841
14815
|
Object.assign(typedResp, resp);
|
|
14842
14816
|
yield yield __await(typedResp);
|
|
@@ -16630,14 +16604,20 @@ class Tokens extends BaseModule {
|
|
|
16630
16604
|
* @experimental
|
|
16631
16605
|
*
|
|
16632
16606
|
* @remarks
|
|
16633
|
-
*
|
|
16607
|
+
* Ephemeral auth tokens is only supported in the Gemini Developer API.
|
|
16634
16608
|
* It can be used for the session connection to the Live constrained API.
|
|
16609
|
+
* Support in v1alpha only.
|
|
16635
16610
|
*
|
|
16636
16611
|
* @param params - The parameters for the create request.
|
|
16637
16612
|
* @return The created auth token.
|
|
16638
16613
|
*
|
|
16639
16614
|
* @example
|
|
16640
16615
|
* ```ts
|
|
16616
|
+
* const ai = new GoogleGenAI({
|
|
16617
|
+
* apiKey: token.name,
|
|
16618
|
+
* httpOptions: { apiVersion: 'v1alpha' } // Support in v1alpha only.
|
|
16619
|
+
* });
|
|
16620
|
+
*
|
|
16641
16621
|
* // Case 1: If LiveEphemeralParameters is unset, unlock LiveConnectConfig
|
|
16642
16622
|
* // when using the token in Live API sessions. Each session connection can
|
|
16643
16623
|
* // use a different configuration.
|
|
@@ -17291,7 +17271,7 @@ function listTuningJobsResponseFromMldev(fromObject) {
|
|
|
17291
17271
|
}
|
|
17292
17272
|
return toObject;
|
|
17293
17273
|
}
|
|
17294
|
-
function
|
|
17274
|
+
function tuningOperationFromMldev(fromObject) {
|
|
17295
17275
|
const toObject = {};
|
|
17296
17276
|
const fromName = getValueByPath(fromObject, ['name']);
|
|
17297
17277
|
if (fromName != null) {
|
|
@@ -17718,7 +17698,7 @@ class Tunings extends BaseModule {
|
|
|
17718
17698
|
return httpResponse.json();
|
|
17719
17699
|
});
|
|
17720
17700
|
return response.then((apiResponse) => {
|
|
17721
|
-
const resp =
|
|
17701
|
+
const resp = tuningOperationFromMldev(apiResponse);
|
|
17722
17702
|
return resp;
|
|
17723
17703
|
});
|
|
17724
17704
|
}
|