@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/web/web.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
- bitRate?: number;
499
+ bit_rate?: number;
500
500
  /**
501
501
  * The delivery mode for the audio output.
502
502
  */
503
- delivery?: 'inline' | 'url';
503
+ delivery?: 'inline' | 'uri';
504
504
  /**
505
505
  * The MIME type of the audio output.
506
506
  */
507
- mimeType?: 'audio/mp3' | 'audio/ogg_opus' | 'audio/l16' | 'audio/wav' | 'audio/alaw' | 'audio/mulaw';
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
- sampleRate?: number;
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 by the BidiGenerateContent method. This enum is not supported in Vertex AI. */
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 unused.
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. Relevant
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 by the BidiGenerateContent method. This field is not supported in Vertex AI. */
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
 
@@ -6123,19 +6122,19 @@ declare interface ImageResponseFormat {
6123
6122
  /**
6124
6123
  * The aspect ratio for the image output.
6125
6124
  */
6126
- aspectRatio?: '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';
6125
+ 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';
6127
6126
  /**
6128
6127
  * The delivery mode for the image output.
6129
6128
  */
6130
- delivery?: 'inline' | 'url';
6129
+ delivery?: 'inline' | 'uri';
6131
6130
  /**
6132
6131
  * The size of the image output.
6133
6132
  */
6134
- imageSize?: '512' | '1K' | '2K' | '4K';
6133
+ image_size?: '512' | '1K' | '2K' | '4K';
6135
6134
  /**
6136
6135
  * The MIME type of the image output.
6137
6136
  */
6138
- mimeType?: 'image/jpeg';
6137
+ mime_type?: 'image/jpeg';
6139
6138
  }
6140
6139
 
6141
6140
  /** Image search for grounding and related configurations. */
