@google/genai 2.0.1 → 2.2.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 +158 -12
- package/dist/index.cjs +539 -509
- package/dist/index.mjs +539 -509
- package/dist/index.mjs.map +1 -1
- package/dist/node/index.cjs +634 -604
- package/dist/node/index.mjs +634 -604
- package/dist/node/index.mjs.map +1 -1
- package/dist/node/node.d.ts +158 -12
- 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 +634 -604
- package/dist/web/index.mjs.map +1 -1
- package/dist/web/web.d.ts +158 -12
- package/package.json +1 -1
package/dist/web/web.d.ts
CHANGED
|
@@ -500,7 +500,7 @@ declare interface AudioResponseFormat {
|
|
|
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
|
*/
|
|
@@ -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
|
/**
|
|
@@ -4039,7 +4039,7 @@ export declare interface FunctionDeclaration {
|
|
|
4039
4039
|
response?: Schema;
|
|
4040
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`. */
|
|
4041
4041
|
responseJsonSchema?: unknown;
|
|
4042
|
-
/** 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. */
|
|
4043
4043
|
behavior?: Behavior;
|
|
4044
4044
|
}
|
|
4045
4045
|
|
|
@@ -6126,7 +6126,7 @@ declare interface ImageResponseFormat {
|
|
|
6126
6126
|
/**
|
|
6127
6127
|
* The delivery mode for the image output.
|
|
6128
6128
|
*/
|
|
6129
|
-
delivery?: 'inline' | '
|
|
6129
|
+
delivery?: 'inline' | 'uri';
|
|
6130
6130
|
/**
|
|
6131
6131
|
* The size of the image output.
|
|
6132
6132
|
*/
|
|
@@ -6252,6 +6252,10 @@ declare interface Interaction {
|
|
|
6252
6252
|
* Required. Output only. The status of the interaction.
|
|
6253
6253
|
*/
|
|
6254
6254
|
status: 'in_progress' | 'requires_action' | 'completed' | 'failed' | 'cancelled' | 'incomplete';
|
|
6255
|
+
/**
|
|
6256
|
+
* Required. Output only. The steps that make up the interaction.
|
|
6257
|
+
*/
|
|
6258
|
+
steps: Array<Step>;
|
|
6255
6259
|
/**
|
|
6256
6260
|
* Required. Output only. The time at which the response was last updated in ISO
|
|
6257
6261
|
* 8601 format (YYYY-MM-DDThh:mm:ssZ).
|
|
@@ -6298,10 +6302,6 @@ declare interface Interaction {
|
|
|
6298
6302
|
* The service tier for the interaction.
|
|
6299
6303
|
*/
|
|
6300
6304
|
service_tier?: 'flex' | 'standard' | 'priority';
|
|
6301
|
-
/**
|
|
6302
|
-
* Output only. The steps that make up the interaction.
|
|
6303
|
-
*/
|
|
6304
|
-
steps?: Array<Step>;
|
|
6305
6305
|
/**
|
|
6306
6306
|
* System instruction for the interaction.
|
|
6307
6307
|
*/
|
|
@@ -7916,7 +7916,7 @@ export declare interface Model {
|
|
|
7916
7916
|
* The model that will complete your prompt.\n\nSee
|
|
7917
7917
|
* [models](https://ai.google.dev/gemini-api/docs/models) for additional details.
|
|
7918
7918
|
*/
|
|
7919
|
-
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 & {});
|
|
7919
|
+
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 & {});
|
|
7920
7920
|
|
|
7921
7921
|
/** 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. */
|
|
7922
7922
|
export declare interface ModelArmorConfig {
|
|
@@ -9967,7 +9967,7 @@ export declare enum StartSensitivity {
|
|
|
9967
9967
|
declare type Step = UserInputStep | ModelOutputStep | ThoughtStep | FunctionCallStep | CodeExecutionCallStep | URLContextCallStep | MCPServerToolCallStep | GoogleSearchCallStep | FileSearchCallStep | GoogleMapsCallStep | FunctionResultStep | CodeExecutionResultStep | URLContextResultStep | GoogleSearchResultStep | MCPServerToolResultStep | FileSearchResultStep | GoogleMapsResultStep;
|
|
9968
9968
|
|
|
9969
9969
|
declare interface StepDelta {
|
|
9970
|
-
delta: StepDelta.Text | StepDelta.Image | StepDelta.Audio | StepDelta.Document | StepDelta.Video | StepDelta.ThoughtSummary | StepDelta.ThoughtSignature | StepDelta.TextAnnotationDelta | StepDelta.ArgumentsDelta;
|
|
9970
|
+
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 | StepDelta.FunctionResult;
|
|
9971
9971
|
event_type: 'step.delta';
|
|
9972
9972
|
index: number;
|
|
9973
9973
|
/**
|
|
@@ -10048,7 +10048,136 @@ declare namespace StepDelta {
|
|
|
10048
10048
|
}
|
|
10049
10049
|
interface ArgumentsDelta {
|
|
10050
10050
|
type: 'arguments_delta';
|
|
10051
|
-
|
|
10051
|
+
arguments?: string;
|
|
10052
|
+
}
|
|
10053
|
+
interface CodeExecutionCall {
|
|
10054
|
+
/**
|
|
10055
|
+
* The arguments to pass to the code execution.
|
|
10056
|
+
*/
|
|
10057
|
+
arguments: InteractionsAPI.CodeExecutionCallArguments;
|
|
10058
|
+
type: 'code_execution_call';
|
|
10059
|
+
/**
|
|
10060
|
+
* A signature hash for backend validation.
|
|
10061
|
+
*/
|
|
10062
|
+
signature?: string;
|
|
10063
|
+
}
|
|
10064
|
+
interface URLContextCall {
|
|
10065
|
+
/**
|
|
10066
|
+
* The arguments to pass to the URL context.
|
|
10067
|
+
*/
|
|
10068
|
+
arguments: InteractionsAPI.URLContextCallArguments;
|
|
10069
|
+
type: 'url_context_call';
|
|
10070
|
+
/**
|
|
10071
|
+
* A signature hash for backend validation.
|
|
10072
|
+
*/
|
|
10073
|
+
signature?: string;
|
|
10074
|
+
}
|
|
10075
|
+
interface GoogleSearchCall {
|
|
10076
|
+
/**
|
|
10077
|
+
* The arguments to pass to Google Search.
|
|
10078
|
+
*/
|
|
10079
|
+
arguments: InteractionsAPI.GoogleSearchCallArguments;
|
|
10080
|
+
type: 'google_search_call';
|
|
10081
|
+
/**
|
|
10082
|
+
* A signature hash for backend validation.
|
|
10083
|
+
*/
|
|
10084
|
+
signature?: string;
|
|
10085
|
+
}
|
|
10086
|
+
interface MCPServerToolCall {
|
|
10087
|
+
arguments: {
|
|
10088
|
+
[key: string]: unknown;
|
|
10089
|
+
};
|
|
10090
|
+
name: string;
|
|
10091
|
+
server_name: string;
|
|
10092
|
+
type: 'mcp_server_tool_call';
|
|
10093
|
+
/**
|
|
10094
|
+
* A signature hash for backend validation.
|
|
10095
|
+
*/
|
|
10096
|
+
signature?: string;
|
|
10097
|
+
}
|
|
10098
|
+
interface FileSearchCall {
|
|
10099
|
+
type: 'file_search_call';
|
|
10100
|
+
/**
|
|
10101
|
+
* A signature hash for backend validation.
|
|
10102
|
+
*/
|
|
10103
|
+
signature?: string;
|
|
10104
|
+
}
|
|
10105
|
+
interface GoogleMapsCall {
|
|
10106
|
+
type: 'google_maps_call';
|
|
10107
|
+
/**
|
|
10108
|
+
* The arguments to pass to the Google Maps tool.
|
|
10109
|
+
*/
|
|
10110
|
+
arguments?: InteractionsAPI.GoogleMapsCallArguments;
|
|
10111
|
+
/**
|
|
10112
|
+
* A signature hash for backend validation.
|
|
10113
|
+
*/
|
|
10114
|
+
signature?: string;
|
|
10115
|
+
}
|
|
10116
|
+
interface CodeExecutionResult {
|
|
10117
|
+
result: string;
|
|
10118
|
+
type: 'code_execution_result';
|
|
10119
|
+
is_error?: boolean;
|
|
10120
|
+
/**
|
|
10121
|
+
* A signature hash for backend validation.
|
|
10122
|
+
*/
|
|
10123
|
+
signature?: string;
|
|
10124
|
+
}
|
|
10125
|
+
interface URLContextResult {
|
|
10126
|
+
result: Array<InteractionsAPI.URLContextResult>;
|
|
10127
|
+
type: 'url_context_result';
|
|
10128
|
+
is_error?: boolean;
|
|
10129
|
+
/**
|
|
10130
|
+
* A signature hash for backend validation.
|
|
10131
|
+
*/
|
|
10132
|
+
signature?: string;
|
|
10133
|
+
}
|
|
10134
|
+
interface GoogleSearchResult {
|
|
10135
|
+
result: Array<InteractionsAPI.GoogleSearchResult>;
|
|
10136
|
+
type: 'google_search_result';
|
|
10137
|
+
is_error?: boolean;
|
|
10138
|
+
/**
|
|
10139
|
+
* A signature hash for backend validation.
|
|
10140
|
+
*/
|
|
10141
|
+
signature?: string;
|
|
10142
|
+
}
|
|
10143
|
+
interface MCPServerToolResult {
|
|
10144
|
+
result: unknown | Array<InteractionsAPI.TextContent | InteractionsAPI.ImageContent> | string;
|
|
10145
|
+
type: 'mcp_server_tool_result';
|
|
10146
|
+
name?: string;
|
|
10147
|
+
server_name?: string;
|
|
10148
|
+
/**
|
|
10149
|
+
* A signature hash for backend validation.
|
|
10150
|
+
*/
|
|
10151
|
+
signature?: string;
|
|
10152
|
+
}
|
|
10153
|
+
interface FileSearchResult {
|
|
10154
|
+
result: Array<unknown>;
|
|
10155
|
+
type: 'file_search_result';
|
|
10156
|
+
/**
|
|
10157
|
+
* A signature hash for backend validation.
|
|
10158
|
+
*/
|
|
10159
|
+
signature?: string;
|
|
10160
|
+
}
|
|
10161
|
+
interface GoogleMapsResult {
|
|
10162
|
+
type: 'google_maps_result';
|
|
10163
|
+
/**
|
|
10164
|
+
* The results of the Google Maps.
|
|
10165
|
+
*/
|
|
10166
|
+
result?: Array<InteractionsAPI.GoogleMapsResult>;
|
|
10167
|
+
/**
|
|
10168
|
+
* A signature hash for backend validation.
|
|
10169
|
+
*/
|
|
10170
|
+
signature?: string;
|
|
10171
|
+
}
|
|
10172
|
+
interface FunctionResult {
|
|
10173
|
+
/**
|
|
10174
|
+
* Required. ID to match the ID from the function call block.
|
|
10175
|
+
*/
|
|
10176
|
+
call_id: string;
|
|
10177
|
+
result: unknown | Array<InteractionsAPI.TextContent | InteractionsAPI.ImageContent> | string;
|
|
10178
|
+
type: 'function_result';
|
|
10179
|
+
is_error?: boolean;
|
|
10180
|
+
name?: string;
|
|
10052
10181
|
}
|
|
10053
10182
|
}
|
|
10054
10183
|
|
|
@@ -12572,6 +12701,23 @@ export declare interface VideoMetadata {
|
|
|
12572
12701
|
*/
|
|
12573
12702
|
declare interface VideoResponseFormat {
|
|
12574
12703
|
type: 'video';
|
|
12704
|
+
/**
|
|
12705
|
+
* The aspect ratio for the video output.
|
|
12706
|
+
*/
|
|
12707
|
+
aspectRatio?: '16:9' | '9:16';
|
|
12708
|
+
/**
|
|
12709
|
+
* The delivery mode for the video output.
|
|
12710
|
+
*/
|
|
12711
|
+
delivery?: 'inline' | 'uri';
|
|
12712
|
+
/**
|
|
12713
|
+
* The duration for the video output.
|
|
12714
|
+
*/
|
|
12715
|
+
duration?: string;
|
|
12716
|
+
/**
|
|
12717
|
+
* The GCS URI to store the video output. Required for Vertex if delivery mode is
|
|
12718
|
+
* URI.
|
|
12719
|
+
*/
|
|
12720
|
+
gcsUri?: string;
|
|
12575
12721
|
}
|
|
12576
12722
|
|
|
12577
12723
|
/** Voice activity signal. */
|