@google/genai 1.25.0 → 1.26.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 +61 -39
- package/dist/index.cjs +57 -77
- package/dist/index.mjs +57 -77
- package/dist/index.mjs.map +1 -1
- package/dist/node/index.cjs +59 -79
- package/dist/node/index.mjs +59 -79
- package/dist/node/index.mjs.map +1 -1
- package/dist/node/node.d.ts +61 -39
- package/dist/web/index.mjs +57 -77
- package/dist/web/index.mjs.map +1 -1
- package/dist/web/web.d.ts +61 -39
- package/package.json +8 -3
package/dist/node/index.cjs
CHANGED
|
@@ -560,6 +560,26 @@ exports.Language = void 0;
|
|
|
560
560
|
*/
|
|
561
561
|
Language["PYTHON"] = "PYTHON";
|
|
562
562
|
})(exports.Language || (exports.Language = {}));
|
|
563
|
+
/** Specifies how the response should be scheduled in the conversation. */
|
|
564
|
+
exports.FunctionResponseScheduling = void 0;
|
|
565
|
+
(function (FunctionResponseScheduling) {
|
|
566
|
+
/**
|
|
567
|
+
* This value is unused.
|
|
568
|
+
*/
|
|
569
|
+
FunctionResponseScheduling["SCHEDULING_UNSPECIFIED"] = "SCHEDULING_UNSPECIFIED";
|
|
570
|
+
/**
|
|
571
|
+
* Only add the result to the conversation context, do not interrupt or trigger generation.
|
|
572
|
+
*/
|
|
573
|
+
FunctionResponseScheduling["SILENT"] = "SILENT";
|
|
574
|
+
/**
|
|
575
|
+
* Add the result to the conversation context, and prompt to generate output without interrupting ongoing generation.
|
|
576
|
+
*/
|
|
577
|
+
FunctionResponseScheduling["WHEN_IDLE"] = "WHEN_IDLE";
|
|
578
|
+
/**
|
|
579
|
+
* Add the result to the conversation context, interrupt ongoing generation and prompt to generate output.
|
|
580
|
+
*/
|
|
581
|
+
FunctionResponseScheduling["INTERRUPT"] = "INTERRUPT";
|
|
582
|
+
})(exports.FunctionResponseScheduling || (exports.FunctionResponseScheduling = {}));
|
|
563
583
|
/** Optional. The type of the data. */
|
|
564
584
|
exports.Type = void 0;
|
|
565
585
|
(function (Type) {
|
|
@@ -603,22 +623,22 @@ exports.HarmCategory = void 0;
|
|
|
603
623
|
* The harm category is unspecified.
|
|
604
624
|
*/
|
|
605
625
|
HarmCategory["HARM_CATEGORY_UNSPECIFIED"] = "HARM_CATEGORY_UNSPECIFIED";
|
|
606
|
-
/**
|
|
607
|
-
* The harm category is hate speech.
|
|
608
|
-
*/
|
|
609
|
-
HarmCategory["HARM_CATEGORY_HATE_SPEECH"] = "HARM_CATEGORY_HATE_SPEECH";
|
|
610
|
-
/**
|
|
611
|
-
* The harm category is dangerous content.
|
|
612
|
-
*/
|
|
613
|
-
HarmCategory["HARM_CATEGORY_DANGEROUS_CONTENT"] = "HARM_CATEGORY_DANGEROUS_CONTENT";
|
|
614
626
|
/**
|
|
615
627
|
* The harm category is harassment.
|
|
616
628
|
*/
|
|
617
629
|
HarmCategory["HARM_CATEGORY_HARASSMENT"] = "HARM_CATEGORY_HARASSMENT";
|
|
630
|
+
/**
|
|
631
|
+
* The harm category is hate speech.
|
|
632
|
+
*/
|
|
633
|
+
HarmCategory["HARM_CATEGORY_HATE_SPEECH"] = "HARM_CATEGORY_HATE_SPEECH";
|
|
618
634
|
/**
|
|
619
635
|
* The harm category is sexually explicit content.
|
|
620
636
|
*/
|
|
621
637
|
HarmCategory["HARM_CATEGORY_SEXUALLY_EXPLICIT"] = "HARM_CATEGORY_SEXUALLY_EXPLICIT";
|
|
638
|
+
/**
|
|
639
|
+
* The harm category is dangerous content.
|
|
640
|
+
*/
|
|
641
|
+
HarmCategory["HARM_CATEGORY_DANGEROUS_CONTENT"] = "HARM_CATEGORY_DANGEROUS_CONTENT";
|
|
622
642
|
/**
|
|
623
643
|
* Deprecated: Election filter is not longer supported. The harm category is civic integrity.
|
|
624
644
|
*/
|
|
@@ -639,6 +659,10 @@ exports.HarmCategory = void 0;
|
|
|
639
659
|
* The harm category is image sexually explicit content.
|
|
640
660
|
*/
|
|
641
661
|
HarmCategory["HARM_CATEGORY_IMAGE_SEXUALLY_EXPLICIT"] = "HARM_CATEGORY_IMAGE_SEXUALLY_EXPLICIT";
|
|
662
|
+
/**
|
|
663
|
+
* The harm category is for jailbreak prompts.
|
|
664
|
+
*/
|
|
665
|
+
HarmCategory["HARM_CATEGORY_JAILBREAK"] = "HARM_CATEGORY_JAILBREAK";
|
|
642
666
|
})(exports.HarmCategory || (exports.HarmCategory = {}));
|
|
643
667
|
/** Optional. Specify if the threshold is used for probability or severity score. If not specified, the threshold is used for probability score. */
|
|
644
668
|
exports.HarmBlockMethod = void 0;
|
|
@@ -879,33 +903,41 @@ exports.HarmSeverity = void 0;
|
|
|
879
903
|
*/
|
|
880
904
|
HarmSeverity["HARM_SEVERITY_HIGH"] = "HARM_SEVERITY_HIGH";
|
|
881
905
|
})(exports.HarmSeverity || (exports.HarmSeverity = {}));
|
|
882
|
-
/** Output only.
|
|
906
|
+
/** Output only. The reason why the prompt was blocked. */
|
|
883
907
|
exports.BlockedReason = void 0;
|
|
884
908
|
(function (BlockedReason) {
|
|
885
909
|
/**
|
|
886
|
-
*
|
|
910
|
+
* The blocked reason is unspecified.
|
|
887
911
|
*/
|
|
888
912
|
BlockedReason["BLOCKED_REASON_UNSPECIFIED"] = "BLOCKED_REASON_UNSPECIFIED";
|
|
889
913
|
/**
|
|
890
|
-
*
|
|
914
|
+
* The prompt was blocked for safety reasons.
|
|
891
915
|
*/
|
|
892
916
|
BlockedReason["SAFETY"] = "SAFETY";
|
|
893
917
|
/**
|
|
894
|
-
*
|
|
918
|
+
* The prompt was blocked for other reasons. For example, it may be due to the prompt's language, or because it contains other harmful content.
|
|
895
919
|
*/
|
|
896
920
|
BlockedReason["OTHER"] = "OTHER";
|
|
897
921
|
/**
|
|
898
|
-
*
|
|
922
|
+
* The prompt was blocked because it contains a term from the terminology blocklist.
|
|
899
923
|
*/
|
|
900
924
|
BlockedReason["BLOCKLIST"] = "BLOCKLIST";
|
|
901
925
|
/**
|
|
902
|
-
*
|
|
926
|
+
* The prompt was blocked because it contains prohibited content.
|
|
903
927
|
*/
|
|
904
928
|
BlockedReason["PROHIBITED_CONTENT"] = "PROHIBITED_CONTENT";
|
|
905
929
|
/**
|
|
906
|
-
*
|
|
930
|
+
* The prompt was blocked because it contains content that is unsafe for image generation.
|
|
907
931
|
*/
|
|
908
932
|
BlockedReason["IMAGE_SAFETY"] = "IMAGE_SAFETY";
|
|
933
|
+
/**
|
|
934
|
+
* The prompt was blocked by Model Armor.
|
|
935
|
+
*/
|
|
936
|
+
BlockedReason["MODEL_ARMOR"] = "MODEL_ARMOR";
|
|
937
|
+
/**
|
|
938
|
+
* The prompt was blocked as a jailbreak attempt.
|
|
939
|
+
*/
|
|
940
|
+
BlockedReason["JAILBREAK"] = "JAILBREAK";
|
|
909
941
|
})(exports.BlockedReason || (exports.BlockedReason = {}));
|
|
910
942
|
/** Output only. Traffic type. This shows whether a request consumes Pay-As-You-Go or Provisioned Throughput quota. */
|
|
911
943
|
exports.TrafficType = void 0;
|
|
@@ -1440,26 +1472,6 @@ exports.TurnCoverage = void 0;
|
|
|
1440
1472
|
*/
|
|
1441
1473
|
TurnCoverage["TURN_INCLUDES_ALL_INPUT"] = "TURN_INCLUDES_ALL_INPUT";
|
|
1442
1474
|
})(exports.TurnCoverage || (exports.TurnCoverage = {}));
|
|
1443
|
-
/** Specifies how the response should be scheduled in the conversation. */
|
|
1444
|
-
exports.FunctionResponseScheduling = void 0;
|
|
1445
|
-
(function (FunctionResponseScheduling) {
|
|
1446
|
-
/**
|
|
1447
|
-
* This value is unused.
|
|
1448
|
-
*/
|
|
1449
|
-
FunctionResponseScheduling["SCHEDULING_UNSPECIFIED"] = "SCHEDULING_UNSPECIFIED";
|
|
1450
|
-
/**
|
|
1451
|
-
* Only add the result to the conversation context, do not interrupt or trigger generation.
|
|
1452
|
-
*/
|
|
1453
|
-
FunctionResponseScheduling["SILENT"] = "SILENT";
|
|
1454
|
-
/**
|
|
1455
|
-
* Add the result to the conversation context, and prompt to generate output without interrupting ongoing generation.
|
|
1456
|
-
*/
|
|
1457
|
-
FunctionResponseScheduling["WHEN_IDLE"] = "WHEN_IDLE";
|
|
1458
|
-
/**
|
|
1459
|
-
* Add the result to the conversation context, interrupt ongoing generation and prompt to generate output.
|
|
1460
|
-
*/
|
|
1461
|
-
FunctionResponseScheduling["INTERRUPT"] = "INTERRUPT";
|
|
1462
|
-
})(exports.FunctionResponseScheduling || (exports.FunctionResponseScheduling = {}));
|
|
1463
1475
|
/** Scale of the generated music. */
|
|
1464
1476
|
exports.Scale = void 0;
|
|
1465
1477
|
(function (Scale) {
|
|
@@ -1757,7 +1769,7 @@ class HttpResponse {
|
|
|
1757
1769
|
return this.responseInternal.json();
|
|
1758
1770
|
}
|
|
1759
1771
|
}
|
|
1760
|
-
/** Content filter results for a prompt sent in the request. */
|
|
1772
|
+
/** Content filter results for a prompt sent in the request. Note: This is sent only in the first stream chunk and only if no candidates were generated due to content violations. */
|
|
1761
1773
|
class GenerateContentResponsePromptFeedback {
|
|
1762
1774
|
}
|
|
1763
1775
|
/** Usage metadata about response(s). */
|
|
@@ -6812,6 +6824,10 @@ function generationConfigToVertex$1(fromObject) {
|
|
|
6812
6824
|
if (fromTopP != null) {
|
|
6813
6825
|
setValueByPath(toObject, ['topP'], fromTopP);
|
|
6814
6826
|
}
|
|
6827
|
+
if (getValueByPath(fromObject, ['enableEnhancedCivicAnswers']) !==
|
|
6828
|
+
undefined) {
|
|
6829
|
+
throw new Error('enableEnhancedCivicAnswers parameter is not supported in Vertex AI.');
|
|
6830
|
+
}
|
|
6815
6831
|
return toObject;
|
|
6816
6832
|
}
|
|
6817
6833
|
function googleMapsToMldev$2(fromObject) {
|
|
@@ -9471,6 +9487,10 @@ function generationConfigToVertex(fromObject) {
|
|
|
9471
9487
|
if (fromTopP != null) {
|
|
9472
9488
|
setValueByPath(toObject, ['topP'], fromTopP);
|
|
9473
9489
|
}
|
|
9490
|
+
if (getValueByPath(fromObject, ['enableEnhancedCivicAnswers']) !==
|
|
9491
|
+
undefined) {
|
|
9492
|
+
throw new Error('enableEnhancedCivicAnswers parameter is not supported in Vertex AI.');
|
|
9493
|
+
}
|
|
9474
9494
|
return toObject;
|
|
9475
9495
|
}
|
|
9476
9496
|
function getModelParametersToMldev(apiClient, fromObject) {
|
|
@@ -10595,7 +10615,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
|
|
|
10595
10615
|
const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
|
|
10596
10616
|
const USER_AGENT_HEADER = 'User-Agent';
|
|
10597
10617
|
const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
|
|
10598
|
-
const SDK_VERSION = '1.
|
|
10618
|
+
const SDK_VERSION = '1.26.0'; // x-release-please-version
|
|
10599
10619
|
const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
|
|
10600
10620
|
const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
|
|
10601
10621
|
const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';
|
|
@@ -14395,11 +14415,11 @@ class NodeAuth {
|
|
|
14395
14415
|
throw new Error('Trying to set google-auth headers but googleAuth is unset');
|
|
14396
14416
|
}
|
|
14397
14417
|
const authHeaders = await this.googleAuth.getRequestHeaders();
|
|
14398
|
-
for (const key
|
|
14418
|
+
for (const [key, value] of Object.entries(authHeaders)) {
|
|
14399
14419
|
if (headers.get(key) !== null) {
|
|
14400
14420
|
continue;
|
|
14401
14421
|
}
|
|
14402
|
-
headers.append(key,
|
|
14422
|
+
headers.append(key, value);
|
|
14403
14423
|
}
|
|
14404
14424
|
}
|
|
14405
14425
|
}
|
|
@@ -14907,46 +14927,6 @@ function tuningJobFromMldev(fromObject) {
|
|
|
14907
14927
|
if (fromTunedModel != null) {
|
|
14908
14928
|
setValueByPath(toObject, ['tunedModel'], tunedModelFromMldev(fromTunedModel));
|
|
14909
14929
|
}
|
|
14910
|
-
const fromCustomBaseModel = getValueByPath(fromObject, [
|
|
14911
|
-
'customBaseModel',
|
|
14912
|
-
]);
|
|
14913
|
-
if (fromCustomBaseModel != null) {
|
|
14914
|
-
setValueByPath(toObject, ['customBaseModel'], fromCustomBaseModel);
|
|
14915
|
-
}
|
|
14916
|
-
const fromExperiment = getValueByPath(fromObject, ['experiment']);
|
|
14917
|
-
if (fromExperiment != null) {
|
|
14918
|
-
setValueByPath(toObject, ['experiment'], fromExperiment);
|
|
14919
|
-
}
|
|
14920
|
-
const fromLabels = getValueByPath(fromObject, ['labels']);
|
|
14921
|
-
if (fromLabels != null) {
|
|
14922
|
-
setValueByPath(toObject, ['labels'], fromLabels);
|
|
14923
|
-
}
|
|
14924
|
-
const fromOutputUri = getValueByPath(fromObject, ['outputUri']);
|
|
14925
|
-
if (fromOutputUri != null) {
|
|
14926
|
-
setValueByPath(toObject, ['outputUri'], fromOutputUri);
|
|
14927
|
-
}
|
|
14928
|
-
const fromPipelineJob = getValueByPath(fromObject, ['pipelineJob']);
|
|
14929
|
-
if (fromPipelineJob != null) {
|
|
14930
|
-
setValueByPath(toObject, ['pipelineJob'], fromPipelineJob);
|
|
14931
|
-
}
|
|
14932
|
-
const fromServiceAccount = getValueByPath(fromObject, [
|
|
14933
|
-
'serviceAccount',
|
|
14934
|
-
]);
|
|
14935
|
-
if (fromServiceAccount != null) {
|
|
14936
|
-
setValueByPath(toObject, ['serviceAccount'], fromServiceAccount);
|
|
14937
|
-
}
|
|
14938
|
-
const fromTunedModelDisplayName = getValueByPath(fromObject, [
|
|
14939
|
-
'tunedModelDisplayName',
|
|
14940
|
-
]);
|
|
14941
|
-
if (fromTunedModelDisplayName != null) {
|
|
14942
|
-
setValueByPath(toObject, ['tunedModelDisplayName'], fromTunedModelDisplayName);
|
|
14943
|
-
}
|
|
14944
|
-
const fromVeoTuningSpec = getValueByPath(fromObject, [
|
|
14945
|
-
'veoTuningSpec',
|
|
14946
|
-
]);
|
|
14947
|
-
if (fromVeoTuningSpec != null) {
|
|
14948
|
-
setValueByPath(toObject, ['veoTuningSpec'], fromVeoTuningSpec);
|
|
14949
|
-
}
|
|
14950
14930
|
return toObject;
|
|
14951
14931
|
}
|
|
14952
14932
|
function tuningJobFromVertex(fromObject) {
|
package/dist/node/index.mjs
CHANGED
|
@@ -538,6 +538,26 @@ var Language;
|
|
|
538
538
|
*/
|
|
539
539
|
Language["PYTHON"] = "PYTHON";
|
|
540
540
|
})(Language || (Language = {}));
|
|
541
|
+
/** Specifies how the response should be scheduled in the conversation. */
|
|
542
|
+
var FunctionResponseScheduling;
|
|
543
|
+
(function (FunctionResponseScheduling) {
|
|
544
|
+
/**
|
|
545
|
+
* This value is unused.
|
|
546
|
+
*/
|
|
547
|
+
FunctionResponseScheduling["SCHEDULING_UNSPECIFIED"] = "SCHEDULING_UNSPECIFIED";
|
|
548
|
+
/**
|
|
549
|
+
* Only add the result to the conversation context, do not interrupt or trigger generation.
|
|
550
|
+
*/
|
|
551
|
+
FunctionResponseScheduling["SILENT"] = "SILENT";
|
|
552
|
+
/**
|
|
553
|
+
* Add the result to the conversation context, and prompt to generate output without interrupting ongoing generation.
|
|
554
|
+
*/
|
|
555
|
+
FunctionResponseScheduling["WHEN_IDLE"] = "WHEN_IDLE";
|
|
556
|
+
/**
|
|
557
|
+
* Add the result to the conversation context, interrupt ongoing generation and prompt to generate output.
|
|
558
|
+
*/
|
|
559
|
+
FunctionResponseScheduling["INTERRUPT"] = "INTERRUPT";
|
|
560
|
+
})(FunctionResponseScheduling || (FunctionResponseScheduling = {}));
|
|
541
561
|
/** Optional. The type of the data. */
|
|
542
562
|
var Type;
|
|
543
563
|
(function (Type) {
|
|
@@ -581,22 +601,22 @@ var HarmCategory;
|
|
|
581
601
|
* The harm category is unspecified.
|
|
582
602
|
*/
|
|
583
603
|
HarmCategory["HARM_CATEGORY_UNSPECIFIED"] = "HARM_CATEGORY_UNSPECIFIED";
|
|
584
|
-
/**
|
|
585
|
-
* The harm category is hate speech.
|
|
586
|
-
*/
|
|
587
|
-
HarmCategory["HARM_CATEGORY_HATE_SPEECH"] = "HARM_CATEGORY_HATE_SPEECH";
|
|
588
|
-
/**
|
|
589
|
-
* The harm category is dangerous content.
|
|
590
|
-
*/
|
|
591
|
-
HarmCategory["HARM_CATEGORY_DANGEROUS_CONTENT"] = "HARM_CATEGORY_DANGEROUS_CONTENT";
|
|
592
604
|
/**
|
|
593
605
|
* The harm category is harassment.
|
|
594
606
|
*/
|
|
595
607
|
HarmCategory["HARM_CATEGORY_HARASSMENT"] = "HARM_CATEGORY_HARASSMENT";
|
|
608
|
+
/**
|
|
609
|
+
* The harm category is hate speech.
|
|
610
|
+
*/
|
|
611
|
+
HarmCategory["HARM_CATEGORY_HATE_SPEECH"] = "HARM_CATEGORY_HATE_SPEECH";
|
|
596
612
|
/**
|
|
597
613
|
* The harm category is sexually explicit content.
|
|
598
614
|
*/
|
|
599
615
|
HarmCategory["HARM_CATEGORY_SEXUALLY_EXPLICIT"] = "HARM_CATEGORY_SEXUALLY_EXPLICIT";
|
|
616
|
+
/**
|
|
617
|
+
* The harm category is dangerous content.
|
|
618
|
+
*/
|
|
619
|
+
HarmCategory["HARM_CATEGORY_DANGEROUS_CONTENT"] = "HARM_CATEGORY_DANGEROUS_CONTENT";
|
|
600
620
|
/**
|
|
601
621
|
* Deprecated: Election filter is not longer supported. The harm category is civic integrity.
|
|
602
622
|
*/
|
|
@@ -617,6 +637,10 @@ var HarmCategory;
|
|
|
617
637
|
* The harm category is image sexually explicit content.
|
|
618
638
|
*/
|
|
619
639
|
HarmCategory["HARM_CATEGORY_IMAGE_SEXUALLY_EXPLICIT"] = "HARM_CATEGORY_IMAGE_SEXUALLY_EXPLICIT";
|
|
640
|
+
/**
|
|
641
|
+
* The harm category is for jailbreak prompts.
|
|
642
|
+
*/
|
|
643
|
+
HarmCategory["HARM_CATEGORY_JAILBREAK"] = "HARM_CATEGORY_JAILBREAK";
|
|
620
644
|
})(HarmCategory || (HarmCategory = {}));
|
|
621
645
|
/** Optional. Specify if the threshold is used for probability or severity score. If not specified, the threshold is used for probability score. */
|
|
622
646
|
var HarmBlockMethod;
|
|
@@ -857,33 +881,41 @@ var HarmSeverity;
|
|
|
857
881
|
*/
|
|
858
882
|
HarmSeverity["HARM_SEVERITY_HIGH"] = "HARM_SEVERITY_HIGH";
|
|
859
883
|
})(HarmSeverity || (HarmSeverity = {}));
|
|
860
|
-
/** Output only.
|
|
884
|
+
/** Output only. The reason why the prompt was blocked. */
|
|
861
885
|
var BlockedReason;
|
|
862
886
|
(function (BlockedReason) {
|
|
863
887
|
/**
|
|
864
|
-
*
|
|
888
|
+
* The blocked reason is unspecified.
|
|
865
889
|
*/
|
|
866
890
|
BlockedReason["BLOCKED_REASON_UNSPECIFIED"] = "BLOCKED_REASON_UNSPECIFIED";
|
|
867
891
|
/**
|
|
868
|
-
*
|
|
892
|
+
* The prompt was blocked for safety reasons.
|
|
869
893
|
*/
|
|
870
894
|
BlockedReason["SAFETY"] = "SAFETY";
|
|
871
895
|
/**
|
|
872
|
-
*
|
|
896
|
+
* The prompt was blocked for other reasons. For example, it may be due to the prompt's language, or because it contains other harmful content.
|
|
873
897
|
*/
|
|
874
898
|
BlockedReason["OTHER"] = "OTHER";
|
|
875
899
|
/**
|
|
876
|
-
*
|
|
900
|
+
* The prompt was blocked because it contains a term from the terminology blocklist.
|
|
877
901
|
*/
|
|
878
902
|
BlockedReason["BLOCKLIST"] = "BLOCKLIST";
|
|
879
903
|
/**
|
|
880
|
-
*
|
|
904
|
+
* The prompt was blocked because it contains prohibited content.
|
|
881
905
|
*/
|
|
882
906
|
BlockedReason["PROHIBITED_CONTENT"] = "PROHIBITED_CONTENT";
|
|
883
907
|
/**
|
|
884
|
-
*
|
|
908
|
+
* The prompt was blocked because it contains content that is unsafe for image generation.
|
|
885
909
|
*/
|
|
886
910
|
BlockedReason["IMAGE_SAFETY"] = "IMAGE_SAFETY";
|
|
911
|
+
/**
|
|
912
|
+
* The prompt was blocked by Model Armor.
|
|
913
|
+
*/
|
|
914
|
+
BlockedReason["MODEL_ARMOR"] = "MODEL_ARMOR";
|
|
915
|
+
/**
|
|
916
|
+
* The prompt was blocked as a jailbreak attempt.
|
|
917
|
+
*/
|
|
918
|
+
BlockedReason["JAILBREAK"] = "JAILBREAK";
|
|
887
919
|
})(BlockedReason || (BlockedReason = {}));
|
|
888
920
|
/** Output only. Traffic type. This shows whether a request consumes Pay-As-You-Go or Provisioned Throughput quota. */
|
|
889
921
|
var TrafficType;
|
|
@@ -1418,26 +1450,6 @@ var TurnCoverage;
|
|
|
1418
1450
|
*/
|
|
1419
1451
|
TurnCoverage["TURN_INCLUDES_ALL_INPUT"] = "TURN_INCLUDES_ALL_INPUT";
|
|
1420
1452
|
})(TurnCoverage || (TurnCoverage = {}));
|
|
1421
|
-
/** Specifies how the response should be scheduled in the conversation. */
|
|
1422
|
-
var FunctionResponseScheduling;
|
|
1423
|
-
(function (FunctionResponseScheduling) {
|
|
1424
|
-
/**
|
|
1425
|
-
* This value is unused.
|
|
1426
|
-
*/
|
|
1427
|
-
FunctionResponseScheduling["SCHEDULING_UNSPECIFIED"] = "SCHEDULING_UNSPECIFIED";
|
|
1428
|
-
/**
|
|
1429
|
-
* Only add the result to the conversation context, do not interrupt or trigger generation.
|
|
1430
|
-
*/
|
|
1431
|
-
FunctionResponseScheduling["SILENT"] = "SILENT";
|
|
1432
|
-
/**
|
|
1433
|
-
* Add the result to the conversation context, and prompt to generate output without interrupting ongoing generation.
|
|
1434
|
-
*/
|
|
1435
|
-
FunctionResponseScheduling["WHEN_IDLE"] = "WHEN_IDLE";
|
|
1436
|
-
/**
|
|
1437
|
-
* Add the result to the conversation context, interrupt ongoing generation and prompt to generate output.
|
|
1438
|
-
*/
|
|
1439
|
-
FunctionResponseScheduling["INTERRUPT"] = "INTERRUPT";
|
|
1440
|
-
})(FunctionResponseScheduling || (FunctionResponseScheduling = {}));
|
|
1441
1453
|
/** Scale of the generated music. */
|
|
1442
1454
|
var Scale;
|
|
1443
1455
|
(function (Scale) {
|
|
@@ -1735,7 +1747,7 @@ class HttpResponse {
|
|
|
1735
1747
|
return this.responseInternal.json();
|
|
1736
1748
|
}
|
|
1737
1749
|
}
|
|
1738
|
-
/** Content filter results for a prompt sent in the request. */
|
|
1750
|
+
/** Content filter results for a prompt sent in the request. Note: This is sent only in the first stream chunk and only if no candidates were generated due to content violations. */
|
|
1739
1751
|
class GenerateContentResponsePromptFeedback {
|
|
1740
1752
|
}
|
|
1741
1753
|
/** Usage metadata about response(s). */
|
|
@@ -6790,6 +6802,10 @@ function generationConfigToVertex$1(fromObject) {
|
|
|
6790
6802
|
if (fromTopP != null) {
|
|
6791
6803
|
setValueByPath(toObject, ['topP'], fromTopP);
|
|
6792
6804
|
}
|
|
6805
|
+
if (getValueByPath(fromObject, ['enableEnhancedCivicAnswers']) !==
|
|
6806
|
+
undefined) {
|
|
6807
|
+
throw new Error('enableEnhancedCivicAnswers parameter is not supported in Vertex AI.');
|
|
6808
|
+
}
|
|
6793
6809
|
return toObject;
|
|
6794
6810
|
}
|
|
6795
6811
|
function googleMapsToMldev$2(fromObject) {
|
|
@@ -9449,6 +9465,10 @@ function generationConfigToVertex(fromObject) {
|
|
|
9449
9465
|
if (fromTopP != null) {
|
|
9450
9466
|
setValueByPath(toObject, ['topP'], fromTopP);
|
|
9451
9467
|
}
|
|
9468
|
+
if (getValueByPath(fromObject, ['enableEnhancedCivicAnswers']) !==
|
|
9469
|
+
undefined) {
|
|
9470
|
+
throw new Error('enableEnhancedCivicAnswers parameter is not supported in Vertex AI.');
|
|
9471
|
+
}
|
|
9452
9472
|
return toObject;
|
|
9453
9473
|
}
|
|
9454
9474
|
function getModelParametersToMldev(apiClient, fromObject) {
|
|
@@ -10573,7 +10593,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
|
|
|
10573
10593
|
const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
|
|
10574
10594
|
const USER_AGENT_HEADER = 'User-Agent';
|
|
10575
10595
|
const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
|
|
10576
|
-
const SDK_VERSION = '1.
|
|
10596
|
+
const SDK_VERSION = '1.26.0'; // x-release-please-version
|
|
10577
10597
|
const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
|
|
10578
10598
|
const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
|
|
10579
10599
|
const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';
|
|
@@ -14373,11 +14393,11 @@ class NodeAuth {
|
|
|
14373
14393
|
throw new Error('Trying to set google-auth headers but googleAuth is unset');
|
|
14374
14394
|
}
|
|
14375
14395
|
const authHeaders = await this.googleAuth.getRequestHeaders();
|
|
14376
|
-
for (const key
|
|
14396
|
+
for (const [key, value] of Object.entries(authHeaders)) {
|
|
14377
14397
|
if (headers.get(key) !== null) {
|
|
14378
14398
|
continue;
|
|
14379
14399
|
}
|
|
14380
|
-
headers.append(key,
|
|
14400
|
+
headers.append(key, value);
|
|
14381
14401
|
}
|
|
14382
14402
|
}
|
|
14383
14403
|
}
|
|
@@ -14885,46 +14905,6 @@ function tuningJobFromMldev(fromObject) {
|
|
|
14885
14905
|
if (fromTunedModel != null) {
|
|
14886
14906
|
setValueByPath(toObject, ['tunedModel'], tunedModelFromMldev(fromTunedModel));
|
|
14887
14907
|
}
|
|
14888
|
-
const fromCustomBaseModel = getValueByPath(fromObject, [
|
|
14889
|
-
'customBaseModel',
|
|
14890
|
-
]);
|
|
14891
|
-
if (fromCustomBaseModel != null) {
|
|
14892
|
-
setValueByPath(toObject, ['customBaseModel'], fromCustomBaseModel);
|
|
14893
|
-
}
|
|
14894
|
-
const fromExperiment = getValueByPath(fromObject, ['experiment']);
|
|
14895
|
-
if (fromExperiment != null) {
|
|
14896
|
-
setValueByPath(toObject, ['experiment'], fromExperiment);
|
|
14897
|
-
}
|
|
14898
|
-
const fromLabels = getValueByPath(fromObject, ['labels']);
|
|
14899
|
-
if (fromLabels != null) {
|
|
14900
|
-
setValueByPath(toObject, ['labels'], fromLabels);
|
|
14901
|
-
}
|
|
14902
|
-
const fromOutputUri = getValueByPath(fromObject, ['outputUri']);
|
|
14903
|
-
if (fromOutputUri != null) {
|
|
14904
|
-
setValueByPath(toObject, ['outputUri'], fromOutputUri);
|
|
14905
|
-
}
|
|
14906
|
-
const fromPipelineJob = getValueByPath(fromObject, ['pipelineJob']);
|
|
14907
|
-
if (fromPipelineJob != null) {
|
|
14908
|
-
setValueByPath(toObject, ['pipelineJob'], fromPipelineJob);
|
|
14909
|
-
}
|
|
14910
|
-
const fromServiceAccount = getValueByPath(fromObject, [
|
|
14911
|
-
'serviceAccount',
|
|
14912
|
-
]);
|
|
14913
|
-
if (fromServiceAccount != null) {
|
|
14914
|
-
setValueByPath(toObject, ['serviceAccount'], fromServiceAccount);
|
|
14915
|
-
}
|
|
14916
|
-
const fromTunedModelDisplayName = getValueByPath(fromObject, [
|
|
14917
|
-
'tunedModelDisplayName',
|
|
14918
|
-
]);
|
|
14919
|
-
if (fromTunedModelDisplayName != null) {
|
|
14920
|
-
setValueByPath(toObject, ['tunedModelDisplayName'], fromTunedModelDisplayName);
|
|
14921
|
-
}
|
|
14922
|
-
const fromVeoTuningSpec = getValueByPath(fromObject, [
|
|
14923
|
-
'veoTuningSpec',
|
|
14924
|
-
]);
|
|
14925
|
-
if (fromVeoTuningSpec != null) {
|
|
14926
|
-
setValueByPath(toObject, ['veoTuningSpec'], fromVeoTuningSpec);
|
|
14927
|
-
}
|
|
14928
14908
|
return toObject;
|
|
14929
14909
|
}
|
|
14930
14910
|
function tuningJobFromVertex(fromObject) {
|