@@ -6253,6 +6252,10 @@ declare interface Interaction {
6253
6252
  * Required. Output only. The status of the interaction.
6254
6253
  */
6255
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>;
6256
6259
  /**
6257
6260
  * Required. Output only. The time at which the response was last updated in ISO
6258
6261
  * 8601 format (YYYY-MM-DDThh:mm:ssZ).
@@ -6299,10 +6302,6 @@ declare interface Interaction {
6299
6302
  * The service tier for the interaction.
6300
6303
  */
6301
6304
  service_tier?: 'flex' | 'standard' | 'priority';
6302
- /**
6303
- * Output only. The steps that make up the interaction.
6304
- */
6305
- steps?: Array<Step>;
6306
6305
  /**
6307
6306
  * System instruction for the interaction.
6308
6307
  */
@@ -7917,7 +7916,7 @@ export declare interface Model {
7917
7916
  * The model that will complete your prompt.\n\nSee
7918
7917
  * [models](https://ai.google.dev/gemini-api/docs/models) for additional details.
7919
7918
  */
7920
- 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 & {});
7921
7920
 
7922
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. */
7923
7922
  export declare interface ModelArmorConfig {
@@ -9968,7 +9967,7 @@ export declare enum StartSensitivity {
9968
9967
  declare type Step = UserInputStep | ModelOutputStep | ThoughtStep | FunctionCallStep | CodeExecutionCallStep | URLContextCallStep | MCPServerToolCallStep | GoogleSearchCallStep | FileSearchCallStep | GoogleMapsCallStep | FunctionResultStep | CodeExecutionResultStep | URLContextResultStep | GoogleSearchResultStep | MCPServerToolResultStep | FileSearchResultStep | GoogleMapsResultStep;
9969
9968
 
9970
9969
  declare interface StepDelta {
9971
- 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;
9972
9971
  event_type: 'step.delta';
9973
9972
  index: number;
9974
9973
  /**
@@ -10049,7 +10048,125 @@ declare namespace StepDelta {
10049
10048
  }
10050
10049
  interface ArgumentsDelta {
10051
10050
  type: 'arguments_delta';
10052
- partial_arguments?: string;
10051
+ }
10052
+ interface CodeExecutionCall {
10053
+ /**
10054
+ * The arguments to pass to the code execution.
10055
+ */
10056
+ arguments: InteractionsAPI.CodeExecutionCallArguments;
10057
+ type: 'code_execution_call';
10058
+ /**
10059
+ * A signature hash for backend validation.
10060
+ */
10061
+ signature?: string;
10062
+ }
10063
+ interface URLContextCall {
10064
+ /**
10065
+ * The arguments to pass to the URL context.
10066
+ */
10067
+ arguments: InteractionsAPI.URLContextCallArguments;
10068
+ type: 'url_context_call';
10069
+ /**
10070
+ * A signature hash for backend validation.
10071
+ */
10072
+ signature?: string;
10073
+ }
10074
+ interface GoogleSearchCall {
10075
+ /**
10076
+ * The arguments to pass to Google Search.
10077
+ */
10078
+ arguments: InteractionsAPI.GoogleSearchCallArguments;
10079
+ type: 'google_search_call';
10080
+ /**
10081
+ * A signature hash for backend validation.
10082
+ */
10083
+ signature?: string;
10084
+ }
10085
+ interface MCPServerToolCall {
10086
+ arguments: {
10087
+ [key: string]: unknown;
10088
+ };
10089
+ name: string;
10090
+ server_name: string;
10091
+ type: 'mcp_server_tool_call';
10092
+ /**
10093
+ * A signature hash for backend validation.
10094
+ */
10095
+ signature?: string;
10096
+ }
10097
+ interface FileSearchCall {
10098
+ type: 'file_search_call';
10099
+ /**
10100
+ * A signature hash for backend validation.
10101
+ */
10102
+ signature?: string;
10103
+ }
10104
+ interface GoogleMapsCall {
10105
+ type: 'google_maps_call';
10106
+ /**
10107
+ * The arguments to pass to the Google Maps tool.
10108
+ */
10109
+ arguments?: InteractionsAPI.GoogleMapsCallArguments;
10110
+ /**
10111
+ * A signature hash for backend validation.
10112
+ */
10113
+ signature?: string;
10114
+ }
10115
+ interface CodeExecutionResult {
10116
+ result: string;
10117
+ type: 'code_execution_result';
10118
+ is_error?: boolean;
10119
+ /**
10120
+ * A signature hash for backend validation.
10121
+ */
10122
+ signature?: string;
10123
+ }
10124
+ interface URLContextResult {
10125
+ result: Array<InteractionsAPI.URLContextResult>;
10126
+ type: 'url_context_result';
10127
+ is_error?: boolean;
10128
+ /**
10129
+ * A signature hash for backend validation.
10130
+ */
10131
+ signature?: string;
10132
+ }
10133
+ interface GoogleSearchResult {
10134
+ result: Array<InteractionsAPI.GoogleSearchResult>;
10135
+ type: 'google_search_result';
10136
+ is_error?: boolean;
10137
+ /**
10138
+ * A signature hash for backend validation.
10139
+ */
10140
+ signature?: string;
10141
+ }
10142
+ interface MCPServerToolResult {
10143
+ result: unknown | Array<InteractionsAPI.TextContent | InteractionsAPI.ImageContent> | string;
10144
+ type: 'mcp_server_tool_result';
10145
+ name?: string;
10146
+ server_name?: string;
10147
+ /**
10148
+ * A signature hash for backend validation.
10149
+ */
10150
+ signature?: string;
10151
+ }
10152
+ interface FileSearchResult {
10153
+ result: Array<unknown>;
10154
+ type: 'file_search_result';
10155
+ /**
10156
+ * A signature hash for backend validation.
10157
+ */
10158
+ signature?: string;
10159
+ }
10160
+ interface GoogleMapsResult {
10161
+ type: 'google_maps_result';
10162
+ /**
10163
+ * The results of the Google Maps.
10164
+ */
10165
+ result?: Array<InteractionsAPI.GoogleMapsResult>;
10166
+ /**
10167
+ * A signature hash for backend validation.
10168
+ */
10169
+ signature?: string;
10053
10170
  }
10054
10171
  }
10055
10172
 
@@ -10318,7 +10435,7 @@ declare interface TextResponseFormat {
10318
10435
  /**
10319
10436
  * The MIME type of the text output.
10320
10437
  */
10321
- mimeType?: 'application/json' | 'text/plain';
10438
+ mime_type?: 'application/json' | 'text/plain';
10322
10439
  /**
10323
10440
  * The JSON schema that the output should conform to. Only applicable when
10324
10441
  * mime_type is application/json.
@@ -10542,7 +10659,7 @@ declare namespace Tool_2 {
10542
10659
  /**
10543
10660
  * The list of predefined functions that are excluded from the model call.
10544
10661
  */
10545
- excludedPredefinedFunctions?: Array<string>;
10662
+ excluded_predefined_functions?: Array<string>;
10546
10663
  }
10547
10664
  /**
10548
10665
  * A MCPServer is a server that can be called by the model to perform actions.
@@ -12573,6 +12690,23 @@ export declare interface VideoMetadata {
12573
12690
  */
12574
12691
  declare interface VideoResponseFormat {
12575
12692
  type: 'video';
12693
+ /**
12694
+ * The aspect ratio for the video output.
12695
+ */
12696
+ aspectRatio?: '16:9' | '9:16';
12697
+ /**
12698
+ * The delivery mode for the video output.
12699
+ */
12700
+ delivery?: 'inline' | 'uri';
12701
+ /**
12702
+ * The duration for the video output.
12703
+ */
12704
+ duration?: string;
12705
+ /**
12706
+ * The GCS URI to store the video output. Required for Vertex if delivery mode is
12707
+ * URI.
12708
+ */
12709
+ gcsUri?: string;
12576
12710
  }
12577
12711
 
12578
12712
  /** Voice activity signal. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@google/genai",
3
- "version": "2.0.0",
3
+ "version": "2.1.0",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "dist/node/index.mjs",