@google/genai 2.0.1 → 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 +147 -12
- 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 +147 -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 +447 -417
- package/dist/web/index.mjs.map +1 -1
- package/dist/web/web.d.ts +147 -12
- package/package.json +1 -1
package/dist/genai.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
|
|
|
@@ -6121,7 +6121,7 @@ declare interface ImageResponseFormat {
|
|
|
6121
6121
|
/**
|
|
6122
6122
|
* The delivery mode for the image output.
|
|
6123
6123
|
*/
|
|
6124
|
-
delivery?: 'inline' | '
|
|
6124
|
+
delivery?: 'inline' | 'uri';
|
|
6125
6125
|
/**
|
|
6126
6126
|
* The size of the image output.
|
|
6127
6127
|
*/
|
|
@@ -6247,6 +6247,10 @@ declare interface Interaction {
|
|
|
6247
6247
|
* Required. Output only. The status of the interaction.
|
|
6248
6248
|
*/
|
|
6249
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>;
|
|
6250
6254
|
/**
|
|
6251
6255
|
* Required. Output only. The time at which the response was last updated in ISO
|
|
6252
6256
|
* 8601 format (YYYY-MM-DDThh:mm:ssZ).
|
|
@@ -6293,10 +6297,6 @@ declare interface Interaction {
|
|
|
6293
6297
|
* The service tier for the interaction.
|
|
6294
6298
|
*/
|
|
6295
6299
|
service_tier?: 'flex' | 'standard' | 'priority';
|
|
6296
|
-
/**
|
|
6297
|
-
* Output only. The steps that make up the interaction.
|
|
6298
|
-
*/
|
|
6299
|
-
steps?: Array<Step>;
|
|
6300
6300
|
/**
|
|
6301
6301
|
* System instruction for the interaction.
|
|
6302
6302
|
*/
|
|
@@ -7911,7 +7911,7 @@ export declare interface Model {
|
|
|
7911
7911
|
* The model that will complete your prompt.\n\nSee
|
|
7912
7912
|
* [models](https://ai.google.dev/gemini-api/docs/models) for additional details.
|
|
7913
7913
|
*/
|
|
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-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 & {});
|
|
7915
7915
|
|
|
7916
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. */
|
|
7917
7917
|
export declare interface ModelArmorConfig {
|
|
@@ -9962,7 +9962,7 @@ export declare enum StartSensitivity {
|
|
|
9962
9962
|
declare type Step = UserInputStep | ModelOutputStep | ThoughtStep | FunctionCallStep | CodeExecutionCallStep | URLContextCallStep | MCPServerToolCallStep | GoogleSearchCallStep | FileSearchCallStep | GoogleMapsCallStep | FunctionResultStep | CodeExecutionResultStep | URLContextResultStep | GoogleSearchResultStep | MCPServerToolResultStep | FileSearchResultStep | GoogleMapsResultStep;
|
|
9963
9963
|
|
|
9964
9964
|
declare interface StepDelta {
|
|
9965
|
-
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;
|
|
9966
9966
|
event_type: 'step.delta';
|
|
9967
9967
|
index: number;
|
|
9968
9968
|
/**
|
|
@@ -10043,7 +10043,125 @@ declare namespace StepDelta {
|
|
|
10043
10043
|
}
|
|
10044
10044
|
interface ArgumentsDelta {
|
|
10045
10045
|
type: 'arguments_delta';
|
|
10046
|
-
|
|
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;
|
|
10047
10165
|
}
|
|
10048
10166
|
}
|
|
10049
10167
|
|
|
@@ -12567,6 +12685,23 @@ export declare interface VideoMetadata {
|
|
|
12567
12685
|
*/
|
|
12568
12686
|
declare interface VideoResponseFormat {
|
|
12569
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;
|
|
12570
12705
|
}
|
|
12571
12706
|
|
|
12572
12707
|
/** Voice activity signal. */
|