@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.
@@ -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.
@@ -5311,10 +5279,6 @@ declare interface GoogleSearchCallContent {
5311
5279
  * The type of search grounding enabled.
5312
5280
  */
5313
5281
  search_type?: 'web_search' | 'image_search';
5314
- /**
5315
- * A signature hash for backend validation.
5316
- */
5317
- signature?: string;
5318
5282
  }
5319
5283
 
5320
5284
  /**
@@ -6060,13 +6024,13 @@ declare interface Interaction {
6060
6024
  */
6061
6025
  agent?: (string & {}) | 'deep-research-pro-preview-12-2025';
6062
6026
  /**
6063
- * Configuration for the agent.
6027
+ * Configuration parameters for the agent interaction.
6064
6028
  */
6065
6029
  agent_config?: DynamicAgentConfig | DeepResearchAgentConfig;
6066
6030
  /**
6067
- * The inputs for the interaction.
6031
+ * The input for the interaction.
6068
6032
  */
6069
- 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;
6033
+ 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;
6070
6034
  /**
6071
6035
  * The name of the `Model` used for generating the interaction.
6072
6036
  */
@@ -7479,10 +7443,6 @@ declare interface MCPServerToolCallContent {
7479
7443
  */
7480
7444
  server_name: string;
7481
7445
  type: 'mcp_server_tool_call';
7482
- /**
7483
- * A signature hash for backend validation.
7484
- */
7485
- signature?: string;
7486
7446
  }
7487
7447
 
7488
7448
  /**
@@ -7494,9 +7454,9 @@ declare interface MCPServerToolResultContent {
7494
7454
  */
7495
7455
  call_id: string;
7496
7456
  /**
7497
- * The result of the tool call.
7457
+ * The output from the MCP server call. Can be simple text or rich content.
7498
7458
  */
7499
- result: MCPServerToolResultContent.Items | unknown | string;
7459
+ result: unknown | Array<TextContent | ImageContent> | string;
7500
7460
  type: 'mcp_server_tool_result';
7501
7461
  /**
7502
7462
  * Name of the tool which is called for this specific tool call.
@@ -7512,12 +7472,6 @@ declare interface MCPServerToolResultContent {
7512
7472
  signature?: string;
7513
7473
  }
7514
7474
 
7515
- declare namespace MCPServerToolResultContent {
7516
- interface Items {
7517
- items?: Array<InteractionsAPI.TextContent | InteractionsAPI.ImageContent>;
7518
- }
7519
- }
7520
-
7521
7475
  /**
7522
7476
  * Creates a McpCallableTool from MCP clients and an optional config.
7523
7477
  *
@@ -10003,19 +9957,9 @@ export declare interface Tool {
10003
9957
  /**
10004
9958
  * A tool that can be used by the model.
10005
9959
  */
10006
- declare type Tool_2 = Function_2 | Tool_2.GoogleSearch | Tool_2.CodeExecution | Tool_2.URLContext | Tool_2.ComputerUse | Tool_2.MCPServer | Tool_2.FileSearch;
9960
+ declare type Tool_2 = Function_2 | Tool_2.CodeExecution | Tool_2.URLContext | Tool_2.ComputerUse | Tool_2.MCPServer | Tool_2.GoogleSearch | Tool_2.FileSearch;
10007
9961
 
10008
9962
  declare namespace Tool_2 {
10009
- /**
10010
- * A tool that can be used by the model to search Google.
10011
- */
10012
- interface GoogleSearch {
10013
- type: 'google_search';
10014
- /**
10015
- * The types of search grounding to enable.
10016
- */
10017
- search_types?: Array<'web_search' | 'image_search'>;
10018
- }
10019
9963
  /**
10020
9964
  * A tool that can be used by the model to execute code.
10021
9965
  */
@@ -10067,6 +10011,16 @@ declare namespace Tool_2 {
10067
10011
  */
10068
10012
  url?: string;
10069
10013
  }
10014
+ /**
10015
+ * A tool that can be used by the model to search Google.
10016
+ */
10017
+ interface GoogleSearch {
10018
+ type: 'google_search';
10019
+ /**
10020
+ * The types of search grounding to enable.
10021
+ */
10022
+ search_types?: Array<'web_search' | 'image_search'>;
10023
+ }
10070
10024
  /**
10071
10025
  * A tool that can be used by the model to search files.
10072
10026
  */
@@ -11332,10 +11286,6 @@ declare interface URLContextCallContent {
11332
11286
  */
11333
11287
  arguments: URLContextCallArguments;
11334
11288
  type: 'url_context_call';
11335
- /**
11336
- * A signature hash for backend validation.
11337
- */
11338
- signature?: string;
11339
11289
  }
11340
11290
 
11341
11291
  /** Metadata returned when the model uses the `url_context` tool to get information from a user-provided URL. */