@google/genai 2.0.0 → 2.1.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 +156 -22
- package/dist/index.cjs +352 -322
- package/dist/index.mjs +352 -322
- package/dist/index.mjs.map +1 -1
- package/dist/node/index.cjs +447 -417
- package/dist/node/index.mjs +447 -417
- package/dist/node/index.mjs.map +1 -1
- package/dist/node/node.d.ts +156 -22
- package/dist/tokenizer/node.cjs +2 -2
- package/dist/tokenizer/node.d.ts +3 -3
- package/dist/tokenizer/node.mjs +2 -2
- package/dist/tokenizer/node.mjs.map +1 -1
- package/dist/vertex_internal/index.cjs +3 -3
- package/dist/vertex_internal/index.cjs.map +1 -1
- package/dist/vertex_internal/index.d.ts +3 -3
- package/dist/vertex_internal/index.js +3 -3
- package/dist/vertex_internal/index.js.map +1 -1
- package/dist/web/index.mjs +447 -417
- package/dist/web/index.mjs.map +1 -1
- package/dist/web/web.d.ts +156 -22
- package/package.json +1 -1
package/dist/genai.d.ts
CHANGED
|
@@ -496,19 +496,19 @@ declare interface AudioResponseFormat {
|
|
|
496
496
|
* Bit rate in bits per second (bps). Only applicable for compressed formats (MP3,
|
|
497
497
|
* Opus).
|
|
498
498
|
*/
|
|
499
|
-
|
|
499
|
+
bit_rate?: number;
|
|
500
500
|
/**
|
|
501
501
|
* The delivery mode for the audio output.
|
|
502
502
|
*/
|
|
503
|
-
delivery?: 'inline' | '
|
|
503
|
+
delivery?: 'inline' | 'uri';
|
|
504
504
|
/**
|
|
505
505
|
* The MIME type of the audio output.
|
|
506
506
|
*/
|
|
507
|
-
|
|
507
|
+
mime_type?: 'audio/mp3' | 'audio/ogg_opus' | 'audio/l16' | 'audio/wav' | 'audio/alaw' | 'audio/mulaw';
|
|
508
508
|
/**
|
|
509
509
|
* Sample rate in Hz.
|
|
510
510
|
*/
|
|
511
|
-
|
|
511
|
+
sample_rate?: number;
|
|
512
512
|
}
|
|
513
513
|
|
|
514
514
|
/** The audio transcription configuration in Setup. */
|
|
@@ -1226,10 +1226,10 @@ export declare interface BatchJobSource {
|
|
|
1226
1226
|
|
|
1227
1227
|
export declare type BatchJobSourceUnion = BatchJobSource | InlinedRequest[] | string;
|
|
1228
1228
|
|
|
1229
|
-
/** Specifies the function Behavior. Currently only supported
|
|
1229
|
+
/** Specifies the function Behavior. Currently only non-blocking functions are supported. If not specified, the system keeps the current function call behavior. This field is currently only supported by the BidiGenerateContent method. */
|
|
1230
1230
|
export declare enum Behavior {
|
|
1231
1231
|
/**
|
|
1232
|
-
* This value is
|
|
1232
|
+
* This value is unspecified.
|
|
1233
1233
|
*/
|
|
1234
1234
|
UNSPECIFIED = "UNSPECIFIED",
|
|
1235
1235
|
/**
|
|
@@ -2585,8 +2585,7 @@ declare interface DeepResearchAgentConfig {
|
|
|
2585
2585
|
/**
|
|
2586
2586
|
* Enables human-in-the-loop planning for the Deep Research agent. If set to true,
|
|
2587
2587
|
* the Deep Research agent will provide a research plan in its response. The agent
|
|
2588
|
-
* will then proceed only if the user confirms the plan in the next turn.
|
|
2589
|
-
* issue: b/482352502.
|
|
2588
|
+
* will then proceed only if the user confirms the plan in the next turn.
|
|
2590
2589
|
*/
|
|
2591
2590
|
collaborative_planning?: boolean;
|
|
2592
2591
|
/**
|
|
@@ -4040,7 +4039,7 @@ export declare interface FunctionDeclaration {
|
|
|
4040
4039
|
response?: Schema;
|
|
4041
4040
|
/** Optional. Describes the output from this function in JSON Schema format. The value specified by the schema is the response value of the function. This field is mutually exclusive with `response`. */
|
|
4042
4041
|
responseJsonSchema?: unknown;
|
|
4043
|
-
/** Optional. Specifies the function Behavior. Currently only supported
|
|
4042
|
+
/** Optional. Specifies the function Behavior. Currently only non-blocking functions are supported. If not specified, the system keeps the current function call behavior. This field is currently only supported by the BidiGenerateContent method. */
|
|
4044
4043
|
behavior?: Behavior;
|
|
4045
4044
|
}
|
|
4046
4045
|
|
|
@@ -6118,19 +6117,19 @@ declare interface ImageResponseFormat {
|
|
|
6118
6117
|
/**
|
|
6119
6118
|
* The aspect ratio for the image output.
|
|
6120
6119
|
*/
|
|
6121
|
-
|
|
6120
|
+
aspect_ratio?: '1:1' | '2:3' | '3:2' | '3:4' | '4:3' | '4:5' | '5:4' | '9:16' | '16:9' | '21:9' | '1:8' | '8:1' | '1:4' | '4:1';
|
|
6122
6121
|
/**
|
|
6123
6122
|
* The delivery mode for the image output.
|
|
6124
6123
|
*/
|
|
6125
|
-
delivery?: 'inline' | '
|
|
6124
|
+
delivery?: 'inline' | 'uri';
|
|
6126
6125
|
/**
|
|
6127
6126
|
* The size of the image output.
|
|
6128
6127
|
*/
|
|
6129
|
-
|
|
6128
|
+
image_size?: '512' | '1K' | '2K' | '4K';
|
|
6130
6129
|
/**
|
|
6131
6130
|
* The MIME type of the image output.
|
|
6132
6131
|
*/
|
|
6133
|
-
|
|
6132
|
+
mime_type?: 'image/jpeg';
|
|
6134
6133
|
}
|
|
6135
6134
|
|
|
6136
6135
|
/** Image search for grounding and related configurations. */
|
|
@@ -6248,6 +6247,10 @@ declare interface Interaction {
|
|
|
6248
6247
|
* Required. Output only. The status of the interaction.
|
|
6249
6248
|
*/
|
|
6250
6249
|
status: 'in_progress' | 'requires_action' | 'completed' | 'failed' | 'cancelled' | 'incomplete';
|
|
6250
|
+
/**
|
|
6251
|
+
* Required. Output only. The steps that make up the interaction.
|
|
6252
|
+
*/
|
|
6253
|
+
steps: Array<Step>;
|
|
6251
6254
|
/**
|
|
6252
6255
|
* Required. Output only. The time at which the response was last updated in ISO
|
|
6253
6256
|
* 8601 format (YYYY-MM-DDThh:mm:ssZ).
|
|
@@ -6294,10 +6297,6 @@ declare interface Interaction {
|
|
|
6294
6297
|
* The service tier for the interaction.
|
|
6295
6298
|
*/
|
|
6296
6299
|
service_tier?: 'flex' | 'standard' | 'priority';
|
|
6297
|
-
/**
|
|
6298
|
-
* Output only. The steps that make up the interaction.
|
|
6299
|
-
*/
|
|
6300
|
-
steps?: Array<Step>;
|
|
6301
6300
|
/**
|
|
6302
6301
|
* System instruction for the interaction.
|
|
6303
6302
|
*/
|
|
@@ -7912,7 +7911,7 @@ export declare interface Model {
|
|
|
7912
7911
|
* The model that will complete your prompt.\n\nSee
|
|
7913
7912
|
* [models](https://ai.google.dev/gemini-api/docs/models) for additional details.
|
|
7914
7913
|
*/
|
|
7915
|
-
declare type Model_2 = 'gemini-2.5-computer-use-preview-10-2025' | 'gemini-2.5-flash' | 'gemini-2.5-flash-image' | 'gemini-2.5-flash-lite' | 'gemini-2.5-flash-lite-preview-09-2025' | 'gemini-2.5-flash-native-audio-preview-12-2025' | 'gemini-2.5-flash-preview-09-2025' | 'gemini-2.5-flash-preview-tts' | 'gemini-2.5-pro' | 'gemini-2.5-pro-preview-tts' | 'gemini-3-flash-preview' | 'gemini-3-pro-image-preview' | 'gemini-3-pro-preview' | 'gemini-3.1-pro-preview' | 'gemini-3.1-flash-image-preview' | 'gemini-3.1-flash-lite-preview' | 'gemini-3.1-flash-tts-preview' | 'lyria-3-clip-preview' | 'lyria-3-pro-preview' | (string & {});
|
|
7914
|
+
declare type Model_2 = 'gemini-2.5-computer-use-preview-10-2025' | 'gemini-2.5-flash' | 'gemini-2.5-flash-image' | 'gemini-2.5-flash-lite' | 'gemini-2.5-flash-lite-preview-09-2025' | 'gemini-2.5-flash-native-audio-preview-12-2025' | 'gemini-2.5-flash-preview-09-2025' | 'gemini-2.5-flash-preview-tts' | 'gemini-2.5-pro' | 'gemini-2.5-pro-preview-tts' | 'gemini-3-flash-preview' | 'gemini-3-pro-image-preview' | 'gemini-3-pro-preview' | 'gemini-3.1-pro-preview' | 'gemini-3.1-flash-image-preview' | 'gemini-3.1-flash-lite' | 'gemini-3.1-flash-lite-preview' | 'gemini-3.1-flash-tts-preview' | 'lyria-3-clip-preview' | 'lyria-3-pro-preview' | (string & {});
|
|
7916
7915
|
|
|
7917
7916
|
/** Configuration for Model Armor. Model Armor is a Google Cloud service that provides safety and security filtering for prompts and responses. It helps protect your AI applications from risks such as harmful content, sensitive data leakage, and prompt injection attacks. This data type is not supported in Gemini API. */
|
|
7918
7917
|
export declare interface ModelArmorConfig {
|
|
@@ -9963,7 +9962,7 @@ export declare enum StartSensitivity {
|
|
|
9963
9962
|
declare type Step = UserInputStep | ModelOutputStep | ThoughtStep | FunctionCallStep | CodeExecutionCallStep | URLContextCallStep | MCPServerToolCallStep | GoogleSearchCallStep | FileSearchCallStep | GoogleMapsCallStep | FunctionResultStep | CodeExecutionResultStep | URLContextResultStep | GoogleSearchResultStep | MCPServerToolResultStep | FileSearchResultStep | GoogleMapsResultStep;
|
|
9964
9963
|
|
|
9965
9964
|
declare interface StepDelta {
|
|
9966
|
-
delta: StepDelta.Text | StepDelta.Image | StepDelta.Audio | StepDelta.Document | StepDelta.Video | StepDelta.ThoughtSummary | StepDelta.ThoughtSignature | StepDelta.TextAnnotationDelta | StepDelta.ArgumentsDelta;
|
|
9965
|
+
delta: StepDelta.Text | StepDelta.Image | StepDelta.Audio | StepDelta.Document | StepDelta.Video | StepDelta.ThoughtSummary | StepDelta.ThoughtSignature | StepDelta.TextAnnotationDelta | StepDelta.ArgumentsDelta | StepDelta.CodeExecutionCall | StepDelta.URLContextCall | StepDelta.GoogleSearchCall | StepDelta.MCPServerToolCall | StepDelta.FileSearchCall | StepDelta.GoogleMapsCall | StepDelta.CodeExecutionResult | StepDelta.URLContextResult | StepDelta.GoogleSearchResult | StepDelta.MCPServerToolResult | StepDelta.FileSearchResult | StepDelta.GoogleMapsResult;
|
|
9967
9966
|
event_type: 'step.delta';
|
|
9968
9967
|
index: number;
|
|
9969
9968
|
/**
|
|
@@ -10044,7 +10043,125 @@ declare namespace StepDelta {
|
|
|
10044
10043
|
}
|
|
10045
10044
|
interface ArgumentsDelta {
|
|
10046
10045
|
type: 'arguments_delta';
|
|
10047
|
-
|
|
10046
|
+
}
|
|
10047
|
+
interface CodeExecutionCall {
|
|
10048
|
+
/**
|
|
10049
|
+
* The arguments to pass to the code execution.
|
|
10050
|
+
*/
|
|
10051
|
+
arguments: InteractionsAPI.CodeExecutionCallArguments;
|
|
10052
|
+
type: 'code_execution_call';
|
|
10053
|
+
/**
|
|
10054
|
+
* A signature hash for backend validation.
|
|
10055
|
+
*/
|
|
10056
|
+
signature?: string;
|
|
10057
|
+
}
|
|
10058
|
+
interface URLContextCall {
|
|
10059
|
+
/**
|
|
10060
|
+
* The arguments to pass to the URL context.
|
|
10061
|
+
*/
|
|
10062
|
+
arguments: InteractionsAPI.URLContextCallArguments;
|
|
10063
|
+
type: 'url_context_call';
|
|
10064
|
+
/**
|
|
10065
|
+
* A signature hash for backend validation.
|
|
10066
|
+
*/
|
|
10067
|
+
signature?: string;
|
|
10068
|
+
}
|
|
10069
|
+
interface GoogleSearchCall {
|
|
10070
|
+
/**
|
|
10071
|
+
* The arguments to pass to Google Search.
|
|
10072
|
+
*/
|
|
10073
|
+
arguments: InteractionsAPI.GoogleSearchCallArguments;
|
|
10074
|
+
type: 'google_search_call';
|
|
10075
|
+
/**
|
|
10076
|
+
* A signature hash for backend validation.
|
|
10077
|
+
*/
|
|
10078
|
+
signature?: string;
|
|
10079
|
+
}
|
|
10080
|
+
interface MCPServerToolCall {
|
|
10081
|
+
arguments: {
|
|
10082
|
+
[key: string]: unknown;
|
|
10083
|
+
};
|
|
10084
|
+
name: string;
|
|
10085
|
+
server_name: string;
|
|
10086
|
+
type: 'mcp_server_tool_call';
|
|
10087
|
+
/**
|
|
10088
|
+
* A signature hash for backend validation.
|
|
10089
|
+
*/
|
|
10090
|
+
signature?: string;
|
|
10091
|
+
}
|
|
10092
|
+
interface FileSearchCall {
|
|
10093
|
+
type: 'file_search_call';
|
|
10094
|
+
/**
|
|
10095
|
+
* A signature hash for backend validation.
|
|
10096
|
+
*/
|
|
10097
|
+
signature?: string;
|
|
10098
|
+
}
|
|
10099
|
+
interface GoogleMapsCall {
|
|
10100
|
+
type: 'google_maps_call';
|
|
10101
|
+
/**
|
|
10102
|
+
* The arguments to pass to the Google Maps tool.
|
|
10103
|
+
*/
|
|
10104
|
+
arguments?: InteractionsAPI.GoogleMapsCallArguments;
|
|
10105
|
+
/**
|
|
10106
|
+
* A signature hash for backend validation.
|
|
10107
|
+
*/
|
|
10108
|
+
signature?: string;
|
|
10109
|
+
}
|
|
10110
|
+
interface CodeExecutionResult {
|
|
10111
|
+
result: string;
|
|
10112
|
+
type: 'code_execution_result';
|
|
10113
|
+
is_error?: boolean;
|
|
10114
|
+
/**
|
|
10115
|
+
* A signature hash for backend validation.
|
|
10116
|
+
*/
|
|
10117
|
+
signature?: string;
|
|
10118
|
+
}
|
|
10119
|
+
interface URLContextResult {
|
|
10120
|
+
result: Array<InteractionsAPI.URLContextResult>;
|
|
10121
|
+
type: 'url_context_result';
|
|
10122
|
+
is_error?: boolean;
|
|
10123
|
+
/**
|
|
10124
|
+
* A signature hash for backend validation.
|
|
10125
|
+
*/
|
|
10126
|
+
signature?: string;
|
|
10127
|
+
}
|
|
10128
|
+
interface GoogleSearchResult {
|
|
10129
|
+
result: Array<InteractionsAPI.GoogleSearchResult>;
|
|
10130
|
+
type: 'google_search_result';
|
|
10131
|
+
is_error?: boolean;
|
|
10132
|
+
/**
|
|
10133
|
+
* A signature hash for backend validation.
|
|
10134
|
+
*/
|
|
10135
|
+
signature?: string;
|
|
10136
|
+
}
|
|
10137
|
+
interface MCPServerToolResult {
|
|
10138
|
+
result: unknown | Array<InteractionsAPI.TextContent | InteractionsAPI.ImageContent> | string;
|
|
10139
|
+
type: 'mcp_server_tool_result';
|
|
10140
|
+
name?: string;
|
|
10141
|
+
server_name?: string;
|
|
10142
|
+
/**
|
|
10143
|
+
* A signature hash for backend validation.
|
|
10144
|
+
*/
|
|
10145
|
+
signature?: string;
|
|
10146
|
+
}
|
|
10147
|
+
interface FileSearchResult {
|
|
10148
|
+
result: Array<unknown>;
|
|
10149
|
+
type: 'file_search_result';
|
|
10150
|
+
/**
|
|
10151
|
+
* A signature hash for backend validation.
|
|
10152
|
+
*/
|
|
10153
|
+
signature?: string;
|
|
10154
|
+
}
|
|
10155
|
+
interface GoogleMapsResult {
|
|
10156
|
+
type: 'google_maps_result';
|
|
10157
|
+
/**
|
|
10158
|
+
* The results of the Google Maps.
|
|
10159
|
+
*/
|
|
10160
|
+
result?: Array<InteractionsAPI.GoogleMapsResult>;
|
|
10161
|
+
/**
|
|
10162
|
+
* A signature hash for backend validation.
|
|
10163
|
+
*/
|
|
10164
|
+
signature?: string;
|
|
10048
10165
|
}
|
|
10049
10166
|
}
|
|
10050
10167
|
|
|
@@ -10313,7 +10430,7 @@ declare interface TextResponseFormat {
|
|
|
10313
10430
|
/**
|
|
10314
10431
|
* The MIME type of the text output.
|
|
10315
10432
|
*/
|
|
10316
|
-
|
|
10433
|
+
mime_type?: 'application/json' | 'text/plain';
|
|
10317
10434
|
/**
|
|
10318
10435
|
* The JSON schema that the output should conform to. Only applicable when
|
|
10319
10436
|
* mime_type is application/json.
|
|
@@ -10537,7 +10654,7 @@ declare namespace Tool_2 {
|
|
|
10537
10654
|
/**
|
|
10538
10655
|
* The list of predefined functions that are excluded from the model call.
|
|
10539
10656
|
*/
|
|
10540
|
-
|
|
10657
|
+
excluded_predefined_functions?: Array<string>;
|
|
10541
10658
|
}
|
|
10542
10659
|
/**
|
|
10543
10660
|
* A MCPServer is a server that can be called by the model to perform actions.
|
|
@@ -12568,6 +12685,23 @@ export declare interface VideoMetadata {
|
|
|
12568
12685
|
*/
|
|
12569
12686
|
declare interface VideoResponseFormat {
|
|
12570
12687
|
type: 'video';
|
|
12688
|
+
/**
|
|
12689
|
+
* The aspect ratio for the video output.
|
|
12690
|
+
*/
|
|
12691
|
+
aspectRatio?: '16:9' | '9:16';
|
|
12692
|
+
/**
|
|
12693
|
+
* The delivery mode for the video output.
|
|
12694
|
+
*/
|
|
12695
|
+
delivery?: 'inline' | 'uri';
|
|
12696
|
+
/**
|
|
12697
|
+
* The duration for the video output.
|
|
12698
|
+
*/
|
|
12699
|
+
duration?: string;
|
|
12700
|
+
/**
|
|
12701
|
+
* The GCS URI to store the video output. Required for Vertex if delivery mode is
|
|
12702
|
+
* URI.
|
|
12703
|
+
*/
|
|
12704
|
+
gcsUri?: string;
|
|
12571
12705
|
}
|
|
12572
12706
|
|
|
12573
12707
|
/** Voice activity signal. */
|