@google/genai 2.5.0 → 2.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/genai.d.ts +344 -95
- package/dist/index.cjs +545 -56
- package/dist/index.mjs +546 -57
- package/dist/index.mjs.map +1 -1
- package/dist/node/index.cjs +545 -56
- package/dist/node/index.mjs +546 -57
- package/dist/node/index.mjs.map +1 -1
- package/dist/node/node.d.ts +344 -95
- package/dist/tokenizer/node.cjs +84 -40
- package/dist/tokenizer/node.d.ts +28 -24
- package/dist/tokenizer/node.mjs +84 -40
- package/dist/tokenizer/node.mjs.map +1 -1
- package/dist/vertex_internal/index.cjs +85 -41
- package/dist/vertex_internal/index.cjs.map +1 -1
- package/dist/vertex_internal/index.d.ts +227 -90
- package/dist/vertex_internal/index.js +85 -41
- package/dist/vertex_internal/index.js.map +1 -1
- package/dist/web/index.mjs +546 -57
- package/dist/web/index.mjs.map +1 -1
- package/dist/web/web.d.ts +344 -95
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -556,18 +556,6 @@ function videoFromVertex$1(fromObject) {
|
|
|
556
556
|
* Copyright 2025 Google LLC
|
|
557
557
|
* SPDX-License-Identifier: Apache-2.0
|
|
558
558
|
*/
|
|
559
|
-
/** Programming language of the `code`. */
|
|
560
|
-
var Language;
|
|
561
|
-
(function (Language) {
|
|
562
|
-
/**
|
|
563
|
-
* Unspecified language. This value should not be used.
|
|
564
|
-
*/
|
|
565
|
-
Language["LANGUAGE_UNSPECIFIED"] = "LANGUAGE_UNSPECIFIED";
|
|
566
|
-
/**
|
|
567
|
-
* Python >= 3.10, with numpy and simpy available.
|
|
568
|
-
*/
|
|
569
|
-
Language["PYTHON"] = "PYTHON";
|
|
570
|
-
})(Language || (Language = {}));
|
|
571
559
|
/** Outcome of the code execution. */
|
|
572
560
|
var Outcome;
|
|
573
561
|
(function (Outcome) {
|
|
@@ -576,18 +564,30 @@ var Outcome;
|
|
|
576
564
|
*/
|
|
577
565
|
Outcome["OUTCOME_UNSPECIFIED"] = "OUTCOME_UNSPECIFIED";
|
|
578
566
|
/**
|
|
579
|
-
* Code execution completed successfully.
|
|
567
|
+
* Code execution completed successfully. `output` contains the stdout, if any.
|
|
580
568
|
*/
|
|
581
569
|
Outcome["OUTCOME_OK"] = "OUTCOME_OK";
|
|
582
570
|
/**
|
|
583
|
-
* Code execution
|
|
571
|
+
* Code execution failed. `output` contains the stderr and stdout, if any.
|
|
584
572
|
*/
|
|
585
573
|
Outcome["OUTCOME_FAILED"] = "OUTCOME_FAILED";
|
|
586
574
|
/**
|
|
587
|
-
* Code execution ran for too long, and was cancelled. There may or may not be a partial output present.
|
|
575
|
+
* Code execution ran for too long, and was cancelled. There may or may not be a partial `output` present.
|
|
588
576
|
*/
|
|
589
577
|
Outcome["OUTCOME_DEADLINE_EXCEEDED"] = "OUTCOME_DEADLINE_EXCEEDED";
|
|
590
578
|
})(Outcome || (Outcome = {}));
|
|
579
|
+
/** Programming language of the `code`. */
|
|
580
|
+
var Language;
|
|
581
|
+
(function (Language) {
|
|
582
|
+
/**
|
|
583
|
+
* Unspecified language. This value should not be used.
|
|
584
|
+
*/
|
|
585
|
+
Language["LANGUAGE_UNSPECIFIED"] = "LANGUAGE_UNSPECIFIED";
|
|
586
|
+
/**
|
|
587
|
+
* Python >= 3.10, with numpy and simpy available.
|
|
588
|
+
*/
|
|
589
|
+
Language["PYTHON"] = "PYTHON";
|
|
590
|
+
})(Language || (Language = {}));
|
|
591
591
|
/** Specifies how the response should be scheduled in the conversation. */
|
|
592
592
|
var FunctionResponseScheduling;
|
|
593
593
|
(function (FunctionResponseScheduling) {
|
|
@@ -655,6 +655,14 @@ var Environment;
|
|
|
655
655
|
* Operates in a web browser.
|
|
656
656
|
*/
|
|
657
657
|
Environment["ENVIRONMENT_BROWSER"] = "ENVIRONMENT_BROWSER";
|
|
658
|
+
/**
|
|
659
|
+
* Operates in a mobile environment.
|
|
660
|
+
*/
|
|
661
|
+
Environment["ENVIRONMENT_MOBILE"] = "ENVIRONMENT_MOBILE";
|
|
662
|
+
/**
|
|
663
|
+
* Operates in a desktop environment.
|
|
664
|
+
*/
|
|
665
|
+
Environment["ENVIRONMENT_DESKTOP"] = "ENVIRONMENT_DESKTOP";
|
|
658
666
|
})(Environment || (Environment = {}));
|
|
659
667
|
/** Type of auth scheme. This enum is not supported in Gemini API. */
|
|
660
668
|
var AuthType;
|
|
@@ -786,30 +794,6 @@ var DynamicRetrievalConfigMode;
|
|
|
786
794
|
*/
|
|
787
795
|
DynamicRetrievalConfigMode["MODE_DYNAMIC"] = "MODE_DYNAMIC";
|
|
788
796
|
})(DynamicRetrievalConfigMode || (DynamicRetrievalConfigMode = {}));
|
|
789
|
-
/** Function calling mode. */
|
|
790
|
-
var FunctionCallingConfigMode;
|
|
791
|
-
(function (FunctionCallingConfigMode) {
|
|
792
|
-
/**
|
|
793
|
-
* Unspecified function calling mode. This value should not be used.
|
|
794
|
-
*/
|
|
795
|
-
FunctionCallingConfigMode["MODE_UNSPECIFIED"] = "MODE_UNSPECIFIED";
|
|
796
|
-
/**
|
|
797
|
-
* Default model behavior, model decides to predict either function calls or natural language response.
|
|
798
|
-
*/
|
|
799
|
-
FunctionCallingConfigMode["AUTO"] = "AUTO";
|
|
800
|
-
/**
|
|
801
|
-
* Model is constrained to always predicting function calls only. If "allowed_function_names" are set, the predicted function calls will be limited to any one of "allowed_function_names", else the predicted function calls will be any one of the provided "function_declarations".
|
|
802
|
-
*/
|
|
803
|
-
FunctionCallingConfigMode["ANY"] = "ANY";
|
|
804
|
-
/**
|
|
805
|
-
* Model will not predict any function calls. Model behavior is same as when not passing any function declarations.
|
|
806
|
-
*/
|
|
807
|
-
FunctionCallingConfigMode["NONE"] = "NONE";
|
|
808
|
-
/**
|
|
809
|
-
* Model is constrained to predict either function calls or natural language response. If "allowed_function_names" are set, the predicted function calls will be limited to any one of "allowed_function_names", else the predicted function calls will be any one of the provided "function_declarations".
|
|
810
|
-
*/
|
|
811
|
-
FunctionCallingConfigMode["VALIDATED"] = "VALIDATED";
|
|
812
|
-
})(FunctionCallingConfigMode || (FunctionCallingConfigMode = {}));
|
|
813
797
|
/** The number of thoughts tokens that the model should generate. */
|
|
814
798
|
var ThinkingLevel;
|
|
815
799
|
(function (ThinkingLevel) {
|
|
@@ -958,6 +942,30 @@ var HarmBlockThreshold;
|
|
|
958
942
|
*/
|
|
959
943
|
HarmBlockThreshold["OFF"] = "OFF";
|
|
960
944
|
})(HarmBlockThreshold || (HarmBlockThreshold = {}));
|
|
945
|
+
/** Function calling mode. */
|
|
946
|
+
var FunctionCallingConfigMode;
|
|
947
|
+
(function (FunctionCallingConfigMode) {
|
|
948
|
+
/**
|
|
949
|
+
* Unspecified function calling mode. This value should not be used.
|
|
950
|
+
*/
|
|
951
|
+
FunctionCallingConfigMode["MODE_UNSPECIFIED"] = "MODE_UNSPECIFIED";
|
|
952
|
+
/**
|
|
953
|
+
* Default model behavior, model decides to predict either function calls or natural language response.
|
|
954
|
+
*/
|
|
955
|
+
FunctionCallingConfigMode["AUTO"] = "AUTO";
|
|
956
|
+
/**
|
|
957
|
+
* Model is constrained to always predicting function calls only. If "allowed_function_names" are set, the predicted function calls will be limited to any one of "allowed_function_names", else the predicted function calls will be any one of the provided "function_declarations".
|
|
958
|
+
*/
|
|
959
|
+
FunctionCallingConfigMode["ANY"] = "ANY";
|
|
960
|
+
/**
|
|
961
|
+
* Model will not predict any function calls. Model behavior is same as when not passing any function declarations.
|
|
962
|
+
*/
|
|
963
|
+
FunctionCallingConfigMode["NONE"] = "NONE";
|
|
964
|
+
/**
|
|
965
|
+
* Model is constrained to predict either function calls or natural language response. If "allowed_function_names" are set, the predicted function calls will be limited to any one of "allowed_function_names", else the predicted function calls will be any one of the provided "function_declarations".
|
|
966
|
+
*/
|
|
967
|
+
FunctionCallingConfigMode["VALIDATED"] = "VALIDATED";
|
|
968
|
+
})(FunctionCallingConfigMode || (FunctionCallingConfigMode = {}));
|
|
961
969
|
/** Output only. The reason why the model stopped generating tokens.
|
|
962
970
|
|
|
963
971
|
If empty, the model has not stopped generating the tokens. */
|
|
@@ -1440,7 +1448,23 @@ var PairwiseChoice;
|
|
|
1440
1448
|
*/
|
|
1441
1449
|
PairwiseChoice["TIE"] = "TIE";
|
|
1442
1450
|
})(PairwiseChoice || (PairwiseChoice = {}));
|
|
1443
|
-
/** The tuning
|
|
1451
|
+
/** The speed of the tuning job. Only supported for Veo 3.0 models. This enum is not supported in Gemini API. */
|
|
1452
|
+
var TuningSpeed;
|
|
1453
|
+
(function (TuningSpeed) {
|
|
1454
|
+
/**
|
|
1455
|
+
* The default / unset value. For Veo 3.0 models, this defaults to FAST.
|
|
1456
|
+
*/
|
|
1457
|
+
TuningSpeed["TUNING_SPEED_UNSPECIFIED"] = "TUNING_SPEED_UNSPECIFIED";
|
|
1458
|
+
/**
|
|
1459
|
+
* Regular tuning speed.
|
|
1460
|
+
*/
|
|
1461
|
+
TuningSpeed["REGULAR"] = "REGULAR";
|
|
1462
|
+
/**
|
|
1463
|
+
* Fast tuning speed.
|
|
1464
|
+
*/
|
|
1465
|
+
TuningSpeed["FAST"] = "FAST";
|
|
1466
|
+
})(TuningSpeed || (TuningSpeed = {}));
|
|
1467
|
+
/** The tuning task for Veo. This enum is not supported in Gemini API. */
|
|
1444
1468
|
var TuningTask;
|
|
1445
1469
|
(function (TuningTask) {
|
|
1446
1470
|
/**
|
|
@@ -1460,6 +1484,22 @@ var TuningTask;
|
|
|
1460
1484
|
*/
|
|
1461
1485
|
TuningTask["TUNING_TASK_R2V"] = "TUNING_TASK_R2V";
|
|
1462
1486
|
})(TuningTask || (TuningTask = {}));
|
|
1487
|
+
/** The orientation of the video. Defaults to LANDSCAPE. This enum is not supported in Gemini API. */
|
|
1488
|
+
var VideoOrientation;
|
|
1489
|
+
(function (VideoOrientation) {
|
|
1490
|
+
/**
|
|
1491
|
+
* Unspecified video orientation. Defaults to landscape.
|
|
1492
|
+
*/
|
|
1493
|
+
VideoOrientation["VIDEO_ORIENTATION_UNSPECIFIED"] = "VIDEO_ORIENTATION_UNSPECIFIED";
|
|
1494
|
+
/**
|
|
1495
|
+
* Landscape orientation (e.g. 16:9, 1280x720).
|
|
1496
|
+
*/
|
|
1497
|
+
VideoOrientation["LANDSCAPE"] = "LANDSCAPE";
|
|
1498
|
+
/**
|
|
1499
|
+
* Portrait orientation (e.g. 9:16, 720x1280).
|
|
1500
|
+
*/
|
|
1501
|
+
VideoOrientation["PORTRAIT"] = "PORTRAIT";
|
|
1502
|
+
})(VideoOrientation || (VideoOrientation = {}));
|
|
1463
1503
|
/** Output only. Current state of the `Document`. This enum is not supported in Vertex AI. */
|
|
1464
1504
|
var DocumentState;
|
|
1465
1505
|
(function (DocumentState) {
|
|
@@ -1759,6 +1799,10 @@ var TuningMethod;
|
|
|
1759
1799
|
* Distillation tuning.
|
|
1760
1800
|
*/
|
|
1761
1801
|
TuningMethod["DISTILLATION"] = "DISTILLATION";
|
|
1802
|
+
/**
|
|
1803
|
+
* Reinforcement tuning.
|
|
1804
|
+
*/
|
|
1805
|
+
TuningMethod["REINFORCEMENT_TUNING"] = "REINFORCEMENT_TUNING";
|
|
1762
1806
|
})(TuningMethod || (TuningMethod = {}));
|
|
1763
1807
|
/** State for the lifecycle of a File. */
|
|
1764
1808
|
var FileState;
|
|
@@ -5080,6 +5124,7 @@ var PagedItem;
|
|
|
5080
5124
|
PagedItem["PAGED_ITEM_CACHED_CONTENTS"] = "cachedContents";
|
|
5081
5125
|
PagedItem["PAGED_ITEM_FILE_SEARCH_STORES"] = "fileSearchStores";
|
|
5082
5126
|
PagedItem["PAGED_ITEM_DOCUMENTS"] = "documents";
|
|
5127
|
+
PagedItem["PAGED_ITEM_SKILLS"] = "skills";
|
|
5083
5128
|
})(PagedItem || (PagedItem = {}));
|
|
5084
5129
|
/**
|
|
5085
5130
|
* Pager class for iterating through paginated results.
|
|
@@ -5800,6 +5845,21 @@ function blobToMldev$3(fromObject) {
|
|
|
5800
5845
|
}
|
|
5801
5846
|
return toObject;
|
|
5802
5847
|
}
|
|
5848
|
+
function codeExecutionResultToVertex$2(fromObject) {
|
|
5849
|
+
const toObject = {};
|
|
5850
|
+
const fromOutcome = getValueByPath(fromObject, ['outcome']);
|
|
5851
|
+
if (fromOutcome != null) {
|
|
5852
|
+
setValueByPath(toObject, ['outcome'], fromOutcome);
|
|
5853
|
+
}
|
|
5854
|
+
const fromOutput = getValueByPath(fromObject, ['output']);
|
|
5855
|
+
if (fromOutput != null) {
|
|
5856
|
+
setValueByPath(toObject, ['output'], fromOutput);
|
|
5857
|
+
}
|
|
5858
|
+
if (getValueByPath(fromObject, ['id']) !== undefined) {
|
|
5859
|
+
throw new Error('id parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
5860
|
+
}
|
|
5861
|
+
return toObject;
|
|
5862
|
+
}
|
|
5803
5863
|
function contentToMldev$3(fromObject) {
|
|
5804
5864
|
const toObject = {};
|
|
5805
5865
|
const fromParts = getValueByPath(fromObject, ['parts']);
|
|
@@ -5995,6 +6055,21 @@ function deleteCachedContentResponseFromVertex(fromObject) {
|
|
|
5995
6055
|
}
|
|
5996
6056
|
return toObject;
|
|
5997
6057
|
}
|
|
6058
|
+
function executableCodeToVertex$2(fromObject) {
|
|
6059
|
+
const toObject = {};
|
|
6060
|
+
const fromCode = getValueByPath(fromObject, ['code']);
|
|
6061
|
+
if (fromCode != null) {
|
|
6062
|
+
setValueByPath(toObject, ['code'], fromCode);
|
|
6063
|
+
}
|
|
6064
|
+
const fromLanguage = getValueByPath(fromObject, ['language']);
|
|
6065
|
+
if (fromLanguage != null) {
|
|
6066
|
+
setValueByPath(toObject, ['language'], fromLanguage);
|
|
6067
|
+
}
|
|
6068
|
+
if (getValueByPath(fromObject, ['id']) !== undefined) {
|
|
6069
|
+
throw new Error('id parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
6070
|
+
}
|
|
6071
|
+
return toObject;
|
|
6072
|
+
}
|
|
5998
6073
|
function fileDataToMldev$3(fromObject) {
|
|
5999
6074
|
const toObject = {};
|
|
6000
6075
|
if (getValueByPath(fromObject, ['displayName']) !== undefined) {
|
|
@@ -6278,13 +6353,13 @@ function partToVertex$2(fromObject) {
|
|
|
6278
6353
|
'codeExecutionResult',
|
|
6279
6354
|
]);
|
|
6280
6355
|
if (fromCodeExecutionResult != null) {
|
|
6281
|
-
setValueByPath(toObject, ['codeExecutionResult'], fromCodeExecutionResult);
|
|
6356
|
+
setValueByPath(toObject, ['codeExecutionResult'], codeExecutionResultToVertex$2(fromCodeExecutionResult));
|
|
6282
6357
|
}
|
|
6283
6358
|
const fromExecutableCode = getValueByPath(fromObject, [
|
|
6284
6359
|
'executableCode',
|
|
6285
6360
|
]);
|
|
6286
6361
|
if (fromExecutableCode != null) {
|
|
6287
|
-
setValueByPath(toObject, ['executableCode'], fromExecutableCode);
|
|
6362
|
+
setValueByPath(toObject, ['executableCode'], executableCodeToVertex$2(fromExecutableCode));
|
|
6288
6363
|
}
|
|
6289
6364
|
const fromFileData = getValueByPath(fromObject, ['fileData']);
|
|
6290
6365
|
if (fromFileData != null) {
|
|
@@ -7594,7 +7669,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
|
|
|
7594
7669
|
const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
|
|
7595
7670
|
const USER_AGENT_HEADER = 'User-Agent';
|
|
7596
7671
|
const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
|
|
7597
|
-
const SDK_VERSION = '2.
|
|
7672
|
+
const SDK_VERSION = '2.7.0'; // x-release-please-version
|
|
7598
7673
|
const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
|
|
7599
7674
|
const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
|
|
7600
7675
|
const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';
|
|
@@ -11631,6 +11706,21 @@ function blobToMldev$2(fromObject) {
|
|
|
11631
11706
|
}
|
|
11632
11707
|
return toObject;
|
|
11633
11708
|
}
|
|
11709
|
+
function codeExecutionResultToVertex$1(fromObject) {
|
|
11710
|
+
const toObject = {};
|
|
11711
|
+
const fromOutcome = getValueByPath(fromObject, ['outcome']);
|
|
11712
|
+
if (fromOutcome != null) {
|
|
11713
|
+
setValueByPath(toObject, ['outcome'], fromOutcome);
|
|
11714
|
+
}
|
|
11715
|
+
const fromOutput = getValueByPath(fromObject, ['output']);
|
|
11716
|
+
if (fromOutput != null) {
|
|
11717
|
+
setValueByPath(toObject, ['output'], fromOutput);
|
|
11718
|
+
}
|
|
11719
|
+
if (getValueByPath(fromObject, ['id']) !== undefined) {
|
|
11720
|
+
throw new Error('id parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
11721
|
+
}
|
|
11722
|
+
return toObject;
|
|
11723
|
+
}
|
|
11634
11724
|
function contentToMldev$2(fromObject) {
|
|
11635
11725
|
const toObject = {};
|
|
11636
11726
|
const fromParts = getValueByPath(fromObject, ['parts']);
|
|
@@ -11667,6 +11757,21 @@ function contentToVertex$1(fromObject) {
|
|
|
11667
11757
|
}
|
|
11668
11758
|
return toObject;
|
|
11669
11759
|
}
|
|
11760
|
+
function executableCodeToVertex$1(fromObject) {
|
|
11761
|
+
const toObject = {};
|
|
11762
|
+
const fromCode = getValueByPath(fromObject, ['code']);
|
|
11763
|
+
if (fromCode != null) {
|
|
11764
|
+
setValueByPath(toObject, ['code'], fromCode);
|
|
11765
|
+
}
|
|
11766
|
+
const fromLanguage = getValueByPath(fromObject, ['language']);
|
|
11767
|
+
if (fromLanguage != null) {
|
|
11768
|
+
setValueByPath(toObject, ['language'], fromLanguage);
|
|
11769
|
+
}
|
|
11770
|
+
if (getValueByPath(fromObject, ['id']) !== undefined) {
|
|
11771
|
+
throw new Error('id parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
11772
|
+
}
|
|
11773
|
+
return toObject;
|
|
11774
|
+
}
|
|
11670
11775
|
function fileDataToMldev$2(fromObject) {
|
|
11671
11776
|
const toObject = {};
|
|
11672
11777
|
if (getValueByPath(fromObject, ['displayName']) !== undefined) {
|
|
@@ -12406,13 +12511,13 @@ function partToVertex$1(fromObject) {
|
|
|
12406
12511
|
'codeExecutionResult',
|
|
12407
12512
|
]);
|
|
12408
12513
|
if (fromCodeExecutionResult != null) {
|
|
12409
|
-
setValueByPath(toObject, ['codeExecutionResult'], fromCodeExecutionResult);
|
|
12514
|
+
setValueByPath(toObject, ['codeExecutionResult'], codeExecutionResultToVertex$1(fromCodeExecutionResult));
|
|
12410
12515
|
}
|
|
12411
12516
|
const fromExecutableCode = getValueByPath(fromObject, [
|
|
12412
12517
|
'executableCode',
|
|
12413
12518
|
]);
|
|
12414
12519
|
if (fromExecutableCode != null) {
|
|
12415
|
-
setValueByPath(toObject, ['executableCode'], fromExecutableCode);
|
|
12520
|
+
setValueByPath(toObject, ['executableCode'], executableCodeToVertex$1(fromExecutableCode));
|
|
12416
12521
|
}
|
|
12417
12522
|
const fromFileData = getValueByPath(fromObject, ['fileData']);
|
|
12418
12523
|
if (fromFileData != null) {
|
|
@@ -12844,6 +12949,21 @@ function citationMetadataFromMldev(fromObject, _rootObject) {
|
|
|
12844
12949
|
}
|
|
12845
12950
|
return toObject;
|
|
12846
12951
|
}
|
|
12952
|
+
function codeExecutionResultToVertex(fromObject, _rootObject) {
|
|
12953
|
+
const toObject = {};
|
|
12954
|
+
const fromOutcome = getValueByPath(fromObject, ['outcome']);
|
|
12955
|
+
if (fromOutcome != null) {
|
|
12956
|
+
setValueByPath(toObject, ['outcome'], fromOutcome);
|
|
12957
|
+
}
|
|
12958
|
+
const fromOutput = getValueByPath(fromObject, ['output']);
|
|
12959
|
+
if (fromOutput != null) {
|
|
12960
|
+
setValueByPath(toObject, ['output'], fromOutput);
|
|
12961
|
+
}
|
|
12962
|
+
if (getValueByPath(fromObject, ['id']) !== undefined) {
|
|
12963
|
+
throw new Error('id parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
12964
|
+
}
|
|
12965
|
+
return toObject;
|
|
12966
|
+
}
|
|
12847
12967
|
function computeTokensParametersToVertex(apiClient, fromObject, rootObject) {
|
|
12848
12968
|
const toObject = {};
|
|
12849
12969
|
const fromModel = getValueByPath(fromObject, ['model']);
|
|
@@ -13556,6 +13676,21 @@ function endpointFromVertex(fromObject, _rootObject) {
|
|
|
13556
13676
|
}
|
|
13557
13677
|
return toObject;
|
|
13558
13678
|
}
|
|
13679
|
+
function executableCodeToVertex(fromObject, _rootObject) {
|
|
13680
|
+
const toObject = {};
|
|
13681
|
+
const fromCode = getValueByPath(fromObject, ['code']);
|
|
13682
|
+
if (fromCode != null) {
|
|
13683
|
+
setValueByPath(toObject, ['code'], fromCode);
|
|
13684
|
+
}
|
|
13685
|
+
const fromLanguage = getValueByPath(fromObject, ['language']);
|
|
13686
|
+
if (fromLanguage != null) {
|
|
13687
|
+
setValueByPath(toObject, ['language'], fromLanguage);
|
|
13688
|
+
}
|
|
13689
|
+
if (getValueByPath(fromObject, ['id']) !== undefined) {
|
|
13690
|
+
throw new Error('id parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
13691
|
+
}
|
|
13692
|
+
return toObject;
|
|
13693
|
+
}
|
|
13559
13694
|
function fileDataToMldev$1(fromObject, _rootObject) {
|
|
13560
13695
|
const toObject = {};
|
|
13561
13696
|
if (getValueByPath(fromObject, ['displayName']) !== undefined) {
|
|
@@ -15434,7 +15569,7 @@ function partToMldev$1(fromObject, rootObject) {
|
|
|
15434
15569
|
}
|
|
15435
15570
|
return toObject;
|
|
15436
15571
|
}
|
|
15437
|
-
function partToVertex(fromObject,
|
|
15572
|
+
function partToVertex(fromObject, rootObject) {
|
|
15438
15573
|
const toObject = {};
|
|
15439
15574
|
const fromMediaResolution = getValueByPath(fromObject, [
|
|
15440
15575
|
'mediaResolution',
|
|
@@ -15446,13 +15581,13 @@ function partToVertex(fromObject, _rootObject) {
|
|
|
15446
15581
|
'codeExecutionResult',
|
|
15447
15582
|
]);
|
|
15448
15583
|
if (fromCodeExecutionResult != null) {
|
|
15449
|
-
setValueByPath(toObject, ['codeExecutionResult'], fromCodeExecutionResult);
|
|
15584
|
+
setValueByPath(toObject, ['codeExecutionResult'], codeExecutionResultToVertex(fromCodeExecutionResult));
|
|
15450
15585
|
}
|
|
15451
15586
|
const fromExecutableCode = getValueByPath(fromObject, [
|
|
15452
15587
|
'executableCode',
|
|
15453
15588
|
]);
|
|
15454
15589
|
if (fromExecutableCode != null) {
|
|
15455
|
-
setValueByPath(toObject, ['executableCode'], fromExecutableCode);
|
|
15590
|
+
setValueByPath(toObject, ['executableCode'], executableCodeToVertex(fromExecutableCode));
|
|
15456
15591
|
}
|
|
15457
15592
|
const fromFileData = getValueByPath(fromObject, ['fileData']);
|
|
15458
15593
|
if (fromFileData != null) {
|
|
@@ -19828,6 +19963,24 @@ function createTuningJobConfigToMldev(fromObject, parentObject, _rootObject) {
|
|
|
19828
19963
|
if (getValueByPath(fromObject, ['encryptionSpec']) !== undefined) {
|
|
19829
19964
|
throw new Error('encryptionSpec parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
19830
19965
|
}
|
|
19966
|
+
if (getValueByPath(fromObject, ['rewardConfig']) !== undefined) {
|
|
19967
|
+
throw new Error('rewardConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
19968
|
+
}
|
|
19969
|
+
if (getValueByPath(fromObject, ['compositeRewardConfig']) !== undefined) {
|
|
19970
|
+
throw new Error('compositeRewardConfig parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
19971
|
+
}
|
|
19972
|
+
if (getValueByPath(fromObject, ['samplesPerPrompt']) !== undefined) {
|
|
19973
|
+
throw new Error('samplesPerPrompt parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
19974
|
+
}
|
|
19975
|
+
if (getValueByPath(fromObject, ['evaluateInterval']) !== undefined) {
|
|
19976
|
+
throw new Error('evaluateInterval parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
19977
|
+
}
|
|
19978
|
+
if (getValueByPath(fromObject, ['checkpointInterval']) !== undefined) {
|
|
19979
|
+
throw new Error('checkpointInterval parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
19980
|
+
}
|
|
19981
|
+
if (getValueByPath(fromObject, ['maxOutputTokens']) !== undefined) {
|
|
19982
|
+
throw new Error('maxOutputTokens parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
19983
|
+
}
|
|
19831
19984
|
return toObject;
|
|
19832
19985
|
}
|
|
19833
19986
|
function createTuningJobConfigToVertex(fromObject, parentObject, rootObject) {
|
|
@@ -19863,6 +20016,14 @@ function createTuningJobConfigToVertex(fromObject, parentObject, rootObject) {
|
|
|
19863
20016
|
setValueByPath(parentObject, ['distillationSpec'], tuningValidationDatasetToVertex(fromValidationDataset));
|
|
19864
20017
|
}
|
|
19865
20018
|
}
|
|
20019
|
+
else if (discriminatorValidationDataset === 'REINFORCEMENT_TUNING') {
|
|
20020
|
+
const fromValidationDataset = getValueByPath(fromObject, [
|
|
20021
|
+
'validationDataset',
|
|
20022
|
+
]);
|
|
20023
|
+
if (parentObject !== undefined && fromValidationDataset != null) {
|
|
20024
|
+
setValueByPath(parentObject, ['reinforcementTuningSpec'], tuningValidationDatasetToVertex(fromValidationDataset));
|
|
20025
|
+
}
|
|
20026
|
+
}
|
|
19866
20027
|
const fromTunedModelDisplayName = getValueByPath(fromObject, [
|
|
19867
20028
|
'tunedModelDisplayName',
|
|
19868
20029
|
]);
|
|
@@ -19898,6 +20059,12 @@ function createTuningJobConfigToVertex(fromObject, parentObject, rootObject) {
|
|
|
19898
20059
|
setValueByPath(parentObject, ['distillationSpec', 'hyperParameters', 'epochCount'], fromEpochCount);
|
|
19899
20060
|
}
|
|
19900
20061
|
}
|
|
20062
|
+
else if (discriminatorEpochCount === 'REINFORCEMENT_TUNING') {
|
|
20063
|
+
const fromEpochCount = getValueByPath(fromObject, ['epochCount']);
|
|
20064
|
+
if (parentObject !== undefined && fromEpochCount != null) {
|
|
20065
|
+
setValueByPath(parentObject, ['reinforcementTuningSpec', 'hyperParameters', 'epochCount'], fromEpochCount);
|
|
20066
|
+
}
|
|
20067
|
+
}
|
|
19901
20068
|
let discriminatorLearningRateMultiplier = getValueByPath(rootObject, [
|
|
19902
20069
|
'config',
|
|
19903
20070
|
'method',
|
|
@@ -19933,6 +20100,18 @@ function createTuningJobConfigToVertex(fromObject, parentObject, rootObject) {
|
|
|
19933
20100
|
setValueByPath(parentObject, ['distillationSpec', 'hyperParameters', 'learningRateMultiplier'], fromLearningRateMultiplier);
|
|
19934
20101
|
}
|
|
19935
20102
|
}
|
|
20103
|
+
else if (discriminatorLearningRateMultiplier === 'REINFORCEMENT_TUNING') {
|
|
20104
|
+
const fromLearningRateMultiplier = getValueByPath(fromObject, [
|
|
20105
|
+
'learningRateMultiplier',
|
|
20106
|
+
]);
|
|
20107
|
+
if (parentObject !== undefined && fromLearningRateMultiplier != null) {
|
|
20108
|
+
setValueByPath(parentObject, [
|
|
20109
|
+
'reinforcementTuningSpec',
|
|
20110
|
+
'hyperParameters',
|
|
20111
|
+
'learningRateMultiplier',
|
|
20112
|
+
], fromLearningRateMultiplier);
|
|
20113
|
+
}
|
|
20114
|
+
}
|
|
19936
20115
|
let discriminatorExportLastCheckpointOnly = getValueByPath(rootObject, ['config', 'method']);
|
|
19937
20116
|
if (discriminatorExportLastCheckpointOnly === undefined) {
|
|
19938
20117
|
discriminatorExportLastCheckpointOnly = 'SUPERVISED_FINE_TUNING';
|
|
@@ -19986,6 +20165,12 @@ function createTuningJobConfigToVertex(fromObject, parentObject, rootObject) {
|
|
|
19986
20165
|
setValueByPath(parentObject, ['distillationSpec', 'hyperParameters', 'adapterSize'], fromAdapterSize);
|
|
19987
20166
|
}
|
|
19988
20167
|
}
|
|
20168
|
+
else if (discriminatorAdapterSize === 'REINFORCEMENT_TUNING') {
|
|
20169
|
+
const fromAdapterSize = getValueByPath(fromObject, ['adapterSize']);
|
|
20170
|
+
if (parentObject !== undefined && fromAdapterSize != null) {
|
|
20171
|
+
setValueByPath(parentObject, ['reinforcementTuningSpec', 'hyperParameters', 'adapterSize'], fromAdapterSize);
|
|
20172
|
+
}
|
|
20173
|
+
}
|
|
19989
20174
|
let discriminatorTuningMode = getValueByPath(rootObject, [
|
|
19990
20175
|
'config',
|
|
19991
20176
|
'method',
|
|
@@ -20030,6 +20215,12 @@ function createTuningJobConfigToVertex(fromObject, parentObject, rootObject) {
|
|
|
20030
20215
|
setValueByPath(parentObject, ['distillationSpec', 'hyperParameters', 'batchSize'], fromBatchSize);
|
|
20031
20216
|
}
|
|
20032
20217
|
}
|
|
20218
|
+
else if (discriminatorBatchSize === 'REINFORCEMENT_TUNING') {
|
|
20219
|
+
const fromBatchSize = getValueByPath(fromObject, ['batchSize']);
|
|
20220
|
+
if (parentObject !== undefined && fromBatchSize != null) {
|
|
20221
|
+
setValueByPath(parentObject, ['reinforcementTuningSpec', 'hyperParameters', 'batchSize'], fromBatchSize);
|
|
20222
|
+
}
|
|
20223
|
+
}
|
|
20033
20224
|
let discriminatorLearningRate = getValueByPath(rootObject, [
|
|
20034
20225
|
'config',
|
|
20035
20226
|
'method',
|
|
@@ -20089,6 +20280,40 @@ function createTuningJobConfigToVertex(fromObject, parentObject, rootObject) {
|
|
|
20089
20280
|
if (parentObject !== undefined && fromEncryptionSpec != null) {
|
|
20090
20281
|
setValueByPath(parentObject, ['encryptionSpec'], fromEncryptionSpec);
|
|
20091
20282
|
}
|
|
20283
|
+
const fromRewardConfig = getValueByPath(fromObject, ['rewardConfig']);
|
|
20284
|
+
if (parentObject !== undefined && fromRewardConfig != null) {
|
|
20285
|
+
setValueByPath(parentObject, ['reinforcementTuningSpec', 'singleRewardConfig'], fromRewardConfig);
|
|
20286
|
+
}
|
|
20287
|
+
const fromCompositeRewardConfig = getValueByPath(fromObject, [
|
|
20288
|
+
'compositeRewardConfig',
|
|
20289
|
+
]);
|
|
20290
|
+
if (parentObject !== undefined && fromCompositeRewardConfig != null) {
|
|
20291
|
+
setValueByPath(parentObject, ['reinforcementTuningSpec', 'compositeRewardConfig'], fromCompositeRewardConfig);
|
|
20292
|
+
}
|
|
20293
|
+
const fromSamplesPerPrompt = getValueByPath(fromObject, [
|
|
20294
|
+
'samplesPerPrompt',
|
|
20295
|
+
]);
|
|
20296
|
+
if (parentObject !== undefined && fromSamplesPerPrompt != null) {
|
|
20297
|
+
setValueByPath(parentObject, ['reinforcementTuningSpec', 'hyperParameters', 'samplesPerPrompt'], fromSamplesPerPrompt);
|
|
20298
|
+
}
|
|
20299
|
+
const fromEvaluateInterval = getValueByPath(fromObject, [
|
|
20300
|
+
'evaluateInterval',
|
|
20301
|
+
]);
|
|
20302
|
+
if (parentObject !== undefined && fromEvaluateInterval != null) {
|
|
20303
|
+
setValueByPath(parentObject, ['reinforcementTuningSpec', 'hyperParameters', 'evaluateInterval'], fromEvaluateInterval);
|
|
20304
|
+
}
|
|
20305
|
+
const fromCheckpointInterval = getValueByPath(fromObject, [
|
|
20306
|
+
'checkpointInterval',
|
|
20307
|
+
]);
|
|
20308
|
+
if (parentObject !== undefined && fromCheckpointInterval != null) {
|
|
20309
|
+
setValueByPath(parentObject, ['reinforcementTuningSpec', 'hyperParameters', 'checkpointInterval'], fromCheckpointInterval);
|
|
20310
|
+
}
|
|
20311
|
+
const fromMaxOutputTokens = getValueByPath(fromObject, [
|
|
20312
|
+
'maxOutputTokens',
|
|
20313
|
+
]);
|
|
20314
|
+
if (parentObject !== undefined && fromMaxOutputTokens != null) {
|
|
20315
|
+
setValueByPath(parentObject, ['reinforcementTuningSpec', 'hyperParameters', 'maxOutputTokens'], fromMaxOutputTokens);
|
|
20316
|
+
}
|
|
20092
20317
|
return toObject;
|
|
20093
20318
|
}
|
|
20094
20319
|
function createTuningJobParametersPrivateToMldev(fromObject, rootObject) {
|
|
@@ -20139,6 +20364,250 @@ function createTuningJobParametersPrivateToVertex(fromObject, rootObject) {
|
|
|
20139
20364
|
}
|
|
20140
20365
|
return toObject;
|
|
20141
20366
|
}
|
|
20367
|
+
function distillationHyperParametersFromVertex(fromObject, rootObject) {
|
|
20368
|
+
const toObject = {};
|
|
20369
|
+
const fromAdapterSize = getValueByPath(fromObject, ['adapterSize']);
|
|
20370
|
+
if (fromAdapterSize != null) {
|
|
20371
|
+
setValueByPath(toObject, ['adapterSize'], fromAdapterSize);
|
|
20372
|
+
}
|
|
20373
|
+
const fromEpochCount = getValueByPath(fromObject, ['epochCount']);
|
|
20374
|
+
if (fromEpochCount != null) {
|
|
20375
|
+
setValueByPath(toObject, ['epochCount'], fromEpochCount);
|
|
20376
|
+
}
|
|
20377
|
+
const fromLearningRateMultiplier = getValueByPath(fromObject, [
|
|
20378
|
+
'learningRateMultiplier',
|
|
20379
|
+
]);
|
|
20380
|
+
if (fromLearningRateMultiplier != null) {
|
|
20381
|
+
setValueByPath(toObject, ['learningRateMultiplier'], fromLearningRateMultiplier);
|
|
20382
|
+
}
|
|
20383
|
+
const fromGenerationConfig = getValueByPath(fromObject, [
|
|
20384
|
+
'generationConfig',
|
|
20385
|
+
]);
|
|
20386
|
+
if (fromGenerationConfig != null) {
|
|
20387
|
+
setValueByPath(toObject, ['generationConfig'], generationConfigFromVertex(fromGenerationConfig));
|
|
20388
|
+
}
|
|
20389
|
+
const fromLearningRate = getValueByPath(fromObject, ['learningRate']);
|
|
20390
|
+
if (fromLearningRate != null) {
|
|
20391
|
+
setValueByPath(toObject, ['learningRate'], fromLearningRate);
|
|
20392
|
+
}
|
|
20393
|
+
const fromBatchSize = getValueByPath(fromObject, ['batchSize']);
|
|
20394
|
+
if (fromBatchSize != null) {
|
|
20395
|
+
setValueByPath(toObject, ['batchSize'], fromBatchSize);
|
|
20396
|
+
}
|
|
20397
|
+
return toObject;
|
|
20398
|
+
}
|
|
20399
|
+
function distillationSamplingSpecFromVertex(fromObject, rootObject) {
|
|
20400
|
+
const toObject = {};
|
|
20401
|
+
const fromBaseTeacherModel = getValueByPath(fromObject, [
|
|
20402
|
+
'baseTeacherModel',
|
|
20403
|
+
]);
|
|
20404
|
+
if (fromBaseTeacherModel != null) {
|
|
20405
|
+
setValueByPath(toObject, ['baseTeacherModel'], fromBaseTeacherModel);
|
|
20406
|
+
}
|
|
20407
|
+
const fromTunedTeacherModelSource = getValueByPath(fromObject, [
|
|
20408
|
+
'tunedTeacherModelSource',
|
|
20409
|
+
]);
|
|
20410
|
+
if (fromTunedTeacherModelSource != null) {
|
|
20411
|
+
setValueByPath(toObject, ['tunedTeacherModelSource'], fromTunedTeacherModelSource);
|
|
20412
|
+
}
|
|
20413
|
+
const fromValidationDatasetUri = getValueByPath(fromObject, [
|
|
20414
|
+
'validationDatasetUri',
|
|
20415
|
+
]);
|
|
20416
|
+
if (fromValidationDatasetUri != null) {
|
|
20417
|
+
setValueByPath(toObject, ['validationDatasetUri'], fromValidationDatasetUri);
|
|
20418
|
+
}
|
|
20419
|
+
const fromPromptDatasetUri = getValueByPath(fromObject, [
|
|
20420
|
+
'promptDatasetUri',
|
|
20421
|
+
]);
|
|
20422
|
+
if (fromPromptDatasetUri != null) {
|
|
20423
|
+
setValueByPath(toObject, ['promptDatasetUri'], fromPromptDatasetUri);
|
|
20424
|
+
}
|
|
20425
|
+
const fromHyperparameters = getValueByPath(fromObject, [
|
|
20426
|
+
'hyperparameters',
|
|
20427
|
+
]);
|
|
20428
|
+
if (fromHyperparameters != null) {
|
|
20429
|
+
setValueByPath(toObject, ['hyperparameters'], distillationHyperParametersFromVertex(fromHyperparameters));
|
|
20430
|
+
}
|
|
20431
|
+
return toObject;
|
|
20432
|
+
}
|
|
20433
|
+
function distillationSpecFromVertex(fromObject, rootObject) {
|
|
20434
|
+
const toObject = {};
|
|
20435
|
+
const fromPromptDatasetUri = getValueByPath(fromObject, [
|
|
20436
|
+
'promptDatasetUri',
|
|
20437
|
+
]);
|
|
20438
|
+
if (fromPromptDatasetUri != null) {
|
|
20439
|
+
setValueByPath(toObject, ['promptDatasetUri'], fromPromptDatasetUri);
|
|
20440
|
+
}
|
|
20441
|
+
const fromBaseTeacherModel = getValueByPath(fromObject, [
|
|
20442
|
+
'baseTeacherModel',
|
|
20443
|
+
]);
|
|
20444
|
+
if (fromBaseTeacherModel != null) {
|
|
20445
|
+
setValueByPath(toObject, ['baseTeacherModel'], fromBaseTeacherModel);
|
|
20446
|
+
}
|
|
20447
|
+
const fromHyperParameters = getValueByPath(fromObject, [
|
|
20448
|
+
'hyperParameters',
|
|
20449
|
+
]);
|
|
20450
|
+
if (fromHyperParameters != null) {
|
|
20451
|
+
setValueByPath(toObject, ['hyperParameters'], distillationHyperParametersFromVertex(fromHyperParameters));
|
|
20452
|
+
}
|
|
20453
|
+
const fromPipelineRootDirectory = getValueByPath(fromObject, [
|
|
20454
|
+
'pipelineRootDirectory',
|
|
20455
|
+
]);
|
|
20456
|
+
if (fromPipelineRootDirectory != null) {
|
|
20457
|
+
setValueByPath(toObject, ['pipelineRootDirectory'], fromPipelineRootDirectory);
|
|
20458
|
+
}
|
|
20459
|
+
const fromStudentModel = getValueByPath(fromObject, ['studentModel']);
|
|
20460
|
+
if (fromStudentModel != null) {
|
|
20461
|
+
setValueByPath(toObject, ['studentModel'], fromStudentModel);
|
|
20462
|
+
}
|
|
20463
|
+
const fromTrainingDatasetUri = getValueByPath(fromObject, [
|
|
20464
|
+
'trainingDatasetUri',
|
|
20465
|
+
]);
|
|
20466
|
+
if (fromTrainingDatasetUri != null) {
|
|
20467
|
+
setValueByPath(toObject, ['trainingDatasetUri'], fromTrainingDatasetUri);
|
|
20468
|
+
}
|
|
20469
|
+
const fromTunedTeacherModelSource = getValueByPath(fromObject, [
|
|
20470
|
+
'tunedTeacherModelSource',
|
|
20471
|
+
]);
|
|
20472
|
+
if (fromTunedTeacherModelSource != null) {
|
|
20473
|
+
setValueByPath(toObject, ['tunedTeacherModelSource'], fromTunedTeacherModelSource);
|
|
20474
|
+
}
|
|
20475
|
+
const fromValidationDatasetUri = getValueByPath(fromObject, [
|
|
20476
|
+
'validationDatasetUri',
|
|
20477
|
+
]);
|
|
20478
|
+
if (fromValidationDatasetUri != null) {
|
|
20479
|
+
setValueByPath(toObject, ['validationDatasetUri'], fromValidationDatasetUri);
|
|
20480
|
+
}
|
|
20481
|
+
const fromTuningMode = getValueByPath(fromObject, ['tuningMode']);
|
|
20482
|
+
if (fromTuningMode != null) {
|
|
20483
|
+
setValueByPath(toObject, ['tuningMode'], fromTuningMode);
|
|
20484
|
+
}
|
|
20485
|
+
return toObject;
|
|
20486
|
+
}
|
|
20487
|
+
function generationConfigFromVertex(fromObject, _rootObject) {
|
|
20488
|
+
const toObject = {};
|
|
20489
|
+
const fromModelSelectionConfig = getValueByPath(fromObject, [
|
|
20490
|
+
'modelConfig',
|
|
20491
|
+
]);
|
|
20492
|
+
if (fromModelSelectionConfig != null) {
|
|
20493
|
+
setValueByPath(toObject, ['modelSelectionConfig'], fromModelSelectionConfig);
|
|
20494
|
+
}
|
|
20495
|
+
const fromResponseJsonSchema = getValueByPath(fromObject, [
|
|
20496
|
+
'responseJsonSchema',
|
|
20497
|
+
]);
|
|
20498
|
+
if (fromResponseJsonSchema != null) {
|
|
20499
|
+
setValueByPath(toObject, ['responseJsonSchema'], fromResponseJsonSchema);
|
|
20500
|
+
}
|
|
20501
|
+
const fromAudioTimestamp = getValueByPath(fromObject, [
|
|
20502
|
+
'audioTimestamp',
|
|
20503
|
+
]);
|
|
20504
|
+
if (fromAudioTimestamp != null) {
|
|
20505
|
+
setValueByPath(toObject, ['audioTimestamp'], fromAudioTimestamp);
|
|
20506
|
+
}
|
|
20507
|
+
const fromCandidateCount = getValueByPath(fromObject, [
|
|
20508
|
+
'candidateCount',
|
|
20509
|
+
]);
|
|
20510
|
+
if (fromCandidateCount != null) {
|
|
20511
|
+
setValueByPath(toObject, ['candidateCount'], fromCandidateCount);
|
|
20512
|
+
}
|
|
20513
|
+
const fromEnableAffectiveDialog = getValueByPath(fromObject, [
|
|
20514
|
+
'enableAffectiveDialog',
|
|
20515
|
+
]);
|
|
20516
|
+
if (fromEnableAffectiveDialog != null) {
|
|
20517
|
+
setValueByPath(toObject, ['enableAffectiveDialog'], fromEnableAffectiveDialog);
|
|
20518
|
+
}
|
|
20519
|
+
const fromFrequencyPenalty = getValueByPath(fromObject, [
|
|
20520
|
+
'frequencyPenalty',
|
|
20521
|
+
]);
|
|
20522
|
+
if (fromFrequencyPenalty != null) {
|
|
20523
|
+
setValueByPath(toObject, ['frequencyPenalty'], fromFrequencyPenalty);
|
|
20524
|
+
}
|
|
20525
|
+
const fromLogprobs = getValueByPath(fromObject, ['logprobs']);
|
|
20526
|
+
if (fromLogprobs != null) {
|
|
20527
|
+
setValueByPath(toObject, ['logprobs'], fromLogprobs);
|
|
20528
|
+
}
|
|
20529
|
+
const fromMaxOutputTokens = getValueByPath(fromObject, [
|
|
20530
|
+
'maxOutputTokens',
|
|
20531
|
+
]);
|
|
20532
|
+
if (fromMaxOutputTokens != null) {
|
|
20533
|
+
setValueByPath(toObject, ['maxOutputTokens'], fromMaxOutputTokens);
|
|
20534
|
+
}
|
|
20535
|
+
const fromMediaResolution = getValueByPath(fromObject, [
|
|
20536
|
+
'mediaResolution',
|
|
20537
|
+
]);
|
|
20538
|
+
if (fromMediaResolution != null) {
|
|
20539
|
+
setValueByPath(toObject, ['mediaResolution'], fromMediaResolution);
|
|
20540
|
+
}
|
|
20541
|
+
const fromPresencePenalty = getValueByPath(fromObject, [
|
|
20542
|
+
'presencePenalty',
|
|
20543
|
+
]);
|
|
20544
|
+
if (fromPresencePenalty != null) {
|
|
20545
|
+
setValueByPath(toObject, ['presencePenalty'], fromPresencePenalty);
|
|
20546
|
+
}
|
|
20547
|
+
const fromResponseLogprobs = getValueByPath(fromObject, [
|
|
20548
|
+
'responseLogprobs',
|
|
20549
|
+
]);
|
|
20550
|
+
if (fromResponseLogprobs != null) {
|
|
20551
|
+
setValueByPath(toObject, ['responseLogprobs'], fromResponseLogprobs);
|
|
20552
|
+
}
|
|
20553
|
+
const fromResponseMimeType = getValueByPath(fromObject, [
|
|
20554
|
+
'responseMimeType',
|
|
20555
|
+
]);
|
|
20556
|
+
if (fromResponseMimeType != null) {
|
|
20557
|
+
setValueByPath(toObject, ['responseMimeType'], fromResponseMimeType);
|
|
20558
|
+
}
|
|
20559
|
+
const fromResponseModalities = getValueByPath(fromObject, [
|
|
20560
|
+
'responseModalities',
|
|
20561
|
+
]);
|
|
20562
|
+
if (fromResponseModalities != null) {
|
|
20563
|
+
setValueByPath(toObject, ['responseModalities'], fromResponseModalities);
|
|
20564
|
+
}
|
|
20565
|
+
const fromResponseSchema = getValueByPath(fromObject, [
|
|
20566
|
+
'responseSchema',
|
|
20567
|
+
]);
|
|
20568
|
+
if (fromResponseSchema != null) {
|
|
20569
|
+
setValueByPath(toObject, ['responseSchema'], fromResponseSchema);
|
|
20570
|
+
}
|
|
20571
|
+
const fromRoutingConfig = getValueByPath(fromObject, [
|
|
20572
|
+
'routingConfig',
|
|
20573
|
+
]);
|
|
20574
|
+
if (fromRoutingConfig != null) {
|
|
20575
|
+
setValueByPath(toObject, ['routingConfig'], fromRoutingConfig);
|
|
20576
|
+
}
|
|
20577
|
+
const fromSeed = getValueByPath(fromObject, ['seed']);
|
|
20578
|
+
if (fromSeed != null) {
|
|
20579
|
+
setValueByPath(toObject, ['seed'], fromSeed);
|
|
20580
|
+
}
|
|
20581
|
+
const fromSpeechConfig = getValueByPath(fromObject, ['speechConfig']);
|
|
20582
|
+
if (fromSpeechConfig != null) {
|
|
20583
|
+
setValueByPath(toObject, ['speechConfig'], fromSpeechConfig);
|
|
20584
|
+
}
|
|
20585
|
+
const fromStopSequences = getValueByPath(fromObject, [
|
|
20586
|
+
'stopSequences',
|
|
20587
|
+
]);
|
|
20588
|
+
if (fromStopSequences != null) {
|
|
20589
|
+
setValueByPath(toObject, ['stopSequences'], fromStopSequences);
|
|
20590
|
+
}
|
|
20591
|
+
const fromTemperature = getValueByPath(fromObject, ['temperature']);
|
|
20592
|
+
if (fromTemperature != null) {
|
|
20593
|
+
setValueByPath(toObject, ['temperature'], fromTemperature);
|
|
20594
|
+
}
|
|
20595
|
+
const fromThinkingConfig = getValueByPath(fromObject, [
|
|
20596
|
+
'thinkingConfig',
|
|
20597
|
+
]);
|
|
20598
|
+
if (fromThinkingConfig != null) {
|
|
20599
|
+
setValueByPath(toObject, ['thinkingConfig'], fromThinkingConfig);
|
|
20600
|
+
}
|
|
20601
|
+
const fromTopK = getValueByPath(fromObject, ['topK']);
|
|
20602
|
+
if (fromTopK != null) {
|
|
20603
|
+
setValueByPath(toObject, ['topK'], fromTopK);
|
|
20604
|
+
}
|
|
20605
|
+
const fromTopP = getValueByPath(fromObject, ['topP']);
|
|
20606
|
+
if (fromTopP != null) {
|
|
20607
|
+
setValueByPath(toObject, ['topP'], fromTopP);
|
|
20608
|
+
}
|
|
20609
|
+
return toObject;
|
|
20610
|
+
}
|
|
20142
20611
|
function getTuningJobParametersToMldev(fromObject, _rootObject) {
|
|
20143
20612
|
const toObject = {};
|
|
20144
20613
|
const fromName = getValueByPath(fromObject, ['name']);
|
|
@@ -20264,6 +20733,12 @@ function tuningDatasetToVertex(fromObject, parentObject, rootObject) {
|
|
|
20264
20733
|
setValueByPath(parentObject, ['distillationSpec', 'promptDatasetUri'], fromGcsUri);
|
|
20265
20734
|
}
|
|
20266
20735
|
}
|
|
20736
|
+
else if (discriminatorGcsUri === 'REINFORCEMENT_TUNING') {
|
|
20737
|
+
const fromGcsUri = getValueByPath(fromObject, ['gcsUri']);
|
|
20738
|
+
if (parentObject !== undefined && fromGcsUri != null) {
|
|
20739
|
+
setValueByPath(parentObject, ['reinforcementTuningSpec', 'trainingDatasetUri'], fromGcsUri);
|
|
20740
|
+
}
|
|
20741
|
+
}
|
|
20267
20742
|
let discriminatorVertexDatasetResource = getValueByPath(rootObject, [
|
|
20268
20743
|
'config',
|
|
20269
20744
|
'method',
|
|
@@ -20295,6 +20770,14 @@ function tuningDatasetToVertex(fromObject, parentObject, rootObject) {
|
|
|
20295
20770
|
setValueByPath(parentObject, ['distillationSpec', 'promptDatasetUri'], fromVertexDatasetResource);
|
|
20296
20771
|
}
|
|
20297
20772
|
}
|
|
20773
|
+
else if (discriminatorVertexDatasetResource === 'REINFORCEMENT_TUNING') {
|
|
20774
|
+
const fromVertexDatasetResource = getValueByPath(fromObject, [
|
|
20775
|
+
'vertexDatasetResource',
|
|
20776
|
+
]);
|
|
20777
|
+
if (parentObject !== undefined && fromVertexDatasetResource != null) {
|
|
20778
|
+
setValueByPath(parentObject, ['reinforcementTuningSpec', 'trainingDatasetUri'], fromVertexDatasetResource);
|
|
20779
|
+
}
|
|
20780
|
+
}
|
|
20298
20781
|
if (getValueByPath(fromObject, ['examples']) !== undefined) {
|
|
20299
20782
|
throw new Error('examples parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
20300
20783
|
}
|
|
@@ -20352,7 +20835,7 @@ function tuningJobFromMldev(fromObject, rootObject) {
|
|
|
20352
20835
|
}
|
|
20353
20836
|
return toObject;
|
|
20354
20837
|
}
|
|
20355
|
-
function tuningJobFromVertex(fromObject,
|
|
20838
|
+
function tuningJobFromVertex(fromObject, rootObject) {
|
|
20356
20839
|
const toObject = {};
|
|
20357
20840
|
const fromSdkHttpResponse = getValueByPath(fromObject, [
|
|
20358
20841
|
'sdkHttpResponse',
|
|
@@ -20422,7 +20905,7 @@ function tuningJobFromVertex(fromObject, _rootObject) {
|
|
|
20422
20905
|
'distillationSpec',
|
|
20423
20906
|
]);
|
|
20424
20907
|
if (fromDistillationSpec != null) {
|
|
20425
|
-
setValueByPath(toObject, ['distillationSpec'], fromDistillationSpec);
|
|
20908
|
+
setValueByPath(toObject, ['distillationSpec'], distillationSpecFromVertex(fromDistillationSpec));
|
|
20426
20909
|
}
|
|
20427
20910
|
const fromTuningDataStats = getValueByPath(fromObject, [
|
|
20428
20911
|
'tuningDataStats',
|
|
@@ -20506,18 +20989,24 @@ function tuningJobFromVertex(fromObject, _rootObject) {
|
|
|
20506
20989
|
if (fromVeoTuningSpec != null) {
|
|
20507
20990
|
setValueByPath(toObject, ['veoTuningSpec'], fromVeoTuningSpec);
|
|
20508
20991
|
}
|
|
20509
|
-
const fromDistillationSamplingSpec = getValueByPath(fromObject, [
|
|
20510
|
-
'distillationSamplingSpec',
|
|
20511
|
-
]);
|
|
20512
|
-
if (fromDistillationSamplingSpec != null) {
|
|
20513
|
-
setValueByPath(toObject, ['distillationSamplingSpec'], fromDistillationSamplingSpec);
|
|
20514
|
-
}
|
|
20515
20992
|
const fromTuningJobMetadata = getValueByPath(fromObject, [
|
|
20516
20993
|
'tuningJobMetadata',
|
|
20517
20994
|
]);
|
|
20518
20995
|
if (fromTuningJobMetadata != null) {
|
|
20519
20996
|
setValueByPath(toObject, ['tuningJobMetadata'], fromTuningJobMetadata);
|
|
20520
20997
|
}
|
|
20998
|
+
const fromVeoLoraTuningSpec = getValueByPath(fromObject, [
|
|
20999
|
+
'veoLoraTuningSpec',
|
|
21000
|
+
]);
|
|
21001
|
+
if (fromVeoLoraTuningSpec != null) {
|
|
21002
|
+
setValueByPath(toObject, ['veoLoraTuningSpec'], fromVeoLoraTuningSpec);
|
|
21003
|
+
}
|
|
21004
|
+
const fromDistillationSamplingSpec = getValueByPath(fromObject, [
|
|
21005
|
+
'distillationSamplingSpec',
|
|
21006
|
+
]);
|
|
21007
|
+
if (fromDistillationSamplingSpec != null) {
|
|
21008
|
+
setValueByPath(toObject, ['distillationSamplingSpec'], distillationSamplingSpecFromVertex(fromDistillationSamplingSpec));
|
|
21009
|
+
}
|
|
20521
21010
|
return toObject;
|
|
20522
21011
|
}
|
|
20523
21012
|
function tuningOperationFromMldev(fromObject, _rootObject) {
|
|
@@ -21054,5 +21543,5 @@ class GoogleGenAI {
|
|
|
21054
21543
|
}
|
|
21055
21544
|
}
|
|
21056
21545
|
|
|
21057
|
-
export { ActivityHandling, AdapterSize, AggregationMetric, ApiError, ApiSpec, AuthType, Batches, Behavior, BlockedReason, Caches, CancelTuningJobResponse, Chat, Chats, ComputeTokensResponse, ContentReferenceImage, ControlReferenceImage, ControlReferenceType, CountTokensResponse, CreateFileResponse, DeleteCachedContentResponse, DeleteFileResponse, DeleteModelResponse, DocumentState, DynamicRetrievalConfigMode, EditImageResponse, EditMode, EmbedContentResponse, EmbeddingApiType, EndSensitivity, Environment, EvaluateDatasetResponse, FeatureSelectionPreference, FileSource, FileState, Files, FinishReason, FunctionCallingConfigMode, FunctionResponse, FunctionResponseBlob, FunctionResponseFileData, FunctionResponsePart, FunctionResponseScheduling, GenerateContentResponse, GenerateContentResponsePromptFeedback, GenerateContentResponseUsageMetadata, GenerateImagesResponse, GenerateVideosOperation, GenerateVideosResponse, GoogleGenAI, HarmBlockMethod, HarmBlockThreshold, HarmCategory, HarmProbability, HarmSeverity, HttpElementLocation, HttpResponse, ImagePromptLanguage, ImageResizeMode, ImportFileOperation, ImportFileResponse, InlinedEmbedContentResponse, InlinedResponse, JobState, Language, ListBatchJobsResponse, ListCachedContentsResponse, ListDocumentsResponse, ListFileSearchStoresResponse, ListFilesResponse, ListModelsResponse, ListTuningJobsResponse, Live, LiveClientToolResponse, LiveMusicPlaybackControl, LiveMusicServerMessage, LiveSendToolResponseParameters, LiveServerMessage, MaskReferenceImage, MaskReferenceMode, MediaModality, MediaResolution, Modality, ModelStage, Models, MusicGenerationMode, Operations, Outcome, PagedItem, Pager, PairwiseChoice, PartMediaResolutionLevel, PersonGeneration, PhishBlockThreshold, ProminentPeople, RawReferenceImage, RecontextImageResponse, RegisterFilesResponse, ReplayResponse, ResourceScope, SafetyFilterLevel, Scale, SegmentImageResponse, SegmentMode, ServiceTier, Session, SingleEmbedContentResponse, StartSensitivity, StyleReferenceImage, SubjectReferenceImage, SubjectReferenceType, ThinkingLevel, Tokens, ToolResponse, ToolType, TrafficType, TuningJobState, TuningMethod, TuningMode, TuningTask, TurnCompleteReason, TurnCoverage, Type, UploadToFileSearchStoreOperation, UploadToFileSearchStoreResponse, UploadToFileSearchStoreResumableResponse, UpscaleImageResponse, UrlRetrievalStatus, VadSignalType, VideoCompressionQuality, VideoGenerationMaskMode, VideoGenerationReferenceType, VoiceActivityType, createFunctionResponsePartFromBase64, createFunctionResponsePartFromUri, createModelContent, createPartFromBase64, createPartFromCodeExecutionResult, createPartFromExecutableCode, createPartFromFunctionCall, createPartFromFunctionResponse, createPartFromText, createPartFromUri, createUserContent, mcpToTool, setDefaultBaseUrls };
|
|
21546
|
+
export { ActivityHandling, AdapterSize, AggregationMetric, ApiError, ApiSpec, AuthType, Batches, Behavior, BlockedReason, Caches, CancelTuningJobResponse, Chat, Chats, ComputeTokensResponse, ContentReferenceImage, ControlReferenceImage, ControlReferenceType, CountTokensResponse, CreateFileResponse, DeleteCachedContentResponse, DeleteFileResponse, DeleteModelResponse, DocumentState, DynamicRetrievalConfigMode, EditImageResponse, EditMode, EmbedContentResponse, EmbeddingApiType, EndSensitivity, Environment, EvaluateDatasetResponse, FeatureSelectionPreference, FileSource, FileState, Files, FinishReason, FunctionCallingConfigMode, FunctionResponse, FunctionResponseBlob, FunctionResponseFileData, FunctionResponsePart, FunctionResponseScheduling, GenerateContentResponse, GenerateContentResponsePromptFeedback, GenerateContentResponseUsageMetadata, GenerateImagesResponse, GenerateVideosOperation, GenerateVideosResponse, GoogleGenAI, HarmBlockMethod, HarmBlockThreshold, HarmCategory, HarmProbability, HarmSeverity, HttpElementLocation, HttpResponse, ImagePromptLanguage, ImageResizeMode, ImportFileOperation, ImportFileResponse, InlinedEmbedContentResponse, InlinedResponse, JobState, Language, ListBatchJobsResponse, ListCachedContentsResponse, ListDocumentsResponse, ListFileSearchStoresResponse, ListFilesResponse, ListModelsResponse, ListTuningJobsResponse, Live, LiveClientToolResponse, LiveMusicPlaybackControl, LiveMusicServerMessage, LiveSendToolResponseParameters, LiveServerMessage, MaskReferenceImage, MaskReferenceMode, MediaModality, MediaResolution, Modality, ModelStage, Models, MusicGenerationMode, Operations, Outcome, PagedItem, Pager, PairwiseChoice, PartMediaResolutionLevel, PersonGeneration, PhishBlockThreshold, ProminentPeople, RawReferenceImage, RecontextImageResponse, RegisterFilesResponse, ReplayResponse, ResourceScope, SafetyFilterLevel, Scale, SegmentImageResponse, SegmentMode, ServiceTier, Session, SingleEmbedContentResponse, StartSensitivity, StyleReferenceImage, SubjectReferenceImage, SubjectReferenceType, ThinkingLevel, Tokens, ToolResponse, ToolType, TrafficType, TuningJobState, TuningMethod, TuningMode, TuningSpeed, TuningTask, TurnCompleteReason, TurnCoverage, Type, UploadToFileSearchStoreOperation, UploadToFileSearchStoreResponse, UploadToFileSearchStoreResumableResponse, UpscaleImageResponse, UrlRetrievalStatus, VadSignalType, VideoCompressionQuality, VideoGenerationMaskMode, VideoGenerationReferenceType, VideoOrientation, VoiceActivityType, createFunctionResponsePartFromBase64, createFunctionResponsePartFromUri, createModelContent, createPartFromBase64, createPartFromCodeExecutionResult, createPartFromExecutableCode, createPartFromFunctionCall, createPartFromFunctionResponse, createPartFromText, createPartFromUri, createUserContent, mcpToTool, setDefaultBaseUrls };
|
|
21058
21547
|
//# sourceMappingURL=index.mjs.map
|