@google/genai 1.24.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 -40
- package/dist/index.cjs +176 -148
- package/dist/index.mjs +176 -148
- package/dist/index.mjs.map +1 -1
- package/dist/node/index.cjs +178 -150
- package/dist/node/index.mjs +178 -150
- package/dist/node/index.mjs.map +1 -1
- package/dist/node/node.d.ts +61 -40
- package/dist/web/index.mjs +176 -148
- package/dist/web/index.mjs.map +1 -1
- package/dist/web/web.d.ts +61 -40
- package/package.json +8 -3
package/dist/genai.d.ts
CHANGED
|
@@ -467,7 +467,6 @@ export declare class Batches extends BaseModule {
|
|
|
467
467
|
*/
|
|
468
468
|
list: (params?: types.ListBatchJobsParameters) => Promise<Pager<types.BatchJob>>;
|
|
469
469
|
private createInlinedGenerateContentRequest;
|
|
470
|
-
private createInlinedEmbedContentRequest;
|
|
471
470
|
private getGcsUri;
|
|
472
471
|
private getBigqueryUri;
|
|
473
472
|
private formatDestination;
|
|
@@ -647,32 +646,40 @@ export { Blob_2 as Blob }
|
|
|
647
646
|
|
|
648
647
|
export declare type BlobImageUnion = Blob_2;
|
|
649
648
|
|
|
650
|
-
/** Output only.
|
|
649
|
+
/** Output only. The reason why the prompt was blocked. */
|
|
651
650
|
export declare enum BlockedReason {
|
|
652
651
|
/**
|
|
653
|
-
*
|
|
652
|
+
* The blocked reason is unspecified.
|
|
654
653
|
*/
|
|
655
654
|
BLOCKED_REASON_UNSPECIFIED = "BLOCKED_REASON_UNSPECIFIED",
|
|
656
655
|
/**
|
|
657
|
-
*
|
|
656
|
+
* The prompt was blocked for safety reasons.
|
|
658
657
|
*/
|
|
659
658
|
SAFETY = "SAFETY",
|
|
660
659
|
/**
|
|
661
|
-
*
|
|
660
|
+
* 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.
|
|
662
661
|
*/
|
|
663
662
|
OTHER = "OTHER",
|
|
664
663
|
/**
|
|
665
|
-
*
|
|
664
|
+
* The prompt was blocked because it contains a term from the terminology blocklist.
|
|
666
665
|
*/
|
|
667
666
|
BLOCKLIST = "BLOCKLIST",
|
|
668
667
|
/**
|
|
669
|
-
*
|
|
668
|
+
* The prompt was blocked because it contains prohibited content.
|
|
670
669
|
*/
|
|
671
670
|
PROHIBITED_CONTENT = "PROHIBITED_CONTENT",
|
|
672
671
|
/**
|
|
673
|
-
*
|
|
672
|
+
* The prompt was blocked because it contains content that is unsafe for image generation.
|
|
674
673
|
*/
|
|
675
|
-
IMAGE_SAFETY = "IMAGE_SAFETY"
|
|
674
|
+
IMAGE_SAFETY = "IMAGE_SAFETY",
|
|
675
|
+
/**
|
|
676
|
+
* The prompt was blocked by Model Armor.
|
|
677
|
+
*/
|
|
678
|
+
MODEL_ARMOR = "MODEL_ARMOR",
|
|
679
|
+
/**
|
|
680
|
+
* The prompt was blocked as a jailbreak attempt.
|
|
681
|
+
*/
|
|
682
|
+
JAILBREAK = "JAILBREAK"
|
|
676
683
|
}
|
|
677
684
|
|
|
678
685
|
/** A resource used in LLM queries for users to explicitly specify what to cache. */
|
|
@@ -2840,13 +2847,13 @@ export declare class GenerateContentResponse {
|
|
|
2840
2847
|
get codeExecutionResult(): string | undefined;
|
|
2841
2848
|
}
|
|
2842
2849
|
|
|
2843
|
-
/** Content filter results for a prompt sent in the request. */
|
|
2850
|
+
/** 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. */
|
|
2844
2851
|
export declare class GenerateContentResponsePromptFeedback {
|
|
2845
|
-
/** Output only.
|
|
2852
|
+
/** Output only. The reason why the prompt was blocked. */
|
|
2846
2853
|
blockReason?: BlockedReason;
|
|
2847
|
-
/** Output only. A readable
|
|
2854
|
+
/** Output only. A readable message that explains the reason why the prompt was blocked. */
|
|
2848
2855
|
blockReasonMessage?: string;
|
|
2849
|
-
/** Output only.
|
|
2856
|
+
/** Output only. A list of safety ratings for the prompt. There is one rating per category. */
|
|
2850
2857
|
safetyRatings?: SafetyRating[];
|
|
2851
2858
|
}
|
|
2852
2859
|
|
|
@@ -3147,11 +3154,13 @@ export declare interface GenerationConfig {
|
|
|
3147
3154
|
/** Optional. Controls the randomness of predictions. */
|
|
3148
3155
|
temperature?: number;
|
|
3149
3156
|
/** Optional. Config for thinking features. An error will be returned if this field is set for models that don't support thinking. */
|
|
3150
|
-
thinkingConfig?:
|
|
3157
|
+
thinkingConfig?: ThinkingConfig;
|
|
3151
3158
|
/** Optional. If specified, top-k sampling will be used. */
|
|
3152
3159
|
topK?: number;
|
|
3153
3160
|
/** Optional. If specified, nucleus sampling will be used. */
|
|
3154
3161
|
topP?: number;
|
|
3162
|
+
/** Optional. Enables enhanced civic answers. It may not be available for all models. */
|
|
3163
|
+
enableEnhancedCivicAnswers?: boolean;
|
|
3155
3164
|
}
|
|
3156
3165
|
|
|
3157
3166
|
/** The configuration for routing the request to a specific model. */
|
|
@@ -3174,12 +3183,12 @@ export declare interface GenerationConfigRoutingConfigManualRoutingMode {
|
|
|
3174
3183
|
modelName?: string;
|
|
3175
3184
|
}
|
|
3176
3185
|
|
|
3177
|
-
/**
|
|
3178
|
-
|
|
3179
|
-
|
|
3180
|
-
|
|
3181
|
-
|
|
3182
|
-
|
|
3186
|
+
/**
|
|
3187
|
+
* Config for thinking feature.
|
|
3188
|
+
*
|
|
3189
|
+
* @deprecated This interface will be deprecated. Please use `ThinkingConfig` instead.
|
|
3190
|
+
*/
|
|
3191
|
+
export declare interface GenerationConfigThinkingConfig extends ThinkingConfig {
|
|
3183
3192
|
}
|
|
3184
3193
|
|
|
3185
3194
|
/** Optional parameters. */
|
|
@@ -3443,8 +3452,7 @@ export declare interface GoogleSearch {
|
|
|
3443
3452
|
If customers set a start time, they must set an end time (and vice versa).
|
|
3444
3453
|
*/
|
|
3445
3454
|
timeRangeFilter?: Interval;
|
|
3446
|
-
/** Optional. List of domains to be excluded from the search results.
|
|
3447
|
-
The default limit is 2000 domains. */
|
|
3455
|
+
/** Optional. List of domains to be excluded from the search results. The default limit is 2000 domains. Example: ["amazon.com", "facebook.com"]. */
|
|
3448
3456
|
excludeDomains?: string[];
|
|
3449
3457
|
}
|
|
3450
3458
|
|
|
@@ -3636,22 +3644,22 @@ export declare enum HarmCategory {
|
|
|
3636
3644
|
* The harm category is unspecified.
|
|
3637
3645
|
*/
|
|
3638
3646
|
HARM_CATEGORY_UNSPECIFIED = "HARM_CATEGORY_UNSPECIFIED",
|
|
3639
|
-
/**
|
|
3640
|
-
* The harm category is hate speech.
|
|
3641
|
-
*/
|
|
3642
|
-
HARM_CATEGORY_HATE_SPEECH = "HARM_CATEGORY_HATE_SPEECH",
|
|
3643
|
-
/**
|
|
3644
|
-
* The harm category is dangerous content.
|
|
3645
|
-
*/
|
|
3646
|
-
HARM_CATEGORY_DANGEROUS_CONTENT = "HARM_CATEGORY_DANGEROUS_CONTENT",
|
|
3647
3647
|
/**
|
|
3648
3648
|
* The harm category is harassment.
|
|
3649
3649
|
*/
|
|
3650
3650
|
HARM_CATEGORY_HARASSMENT = "HARM_CATEGORY_HARASSMENT",
|
|
3651
|
+
/**
|
|
3652
|
+
* The harm category is hate speech.
|
|
3653
|
+
*/
|
|
3654
|
+
HARM_CATEGORY_HATE_SPEECH = "HARM_CATEGORY_HATE_SPEECH",
|
|
3651
3655
|
/**
|
|
3652
3656
|
* The harm category is sexually explicit content.
|
|
3653
3657
|
*/
|
|
3654
3658
|
HARM_CATEGORY_SEXUALLY_EXPLICIT = "HARM_CATEGORY_SEXUALLY_EXPLICIT",
|
|
3659
|
+
/**
|
|
3660
|
+
* The harm category is dangerous content.
|
|
3661
|
+
*/
|
|
3662
|
+
HARM_CATEGORY_DANGEROUS_CONTENT = "HARM_CATEGORY_DANGEROUS_CONTENT",
|
|
3655
3663
|
/**
|
|
3656
3664
|
* Deprecated: Election filter is not longer supported. The harm category is civic integrity.
|
|
3657
3665
|
*/
|
|
@@ -3671,7 +3679,11 @@ export declare enum HarmCategory {
|
|
|
3671
3679
|
/**
|
|
3672
3680
|
* The harm category is image sexually explicit content.
|
|
3673
3681
|
*/
|
|
3674
|
-
HARM_CATEGORY_IMAGE_SEXUALLY_EXPLICIT = "HARM_CATEGORY_IMAGE_SEXUALLY_EXPLICIT"
|
|
3682
|
+
HARM_CATEGORY_IMAGE_SEXUALLY_EXPLICIT = "HARM_CATEGORY_IMAGE_SEXUALLY_EXPLICIT",
|
|
3683
|
+
/**
|
|
3684
|
+
* The harm category is for jailbreak prompts.
|
|
3685
|
+
*/
|
|
3686
|
+
HARM_CATEGORY_JAILBREAK = "HARM_CATEGORY_JAILBREAK"
|
|
3675
3687
|
}
|
|
3676
3688
|
|
|
3677
3689
|
/** Output only. Harm probability levels in the content. */
|
|
@@ -4077,9 +4089,9 @@ export declare interface ListFilesParameters {
|
|
|
4077
4089
|
export declare class ListFilesResponse {
|
|
4078
4090
|
/** Used to retain the full HTTP response. */
|
|
4079
4091
|
sdkHttpResponse?: HttpResponse;
|
|
4080
|
-
/** A token
|
|
4092
|
+
/** A token that can be sent as a `page_token` into a subsequent `ListFiles` call. */
|
|
4081
4093
|
nextPageToken?: string;
|
|
4082
|
-
/** The list of
|
|
4094
|
+
/** The list of `File`s. */
|
|
4083
4095
|
files?: File_2[];
|
|
4084
4096
|
}
|
|
4085
4097
|
|
|
@@ -6906,10 +6918,18 @@ export declare interface Transcription {
|
|
|
6906
6918
|
finished?: boolean;
|
|
6907
6919
|
}
|
|
6908
6920
|
|
|
6921
|
+
/** TunedModel for the Tuned Model of a Tuning Job. */
|
|
6909
6922
|
export declare interface TunedModel {
|
|
6910
|
-
/** Output only. The resource name of the TunedModel.
|
|
6923
|
+
/** Output only. The resource name of the TunedModel.
|
|
6924
|
+
Format: `projects/{project}/locations/{location}/models/{model}@{version_id}`
|
|
6925
|
+
When tuning from a base model, the version_id will be 1.
|
|
6926
|
+
For continuous tuning, the version id will be incremented by 1 from the
|
|
6927
|
+
last version id in the parent model. E.g., `projects/{project}/locations/{location}/models/{model}@{last_version_id + 1}`
|
|
6928
|
+
*/
|
|
6911
6929
|
model?: string;
|
|
6912
|
-
/** Output only. A resource name of an Endpoint.
|
|
6930
|
+
/** Output only. A resource name of an Endpoint.
|
|
6931
|
+
Format: `projects/{project}/locations/{location}/endpoints/{endpoint}`.
|
|
6932
|
+
*/
|
|
6913
6933
|
endpoint?: string;
|
|
6914
6934
|
/** The checkpoints associated with this TunedModel.
|
|
6915
6935
|
This field is only populated for tuning jobs that enable intermediate
|
|
@@ -6964,11 +6984,12 @@ export declare interface TuningDataStats {
|
|
|
6964
6984
|
supervisedTuningDataStats?: SupervisedTuningDataStats;
|
|
6965
6985
|
}
|
|
6966
6986
|
|
|
6987
|
+
/** A single example for tuning. */
|
|
6967
6988
|
export declare interface TuningExample {
|
|
6968
|
-
/**
|
|
6969
|
-
textInput?: string;
|
|
6970
|
-
/** The expected model output. */
|
|
6989
|
+
/** Required. The expected model output. */
|
|
6971
6990
|
output?: string;
|
|
6991
|
+
/** Optional. Text model input. */
|
|
6992
|
+
textInput?: string;
|
|
6972
6993
|
}
|
|
6973
6994
|
|
|
6974
6995
|
/** A tuning job. */
|
|
@@ -7214,6 +7235,7 @@ declare namespace types {
|
|
|
7214
7235
|
createModelContent,
|
|
7215
7236
|
Outcome,
|
|
7216
7237
|
Language,
|
|
7238
|
+
FunctionResponseScheduling,
|
|
7217
7239
|
Type,
|
|
7218
7240
|
HarmCategory,
|
|
7219
7241
|
HarmBlockMethod,
|
|
@@ -7257,7 +7279,6 @@ declare namespace types {
|
|
|
7257
7279
|
EndSensitivity,
|
|
7258
7280
|
ActivityHandling,
|
|
7259
7281
|
TurnCoverage,
|
|
7260
|
-
FunctionResponseScheduling,
|
|
7261
7282
|
Scale,
|
|
7262
7283
|
MusicGenerationMode,
|
|
7263
7284
|
LiveMusicPlaybackControl,
|
|
@@ -7405,7 +7426,6 @@ declare namespace types {
|
|
|
7405
7426
|
DeleteModelConfig,
|
|
7406
7427
|
DeleteModelParameters,
|
|
7407
7428
|
DeleteModelResponse,
|
|
7408
|
-
GenerationConfigThinkingConfig,
|
|
7409
7429
|
GenerationConfig,
|
|
7410
7430
|
CountTokensConfig,
|
|
7411
7431
|
CountTokensParameters,
|
|
@@ -7541,6 +7561,7 @@ declare namespace types {
|
|
|
7541
7561
|
LiveServerSessionResumptionUpdate,
|
|
7542
7562
|
LiveServerMessage,
|
|
7543
7563
|
OperationFromAPIResponseParameters,
|
|
7564
|
+
GenerationConfigThinkingConfig,
|
|
7544
7565
|
AutomaticActivityDetection,
|
|
7545
7566
|
RealtimeInputConfig,
|
|
7546
7567
|
SessionResumptionConfig,
|