@google/genai 1.44.0 → 1.45.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
@@ -497,6 +497,9 @@ declare interface AudioContent {
497
497
 
498
498
  /** The audio transcription configuration in Setup. */
499
499
  export declare interface AudioTranscriptionConfig {
500
+ /** The language codes of the audio. BCP-47 language code. If not set, the transcription will be in the language detected by the model. If set, the server will use the language code specified in the model config as a hint for the language of the audio
501
+ */
502
+ languageCodes?: string[];
500
503
  }
501
504
 
502
505
  /**
@@ -650,11 +653,11 @@ declare interface BaseCreateAgentInteractionParams {
650
653
  */
651
654
  agent: (string & {}) | 'deep-research-pro-preview-12-2025';
652
655
  /**
653
- * Body param: The inputs for the interaction.
656
+ * Body param: The input for the interaction.
654
657
  */
655
- input: string | Array<Content_2> | Array<Turn> | TextContent | ImageContent | AudioContent | DocumentContent | VideoContent | ThoughtContent | FunctionCallContent | FunctionResultContent | CodeExecutionCallContent | CodeExecutionResultContent | URLContextCallContent | URLContextResultContent | GoogleSearchCallContent | GoogleSearchResultContent | MCPServerToolCallContent | MCPServerToolResultContent | FileSearchCallContent | FileSearchResultContent;
658
+ input: Array<Content_2> | string | Array<Turn> | TextContent | ImageContent | AudioContent | DocumentContent | VideoContent | ThoughtContent | FunctionCallContent | FunctionResultContent | CodeExecutionCallContent | CodeExecutionResultContent | URLContextCallContent | URLContextResultContent | GoogleSearchCallContent | GoogleSearchResultContent | MCPServerToolCallContent | MCPServerToolResultContent | FileSearchCallContent | FileSearchResultContent;
656
659
  /**
657
- * Body param: Configuration for the agent.
660
+ * Body param: Configuration parameters for the agent interaction.
658
661
  */
659
662
  agent_config?: DynamicAgentConfig | DeepResearchAgentConfig;
660
663
  /**
@@ -702,9 +705,9 @@ declare interface BaseCreateModelInteractionParams {
702
705
  */
703
706
  api_version?: string;
704
707
  /**
705
- * Body param: The inputs for the interaction.
708
+ * Body param: The input for the interaction.
706
709
  */
707
- input: string | Array<Content_2> | Array<Turn> | TextContent | ImageContent | AudioContent | DocumentContent | VideoContent | ThoughtContent | FunctionCallContent | FunctionResultContent | CodeExecutionCallContent | CodeExecutionResultContent | URLContextCallContent | URLContextResultContent | GoogleSearchCallContent | GoogleSearchResultContent | MCPServerToolCallContent | MCPServerToolResultContent | FileSearchCallContent | FileSearchResultContent;
710
+ input: Array<Content_2> | string | Array<Turn> | TextContent | ImageContent | AudioContent | DocumentContent | VideoContent | ThoughtContent | FunctionCallContent | FunctionResultContent | CodeExecutionCallContent | CodeExecutionResultContent | URLContextCallContent | URLContextResultContent | GoogleSearchCallContent | GoogleSearchResultContent | MCPServerToolCallContent | MCPServerToolResultContent | FileSearchCallContent | FileSearchResultContent;
708
711
  /**
709
712
  * Body param: The name of the `Model` used for generating the interaction.
710
713
  */
@@ -797,7 +800,7 @@ declare class BaseGeminiNextGenAPIClient {
797
800
  /**
798
801
  * Basic re-implementation of `qs.stringify` for primitive types.
799
802
  */
800
- protected stringifyQuery(query: Record<string, unknown>): string;
803
+ protected stringifyQuery(query: object | Record<string, unknown>): string;
801
804
  private getUserAgent;
802
805
  protected defaultIdempotencyKey(): string;
803
806
  protected makeStatusError(status: number, error: Object, message: string | undefined, headers: Headers): Errors.APIError;
@@ -851,7 +854,7 @@ declare class BaseInteractions extends APIResource {
851
854
  * ```ts
852
855
  * const interaction = await client.interactions.create({
853
856
  * api_version: 'api_version',
854
- * input: 'string',
857
+ * input: [{ text: 'text', type: 'text' }],
855
858
  * model: 'gemini-2.5-flash',
856
859
  * });
857
860
  * ```
@@ -1700,10 +1703,6 @@ declare interface CodeExecutionCallContent {
1700
1703
  */
1701
1704
  arguments: CodeExecutionCallArguments;
1702
1705
  type: 'code_execution_call';
1703
- /**
1704
- * A signature hash for backend validation.
1705
- */
1706
- signature?: string;
1707
1706
  }
1708
1707
 
1709
1708
  /** Result of executing the [ExecutableCode]. Only generated when using the [CodeExecution] tool, and always follows a `part` containing the [ExecutableCode]. */
@@ -1875,7 +1874,7 @@ declare namespace ContentDelta {
1875
1874
  interface ThoughtSummaryDelta {
1876
1875
  type: 'thought_summary';
1877
1876
  /**
1878
- * A text content block.
1877
+ * A new summary item to be added to the thought.
1879
1878
  */
1880
1879
  content?: InteractionsAPI.TextContent | InteractionsAPI.ImageContent;
1881
1880
  }
@@ -1896,10 +1895,6 @@ declare namespace ContentDelta {
1896
1895
  };
1897
1896
  name: string;
1898
1897
  type: 'function_call';
1899
- /**
1900
- * A signature hash for backend validation.
1901
- */
1902
- signature?: string;
1903
1898
  }
1904
1899
  interface FunctionResultDelta {
1905
1900
  /**
@@ -1933,10 +1928,6 @@ declare namespace ContentDelta {
1933
1928
  */
1934
1929
  arguments: InteractionsAPI.CodeExecutionCallArguments;
1935
1930
  type: 'code_execution_call';
1936
- /**
1937
- * A signature hash for backend validation.
1938
- */
1939
- signature?: string;
1940
1931
  }
1941
1932
  interface CodeExecutionResultDelta {
1942
1933
  /**
@@ -1961,10 +1952,6 @@ declare namespace ContentDelta {
1961
1952
  */
1962
1953
  arguments: InteractionsAPI.URLContextCallArguments;
1963
1954
  type: 'url_context_call';
1964
- /**
1965
- * A signature hash for backend validation.
1966
- */
1967
- signature?: string;
1968
1955
  }
1969
1956
  interface URLContextResultDelta {
1970
1957
  /**
@@ -1989,10 +1976,6 @@ declare namespace ContentDelta {
1989
1976
  */
1990
1977
  arguments: InteractionsAPI.GoogleSearchCallArguments;
1991
1978
  type: 'google_search_call';
1992
- /**
1993
- * A signature hash for backend validation.
1994
- */
1995
- signature?: string;
1996
1979
  }
1997
1980
  interface GoogleSearchResultDelta {
1998
1981
  /**
@@ -2018,10 +2001,6 @@ declare namespace ContentDelta {
2018
2001
  name: string;
2019
2002
  server_name: string;
2020
2003
  type: 'mcp_server_tool_call';
2021
- /**
2022
- * A signature hash for backend validation.
2023
- */
2024
- signature?: string;
2025
2004
  }
2026
2005
  interface MCPServerToolResultDelta {
2027
2006
  /**
@@ -2051,14 +2030,18 @@ declare namespace ContentDelta {
2051
2030
  */
2052
2031
  id: string;
2053
2032
  type: 'file_search_call';
2054
- /**
2055
- * A signature hash for backend validation.
2056
- */
2057
- signature?: string;
2058
2033
  }
2059
2034
  interface FileSearchResultDelta {
2035
+ /**
2036
+ * ID to match the ID from the function call block.
2037
+ */
2038
+ call_id: string;
2060
2039
  type: 'file_search_result';
2061
2040
  result?: Array<FileSearchResultDelta.Result>;
2041
+ /**
2042
+ * A signature hash for backend validation.
2043
+ */
2044
+ signature?: string;
2062
2045
  }
2063
2046
  namespace FileSearchResultDelta {
2064
2047
  /**
@@ -3684,10 +3667,6 @@ declare interface FileSearchCallContent {
3684
3667
  */
3685
3668
  id: string;
3686
3669
  type: 'file_search_call';
3687
- /**
3688
- * A signature hash for backend validation.
3689
- */
3690
- signature?: string;
3691
3670
  }
3692
3671
 
3693
3672
  /**
@@ -4028,10 +4007,6 @@ declare interface FunctionCallContent {
4028
4007
  */
4029
4008
  name: string;
4030
4009
  type: 'function_call';
4031
- /**
4032
- * A signature hash for backend validation.
4033
- */
4034
- signature?: string;
4035
4010
  }
4036
4011
 
4037
4012
  /** Function calling config. */
@@ -4176,7 +4151,7 @@ declare interface FunctionResultContent {
4176
4151
  /**
4177
4152
  * The result of the tool call.
4178
4153
  */
4179
- result: FunctionResultContent.Items | unknown | string;
4154
+ result: unknown | Array<TextContent | ImageContent> | string;
4180
4155
  type: 'function_result';
4181
4156
  /**
4182
4157
  * Whether the tool call resulted in an error.
@@ -4192,12 +4167,6 @@ declare interface FunctionResultContent {
4192
4167
  signature?: string;
4193
4168
  }
4194
4169
 
4195
- declare namespace FunctionResultContent {
4196
- interface Items {
4197
- items?: Array<InteractionsAPI.TextContent | InteractionsAPI.ImageContent>;
4198
- }
4199
- }
4200
-
4201
4170
  /** The Google Cloud Storage location for the input content. This data type is not supported in Gemini API. */
4202
4171
  export declare interface GcsSource {
4203
4172
  /** Required. Google Cloud Storage URI(-s) to the input file(s). May contain wildcards. For more information on wildcards, see https://cloud.google.com/storage/docs/wildcards. */
@@ -4316,7 +4285,6 @@ export declare interface GenerateContentConfig {
4316
4285
  - `application/json`: JSON response in the candidates.
4317
4286
  The model needs to be prompted to output the appropriate response type,
4318
4287
  otherwise the behavior is undefined.
4319
- This is a preview feature.
4320
4288
  */
4321
4289
  responseMimeType?: string;
4322
4290
  /** The `Schema` object allows the definition of input and output data types.
@@ -5304,10 +5272,6 @@ declare interface GoogleSearchCallContent {
5304
5272
  * The type of search grounding enabled.
5305
5273
  */
5306
5274
  search_type?: 'web_search' | 'image_search';
5307
- /**
5308
- * A signature hash for backend validation.
5309
- */
5310
- signature?: string;
5311
5275
  }
5312
5276
 
5313
5277
  /**
@@ -6053,13 +6017,13 @@ declare interface Interaction {
6053
6017
  */
6054
6018
  agent?: (string & {}) | 'deep-research-pro-preview-12-2025';
6055
6019
  /**
6056
- * Configuration for the agent.
6020
+ * Configuration parameters for the agent interaction.
6057
6021
  */
6058
6022
  agent_config?: DynamicAgentConfig | DeepResearchAgentConfig;
6059
6023
  /**
6060
- * The inputs for the interaction.
6024
+ * The input for the interaction.
6061
6025
  */
6062
- input?: string | Array<Content_2> | Array<Turn> | TextContent | ImageContent | AudioContent | DocumentContent | VideoContent | ThoughtContent | FunctionCallContent | FunctionResultContent | CodeExecutionCallContent | CodeExecutionResultContent | URLContextCallContent | URLContextResultContent | GoogleSearchCallContent | GoogleSearchResultContent | MCPServerToolCallContent | MCPServerToolResultContent | FileSearchCallContent | FileSearchResultContent;
6026
+ input?: Array<Content_2> | string | Array<Turn> | TextContent | ImageContent | AudioContent | DocumentContent | VideoContent | ThoughtContent | FunctionCallContent | FunctionResultContent | CodeExecutionCallContent | CodeExecutionResultContent | URLContextCallContent | URLContextResultContent | GoogleSearchCallContent | GoogleSearchResultContent | MCPServerToolCallContent | MCPServerToolResultContent | FileSearchCallContent | FileSearchResultContent;
6063
6027
  /**
6064
6028
  * The name of the `Model` used for generating the interaction.
6065
6029
  */
@@ -7472,10 +7436,6 @@ declare interface MCPServerToolCallContent {
7472
7436
  */
7473
7437
  server_name: string;
7474
7438
  type: 'mcp_server_tool_call';
7475
- /**
7476
- * A signature hash for backend validation.
7477
- */
7478
- signature?: string;
7479
7439
  }
7480
7440
 
7481
7441
  /**
@@ -7487,9 +7447,9 @@ declare interface MCPServerToolResultContent {
7487
7447
  */
7488
7448
  call_id: string;
7489
7449
  /**
7490
- * The result of the tool call.
7450
+ * The output from the MCP server call. Can be simple text or rich content.
7491
7451
  */
7492
- result: MCPServerToolResultContent.Items | unknown | string;
7452
+ result: unknown | Array<TextContent | ImageContent> | string;
7493
7453
  type: 'mcp_server_tool_result';
7494
7454
  /**
7495
7455
  * Name of the tool which is called for this specific tool call.
@@ -7505,12 +7465,6 @@ declare interface MCPServerToolResultContent {
7505
7465
  signature?: string;
7506
7466
  }
7507
7467
 
7508
- declare namespace MCPServerToolResultContent {
7509
- interface Items {
7510
- items?: Array<InteractionsAPI.TextContent | InteractionsAPI.ImageContent>;
7511
- }
7512
- }
7513
-
7514
7468
  /**
7515
7469
  * Creates a McpCallableTool from MCP clients and an optional config.
7516
7470
  *
@@ -9996,19 +9950,9 @@ export declare interface Tool {
9996
9950
  /**
9997
9951
  * A tool that can be used by the model.
9998
9952
  */
9999
- declare type Tool_2 = Function_2 | Tool_2.GoogleSearch | Tool_2.CodeExecution | Tool_2.URLContext | Tool_2.ComputerUse | Tool_2.MCPServer | Tool_2.FileSearch;
9953
+ declare type Tool_2 = Function_2 | Tool_2.CodeExecution | Tool_2.URLContext | Tool_2.ComputerUse | Tool_2.MCPServer | Tool_2.GoogleSearch | Tool_2.FileSearch;
10000
9954
 
10001
9955
  declare namespace Tool_2 {
10002
- /**
10003
- * A tool that can be used by the model to search Google.
10004
- */
10005
- interface GoogleSearch {
10006
- type: 'google_search';
10007
- /**
10008
- * The types of search grounding to enable.
10009
- */
10010
- search_types?: Array<'web_search' | 'image_search'>;
10011
- }
10012
9956
  /**
10013
9957
  * A tool that can be used by the model to execute code.
10014
9958
  */
@@ -10060,6 +10004,16 @@ declare namespace Tool_2 {
10060
10004
  */
10061
10005
  url?: string;
10062
10006
  }
10007
+ /**
10008
+ * A tool that can be used by the model to search Google.
10009
+ */
10010
+ interface GoogleSearch {
10011
+ type: 'google_search';
10012
+ /**
10013
+ * The types of search grounding to enable.
10014
+ */
10015
+ search_types?: Array<'web_search' | 'image_search'>;
10016
+ }
10063
10017
  /**
10064
10018
  * A tool that can be used by the model to search files.
10065
10019
  */
@@ -11325,10 +11279,6 @@ declare interface URLContextCallContent {
11325
11279
  */
11326
11280
  arguments: URLContextCallArguments;
11327
11281
  type: 'url_context_call';
11328
- /**
11329
- * A signature hash for backend validation.
11330
- */
11331
- signature?: string;
11332
11282
  }
11333
11283
 
11334
11284
  /** Metadata returned when the model uses the `url_context` tool to get information from a user-provided URL. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@google/genai",
3
- "version": "1.44.0",
3
+ "version": "1.45.0",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "dist/node/index.mjs",
@@ -55,7 +55,8 @@
55
55
  },
56
56
  "./vertex_internal": {
57
57
  "types": "./dist/vertex_internal/index.d.ts",
58
- "import": "./dist/vertex_internal/index.js"
58
+ "import": "./dist/vertex_internal/index.js",
59
+ "require": "./dist/vertex_internal/index.cjs"
59
60
  }
60
61
  },
61
62
  "scripts": {
@@ -70,6 +71,8 @@
70
71
  "api-extractor:prod:node": "api-extractor run -c api-extractor.node.json --verbose",
71
72
  "api-extractor:prod:web": "api-extractor run -c api-extractor.web.json --verbose",
72
73
  "api-extractor:prod:tokenizer-node": "api-extractor run -c api-extractor.tokenizer-node.json --verbose",
74
+ "api-extractor:dev:vertex_internal": "api-extractor run -c api-extractor.vertex_internal.json --local --verbose",
75
+ "api-extractor:prod:vertex_internal": "api-extractor run -c api-extractor.vertex_internal.json --verbose",
73
76
  "unit-test": "tsc && cp src/cross/sentencepiece/sentencepiece_model.pb.js dist/src/cross/sentencepiece/ && jasmine dist/test/unit/**/*_test.js dist/test/unit/**/**/*_test.js dist/test/unit/*_test.js",
74
77
  "system-test": "tsc && jasmine dist/test/system/**/*_test.js",
75
78
  "test-server-tests": "tsc && GOOGLE_CLOUD_PROJECT=googcloudproj GOOGLE_CLOUD_LOCATION=googcloudloc jasmine dist/test/system/node/*_test.js -- --test-server",
@@ -105,6 +108,11 @@
105
108
  "dist/tokenizer/node.cjs",
106
109
  "dist/tokenizer/node.mjs.map",
107
110
  "dist/tokenizer/node.d.ts",
111
+ "dist/vertex_internal/index.js",
112
+ "dist/vertex_internal/index.cjs",
113
+ "dist/vertex_internal/index.d.ts",
114
+ "dist/vertex_internal/index.js.map",
115
+ "dist/vertex_internal/index.cjs.map",
108
116
  "node/package.json",
109
117
  "web/package.json"
110
118
  ],