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