@google/genai 2.9.0 → 2.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/genai.d.ts +215 -19
- package/dist/index.cjs +134 -29
- package/dist/index.mjs +135 -30
- package/dist/index.mjs.map +1 -1
- package/dist/node/index.cjs +134 -29
- package/dist/node/index.mjs +135 -30
- package/dist/node/index.mjs.map +1 -1
- package/dist/node/node.d.ts +215 -19
- package/dist/tokenizer/node.cjs +56 -20
- package/dist/tokenizer/node.d.ts +41 -10
- package/dist/tokenizer/node.mjs +56 -20
- package/dist/tokenizer/node.mjs.map +1 -1
- package/dist/vertex_internal/index.cjs +57 -21
- package/dist/vertex_internal/index.cjs.map +1 -1
- package/dist/vertex_internal/index.d.ts +47 -15
- package/dist/vertex_internal/index.js +57 -21
- package/dist/vertex_internal/index.js.map +1 -1
- package/dist/web/index.mjs +135 -30
- package/dist/web/index.mjs.map +1 -1
- package/dist/web/web.d.ts +215 -19
- package/package.json +1 -1
package/dist/genai.d.ts
CHANGED
|
@@ -1031,7 +1031,7 @@ export declare interface BatchJob {
|
|
|
1031
1031
|
outputInfo?: BatchJobOutputInfo;
|
|
1032
1032
|
}
|
|
1033
1033
|
|
|
1034
|
-
/** Config for `
|
|
1034
|
+
/** Config for `dest` parameter. */
|
|
1035
1035
|
export declare interface BatchJobDestination {
|
|
1036
1036
|
/** Storage format of the output files. Must be one of:
|
|
1037
1037
|
'jsonl', 'bigquery', 'vertex-dataset'.
|
|
@@ -1752,15 +1752,12 @@ declare type ComputerUse$ = ComputerUse_2;
|
|
|
1752
1752
|
export declare interface ComputerUse {
|
|
1753
1753
|
/** Required. The environment being operated. */
|
|
1754
1754
|
environment?: Environment;
|
|
1755
|
-
/** By default, predefined functions are included in the final model call.
|
|
1756
|
-
Some of them can be explicitly excluded from being automatically included.
|
|
1757
|
-
This can serve two purposes:
|
|
1758
|
-
1. Using a more restricted / different action space.
|
|
1759
|
-
2. Improving the definitions / instructions of predefined functions. */
|
|
1755
|
+
/** Optional. By default, [predefined functions](https://cloud.google.com/vertex-ai/generative-ai/docs/computer-use#supported-actions) are included in the final model call. Some of them can be explicitly excluded from being automatically included. This can serve two purposes: 1. Using a more restricted / different action space. 2. Improving the definitions / instructions of predefined functions. */
|
|
1760
1756
|
excludedPredefinedFunctions?: string[];
|
|
1761
|
-
/** Optional.
|
|
1762
|
-
*/
|
|
1757
|
+
/** Optional. Enables the prompt injection detection check on computer-use request. */
|
|
1763
1758
|
enablePromptInjectionDetection?: boolean;
|
|
1759
|
+
/** Optional. Disabled safety policies for computer use. This field is not supported in Vertex AI. */
|
|
1760
|
+
disabledSafetyPolicies?: SafetyPolicy[];
|
|
1764
1761
|
}
|
|
1765
1762
|
|
|
1766
1763
|
/**
|
|
@@ -1783,6 +1780,10 @@ declare type ComputerUse_2 = {
|
|
|
1783
1780
|
* request.
|
|
1784
1781
|
*/
|
|
1785
1782
|
enable_prompt_injection_detection?: boolean | undefined;
|
|
1783
|
+
/**
|
|
1784
|
+
* Optional. Disabled safety policies for computer use.
|
|
1785
|
+
*/
|
|
1786
|
+
disabled_safety_policies?: Array<DisabledSafetyPolicy> | undefined;
|
|
1786
1787
|
};
|
|
1787
1788
|
|
|
1788
1789
|
/** Optional parameters for computing tokens. */
|
|
@@ -2935,6 +2936,8 @@ declare type DeleteWebhookRequest = {
|
|
|
2935
2936
|
*/
|
|
2936
2937
|
declare type Disabled = "disabled";
|
|
2937
2938
|
|
|
2939
|
+
declare type DisabledSafetyPolicy = "financial_transactions" | "sensitive_data_modification" | "communication_tool" | "account_creation" | "data_modification" | "user_consent_management" | "legal_terms_and_agreements" | (string & {});
|
|
2940
|
+
|
|
2938
2941
|
/** Statistics for distillation prompt dataset. These statistics do not include the responses sampled from the teacher model. This data type is not supported in Gemini API. */
|
|
2939
2942
|
export declare interface DistillationDataStats {
|
|
2940
2943
|
/** Output only. Statistics computed for the training dataset. */
|
|
@@ -3550,6 +3553,8 @@ declare type EnvironmentNetworkEgressAllowlist = Allowlist | Disabled;
|
|
|
3550
3553
|
|
|
3551
3554
|
declare type Error$ = ErrorT;
|
|
3552
3555
|
|
|
3556
|
+
declare type Error$2 = Status;
|
|
3557
|
+
|
|
3553
3558
|
declare type ErrorEvent$ = ErrorEvent_2;
|
|
3554
3559
|
|
|
3555
3560
|
declare type ErrorEvent_2 = {
|
|
@@ -3845,7 +3850,7 @@ export declare class Files extends BaseModule {
|
|
|
3845
3850
|
* file extension.
|
|
3846
3851
|
* - For Blob object inputs, the `mimeType` will be set to the Blob's `type`
|
|
3847
3852
|
* property.
|
|
3848
|
-
*
|
|
3853
|
+
* Some examples for file extension to mimeType mapping:
|
|
3849
3854
|
* .txt -> text/plain
|
|
3850
3855
|
* .json -> application/json
|
|
3851
3856
|
* .jpg -> image/jpeg
|
|
@@ -5344,6 +5349,10 @@ declare type GenerationConfig_2 = {
|
|
|
5344
5349
|
* @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
|
|
5345
5350
|
*/
|
|
5346
5351
|
image_config?: ImageConfig_2 | undefined;
|
|
5352
|
+
/**
|
|
5353
|
+
* Configuration options for video generation.
|
|
5354
|
+
*/
|
|
5355
|
+
video_config?: VideoConfig | undefined;
|
|
5347
5356
|
/**
|
|
5348
5357
|
* Penalizes tokens that have already appeared in the generated
|
|
5349
5358
|
*
|
|
@@ -7216,7 +7225,8 @@ export declare namespace Interactions {
|
|
|
7216
7225
|
export type MCPServerToolCallStep = MCPServerToolCallStep$;
|
|
7217
7226
|
export type MCPServerToolResultStep = MCPServerToolResultStep$;
|
|
7218
7227
|
export type Model = Model$;
|
|
7219
|
-
export
|
|
7228
|
+
export interface ModelOutputStep extends ModelOutputStep$ {
|
|
7229
|
+
}
|
|
7220
7230
|
export interface PlaceCitation extends PlaceCitation$ {
|
|
7221
7231
|
}
|
|
7222
7232
|
export type SpeechConfig = SpeechConfig$;
|
|
@@ -7244,7 +7254,9 @@ export declare namespace Interactions {
|
|
|
7244
7254
|
export interface Usage extends Usage$ {
|
|
7245
7255
|
}
|
|
7246
7256
|
export type UserInputStep = UserInputStep$;
|
|
7257
|
+
export type VideoConfig = VideoConfig$;
|
|
7247
7258
|
export type VideoContent = VideoContent$;
|
|
7259
|
+
export type VideoResponseFormat = VideoResponseFormat$;
|
|
7248
7260
|
export type WebhookConfig = WebhookConfig$;
|
|
7249
7261
|
export namespace CodeExecutionCallStep {
|
|
7250
7262
|
export type Arguments = Arguments$;
|
|
@@ -7301,6 +7313,9 @@ export declare namespace Interactions {
|
|
|
7301
7313
|
export namespace InteractionStatusUpdate {
|
|
7302
7314
|
export type Metadata = Metadata$4;
|
|
7303
7315
|
}
|
|
7316
|
+
export namespace ModelOutputStep {
|
|
7317
|
+
export type Error = Error$2;
|
|
7318
|
+
}
|
|
7304
7319
|
export namespace PlaceCitation {
|
|
7305
7320
|
export type ReviewSnippet = ReviewSnippet$3;
|
|
7306
7321
|
}
|
|
@@ -7386,6 +7401,7 @@ declare namespace interactions {
|
|
|
7386
7401
|
CodeExecutionResultStep,
|
|
7387
7402
|
CodeExecution,
|
|
7388
7403
|
EnvironmentEnum,
|
|
7404
|
+
DisabledSafetyPolicy,
|
|
7389
7405
|
ComputerUse_2 as ComputerUse,
|
|
7390
7406
|
Content_2 as Content,
|
|
7391
7407
|
CreateAgentInteractionResponseFormat,
|
|
@@ -7505,6 +7521,7 @@ declare namespace interactions {
|
|
|
7505
7521
|
SourceType,
|
|
7506
7522
|
Source,
|
|
7507
7523
|
SpeechConfig_2 as SpeechConfig,
|
|
7524
|
+
Status,
|
|
7508
7525
|
StepDeltaData,
|
|
7509
7526
|
StepDeltaMetadata,
|
|
7510
7527
|
StepDelta,
|
|
@@ -7541,10 +7558,15 @@ declare namespace interactions {
|
|
|
7541
7558
|
Usage,
|
|
7542
7559
|
UserInputStep,
|
|
7543
7560
|
VertexAISearchConfig,
|
|
7561
|
+
Task,
|
|
7562
|
+
VideoConfig,
|
|
7544
7563
|
VideoContentMimeType,
|
|
7545
7564
|
VideoContent,
|
|
7546
7565
|
VideoDeltaMimeType,
|
|
7547
7566
|
VideoDelta,
|
|
7567
|
+
VideoResponseFormatDelivery,
|
|
7568
|
+
VideoResponseFormatAspectRatio,
|
|
7569
|
+
VideoResponseFormat,
|
|
7548
7570
|
WebhookConfig_2 as WebhookConfig
|
|
7549
7571
|
}
|
|
7550
7572
|
}
|
|
@@ -8771,9 +8793,9 @@ export declare interface LiveServerSessionResumptionUpdate {
|
|
|
8771
8793
|
resumable?: boolean;
|
|
8772
8794
|
/** Index of last message sent by client that is included in state represented by this SessionResumptionToken. Only sent when `SessionResumptionConfig.transparent` is set.
|
|
8773
8795
|
|
|
8774
|
-
Presence of this index allows users to transparently reconnect and avoid issue of losing some part of realtime audio input/video. If client wishes to temporarily disconnect (for example as result of receiving GoAway) they can do it without losing state by buffering messages sent since last `
|
|
8796
|
+
Presence of this index allows users to transparently reconnect and avoid issue of losing some part of realtime audio input/video. If client wishes to temporarily disconnect (for example as result of receiving GoAway) they can do it without losing state by buffering messages sent since last `SessionResumptionTokenUpdate`. This field will enable them to limit buffering (avoid keeping all requests in RAM).
|
|
8775
8797
|
|
|
8776
|
-
Note: This should not be used for when resuming a session at some time later -- in those cases partial audio and video frames
|
|
8798
|
+
Note: This should not be used for when resuming a session at some time later -- in those cases partial audio and video frames are likely not needed. */
|
|
8777
8799
|
lastConsumedClientMessageIndex?: string;
|
|
8778
8800
|
}
|
|
8779
8801
|
|
|
@@ -9235,6 +9257,18 @@ declare type ModelOutputStep$ = ModelOutputStep;
|
|
|
9235
9257
|
declare type ModelOutputStep = {
|
|
9236
9258
|
type: "model_output";
|
|
9237
9259
|
content?: Array<Content_2> | undefined;
|
|
9260
|
+
/**
|
|
9261
|
+
* The `Status` type defines a logical error model that is suitable for
|
|
9262
|
+
*
|
|
9263
|
+
* @remarks
|
|
9264
|
+
* different programming environments, including REST APIs and RPC APIs. It is
|
|
9265
|
+
* used by [gRPC](https://github.com/grpc). Each `Status` message contains
|
|
9266
|
+
* three pieces of data: error code, error message, and error details.
|
|
9267
|
+
*
|
|
9268
|
+
* You can find out more about this error model and how to work with it in the
|
|
9269
|
+
* [API Design Guide](https://cloud.google.com/apis/design/errors).
|
|
9270
|
+
*/
|
|
9271
|
+
error?: Status | undefined;
|
|
9238
9272
|
};
|
|
9239
9273
|
|
|
9240
9274
|
export declare class Models extends BaseModule {
|
|
@@ -9308,7 +9342,7 @@ export declare class Models extends BaseModule {
|
|
|
9308
9342
|
* To maintain backward compatibility, we move the data that was treated as
|
|
9309
9343
|
* JSON schema from the responseSchema field to the responseJsonSchema field.
|
|
9310
9344
|
*/
|
|
9311
|
-
private
|
|
9345
|
+
private maybeMoveToResponseJsonSchema;
|
|
9312
9346
|
/**
|
|
9313
9347
|
* Makes an API request to generate content with a given model and yields the
|
|
9314
9348
|
* response in chunks.
|
|
@@ -10836,7 +10870,7 @@ export declare enum ResourceScope {
|
|
|
10836
10870
|
COLLECTION = "COLLECTION"
|
|
10837
10871
|
}
|
|
10838
10872
|
|
|
10839
|
-
declare type ResponseFormat = AudioResponseFormat | TextResponseFormat | ImageResponseFormat | {
|
|
10873
|
+
declare type ResponseFormat = AudioResponseFormat | TextResponseFormat | ImageResponseFormat | VideoResponseFormat | {
|
|
10840
10874
|
[k: string]: any;
|
|
10841
10875
|
};
|
|
10842
10876
|
|
|
@@ -11028,6 +11062,42 @@ export declare enum SafetyFilterLevel {
|
|
|
11028
11062
|
BLOCK_NONE = "BLOCK_NONE"
|
|
11029
11063
|
}
|
|
11030
11064
|
|
|
11065
|
+
/** SafetyPolicy */
|
|
11066
|
+
export declare enum SafetyPolicy {
|
|
11067
|
+
/**
|
|
11068
|
+
* Unspecified safety policy.
|
|
11069
|
+
*/
|
|
11070
|
+
SAFETY_POLICY_UNSPECIFIED = "SAFETY_POLICY_UNSPECIFIED",
|
|
11071
|
+
/**
|
|
11072
|
+
* Safety policy for financial transactions.
|
|
11073
|
+
*/
|
|
11074
|
+
FINANCIAL_TRANSACTIONS = "FINANCIAL_TRANSACTIONS",
|
|
11075
|
+
/**
|
|
11076
|
+
* Safety policy for sensitive data modification.
|
|
11077
|
+
*/
|
|
11078
|
+
SENSITIVE_DATA_MODIFICATION = "SENSITIVE_DATA_MODIFICATION",
|
|
11079
|
+
/**
|
|
11080
|
+
* Safety policy for communication tools (e.g. Gmail, Chat, Meet).
|
|
11081
|
+
*/
|
|
11082
|
+
COMMUNICATION_TOOL = "COMMUNICATION_TOOL",
|
|
11083
|
+
/**
|
|
11084
|
+
* Safety policy for account creation.
|
|
11085
|
+
*/
|
|
11086
|
+
ACCOUNT_CREATION = "ACCOUNT_CREATION",
|
|
11087
|
+
/**
|
|
11088
|
+
* Safety policy for data modification.
|
|
11089
|
+
*/
|
|
11090
|
+
DATA_MODIFICATION = "DATA_MODIFICATION",
|
|
11091
|
+
/**
|
|
11092
|
+
* Safety policy for user consent management.
|
|
11093
|
+
*/
|
|
11094
|
+
USER_CONSENT_MANAGEMENT = "USER_CONSENT_MANAGEMENT",
|
|
11095
|
+
/**
|
|
11096
|
+
* Safety policy for legal terms and agreements.
|
|
11097
|
+
*/
|
|
11098
|
+
LEGAL_TERMS_AND_AGREEMENTS = "LEGAL_TERMS_AND_AGREEMENTS"
|
|
11099
|
+
}
|
|
11100
|
+
|
|
11031
11101
|
/** A safety rating for a piece of content. The safety rating contains the harm category and the harm probability level. */
|
|
11032
11102
|
export declare interface SafetyRating {
|
|
11033
11103
|
/** Output only. Indicates whether the content was blocked because of this rating. */
|
|
@@ -11656,6 +11726,48 @@ export declare enum StartSensitivity {
|
|
|
11656
11726
|
START_SENSITIVITY_LOW = "START_SENSITIVITY_LOW"
|
|
11657
11727
|
}
|
|
11658
11728
|
|
|
11729
|
+
/**
|
|
11730
|
+
* @license
|
|
11731
|
+
* Copyright 2026 Google LLC
|
|
11732
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
11733
|
+
*
|
|
11734
|
+
* g3-prettier-ignore-file
|
|
11735
|
+
*/
|
|
11736
|
+
/**
|
|
11737
|
+
* The `Status` type defines a logical error model that is suitable for
|
|
11738
|
+
*
|
|
11739
|
+
* @remarks
|
|
11740
|
+
* different programming environments, including REST APIs and RPC APIs. It is
|
|
11741
|
+
* used by [gRPC](https://github.com/grpc). Each `Status` message contains
|
|
11742
|
+
* three pieces of data: error code, error message, and error details.
|
|
11743
|
+
*
|
|
11744
|
+
* You can find out more about this error model and how to work with it in the
|
|
11745
|
+
* [API Design Guide](https://cloud.google.com/apis/design/errors).
|
|
11746
|
+
*/
|
|
11747
|
+
declare type Status = {
|
|
11748
|
+
/**
|
|
11749
|
+
* The status code, which should be an enum value of google.rpc.Code.
|
|
11750
|
+
*/
|
|
11751
|
+
code?: number | undefined;
|
|
11752
|
+
/**
|
|
11753
|
+
* A developer-facing error message, which should be in English. Any
|
|
11754
|
+
*
|
|
11755
|
+
* @remarks
|
|
11756
|
+
* user-facing error message should be localized and sent in the
|
|
11757
|
+
* google.rpc.Status.details field, or localized by the client.
|
|
11758
|
+
*/
|
|
11759
|
+
message?: string | undefined;
|
|
11760
|
+
/**
|
|
11761
|
+
* A list of messages that carry the error details. There is a common set of
|
|
11762
|
+
*
|
|
11763
|
+
* @remarks
|
|
11764
|
+
* message types for APIs to use.
|
|
11765
|
+
*/
|
|
11766
|
+
details?: Array<{
|
|
11767
|
+
[k: string]: any;
|
|
11768
|
+
}> | undefined;
|
|
11769
|
+
};
|
|
11770
|
+
|
|
11659
11771
|
declare type Step$ = Step;
|
|
11660
11772
|
|
|
11661
11773
|
/**
|
|
@@ -11718,6 +11830,14 @@ declare type StepStop$ = StepStop;
|
|
|
11718
11830
|
declare type StepStop = {
|
|
11719
11831
|
event_type: "step.stop";
|
|
11720
11832
|
index: number;
|
|
11833
|
+
/**
|
|
11834
|
+
* Statistics on the interaction request's token usage.
|
|
11835
|
+
*/
|
|
11836
|
+
usage?: Usage | undefined;
|
|
11837
|
+
/**
|
|
11838
|
+
* Statistics on the interaction request's token usage.
|
|
11839
|
+
*/
|
|
11840
|
+
step_usage?: Usage | undefined;
|
|
11721
11841
|
/**
|
|
11722
11842
|
* The event_id token to be used to resume the interaction stream, from
|
|
11723
11843
|
*
|
|
@@ -11930,6 +12050,22 @@ export declare interface SupervisedTuningSpec {
|
|
|
11930
12050
|
validationDatasetUri?: string;
|
|
11931
12051
|
}
|
|
11932
12052
|
|
|
12053
|
+
/**
|
|
12054
|
+
* @license
|
|
12055
|
+
* Copyright 2026 Google LLC
|
|
12056
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
12057
|
+
*
|
|
12058
|
+
* g3-prettier-ignore-file
|
|
12059
|
+
*/
|
|
12060
|
+
/**
|
|
12061
|
+
* Optional task mode for video generation. If not specified, the model
|
|
12062
|
+
*
|
|
12063
|
+
* @remarks
|
|
12064
|
+
* automatically determines the appropriate mode based on the provided text
|
|
12065
|
+
* prompt and input media.
|
|
12066
|
+
*/
|
|
12067
|
+
declare type Task = "text_to_video" | "image_to_video" | "reference_to_video" | "edit" | (string & {});
|
|
12068
|
+
|
|
11933
12069
|
export declare interface TestTableFile {
|
|
11934
12070
|
comment?: string;
|
|
11935
12071
|
testMethod?: string;
|
|
@@ -12239,9 +12375,7 @@ declare type Tool$ = Tool_2;
|
|
|
12239
12375
|
export declare interface Tool {
|
|
12240
12376
|
/** Optional. Retrieval tool type. System will always execute the provided retrieval tool(s) to get external knowledge to answer the prompt. Retrieval results are presented to the model for generation. This field is not supported in Gemini API. */
|
|
12241
12377
|
retrieval?: Retrieval;
|
|
12242
|
-
/** Optional. Tool to support the model interacting directly with the
|
|
12243
|
-
computer. If enabled, it automatically populates computer-use specific
|
|
12244
|
-
Function Declarations. */
|
|
12378
|
+
/** Optional. Tool to support the model interacting directly with the computer. If enabled, it automatically populates computer-use specific Function Declarations. */
|
|
12245
12379
|
computerUse?: ComputerUse;
|
|
12246
12380
|
/** Optional. FileSearch tool type. Tool to retrieve knowledge from Semantic Retrieval corpora. This field is not supported in Vertex AI. */
|
|
12247
12381
|
fileSearch?: FileSearch;
|
|
@@ -12963,10 +13097,11 @@ declare namespace types {
|
|
|
12963
13097
|
Language,
|
|
12964
13098
|
FunctionResponseScheduling,
|
|
12965
13099
|
Type,
|
|
12966
|
-
Environment,
|
|
12967
13100
|
AuthType,
|
|
12968
13101
|
HttpElementLocation,
|
|
12969
13102
|
ApiSpec,
|
|
13103
|
+
Environment,
|
|
13104
|
+
SafetyPolicy,
|
|
12970
13105
|
PhishBlockThreshold,
|
|
12971
13106
|
Behavior,
|
|
12972
13107
|
DynamicRetrievalConfigMode,
|
|
@@ -13050,7 +13185,6 @@ declare namespace types {
|
|
|
13050
13185
|
HttpOptions,
|
|
13051
13186
|
Schema,
|
|
13052
13187
|
ModelSelectionConfig,
|
|
13053
|
-
ComputerUse,
|
|
13054
13188
|
ApiKeyConfig,
|
|
13055
13189
|
AuthConfigGoogleServiceAccountConfig,
|
|
13056
13190
|
AuthConfigHttpBasicAuthConfig,
|
|
@@ -13074,6 +13208,7 @@ declare namespace types {
|
|
|
13074
13208
|
RagRetrievalConfig,
|
|
13075
13209
|
VertexRagStore,
|
|
13076
13210
|
Retrieval,
|
|
13211
|
+
ComputerUse,
|
|
13077
13212
|
FileSearch,
|
|
13078
13213
|
WebSearch,
|
|
13079
13214
|
ImageSearch,
|
|
@@ -14244,6 +14379,22 @@ export declare enum VideoCompressionQuality {
|
|
|
14244
14379
|
LOSSLESS = "LOSSLESS"
|
|
14245
14380
|
}
|
|
14246
14381
|
|
|
14382
|
+
declare type VideoConfig$ = VideoConfig;
|
|
14383
|
+
|
|
14384
|
+
/**
|
|
14385
|
+
* Configuration options for video generation.
|
|
14386
|
+
*/
|
|
14387
|
+
declare type VideoConfig = {
|
|
14388
|
+
/**
|
|
14389
|
+
* Optional task mode for video generation. If not specified, the model
|
|
14390
|
+
*
|
|
14391
|
+
* @remarks
|
|
14392
|
+
* automatically determines the appropriate mode based on the provided text
|
|
14393
|
+
* prompt and input media.
|
|
14394
|
+
*/
|
|
14395
|
+
task?: Task | undefined;
|
|
14396
|
+
};
|
|
14397
|
+
|
|
14247
14398
|
declare type VideoContent$ = VideoContent;
|
|
14248
14399
|
|
|
14249
14400
|
/**
|
|
@@ -14368,6 +14519,51 @@ export declare enum VideoOrientation {
|
|
|
14368
14519
|
PORTRAIT = "PORTRAIT"
|
|
14369
14520
|
}
|
|
14370
14521
|
|
|
14522
|
+
declare type VideoResponseFormat$ = VideoResponseFormat;
|
|
14523
|
+
|
|
14524
|
+
/**
|
|
14525
|
+
* Configuration for video output format.
|
|
14526
|
+
*/
|
|
14527
|
+
declare type VideoResponseFormat = {
|
|
14528
|
+
type: "video";
|
|
14529
|
+
/**
|
|
14530
|
+
* The delivery mode for the video output.
|
|
14531
|
+
*/
|
|
14532
|
+
delivery?: VideoResponseFormatDelivery | undefined;
|
|
14533
|
+
/**
|
|
14534
|
+
* The GCS URI to store the video output. Required for Vertex if delivery mode
|
|
14535
|
+
*
|
|
14536
|
+
* @remarks
|
|
14537
|
+
* is URI.
|
|
14538
|
+
*/
|
|
14539
|
+
gcs_uri?: string | undefined;
|
|
14540
|
+
/**
|
|
14541
|
+
* The aspect ratio for the video output.
|
|
14542
|
+
*/
|
|
14543
|
+
aspect_ratio?: VideoResponseFormatAspectRatio | undefined;
|
|
14544
|
+
/**
|
|
14545
|
+
* The duration for the video output.
|
|
14546
|
+
*/
|
|
14547
|
+
duration?: string | undefined;
|
|
14548
|
+
};
|
|
14549
|
+
|
|
14550
|
+
/**
|
|
14551
|
+
* The aspect ratio for the video output.
|
|
14552
|
+
*/
|
|
14553
|
+
declare type VideoResponseFormatAspectRatio = "16:9" | "9:16" | (string & {});
|
|
14554
|
+
|
|
14555
|
+
/**
|
|
14556
|
+
* @license
|
|
14557
|
+
* Copyright 2026 Google LLC
|
|
14558
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
14559
|
+
*
|
|
14560
|
+
* g3-prettier-ignore-file
|
|
14561
|
+
*/
|
|
14562
|
+
/**
|
|
14563
|
+
* The delivery mode for the video output.
|
|
14564
|
+
*/
|
|
14565
|
+
declare type VideoResponseFormatDelivery = "inline" | "uri" | (string & {});
|
|
14566
|
+
|
|
14371
14567
|
/**
|
|
14372
14568
|
* Whether to include visualizations in the response.
|
|
14373
14569
|
*/
|
package/dist/index.cjs
CHANGED
|
@@ -646,26 +646,6 @@ exports.Type = void 0;
|
|
|
646
646
|
*/
|
|
647
647
|
Type["NULL"] = "NULL";
|
|
648
648
|
})(exports.Type || (exports.Type = {}));
|
|
649
|
-
/** The environment being operated. */
|
|
650
|
-
exports.Environment = void 0;
|
|
651
|
-
(function (Environment) {
|
|
652
|
-
/**
|
|
653
|
-
* Defaults to browser.
|
|
654
|
-
*/
|
|
655
|
-
Environment["ENVIRONMENT_UNSPECIFIED"] = "ENVIRONMENT_UNSPECIFIED";
|
|
656
|
-
/**
|
|
657
|
-
* Operates in a web browser.
|
|
658
|
-
*/
|
|
659
|
-
Environment["ENVIRONMENT_BROWSER"] = "ENVIRONMENT_BROWSER";
|
|
660
|
-
/**
|
|
661
|
-
* Operates in a mobile environment.
|
|
662
|
-
*/
|
|
663
|
-
Environment["ENVIRONMENT_MOBILE"] = "ENVIRONMENT_MOBILE";
|
|
664
|
-
/**
|
|
665
|
-
* Operates in a desktop environment.
|
|
666
|
-
*/
|
|
667
|
-
Environment["ENVIRONMENT_DESKTOP"] = "ENVIRONMENT_DESKTOP";
|
|
668
|
-
})(exports.Environment || (exports.Environment = {}));
|
|
669
649
|
/** Type of auth scheme. This enum is not supported in Gemini API. */
|
|
670
650
|
exports.AuthType = void 0;
|
|
671
651
|
(function (AuthType) {
|
|
@@ -736,6 +716,62 @@ exports.ApiSpec = void 0;
|
|
|
736
716
|
*/
|
|
737
717
|
ApiSpec["ELASTIC_SEARCH"] = "ELASTIC_SEARCH";
|
|
738
718
|
})(exports.ApiSpec || (exports.ApiSpec = {}));
|
|
719
|
+
/** The environment being operated. */
|
|
720
|
+
exports.Environment = void 0;
|
|
721
|
+
(function (Environment) {
|
|
722
|
+
/**
|
|
723
|
+
* Defaults to browser.
|
|
724
|
+
*/
|
|
725
|
+
Environment["ENVIRONMENT_UNSPECIFIED"] = "ENVIRONMENT_UNSPECIFIED";
|
|
726
|
+
/**
|
|
727
|
+
* Operates in a web browser.
|
|
728
|
+
*/
|
|
729
|
+
Environment["ENVIRONMENT_BROWSER"] = "ENVIRONMENT_BROWSER";
|
|
730
|
+
/**
|
|
731
|
+
* Operates in a mobile environment.
|
|
732
|
+
*/
|
|
733
|
+
Environment["ENVIRONMENT_MOBILE"] = "ENVIRONMENT_MOBILE";
|
|
734
|
+
/**
|
|
735
|
+
* Operates in a desktop environment.
|
|
736
|
+
*/
|
|
737
|
+
Environment["ENVIRONMENT_DESKTOP"] = "ENVIRONMENT_DESKTOP";
|
|
738
|
+
})(exports.Environment || (exports.Environment = {}));
|
|
739
|
+
/** SafetyPolicy */
|
|
740
|
+
exports.SafetyPolicy = void 0;
|
|
741
|
+
(function (SafetyPolicy) {
|
|
742
|
+
/**
|
|
743
|
+
* Unspecified safety policy.
|
|
744
|
+
*/
|
|
745
|
+
SafetyPolicy["SAFETY_POLICY_UNSPECIFIED"] = "SAFETY_POLICY_UNSPECIFIED";
|
|
746
|
+
/**
|
|
747
|
+
* Safety policy for financial transactions.
|
|
748
|
+
*/
|
|
749
|
+
SafetyPolicy["FINANCIAL_TRANSACTIONS"] = "FINANCIAL_TRANSACTIONS";
|
|
750
|
+
/**
|
|
751
|
+
* Safety policy for sensitive data modification.
|
|
752
|
+
*/
|
|
753
|
+
SafetyPolicy["SENSITIVE_DATA_MODIFICATION"] = "SENSITIVE_DATA_MODIFICATION";
|
|
754
|
+
/**
|
|
755
|
+
* Safety policy for communication tools (e.g. Gmail, Chat, Meet).
|
|
756
|
+
*/
|
|
757
|
+
SafetyPolicy["COMMUNICATION_TOOL"] = "COMMUNICATION_TOOL";
|
|
758
|
+
/**
|
|
759
|
+
* Safety policy for account creation.
|
|
760
|
+
*/
|
|
761
|
+
SafetyPolicy["ACCOUNT_CREATION"] = "ACCOUNT_CREATION";
|
|
762
|
+
/**
|
|
763
|
+
* Safety policy for data modification.
|
|
764
|
+
*/
|
|
765
|
+
SafetyPolicy["DATA_MODIFICATION"] = "DATA_MODIFICATION";
|
|
766
|
+
/**
|
|
767
|
+
* Safety policy for user consent management.
|
|
768
|
+
*/
|
|
769
|
+
SafetyPolicy["USER_CONSENT_MANAGEMENT"] = "USER_CONSENT_MANAGEMENT";
|
|
770
|
+
/**
|
|
771
|
+
* Safety policy for legal terms and agreements.
|
|
772
|
+
*/
|
|
773
|
+
SafetyPolicy["LEGAL_TERMS_AND_AGREEMENTS"] = "LEGAL_TERMS_AND_AGREEMENTS";
|
|
774
|
+
})(exports.SafetyPolicy || (exports.SafetyPolicy = {}));
|
|
739
775
|
/** Sites with confidence level chosen & above this value will be blocked from the search results. This enum is not supported in Gemini API. */
|
|
740
776
|
exports.PhishBlockThreshold = void 0;
|
|
741
777
|
(function (PhishBlockThreshold) {
|
|
@@ -5915,6 +5951,29 @@ function codeExecutionResultToVertex$3(fromObject) {
|
|
|
5915
5951
|
}
|
|
5916
5952
|
return toObject;
|
|
5917
5953
|
}
|
|
5954
|
+
function computerUseToVertex$2(fromObject) {
|
|
5955
|
+
const toObject = {};
|
|
5956
|
+
const fromEnvironment = getValueByPath(fromObject, ['environment']);
|
|
5957
|
+
if (fromEnvironment != null) {
|
|
5958
|
+
setValueByPath(toObject, ['environment'], fromEnvironment);
|
|
5959
|
+
}
|
|
5960
|
+
const fromExcludedPredefinedFunctions = getValueByPath(fromObject, [
|
|
5961
|
+
'excludedPredefinedFunctions',
|
|
5962
|
+
]);
|
|
5963
|
+
if (fromExcludedPredefinedFunctions != null) {
|
|
5964
|
+
setValueByPath(toObject, ['excludedPredefinedFunctions'], fromExcludedPredefinedFunctions);
|
|
5965
|
+
}
|
|
5966
|
+
const fromEnablePromptInjectionDetection = getValueByPath(fromObject, [
|
|
5967
|
+
'enablePromptInjectionDetection',
|
|
5968
|
+
]);
|
|
5969
|
+
if (fromEnablePromptInjectionDetection != null) {
|
|
5970
|
+
setValueByPath(toObject, ['enablePromptInjectionDetection'], fromEnablePromptInjectionDetection);
|
|
5971
|
+
}
|
|
5972
|
+
if (getValueByPath(fromObject, ['disabledSafetyPolicies']) !== undefined) {
|
|
5973
|
+
throw new Error('disabledSafetyPolicies parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
5974
|
+
}
|
|
5975
|
+
return toObject;
|
|
5976
|
+
}
|
|
5918
5977
|
function contentToMldev$3(fromObject) {
|
|
5919
5978
|
const toObject = {};
|
|
5920
5979
|
const fromParts = getValueByPath(fromObject, ['parts']);
|
|
@@ -6590,7 +6649,7 @@ function toolToVertex$2(fromObject) {
|
|
|
6590
6649
|
}
|
|
6591
6650
|
const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
|
|
6592
6651
|
if (fromComputerUse != null) {
|
|
6593
|
-
setValueByPath(toObject, ['computerUse'], fromComputerUse);
|
|
6652
|
+
setValueByPath(toObject, ['computerUse'], computerUseToVertex$2(fromComputerUse));
|
|
6594
6653
|
}
|
|
6595
6654
|
if (getValueByPath(fromObject, ['fileSearch']) !== undefined) {
|
|
6596
6655
|
throw new Error('fileSearch parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
@@ -7741,7 +7800,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
|
|
|
7741
7800
|
const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
|
|
7742
7801
|
const USER_AGENT_HEADER = 'User-Agent';
|
|
7743
7802
|
const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
|
|
7744
|
-
const SDK_VERSION = '2.
|
|
7803
|
+
const SDK_VERSION = '2.10.0'; // x-release-please-version
|
|
7745
7804
|
const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
|
|
7746
7805
|
const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
|
|
7747
7806
|
const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';
|
|
@@ -8750,7 +8809,7 @@ class Files extends BaseModule {
|
|
|
8750
8809
|
* file extension.
|
|
8751
8810
|
* - For Blob object inputs, the `mimeType` will be set to the Blob's `type`
|
|
8752
8811
|
* property.
|
|
8753
|
-
*
|
|
8812
|
+
* Some examples for file extension to mimeType mapping:
|
|
8754
8813
|
* .txt -> text/plain
|
|
8755
8814
|
* .json -> application/json
|
|
8756
8815
|
* .jpg -> image/jpeg
|
|
@@ -13997,6 +14056,29 @@ function codeExecutionResultToVertex$2(fromObject) {
|
|
|
13997
14056
|
}
|
|
13998
14057
|
return toObject;
|
|
13999
14058
|
}
|
|
14059
|
+
function computerUseToVertex$1(fromObject) {
|
|
14060
|
+
const toObject = {};
|
|
14061
|
+
const fromEnvironment = getValueByPath(fromObject, ['environment']);
|
|
14062
|
+
if (fromEnvironment != null) {
|
|
14063
|
+
setValueByPath(toObject, ['environment'], fromEnvironment);
|
|
14064
|
+
}
|
|
14065
|
+
const fromExcludedPredefinedFunctions = getValueByPath(fromObject, [
|
|
14066
|
+
'excludedPredefinedFunctions',
|
|
14067
|
+
]);
|
|
14068
|
+
if (fromExcludedPredefinedFunctions != null) {
|
|
14069
|
+
setValueByPath(toObject, ['excludedPredefinedFunctions'], fromExcludedPredefinedFunctions);
|
|
14070
|
+
}
|
|
14071
|
+
const fromEnablePromptInjectionDetection = getValueByPath(fromObject, [
|
|
14072
|
+
'enablePromptInjectionDetection',
|
|
14073
|
+
]);
|
|
14074
|
+
if (fromEnablePromptInjectionDetection != null) {
|
|
14075
|
+
setValueByPath(toObject, ['enablePromptInjectionDetection'], fromEnablePromptInjectionDetection);
|
|
14076
|
+
}
|
|
14077
|
+
if (getValueByPath(fromObject, ['disabledSafetyPolicies']) !== undefined) {
|
|
14078
|
+
throw new Error('disabledSafetyPolicies parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
14079
|
+
}
|
|
14080
|
+
return toObject;
|
|
14081
|
+
}
|
|
14000
14082
|
function contentToMldev$2(fromObject) {
|
|
14001
14083
|
const toObject = {};
|
|
14002
14084
|
const fromParts = getValueByPath(fromObject, ['parts']);
|
|
@@ -14955,7 +15037,7 @@ function toolToVertex$1(fromObject) {
|
|
|
14955
15037
|
}
|
|
14956
15038
|
const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
|
|
14957
15039
|
if (fromComputerUse != null) {
|
|
14958
|
-
setValueByPath(toObject, ['computerUse'], fromComputerUse);
|
|
15040
|
+
setValueByPath(toObject, ['computerUse'], computerUseToVertex$1(fromComputerUse));
|
|
14959
15041
|
}
|
|
14960
15042
|
if (getValueByPath(fromObject, ['fileSearch']) !== undefined) {
|
|
14961
15043
|
throw new Error('fileSearch parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
@@ -15299,6 +15381,29 @@ function computeTokensResponseFromVertex(fromObject, _rootObject) {
|
|
|
15299
15381
|
}
|
|
15300
15382
|
return toObject;
|
|
15301
15383
|
}
|
|
15384
|
+
function computerUseToVertex(fromObject, _rootObject) {
|
|
15385
|
+
const toObject = {};
|
|
15386
|
+
const fromEnvironment = getValueByPath(fromObject, ['environment']);
|
|
15387
|
+
if (fromEnvironment != null) {
|
|
15388
|
+
setValueByPath(toObject, ['environment'], fromEnvironment);
|
|
15389
|
+
}
|
|
15390
|
+
const fromExcludedPredefinedFunctions = getValueByPath(fromObject, [
|
|
15391
|
+
'excludedPredefinedFunctions',
|
|
15392
|
+
]);
|
|
15393
|
+
if (fromExcludedPredefinedFunctions != null) {
|
|
15394
|
+
setValueByPath(toObject, ['excludedPredefinedFunctions'], fromExcludedPredefinedFunctions);
|
|
15395
|
+
}
|
|
15396
|
+
const fromEnablePromptInjectionDetection = getValueByPath(fromObject, [
|
|
15397
|
+
'enablePromptInjectionDetection',
|
|
15398
|
+
]);
|
|
15399
|
+
if (fromEnablePromptInjectionDetection != null) {
|
|
15400
|
+
setValueByPath(toObject, ['enablePromptInjectionDetection'], fromEnablePromptInjectionDetection);
|
|
15401
|
+
}
|
|
15402
|
+
if (getValueByPath(fromObject, ['disabledSafetyPolicies']) !== undefined) {
|
|
15403
|
+
throw new Error('disabledSafetyPolicies parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
15404
|
+
}
|
|
15405
|
+
return toObject;
|
|
15406
|
+
}
|
|
15302
15407
|
function contentEmbeddingFromVertex(fromObject, rootObject) {
|
|
15303
15408
|
const toObject = {};
|
|
15304
15409
|
const fromValues = getValueByPath(fromObject, ['values']);
|
|
@@ -18377,7 +18482,7 @@ function toolToVertex(fromObject, rootObject) {
|
|
|
18377
18482
|
}
|
|
18378
18483
|
const fromComputerUse = getValueByPath(fromObject, ['computerUse']);
|
|
18379
18484
|
if (fromComputerUse != null) {
|
|
18380
|
-
setValueByPath(toObject, ['computerUse'], fromComputerUse);
|
|
18485
|
+
setValueByPath(toObject, ['computerUse'], computerUseToVertex(fromComputerUse));
|
|
18381
18486
|
}
|
|
18382
18487
|
if (getValueByPath(fromObject, ['fileSearch']) !== undefined) {
|
|
18383
18488
|
throw new Error('fileSearch parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.');
|
|
@@ -19773,7 +19878,7 @@ class Models extends BaseModule {
|
|
|
19773
19878
|
this.generateContent = async (params) => {
|
|
19774
19879
|
var _a, _b, _c, _d, _e;
|
|
19775
19880
|
const transformedParams = await this.processParamsMaybeAddMcpUsage(params);
|
|
19776
|
-
this.
|
|
19881
|
+
this.maybeMoveToResponseJsonSchema(params);
|
|
19777
19882
|
if (!hasCallableTools(params) || shouldDisableAfc(params.config)) {
|
|
19778
19883
|
return await this.generateContentInternal(transformedParams);
|
|
19779
19884
|
}
|
|
@@ -19865,7 +19970,7 @@ class Models extends BaseModule {
|
|
|
19865
19970
|
*/
|
|
19866
19971
|
this.generateContentStream = async (params) => {
|
|
19867
19972
|
var _a, _b, _c, _d, _e;
|
|
19868
|
-
this.
|
|
19973
|
+
this.maybeMoveToResponseJsonSchema(params);
|
|
19869
19974
|
if (shouldDisableAfc(params.config)) {
|
|
19870
19975
|
const transformedParams = await this.processParamsMaybeAddMcpUsage(params);
|
|
19871
19976
|
return await this.generateContentStreamInternal(transformedParams);
|
|
@@ -20090,7 +20195,7 @@ class Models extends BaseModule {
|
|
|
20090
20195
|
* To maintain backward compatibility, we move the data that was treated as
|
|
20091
20196
|
* JSON schema from the responseSchema field to the responseJsonSchema field.
|
|
20092
20197
|
*/
|
|
20093
|
-
|
|
20198
|
+
maybeMoveToResponseJsonSchema(params) {
|
|
20094
20199
|
if (params.config && params.config.responseSchema) {
|
|
20095
20200
|
if (!params.config.responseJsonSchema) {
|
|
20096
20201
|
if (Object.keys(params.config.responseSchema).includes('$schema')) {
|
|
@@ -20192,7 +20297,7 @@ class Models extends BaseModule {
|
|
|
20192
20297
|
throw new Error('Function call name was not returned by the model.');
|
|
20193
20298
|
}
|
|
20194
20299
|
if (!afcTools.has(part.functionCall.name)) {
|
|
20195
|
-
throw new Error(`Automatic function calling was requested, but not all the tools the model used implement the CallableTool interface. Available tools: ${afcTools.keys()},
|
|
20300
|
+
throw new Error(`Automatic function calling was requested, but not all the tools the model used implement the CallableTool interface. Available tools: ${afcTools.keys()}, missing tool: ${part.functionCall.name}`);
|
|
20196
20301
|
}
|
|
20197
20302
|
else {
|
|
20198
20303
|
const responseParts = yield __await(afcTools
|