@google/genai 2.10.0 → 2.11.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 +975 -588
- package/dist/index.cjs +446 -77
- package/dist/index.mjs +442 -78
- package/dist/index.mjs.map +1 -1
- package/dist/node/index.cjs +446 -77
- package/dist/node/index.mjs +442 -78
- package/dist/node/index.mjs.map +1 -1
- package/dist/node/node.d.ts +975 -588
- package/dist/tokenizer/node.cjs +157 -53
- package/dist/tokenizer/node.d.ts +204 -4
- package/dist/tokenizer/node.mjs +157 -53
- package/dist/tokenizer/node.mjs.map +1 -1
- package/dist/vertex_internal/index.cjs +158 -54
- package/dist/vertex_internal/index.cjs.map +1 -1
- package/dist/vertex_internal/index.d.ts +292 -67
- package/dist/vertex_internal/index.js +158 -54
- package/dist/vertex_internal/index.js.map +1 -1
- package/dist/web/index.mjs +442 -78
- package/dist/web/index.mjs.map +1 -1
- package/dist/web/web.d.ts +975 -588
- package/package.json +2 -9
package/dist/node/index.mjs
CHANGED
|
@@ -840,7 +840,7 @@ var PhishBlockThreshold;
|
|
|
840
840
|
*/
|
|
841
841
|
PhishBlockThreshold["BLOCK_ONLY_EXTREMELY_HIGH"] = "BLOCK_ONLY_EXTREMELY_HIGH";
|
|
842
842
|
})(PhishBlockThreshold || (PhishBlockThreshold = {}));
|
|
843
|
-
/** Specifies the function Behavior.
|
|
843
|
+
/** Specifies the function Behavior. If not specified, the system keeps the current function call behavior. This field is currently only supported by the BidiGenerateContent method. */
|
|
844
844
|
var Behavior;
|
|
845
845
|
(function (Behavior) {
|
|
846
846
|
/**
|
|
@@ -1354,6 +1354,110 @@ var Modality;
|
|
|
1354
1354
|
*/
|
|
1355
1355
|
Modality["VIDEO"] = "VIDEO";
|
|
1356
1356
|
})(Modality || (Modality = {}));
|
|
1357
|
+
/** Delivery mode for the generated content. */
|
|
1358
|
+
var Delivery;
|
|
1359
|
+
(function (Delivery) {
|
|
1360
|
+
/**
|
|
1361
|
+
* Default value. This value is unused.
|
|
1362
|
+
*/
|
|
1363
|
+
Delivery["DELIVERY_UNSPECIFIED"] = "DELIVERY_UNSPECIFIED";
|
|
1364
|
+
/**
|
|
1365
|
+
* Generated bytes are returned inline in the response.
|
|
1366
|
+
*/
|
|
1367
|
+
Delivery["INLINE"] = "INLINE";
|
|
1368
|
+
/**
|
|
1369
|
+
* Generated content is stored and a URI is returned.
|
|
1370
|
+
*/
|
|
1371
|
+
Delivery["URI"] = "URI";
|
|
1372
|
+
})(Delivery || (Delivery = {}));
|
|
1373
|
+
/** The aspect ratio for the image output. */
|
|
1374
|
+
var AspectRatio;
|
|
1375
|
+
(function (AspectRatio) {
|
|
1376
|
+
/**
|
|
1377
|
+
* Default value. This value is unused.
|
|
1378
|
+
*/
|
|
1379
|
+
AspectRatio["ASPECT_RATIO_UNSPECIFIED"] = "ASPECT_RATIO_UNSPECIFIED";
|
|
1380
|
+
/**
|
|
1381
|
+
* 1:1 aspect ratio.
|
|
1382
|
+
*/
|
|
1383
|
+
AspectRatio["ASPECT_RATIO_ONE_BY_ONE"] = "ASPECT_RATIO_ONE_BY_ONE";
|
|
1384
|
+
/**
|
|
1385
|
+
* 2:3 aspect ratio.
|
|
1386
|
+
*/
|
|
1387
|
+
AspectRatio["ASPECT_RATIO_TWO_BY_THREE"] = "ASPECT_RATIO_TWO_BY_THREE";
|
|
1388
|
+
/**
|
|
1389
|
+
* 3:2 aspect ratio.
|
|
1390
|
+
*/
|
|
1391
|
+
AspectRatio["ASPECT_RATIO_THREE_BY_TWO"] = "ASPECT_RATIO_THREE_BY_TWO";
|
|
1392
|
+
/**
|
|
1393
|
+
* 3:4 aspect ratio.
|
|
1394
|
+
*/
|
|
1395
|
+
AspectRatio["ASPECT_RATIO_THREE_BY_FOUR"] = "ASPECT_RATIO_THREE_BY_FOUR";
|
|
1396
|
+
/**
|
|
1397
|
+
* 4:3 aspect ratio.
|
|
1398
|
+
*/
|
|
1399
|
+
AspectRatio["ASPECT_RATIO_FOUR_BY_THREE"] = "ASPECT_RATIO_FOUR_BY_THREE";
|
|
1400
|
+
/**
|
|
1401
|
+
* 4:5 aspect ratio.
|
|
1402
|
+
*/
|
|
1403
|
+
AspectRatio["ASPECT_RATIO_FOUR_BY_FIVE"] = "ASPECT_RATIO_FOUR_BY_FIVE";
|
|
1404
|
+
/**
|
|
1405
|
+
* 5:4 aspect ratio.
|
|
1406
|
+
*/
|
|
1407
|
+
AspectRatio["ASPECT_RATIO_FIVE_BY_FOUR"] = "ASPECT_RATIO_FIVE_BY_FOUR";
|
|
1408
|
+
/**
|
|
1409
|
+
* 9:16 aspect ratio.
|
|
1410
|
+
*/
|
|
1411
|
+
AspectRatio["ASPECT_RATIO_NINE_BY_SIXTEEN"] = "ASPECT_RATIO_NINE_BY_SIXTEEN";
|
|
1412
|
+
/**
|
|
1413
|
+
* 16:9 aspect ratio.
|
|
1414
|
+
*/
|
|
1415
|
+
AspectRatio["ASPECT_RATIO_SIXTEEN_BY_NINE"] = "ASPECT_RATIO_SIXTEEN_BY_NINE";
|
|
1416
|
+
/**
|
|
1417
|
+
* 21:9 aspect ratio.
|
|
1418
|
+
*/
|
|
1419
|
+
AspectRatio["ASPECT_RATIO_TWENTY_ONE_BY_NINE"] = "ASPECT_RATIO_TWENTY_ONE_BY_NINE";
|
|
1420
|
+
/**
|
|
1421
|
+
* 1:8 aspect ratio.
|
|
1422
|
+
*/
|
|
1423
|
+
AspectRatio["ASPECT_RATIO_ONE_BY_EIGHT"] = "ASPECT_RATIO_ONE_BY_EIGHT";
|
|
1424
|
+
/**
|
|
1425
|
+
* 8:1 aspect ratio.
|
|
1426
|
+
*/
|
|
1427
|
+
AspectRatio["ASPECT_RATIO_EIGHT_BY_ONE"] = "ASPECT_RATIO_EIGHT_BY_ONE";
|
|
1428
|
+
/**
|
|
1429
|
+
* 1:4 aspect ratio.
|
|
1430
|
+
*/
|
|
1431
|
+
AspectRatio["ASPECT_RATIO_ONE_BY_FOUR"] = "ASPECT_RATIO_ONE_BY_FOUR";
|
|
1432
|
+
/**
|
|
1433
|
+
* 4:1 aspect ratio.
|
|
1434
|
+
*/
|
|
1435
|
+
AspectRatio["ASPECT_RATIO_FOUR_BY_ONE"] = "ASPECT_RATIO_FOUR_BY_ONE";
|
|
1436
|
+
})(AspectRatio || (AspectRatio = {}));
|
|
1437
|
+
/** The size of the image output. */
|
|
1438
|
+
var ImageSize;
|
|
1439
|
+
(function (ImageSize) {
|
|
1440
|
+
/**
|
|
1441
|
+
* Default value. This value is unused.
|
|
1442
|
+
*/
|
|
1443
|
+
ImageSize["IMAGE_SIZE_UNSPECIFIED"] = "IMAGE_SIZE_UNSPECIFIED";
|
|
1444
|
+
/**
|
|
1445
|
+
* 512px image size.
|
|
1446
|
+
*/
|
|
1447
|
+
ImageSize["IMAGE_SIZE_FIVE_TWELVE"] = "IMAGE_SIZE_FIVE_TWELVE";
|
|
1448
|
+
/**
|
|
1449
|
+
* 1K image size.
|
|
1450
|
+
*/
|
|
1451
|
+
ImageSize["IMAGE_SIZE_ONE_K"] = "IMAGE_SIZE_ONE_K";
|
|
1452
|
+
/**
|
|
1453
|
+
* 2K image size.
|
|
1454
|
+
*/
|
|
1455
|
+
ImageSize["IMAGE_SIZE_TWO_K"] = "IMAGE_SIZE_TWO_K";
|
|
1456
|
+
/**
|
|
1457
|
+
* 4K image size.
|
|
1458
|
+
*/
|
|
1459
|
+
ImageSize["IMAGE_SIZE_FOUR_K"] = "IMAGE_SIZE_FOUR_K";
|
|
1460
|
+
})(ImageSize || (ImageSize = {}));
|
|
1357
1461
|
/** Tuning mode. This enum is not supported in Gemini API. */
|
|
1358
1462
|
var TuningMode;
|
|
1359
1463
|
(function (TuningMode) {
|
|
@@ -1402,6 +1506,58 @@ var AdapterSize;
|
|
|
1402
1506
|
*/
|
|
1403
1507
|
AdapterSize["ADAPTER_SIZE_THIRTY_TWO"] = "ADAPTER_SIZE_THIRTY_TWO";
|
|
1404
1508
|
})(AdapterSize || (AdapterSize = {}));
|
|
1509
|
+
/** Defines the type for parsing sample response. This enum is not supported in Gemini API. */
|
|
1510
|
+
var ResponseParseType;
|
|
1511
|
+
(function (ResponseParseType) {
|
|
1512
|
+
/**
|
|
1513
|
+
* Default value. Fallback to IDENTITY
|
|
1514
|
+
*/
|
|
1515
|
+
ResponseParseType["RESPONSE_PARSE_TYPE_UNSPECIFIED"] = "RESPONSE_PARSE_TYPE_UNSPECIFIED";
|
|
1516
|
+
/**
|
|
1517
|
+
* Returns the sample response as is.
|
|
1518
|
+
*/
|
|
1519
|
+
ResponseParseType["IDENTITY"] = "IDENTITY";
|
|
1520
|
+
/**
|
|
1521
|
+
* Uses regex to extract the important part of sample response. Similar to [GoogleSQL](https://cloud.google.com/bigquery/docs/reference/standard-sql/string_functions#regexp_extract) `REGEX_EXTRACT(response, regex_extract_expression)`, but different in that if there are multiple matches, the last match will be returned.
|
|
1522
|
+
*/
|
|
1523
|
+
ResponseParseType["REGEX_EXTRACT"] = "REGEX_EXTRACT";
|
|
1524
|
+
})(ResponseParseType || (ResponseParseType = {}));
|
|
1525
|
+
/** Match operation to use for evaluating rewards. This enum is not supported in Gemini API. */
|
|
1526
|
+
var MatchOperation;
|
|
1527
|
+
(function (MatchOperation) {
|
|
1528
|
+
/**
|
|
1529
|
+
* Default value. A user error will be returned if not set.
|
|
1530
|
+
*/
|
|
1531
|
+
MatchOperation["MATCH_OPERATION_UNSPECIFIED"] = "MATCH_OPERATION_UNSPECIFIED";
|
|
1532
|
+
/**
|
|
1533
|
+
* Equivalent to [GoogleSQL](https://cloud.google.com/bigquery/docs/reference/standard-sql/string_functions#regexp_contains) `REGEX_CONTAINS(target, expression)`.
|
|
1534
|
+
*/
|
|
1535
|
+
MatchOperation["REGEX_CONTAINS"] = "REGEX_CONTAINS";
|
|
1536
|
+
/**
|
|
1537
|
+
* The match operation returns `true` if expression is a substring of the target.
|
|
1538
|
+
*/
|
|
1539
|
+
MatchOperation["PARTIAL_MATCH"] = "PARTIAL_MATCH";
|
|
1540
|
+
/**
|
|
1541
|
+
* The match operation returns `true` expression is an exact match of the target.
|
|
1542
|
+
*/
|
|
1543
|
+
MatchOperation["EXACT_MATCH"] = "EXACT_MATCH";
|
|
1544
|
+
})(MatchOperation || (MatchOperation = {}));
|
|
1545
|
+
/** Represents how much to think for the tuning job. */
|
|
1546
|
+
var ReinforcementTuningThinkingLevel;
|
|
1547
|
+
(function (ReinforcementTuningThinkingLevel) {
|
|
1548
|
+
/**
|
|
1549
|
+
* Unspecified thinking level.
|
|
1550
|
+
*/
|
|
1551
|
+
ReinforcementTuningThinkingLevel["REINFORCEMENT_TUNING_THINKING_LEVEL_UNSPECIFIED"] = "REINFORCEMENT_TUNING_THINKING_LEVEL_UNSPECIFIED";
|
|
1552
|
+
/**
|
|
1553
|
+
* Little to no thinking.
|
|
1554
|
+
*/
|
|
1555
|
+
ReinforcementTuningThinkingLevel["MINIMAL"] = "MINIMAL";
|
|
1556
|
+
/**
|
|
1557
|
+
* High thinking level.
|
|
1558
|
+
*/
|
|
1559
|
+
ReinforcementTuningThinkingLevel["HIGH"] = "HIGH";
|
|
1560
|
+
})(ReinforcementTuningThinkingLevel || (ReinforcementTuningThinkingLevel = {}));
|
|
1405
1561
|
/** Job state. */
|
|
1406
1562
|
var JobState;
|
|
1407
1563
|
(function (JobState) {
|
|
@@ -1886,58 +2042,6 @@ var ImageResizeMode;
|
|
|
1886
2042
|
*/
|
|
1887
2043
|
ImageResizeMode["PAD"] = "PAD";
|
|
1888
2044
|
})(ImageResizeMode || (ImageResizeMode = {}));
|
|
1889
|
-
/** Defines how to parse sample response. */
|
|
1890
|
-
var ResponseParseType;
|
|
1891
|
-
(function (ResponseParseType) {
|
|
1892
|
-
/**
|
|
1893
|
-
* Default value. This value is unused.
|
|
1894
|
-
*/
|
|
1895
|
-
ResponseParseType["RESPONSE_PARSE_TYPE_UNSPECIFIED"] = "RESPONSE_PARSE_TYPE_UNSPECIFIED";
|
|
1896
|
-
/**
|
|
1897
|
-
* Use the sample response as is.
|
|
1898
|
-
*/
|
|
1899
|
-
ResponseParseType["IDENTITY"] = "IDENTITY";
|
|
1900
|
-
/**
|
|
1901
|
-
* Use regex to extract the important part of sample response.
|
|
1902
|
-
*/
|
|
1903
|
-
ResponseParseType["REGEX_EXTRACT"] = "REGEX_EXTRACT";
|
|
1904
|
-
})(ResponseParseType || (ResponseParseType = {}));
|
|
1905
|
-
/** Match operation to use for evaluation. */
|
|
1906
|
-
var MatchOperation;
|
|
1907
|
-
(function (MatchOperation) {
|
|
1908
|
-
/**
|
|
1909
|
-
* Default value. This value is unused.
|
|
1910
|
-
*/
|
|
1911
|
-
MatchOperation["MATCH_OPERATION_UNSPECIFIED"] = "MATCH_OPERATION_UNSPECIFIED";
|
|
1912
|
-
/**
|
|
1913
|
-
* Equivalent to GoogleSQL `REGEX_CONTAINS(target, expression)`.
|
|
1914
|
-
*/
|
|
1915
|
-
MatchOperation["REGEX_CONTAINS"] = "REGEX_CONTAINS";
|
|
1916
|
-
/**
|
|
1917
|
-
* `expression` is a substring of target.
|
|
1918
|
-
*/
|
|
1919
|
-
MatchOperation["PARTIAL_MATCH"] = "PARTIAL_MATCH";
|
|
1920
|
-
/**
|
|
1921
|
-
* `expression` is an exact match of target.
|
|
1922
|
-
*/
|
|
1923
|
-
MatchOperation["EXACT_MATCH"] = "EXACT_MATCH";
|
|
1924
|
-
})(MatchOperation || (MatchOperation = {}));
|
|
1925
|
-
/** Represents how much to think for the tuning job. */
|
|
1926
|
-
var ReinforcementTuningThinkingLevel;
|
|
1927
|
-
(function (ReinforcementTuningThinkingLevel) {
|
|
1928
|
-
/**
|
|
1929
|
-
* Unspecified thinking level.
|
|
1930
|
-
*/
|
|
1931
|
-
ReinforcementTuningThinkingLevel["REINFORCEMENT_TUNING_THINKING_LEVEL_UNSPECIFIED"] = "REINFORCEMENT_TUNING_THINKING_LEVEL_UNSPECIFIED";
|
|
1932
|
-
/**
|
|
1933
|
-
* Little to no thinking.
|
|
1934
|
-
*/
|
|
1935
|
-
ReinforcementTuningThinkingLevel["MINIMAL"] = "MINIMAL";
|
|
1936
|
-
/**
|
|
1937
|
-
* High thinking level.
|
|
1938
|
-
*/
|
|
1939
|
-
ReinforcementTuningThinkingLevel["HIGH"] = "HIGH";
|
|
1940
|
-
})(ReinforcementTuningThinkingLevel || (ReinforcementTuningThinkingLevel = {}));
|
|
1941
2045
|
/** Enum representing the tuning method. */
|
|
1942
2046
|
var TuningMethod;
|
|
1943
2047
|
(function (TuningMethod) {
|
|
@@ -2734,6 +2838,21 @@ class ListModelsResponse {
|
|
|
2734
2838
|
}
|
|
2735
2839
|
class DeleteModelResponse {
|
|
2736
2840
|
}
|
|
2841
|
+
/** Configuration for audio-specific output formatting. */
|
|
2842
|
+
class AudioResponseFormat {
|
|
2843
|
+
}
|
|
2844
|
+
/** Configuration for image-specific output formatting. */
|
|
2845
|
+
class ImageResponseFormat {
|
|
2846
|
+
}
|
|
2847
|
+
/** Configuration for text-specific output formatting. */
|
|
2848
|
+
class TextResponseFormat {
|
|
2849
|
+
}
|
|
2850
|
+
/** Configuration for video-specific output formatting. This data type is not supported in Gemini API. */
|
|
2851
|
+
class VideoResponseFormat {
|
|
2852
|
+
}
|
|
2853
|
+
/** Configuration for the model to configure output formatting and delivery. This data type is not supported in Gemini API. */
|
|
2854
|
+
class ResponseFormat {
|
|
2855
|
+
}
|
|
2737
2856
|
/** Response for counting tokens. */
|
|
2738
2857
|
class CountTokensResponse {
|
|
2739
2858
|
}
|
|
@@ -2762,10 +2881,10 @@ class GenerateVideosOperation {
|
|
|
2762
2881
|
return operation;
|
|
2763
2882
|
}
|
|
2764
2883
|
}
|
|
2765
|
-
/** Defines how to parse sample response for reinforcement tuning. */
|
|
2884
|
+
/** Defines how to parse sample response config for reinforcement tuning. The parsed response (i.e., substring) will be passed to the reward functions. For example, the input prompt might be: > "Perform step-by-step thoughts first to problem A, finally output answer in the <ans> </ans> block." The sample response from the model under tuning might look like: > "<ans>Yes</ans>" Here, users can define the following parse config: ``` { "parseType": "REGEX_EXTRACT", "regexExtractExpression": ".*(.*?)" } ``` The resulting parsed response would be `"Yes"` and will be passed to the reward functions for evaluating rewards. This data type is not supported in Gemini API. */
|
|
2766
2885
|
class ReinforcementTuningParseResponseConfig {
|
|
2767
2886
|
}
|
|
2768
|
-
/** Scores responses by directly converting parsed autorater response to float reward
|
|
2887
|
+
/** Scores responses by directly converting the parsed autorater response to a float reward. Note: Reward is clipped to be within `[-1, 1]`, i.e., `reward = max(min(reward, 1.0), -1.0)`. This data type is not supported in Gemini API. */
|
|
2769
2888
|
class ReinforcementTuningAutoraterScorerParsedResponseConversionScorer {
|
|
2770
2889
|
}
|
|
2771
2890
|
/** The results from an evaluation run performed by the EvaluationService. This data type is not supported in Gemini API. */
|
|
@@ -5205,6 +5324,9 @@ function toolToMldev$4(fromObject) {
|
|
|
5205
5324
|
}
|
|
5206
5325
|
setValueByPath(toObject, ['mcpServers'], transformedList);
|
|
5207
5326
|
}
|
|
5327
|
+
if (getValueByPath(fromObject, ['exaAiSearch']) !== undefined) {
|
|
5328
|
+
throw new Error('exaAiSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
5329
|
+
}
|
|
5208
5330
|
return toObject;
|
|
5209
5331
|
}
|
|
5210
5332
|
function vertexMultimodalDatasetDestinationFromVertex(fromObject) {
|
|
@@ -6675,6 +6797,9 @@ function toolToMldev$3(fromObject) {
|
|
|
6675
6797
|
}
|
|
6676
6798
|
setValueByPath(toObject, ['mcpServers'], transformedList);
|
|
6677
6799
|
}
|
|
6800
|
+
if (getValueByPath(fromObject, ['exaAiSearch']) !== undefined) {
|
|
6801
|
+
throw new Error('exaAiSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
6802
|
+
}
|
|
6678
6803
|
return toObject;
|
|
6679
6804
|
}
|
|
6680
6805
|
function toolToVertex$2(fromObject) {
|
|
@@ -6748,6 +6873,10 @@ function toolToVertex$2(fromObject) {
|
|
|
6748
6873
|
}
|
|
6749
6874
|
setValueByPath(toObject, ['mcpServers'], transformedList);
|
|
6750
6875
|
}
|
|
6876
|
+
const fromExaAiSearch = getValueByPath(fromObject, ['exaAiSearch']);
|
|
6877
|
+
if (fromExaAiSearch != null) {
|
|
6878
|
+
setValueByPath(toObject, ['exaAiSearch'], fromExaAiSearch);
|
|
6879
|
+
}
|
|
6751
6880
|
return toObject;
|
|
6752
6881
|
}
|
|
6753
6882
|
function updateCachedContentConfigToMldev(fromObject, parentObject) {
|
|
@@ -8322,7 +8451,7 @@ function generationConfigToVertex$1(fromObject) {
|
|
|
8322
8451
|
}
|
|
8323
8452
|
const fromSpeechConfig = getValueByPath(fromObject, ['speechConfig']);
|
|
8324
8453
|
if (fromSpeechConfig != null) {
|
|
8325
|
-
setValueByPath(toObject, ['speechConfig'], fromSpeechConfig);
|
|
8454
|
+
setValueByPath(toObject, ['speechConfig'], speechConfigToVertex$1(fromSpeechConfig));
|
|
8326
8455
|
}
|
|
8327
8456
|
const fromStopSequences = getValueByPath(fromObject, [
|
|
8328
8457
|
'stopSequences',
|
|
@@ -8352,6 +8481,21 @@ function generationConfigToVertex$1(fromObject) {
|
|
|
8352
8481
|
undefined) {
|
|
8353
8482
|
throw new Error('enableEnhancedCivicAnswers parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
8354
8483
|
}
|
|
8484
|
+
const fromResponseFormat = getValueByPath(fromObject, [
|
|
8485
|
+
'responseFormat',
|
|
8486
|
+
]);
|
|
8487
|
+
if (fromResponseFormat != null) {
|
|
8488
|
+
let transformedList = fromResponseFormat;
|
|
8489
|
+
if (Array.isArray(transformedList)) {
|
|
8490
|
+
transformedList = transformedList.map((item) => {
|
|
8491
|
+
return item;
|
|
8492
|
+
});
|
|
8493
|
+
}
|
|
8494
|
+
setValueByPath(toObject, ['responseFormat'], transformedList);
|
|
8495
|
+
}
|
|
8496
|
+
if (getValueByPath(fromObject, ['translationConfig']) !== undefined) {
|
|
8497
|
+
throw new Error('translationConfig parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
8498
|
+
}
|
|
8355
8499
|
return toObject;
|
|
8356
8500
|
}
|
|
8357
8501
|
function googleMapsToMldev$2(fromObject) {
|
|
@@ -8565,7 +8709,7 @@ function liveConnectConfigToVertex(fromObject, parentObject) {
|
|
|
8565
8709
|
}
|
|
8566
8710
|
const fromSpeechConfig = getValueByPath(fromObject, ['speechConfig']);
|
|
8567
8711
|
if (parentObject !== undefined && fromSpeechConfig != null) {
|
|
8568
|
-
setValueByPath(parentObject, ['setup', 'generationConfig', 'speechConfig'], tLiveSpeechConfig(fromSpeechConfig));
|
|
8712
|
+
setValueByPath(parentObject, ['setup', 'generationConfig', 'speechConfig'], speechConfigToVertex$1(tLiveSpeechConfig(fromSpeechConfig)));
|
|
8569
8713
|
}
|
|
8570
8714
|
const fromThinkingConfig = getValueByPath(fromObject, [
|
|
8571
8715
|
'thinkingConfig',
|
|
@@ -8854,6 +8998,22 @@ function mcpServerToVertex$1(fromObject) {
|
|
|
8854
8998
|
}
|
|
8855
8999
|
return toObject;
|
|
8856
9000
|
}
|
|
9001
|
+
function multiSpeakerVoiceConfigToVertex$1(fromObject) {
|
|
9002
|
+
const toObject = {};
|
|
9003
|
+
const fromSpeakerVoiceConfigs = getValueByPath(fromObject, [
|
|
9004
|
+
'speakerVoiceConfigs',
|
|
9005
|
+
]);
|
|
9006
|
+
if (fromSpeakerVoiceConfigs != null) {
|
|
9007
|
+
let transformedList = fromSpeakerVoiceConfigs;
|
|
9008
|
+
if (Array.isArray(transformedList)) {
|
|
9009
|
+
transformedList = transformedList.map((item) => {
|
|
9010
|
+
return speakerVoiceConfigToVertex$1(item);
|
|
9011
|
+
});
|
|
9012
|
+
}
|
|
9013
|
+
setValueByPath(toObject, ['speakerVoiceConfigs'], transformedList);
|
|
9014
|
+
}
|
|
9015
|
+
return toObject;
|
|
9016
|
+
}
|
|
8857
9017
|
function partToMldev$2(fromObject) {
|
|
8858
9018
|
const toObject = {};
|
|
8859
9019
|
const fromMediaResolution = getValueByPath(fromObject, [
|
|
@@ -8995,6 +9155,26 @@ function partToVertex$2(fromObject) {
|
|
|
8995
9155
|
}
|
|
8996
9156
|
return toObject;
|
|
8997
9157
|
}
|
|
9158
|
+
function replicatedVoiceConfigToVertex$1(fromObject) {
|
|
9159
|
+
const toObject = {};
|
|
9160
|
+
const fromMimeType = getValueByPath(fromObject, ['mimeType']);
|
|
9161
|
+
if (fromMimeType != null) {
|
|
9162
|
+
setValueByPath(toObject, ['mimeType'], fromMimeType);
|
|
9163
|
+
}
|
|
9164
|
+
const fromVoiceSampleAudio = getValueByPath(fromObject, [
|
|
9165
|
+
'voiceSampleAudio',
|
|
9166
|
+
]);
|
|
9167
|
+
if (fromVoiceSampleAudio != null) {
|
|
9168
|
+
setValueByPath(toObject, ['voiceSampleAudio'], fromVoiceSampleAudio);
|
|
9169
|
+
}
|
|
9170
|
+
if (getValueByPath(fromObject, ['consentAudio']) !== undefined) {
|
|
9171
|
+
throw new Error('consentAudio parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
9172
|
+
}
|
|
9173
|
+
if (getValueByPath(fromObject, ['voiceConsentSignature']) !== undefined) {
|
|
9174
|
+
throw new Error('voiceConsentSignature parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
9175
|
+
}
|
|
9176
|
+
return toObject;
|
|
9177
|
+
}
|
|
8998
9178
|
function safetySettingToMldev$2(fromObject) {
|
|
8999
9179
|
const toObject = {};
|
|
9000
9180
|
const fromCategory = getValueByPath(fromObject, ['category']);
|
|
@@ -9021,6 +9201,36 @@ function sessionResumptionConfigToMldev$1(fromObject) {
|
|
|
9021
9201
|
}
|
|
9022
9202
|
return toObject;
|
|
9023
9203
|
}
|
|
9204
|
+
function speakerVoiceConfigToVertex$1(fromObject) {
|
|
9205
|
+
const toObject = {};
|
|
9206
|
+
const fromSpeaker = getValueByPath(fromObject, ['speaker']);
|
|
9207
|
+
if (fromSpeaker != null) {
|
|
9208
|
+
setValueByPath(toObject, ['speaker'], fromSpeaker);
|
|
9209
|
+
}
|
|
9210
|
+
const fromVoiceConfig = getValueByPath(fromObject, ['voiceConfig']);
|
|
9211
|
+
if (fromVoiceConfig != null) {
|
|
9212
|
+
setValueByPath(toObject, ['voiceConfig'], voiceConfigToVertex$1(fromVoiceConfig));
|
|
9213
|
+
}
|
|
9214
|
+
return toObject;
|
|
9215
|
+
}
|
|
9216
|
+
function speechConfigToVertex$1(fromObject) {
|
|
9217
|
+
const toObject = {};
|
|
9218
|
+
const fromVoiceConfig = getValueByPath(fromObject, ['voiceConfig']);
|
|
9219
|
+
if (fromVoiceConfig != null) {
|
|
9220
|
+
setValueByPath(toObject, ['voiceConfig'], voiceConfigToVertex$1(fromVoiceConfig));
|
|
9221
|
+
}
|
|
9222
|
+
const fromLanguageCode = getValueByPath(fromObject, ['languageCode']);
|
|
9223
|
+
if (fromLanguageCode != null) {
|
|
9224
|
+
setValueByPath(toObject, ['languageCode'], fromLanguageCode);
|
|
9225
|
+
}
|
|
9226
|
+
const fromMultiSpeakerVoiceConfig = getValueByPath(fromObject, [
|
|
9227
|
+
'multiSpeakerVoiceConfig',
|
|
9228
|
+
]);
|
|
9229
|
+
if (fromMultiSpeakerVoiceConfig != null) {
|
|
9230
|
+
setValueByPath(toObject, ['multiSpeakerVoiceConfig'], multiSpeakerVoiceConfigToVertex$1(fromMultiSpeakerVoiceConfig));
|
|
9231
|
+
}
|
|
9232
|
+
return toObject;
|
|
9233
|
+
}
|
|
9024
9234
|
function toolToMldev$2(fromObject) {
|
|
9025
9235
|
const toObject = {};
|
|
9026
9236
|
if (getValueByPath(fromObject, ['retrieval']) !== undefined) {
|
|
@@ -9086,6 +9296,9 @@ function toolToMldev$2(fromObject) {
|
|
|
9086
9296
|
}
|
|
9087
9297
|
setValueByPath(toObject, ['mcpServers'], transformedList);
|
|
9088
9298
|
}
|
|
9299
|
+
if (getValueByPath(fromObject, ['exaAiSearch']) !== undefined) {
|
|
9300
|
+
throw new Error('exaAiSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
9301
|
+
}
|
|
9089
9302
|
return toObject;
|
|
9090
9303
|
}
|
|
9091
9304
|
function toolToVertex$1(fromObject) {
|
|
@@ -9159,6 +9372,10 @@ function toolToVertex$1(fromObject) {
|
|
|
9159
9372
|
}
|
|
9160
9373
|
setValueByPath(toObject, ['mcpServers'], transformedList);
|
|
9161
9374
|
}
|
|
9375
|
+
const fromExaAiSearch = getValueByPath(fromObject, ['exaAiSearch']);
|
|
9376
|
+
if (fromExaAiSearch != null) {
|
|
9377
|
+
setValueByPath(toObject, ['exaAiSearch'], fromExaAiSearch);
|
|
9378
|
+
}
|
|
9162
9379
|
return toObject;
|
|
9163
9380
|
}
|
|
9164
9381
|
function usageMetadataFromVertex(fromObject) {
|
|
@@ -9265,6 +9482,22 @@ function voiceActivityFromVertex(fromObject) {
|
|
|
9265
9482
|
}
|
|
9266
9483
|
return toObject;
|
|
9267
9484
|
}
|
|
9485
|
+
function voiceConfigToVertex$1(fromObject) {
|
|
9486
|
+
const toObject = {};
|
|
9487
|
+
const fromReplicatedVoiceConfig = getValueByPath(fromObject, [
|
|
9488
|
+
'replicatedVoiceConfig',
|
|
9489
|
+
]);
|
|
9490
|
+
if (fromReplicatedVoiceConfig != null) {
|
|
9491
|
+
setValueByPath(toObject, ['replicatedVoiceConfig'], replicatedVoiceConfigToVertex$1(fromReplicatedVoiceConfig));
|
|
9492
|
+
}
|
|
9493
|
+
const fromPrebuiltVoiceConfig = getValueByPath(fromObject, [
|
|
9494
|
+
'prebuiltVoiceConfig',
|
|
9495
|
+
]);
|
|
9496
|
+
if (fromPrebuiltVoiceConfig != null) {
|
|
9497
|
+
setValueByPath(toObject, ['prebuiltVoiceConfig'], fromPrebuiltVoiceConfig);
|
|
9498
|
+
}
|
|
9499
|
+
return toObject;
|
|
9500
|
+
}
|
|
9268
9501
|
|
|
9269
9502
|
/**
|
|
9270
9503
|
* @license
|
|
@@ -10518,7 +10751,7 @@ function generateContentConfigToVertex(apiClient, fromObject, parentObject, root
|
|
|
10518
10751
|
}
|
|
10519
10752
|
const fromSpeechConfig = getValueByPath(fromObject, ['speechConfig']);
|
|
10520
10753
|
if (fromSpeechConfig != null) {
|
|
10521
|
-
setValueByPath(toObject, ['speechConfig'], tSpeechConfig(fromSpeechConfig));
|
|
10754
|
+
setValueByPath(toObject, ['speechConfig'], speechConfigToVertex(tSpeechConfig(fromSpeechConfig)));
|
|
10522
10755
|
}
|
|
10523
10756
|
const fromAudioTimestamp = getValueByPath(fromObject, [
|
|
10524
10757
|
'audioTimestamp',
|
|
@@ -11405,7 +11638,7 @@ function generatedVideoFromVertex(fromObject, rootObject) {
|
|
|
11405
11638
|
}
|
|
11406
11639
|
return toObject;
|
|
11407
11640
|
}
|
|
11408
|
-
function generationConfigToVertex(fromObject,
|
|
11641
|
+
function generationConfigToVertex(fromObject, rootObject) {
|
|
11409
11642
|
const toObject = {};
|
|
11410
11643
|
const fromModelSelectionConfig = getValueByPath(fromObject, [
|
|
11411
11644
|
'modelSelectionConfig',
|
|
@@ -11501,7 +11734,7 @@ function generationConfigToVertex(fromObject, _rootObject) {
|
|
|
11501
11734
|
}
|
|
11502
11735
|
const fromSpeechConfig = getValueByPath(fromObject, ['speechConfig']);
|
|
11503
11736
|
if (fromSpeechConfig != null) {
|
|
11504
|
-
setValueByPath(toObject, ['speechConfig'], fromSpeechConfig);
|
|
11737
|
+
setValueByPath(toObject, ['speechConfig'], speechConfigToVertex(fromSpeechConfig));
|
|
11505
11738
|
}
|
|
11506
11739
|
const fromStopSequences = getValueByPath(fromObject, [
|
|
11507
11740
|
'stopSequences',
|
|
@@ -11531,6 +11764,21 @@ function generationConfigToVertex(fromObject, _rootObject) {
|
|
|
11531
11764
|
undefined) {
|
|
11532
11765
|
throw new Error('enableEnhancedCivicAnswers parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
11533
11766
|
}
|
|
11767
|
+
const fromResponseFormat = getValueByPath(fromObject, [
|
|
11768
|
+
'responseFormat',
|
|
11769
|
+
]);
|
|
11770
|
+
if (fromResponseFormat != null) {
|
|
11771
|
+
let transformedList = fromResponseFormat;
|
|
11772
|
+
if (Array.isArray(transformedList)) {
|
|
11773
|
+
transformedList = transformedList.map((item) => {
|
|
11774
|
+
return item;
|
|
11775
|
+
});
|
|
11776
|
+
}
|
|
11777
|
+
setValueByPath(toObject, ['responseFormat'], transformedList);
|
|
11778
|
+
}
|
|
11779
|
+
if (getValueByPath(fromObject, ['translationConfig']) !== undefined) {
|
|
11780
|
+
throw new Error('translationConfig parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
11781
|
+
}
|
|
11534
11782
|
return toObject;
|
|
11535
11783
|
}
|
|
11536
11784
|
function getModelParametersToMldev(apiClient, fromObject, _rootObject) {
|
|
@@ -11968,6 +12216,22 @@ function modelFromVertex(fromObject, rootObject) {
|
|
|
11968
12216
|
}
|
|
11969
12217
|
return toObject;
|
|
11970
12218
|
}
|
|
12219
|
+
function multiSpeakerVoiceConfigToVertex(fromObject, rootObject) {
|
|
12220
|
+
const toObject = {};
|
|
12221
|
+
const fromSpeakerVoiceConfigs = getValueByPath(fromObject, [
|
|
12222
|
+
'speakerVoiceConfigs',
|
|
12223
|
+
]);
|
|
12224
|
+
if (fromSpeakerVoiceConfigs != null) {
|
|
12225
|
+
let transformedList = fromSpeakerVoiceConfigs;
|
|
12226
|
+
if (Array.isArray(transformedList)) {
|
|
12227
|
+
transformedList = transformedList.map((item) => {
|
|
12228
|
+
return speakerVoiceConfigToVertex(item);
|
|
12229
|
+
});
|
|
12230
|
+
}
|
|
12231
|
+
setValueByPath(toObject, ['speakerVoiceConfigs'], transformedList);
|
|
12232
|
+
}
|
|
12233
|
+
return toObject;
|
|
12234
|
+
}
|
|
11971
12235
|
function partToMldev$1(fromObject, rootObject) {
|
|
11972
12236
|
const toObject = {};
|
|
11973
12237
|
const fromMediaResolution = getValueByPath(fromObject, [
|
|
@@ -12277,6 +12541,26 @@ function referenceImageAPIInternalToVertex(fromObject, rootObject) {
|
|
|
12277
12541
|
}
|
|
12278
12542
|
return toObject;
|
|
12279
12543
|
}
|
|
12544
|
+
function replicatedVoiceConfigToVertex(fromObject, _rootObject) {
|
|
12545
|
+
const toObject = {};
|
|
12546
|
+
const fromMimeType = getValueByPath(fromObject, ['mimeType']);
|
|
12547
|
+
if (fromMimeType != null) {
|
|
12548
|
+
setValueByPath(toObject, ['mimeType'], fromMimeType);
|
|
12549
|
+
}
|
|
12550
|
+
const fromVoiceSampleAudio = getValueByPath(fromObject, [
|
|
12551
|
+
'voiceSampleAudio',
|
|
12552
|
+
]);
|
|
12553
|
+
if (fromVoiceSampleAudio != null) {
|
|
12554
|
+
setValueByPath(toObject, ['voiceSampleAudio'], fromVoiceSampleAudio);
|
|
12555
|
+
}
|
|
12556
|
+
if (getValueByPath(fromObject, ['consentAudio']) !== undefined) {
|
|
12557
|
+
throw new Error('consentAudio parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
12558
|
+
}
|
|
12559
|
+
if (getValueByPath(fromObject, ['voiceConsentSignature']) !== undefined) {
|
|
12560
|
+
throw new Error('voiceConsentSignature parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
12561
|
+
}
|
|
12562
|
+
return toObject;
|
|
12563
|
+
}
|
|
12280
12564
|
function safetyAttributesFromMldev(fromObject, _rootObject) {
|
|
12281
12565
|
const toObject = {};
|
|
12282
12566
|
const fromCategories = getValueByPath(fromObject, [
|
|
@@ -12426,6 +12710,36 @@ function segmentImageSourceToVertex(fromObject, parentObject, rootObject) {
|
|
|
12426
12710
|
}
|
|
12427
12711
|
return toObject;
|
|
12428
12712
|
}
|
|
12713
|
+
function speakerVoiceConfigToVertex(fromObject, rootObject) {
|
|
12714
|
+
const toObject = {};
|
|
12715
|
+
const fromSpeaker = getValueByPath(fromObject, ['speaker']);
|
|
12716
|
+
if (fromSpeaker != null) {
|
|
12717
|
+
setValueByPath(toObject, ['speaker'], fromSpeaker);
|
|
12718
|
+
}
|
|
12719
|
+
const fromVoiceConfig = getValueByPath(fromObject, ['voiceConfig']);
|
|
12720
|
+
if (fromVoiceConfig != null) {
|
|
12721
|
+
setValueByPath(toObject, ['voiceConfig'], voiceConfigToVertex(fromVoiceConfig));
|
|
12722
|
+
}
|
|
12723
|
+
return toObject;
|
|
12724
|
+
}
|
|
12725
|
+
function speechConfigToVertex(fromObject, rootObject) {
|
|
12726
|
+
const toObject = {};
|
|
12727
|
+
const fromVoiceConfig = getValueByPath(fromObject, ['voiceConfig']);
|
|
12728
|
+
if (fromVoiceConfig != null) {
|
|
12729
|
+
setValueByPath(toObject, ['voiceConfig'], voiceConfigToVertex(fromVoiceConfig));
|
|
12730
|
+
}
|
|
12731
|
+
const fromLanguageCode = getValueByPath(fromObject, ['languageCode']);
|
|
12732
|
+
if (fromLanguageCode != null) {
|
|
12733
|
+
setValueByPath(toObject, ['languageCode'], fromLanguageCode);
|
|
12734
|
+
}
|
|
12735
|
+
const fromMultiSpeakerVoiceConfig = getValueByPath(fromObject, [
|
|
12736
|
+
'multiSpeakerVoiceConfig',
|
|
12737
|
+
]);
|
|
12738
|
+
if (fromMultiSpeakerVoiceConfig != null) {
|
|
12739
|
+
setValueByPath(toObject, ['multiSpeakerVoiceConfig'], multiSpeakerVoiceConfigToVertex(fromMultiSpeakerVoiceConfig));
|
|
12740
|
+
}
|
|
12741
|
+
return toObject;
|
|
12742
|
+
}
|
|
12429
12743
|
function toolConfigToMldev(fromObject, rootObject) {
|
|
12430
12744
|
const toObject = {};
|
|
12431
12745
|
const fromRetrievalConfig = getValueByPath(fromObject, [
|
|
@@ -12531,6 +12845,9 @@ function toolToMldev$1(fromObject, rootObject) {
|
|
|
12531
12845
|
}
|
|
12532
12846
|
setValueByPath(toObject, ['mcpServers'], transformedList);
|
|
12533
12847
|
}
|
|
12848
|
+
if (getValueByPath(fromObject, ['exaAiSearch']) !== undefined) {
|
|
12849
|
+
throw new Error('exaAiSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
12850
|
+
}
|
|
12534
12851
|
return toObject;
|
|
12535
12852
|
}
|
|
12536
12853
|
function toolToVertex(fromObject, rootObject) {
|
|
@@ -12604,6 +12921,10 @@ function toolToVertex(fromObject, rootObject) {
|
|
|
12604
12921
|
}
|
|
12605
12922
|
setValueByPath(toObject, ['mcpServers'], transformedList);
|
|
12606
12923
|
}
|
|
12924
|
+
const fromExaAiSearch = getValueByPath(fromObject, ['exaAiSearch']);
|
|
12925
|
+
if (fromExaAiSearch != null) {
|
|
12926
|
+
setValueByPath(toObject, ['exaAiSearch'], fromExaAiSearch);
|
|
12927
|
+
}
|
|
12607
12928
|
return toObject;
|
|
12608
12929
|
}
|
|
12609
12930
|
function tunedModelInfoFromMldev(fromObject, _rootObject) {
|
|
@@ -12915,6 +13236,22 @@ function videoToVertex(fromObject, _rootObject) {
|
|
|
12915
13236
|
}
|
|
12916
13237
|
return toObject;
|
|
12917
13238
|
}
|
|
13239
|
+
function voiceConfigToVertex(fromObject, rootObject) {
|
|
13240
|
+
const toObject = {};
|
|
13241
|
+
const fromReplicatedVoiceConfig = getValueByPath(fromObject, [
|
|
13242
|
+
'replicatedVoiceConfig',
|
|
13243
|
+
]);
|
|
13244
|
+
if (fromReplicatedVoiceConfig != null) {
|
|
13245
|
+
setValueByPath(toObject, ['replicatedVoiceConfig'], replicatedVoiceConfigToVertex(fromReplicatedVoiceConfig));
|
|
13246
|
+
}
|
|
13247
|
+
const fromPrebuiltVoiceConfig = getValueByPath(fromObject, [
|
|
13248
|
+
'prebuiltVoiceConfig',
|
|
13249
|
+
]);
|
|
13250
|
+
if (fromPrebuiltVoiceConfig != null) {
|
|
13251
|
+
setValueByPath(toObject, ['prebuiltVoiceConfig'], fromPrebuiltVoiceConfig);
|
|
13252
|
+
}
|
|
13253
|
+
return toObject;
|
|
13254
|
+
}
|
|
12918
13255
|
|
|
12919
13256
|
/**
|
|
12920
13257
|
* @license
|
|
@@ -13165,7 +13502,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
|
|
|
13165
13502
|
const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
|
|
13166
13503
|
const USER_AGENT_HEADER = 'User-Agent';
|
|
13167
13504
|
const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
|
|
13168
|
-
const SDK_VERSION = '2.
|
|
13505
|
+
const SDK_VERSION = '2.11.0'; // x-release-please-version
|
|
13169
13506
|
const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
|
|
13170
13507
|
const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
|
|
13171
13508
|
const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';
|
|
@@ -14419,10 +14756,27 @@ class Live {
|
|
|
14419
14756
|
onopenResolve({});
|
|
14420
14757
|
};
|
|
14421
14758
|
const apiClient = this.apiClient;
|
|
14759
|
+
let sessionResolved = false;
|
|
14760
|
+
const messageQueue = [];
|
|
14761
|
+
let setupCompleteResolve = () => { };
|
|
14762
|
+
const setupCompletePromise = new Promise((resolve) => {
|
|
14763
|
+
setupCompleteResolve = resolve;
|
|
14764
|
+
});
|
|
14422
14765
|
const websocketCallbacks = {
|
|
14423
14766
|
onopen: onopenAwaitedCallback,
|
|
14424
14767
|
onmessage: (event) => {
|
|
14425
|
-
void handleWebSocketMessage(apiClient,
|
|
14768
|
+
void handleWebSocketMessage(apiClient, (msg) => {
|
|
14769
|
+
if (msg.setupComplete && !session.setupComplete) {
|
|
14770
|
+
session.setupComplete = msg.setupComplete;
|
|
14771
|
+
setupCompleteResolve({});
|
|
14772
|
+
}
|
|
14773
|
+
if (sessionResolved) {
|
|
14774
|
+
callbacks.onmessage(msg);
|
|
14775
|
+
}
|
|
14776
|
+
else {
|
|
14777
|
+
messageQueue.push(msg);
|
|
14778
|
+
}
|
|
14779
|
+
}, event);
|
|
14426
14780
|
},
|
|
14427
14781
|
onerror: (_a = callbacks === null || callbacks === void 0 ? void 0 : callbacks.onerror) !== null && _a !== void 0 ? _a : function (e) {
|
|
14428
14782
|
},
|
|
@@ -14484,8 +14838,14 @@ class Live {
|
|
|
14484
14838
|
clientMessage = liveConnectParametersToMldev(this.apiClient, liveConnectParameters);
|
|
14485
14839
|
}
|
|
14486
14840
|
delete clientMessage['config'];
|
|
14841
|
+
const session = new Session(conn, this.apiClient);
|
|
14487
14842
|
conn.send(JSON.stringify(clientMessage));
|
|
14488
|
-
|
|
14843
|
+
await setupCompletePromise;
|
|
14844
|
+
sessionResolved = true;
|
|
14845
|
+
for (const msg of messageQueue) {
|
|
14846
|
+
callbacks.onmessage(msg);
|
|
14847
|
+
}
|
|
14848
|
+
return session;
|
|
14489
14849
|
}
|
|
14490
14850
|
// TODO: b/416041229 - Abstract this method to a common place.
|
|
14491
14851
|
isCallableTool(tool) {
|
|
@@ -17014,6 +17374,9 @@ function toolToMldev(fromObject) {
|
|
|
17014
17374
|
}
|
|
17015
17375
|
setValueByPath(toObject, ['mcpServers'], transformedList);
|
|
17016
17376
|
}
|
|
17377
|
+
if (getValueByPath(fromObject, ['exaAiSearch']) !== undefined) {
|
|
17378
|
+
throw new Error('exaAiSearch parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.');
|
|
17379
|
+
}
|
|
17017
17380
|
return toObject;
|
|
17018
17381
|
}
|
|
17019
17382
|
|
|
@@ -17865,17 +18228,14 @@ function env() {
|
|
|
17865
18228
|
* Populates global parameters with environment variables.
|
|
17866
18229
|
*/
|
|
17867
18230
|
function fillGlobals(options) {
|
|
17868
|
-
var _a, _b
|
|
18231
|
+
var _a, _b;
|
|
17869
18232
|
const clone = Object.assign({}, options);
|
|
17870
18233
|
const envVars = env();
|
|
17871
18234
|
if (typeof envVars.GOOGLE_GENAI_API_VERSION !== "undefined") {
|
|
17872
18235
|
(_a = clone.api_version) !== null && _a !== void 0 ? _a : (clone.api_version = envVars.GOOGLE_GENAI_API_VERSION);
|
|
17873
18236
|
}
|
|
17874
|
-
if (typeof envVars.GOOGLE_GENAI_API_REVISION !== "undefined") {
|
|
17875
|
-
(_b = clone.api_revision) !== null && _b !== void 0 ? _b : (clone.api_revision = envVars.GOOGLE_GENAI_API_REVISION);
|
|
17876
|
-
}
|
|
17877
18237
|
if (typeof envVars.GOOGLE_GENAI_USER_PROJECT !== "undefined") {
|
|
17878
|
-
(
|
|
18238
|
+
(_b = clone.user_project) !== null && _b !== void 0 ? _b : (clone.user_project = envVars.GOOGLE_GENAI_USER_PROJECT);
|
|
17879
18239
|
}
|
|
17880
18240
|
return clone;
|
|
17881
18241
|
}
|
|
@@ -17887,7 +18247,6 @@ function fillGlobals(options) {
|
|
|
17887
18247
|
*
|
|
17888
18248
|
* g3-prettier-ignore-file
|
|
17889
18249
|
*/
|
|
17890
|
-
const GOOGLE_GENAI_API_REVISION = "2026-05-20";
|
|
17891
18250
|
class GoogleGenAISecurityProvider {
|
|
17892
18251
|
constructor(options) {
|
|
17893
18252
|
this.options = options;
|
|
@@ -17905,7 +18264,6 @@ class GoogleGenAIAuthHook {
|
|
|
17905
18264
|
}
|
|
17906
18265
|
async beforeRequest(hookCtx, request) {
|
|
17907
18266
|
applyDefaultHeaders(request.headers, getStaticDefaultHeaders(hookCtx.security_source));
|
|
17908
|
-
applyApiRevision(hookCtx, request.headers);
|
|
17909
18267
|
applyUserProject(hookCtx, request.headers);
|
|
17910
18268
|
if (hasAuthHeaders(request.headers)) {
|
|
17911
18269
|
return request;
|
|
@@ -17985,12 +18343,6 @@ function applyDefaultHeaders(target, source) {
|
|
|
17985
18343
|
}
|
|
17986
18344
|
}
|
|
17987
18345
|
}
|
|
17988
|
-
function applyApiRevision(hookCtx, headers) {
|
|
17989
|
-
var _a;
|
|
17990
|
-
if (headers.get("api-revision") === null) {
|
|
17991
|
-
headers.set("Api-Revision", (_a = hookCtx.options.api_revision) !== null && _a !== void 0 ? _a : GOOGLE_GENAI_API_REVISION);
|
|
17992
|
-
}
|
|
17993
|
-
}
|
|
17994
18346
|
function applyUserProject(hookCtx, headers) {
|
|
17995
18347
|
if (hookCtx.options.user_project !== undefined &&
|
|
17996
18348
|
headers.get("x-goog-user-project") === null) {
|
|
@@ -18522,7 +18874,7 @@ function serverURLFromOptions(options) {
|
|
|
18522
18874
|
return new URL(u);
|
|
18523
18875
|
}
|
|
18524
18876
|
const SDK_METADATA = {
|
|
18525
|
-
userAgent: "speakeasy-sdk/typescript 2.4.1-preview.4 2.
|
|
18877
|
+
userAgent: "speakeasy-sdk/typescript 2.4.1-preview.4 2.913.3 v1beta @google/genai",
|
|
18526
18878
|
};
|
|
18527
18879
|
|
|
18528
18880
|
/**
|
|
@@ -23171,6 +23523,18 @@ function generationConfigFromVertex(fromObject, _rootObject) {
|
|
|
23171
23523
|
if (fromTopP != null) {
|
|
23172
23524
|
setValueByPath(toObject, ['topP'], fromTopP);
|
|
23173
23525
|
}
|
|
23526
|
+
const fromResponseFormat = getValueByPath(fromObject, [
|
|
23527
|
+
'responseFormat',
|
|
23528
|
+
]);
|
|
23529
|
+
if (fromResponseFormat != null) {
|
|
23530
|
+
let transformedList = fromResponseFormat;
|
|
23531
|
+
if (Array.isArray(transformedList)) {
|
|
23532
|
+
transformedList = transformedList.map((item) => {
|
|
23533
|
+
return item;
|
|
23534
|
+
});
|
|
23535
|
+
}
|
|
23536
|
+
setValueByPath(toObject, ['responseFormat'], transformedList);
|
|
23537
|
+
}
|
|
23174
23538
|
return toObject;
|
|
23175
23539
|
}
|
|
23176
23540
|
function getTuningJobParametersToMldev(fromObject, _rootObject) {
|
|
@@ -24719,5 +25083,5 @@ function getApiKeyFromEnv() {
|
|
|
24719
25083
|
return envGoogleApiKey || envGeminiApiKey || undefined;
|
|
24720
25084
|
}
|
|
24721
25085
|
|
|
24722
|
-
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, MatchOperation, MediaModality, MediaResolution, Modality, ModelStage, Models, MusicGenerationMode, Operations, Outcome, PagedItem, Pager, PairwiseChoice, PartMediaResolutionLevel, PersonGeneration, PhishBlockThreshold, ProminentPeople, RawReferenceImage, RecontextImageResponse, RegisterFilesResponse, ReinforcementTuningAutoraterScorerParsedResponseConversionScorer, ReinforcementTuningParseResponseConfig, ReinforcementTuningThinkingLevel, ReplayResponse, ResourceScope, ResponseParseType, SafetyFilterLevel, SafetyPolicy, 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, ValidateRewardResponse, VideoCompressionQuality, VideoGenerationMaskMode, VideoGenerationReferenceType, VideoOrientation, VoiceActivityType, createFunctionResponsePartFromBase64, createFunctionResponsePartFromUri, createModelContent, createPartFromBase64, createPartFromCodeExecutionResult, createPartFromExecutableCode, createPartFromFunctionCall, createPartFromFunctionResponse, createPartFromText, createPartFromUri, createUserContent, mcpToTool, setDefaultBaseUrls };
|
|
25086
|
+
export { ActivityHandling, AdapterSize, AggregationMetric, ApiError, ApiSpec, AspectRatio, AudioResponseFormat, AuthType, Batches, Behavior, BlockedReason, Caches, CancelTuningJobResponse, Chat, Chats, ComputeTokensResponse, ContentReferenceImage, ControlReferenceImage, ControlReferenceType, CountTokensResponse, CreateFileResponse, DeleteCachedContentResponse, DeleteFileResponse, DeleteModelResponse, Delivery, 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, ImageResponseFormat, ImageSize, ImportFileOperation, ImportFileResponse, InlinedEmbedContentResponse, InlinedResponse, JobState, Language, ListBatchJobsResponse, ListCachedContentsResponse, ListDocumentsResponse, ListFileSearchStoresResponse, ListFilesResponse, ListModelsResponse, ListTuningJobsResponse, Live, LiveClientToolResponse, LiveMusicPlaybackControl, LiveMusicServerMessage, LiveSendToolResponseParameters, LiveServerMessage, MaskReferenceImage, MaskReferenceMode, MatchOperation, MediaModality, MediaResolution, Modality, ModelStage, Models, MusicGenerationMode, Operations, Outcome, PagedItem, Pager, PairwiseChoice, PartMediaResolutionLevel, PersonGeneration, PhishBlockThreshold, ProminentPeople, RawReferenceImage, RecontextImageResponse, RegisterFilesResponse, ReinforcementTuningAutoraterScorerParsedResponseConversionScorer, ReinforcementTuningParseResponseConfig, ReinforcementTuningThinkingLevel, ReplayResponse, ResourceScope, ResponseFormat, ResponseParseType, SafetyFilterLevel, SafetyPolicy, Scale, SegmentImageResponse, SegmentMode, ServiceTier, Session, SingleEmbedContentResponse, StartSensitivity, StyleReferenceImage, SubjectReferenceImage, SubjectReferenceType, TextResponseFormat, ThinkingLevel, Tokens, ToolResponse, ToolType, TrafficType, TuningJobState, TuningMethod, TuningMode, TuningSpeed, TuningTask, TurnCompleteReason, TurnCoverage, Type, UploadToFileSearchStoreOperation, UploadToFileSearchStoreResponse, UploadToFileSearchStoreResumableResponse, UpscaleImageResponse, UrlRetrievalStatus, VadSignalType, ValidateRewardResponse, VideoCompressionQuality, VideoGenerationMaskMode, VideoGenerationReferenceType, VideoOrientation, VideoResponseFormat, VoiceActivityType, createFunctionResponsePartFromBase64, createFunctionResponsePartFromUri, createModelContent, createPartFromBase64, createPartFromCodeExecutionResult, createPartFromExecutableCode, createPartFromFunctionCall, createPartFromFunctionResponse, createPartFromText, createPartFromUri, createUserContent, mcpToTool, setDefaultBaseUrls };
|
|
24723
25087
|
//# sourceMappingURL=index.mjs.map
|