@google/genai 1.35.0 → 1.36.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.
@@ -417,11 +417,17 @@ export declare interface AudioChunk {
417
417
  */
418
418
  declare interface AudioContent {
419
419
  type: 'audio';
420
+ /**
421
+ * The audio content.
422
+ */
420
423
  data?: string;
421
424
  /**
422
425
  * The mime type of the audio.
423
426
  */
424
427
  mime_type?: AudioMimeType;
428
+ /**
429
+ * The URI of the audio.
430
+ */
425
431
  uri?: string;
426
432
  }
427
433
 
@@ -581,7 +587,7 @@ declare interface BaseCreateAgentInteractionParams {
581
587
  /**
582
588
  * Body param: The inputs for the interaction.
583
589
  */
584
- input: string | Array<Content_2> | Array<Turn> | TextContent | ImageContent | AudioContent | DocumentContent | VideoContent | ThoughtContent | FunctionCallContent | FunctionResultContent | CodeExecutionCallContent | CodeExecutionResultContent | URLContextCallContent | URLContextResultContent | GoogleSearchCallContent | GoogleSearchResultContent | MCPServerToolCallContent | MCPServerToolResultContent | FileSearchResultContent;
590
+ 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;
585
591
  /**
586
592
  * Path param: Which version of the API to use.
587
593
  */
@@ -633,7 +639,7 @@ declare interface BaseCreateModelInteractionParams {
633
639
  /**
634
640
  * Body param: The inputs for the interaction.
635
641
  */
636
- input: string | Array<Content_2> | Array<Turn> | TextContent | ImageContent | AudioContent | DocumentContent | VideoContent | ThoughtContent | FunctionCallContent | FunctionResultContent | CodeExecutionCallContent | CodeExecutionResultContent | URLContextCallContent | URLContextResultContent | GoogleSearchCallContent | GoogleSearchResultContent | MCPServerToolCallContent | MCPServerToolResultContent | FileSearchResultContent;
642
+ 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;
637
643
  /**
638
644
  * Body param: The name of the `Model` used for generating the interaction.
639
645
  */
@@ -1701,6 +1707,12 @@ export declare class ComputeTokensResponse {
1701
1707
  tokensInfo?: TokensInfo[];
1702
1708
  }
1703
1709
 
1710
+ /** Local tokenizer compute tokens result. */
1711
+ export declare interface ComputeTokensResult {
1712
+ /** Lists of tokens info from the input. */
1713
+ tokensInfo?: TokensInfo[];
1714
+ }
1715
+
1704
1716
  declare type _ConditionalNodeReadableStream<R = any> = typeof globalThis extends {
1705
1717
  ReadableStream: any;
1706
1718
  } ? never : _NodeReadableStream<R>;
@@ -1720,10 +1732,10 @@ export declare interface Content {
1720
1732
  /**
1721
1733
  * The content of the response.
1722
1734
  */
1723
- declare type Content_2 = TextContent | ImageContent | AudioContent | DocumentContent | VideoContent | ThoughtContent | FunctionCallContent | FunctionResultContent | CodeExecutionCallContent | CodeExecutionResultContent | URLContextCallContent | URLContextResultContent | GoogleSearchCallContent | GoogleSearchResultContent | MCPServerToolCallContent | MCPServerToolResultContent | FileSearchResultContent;
1735
+ declare type Content_2 = TextContent | ImageContent | AudioContent | DocumentContent | VideoContent | ThoughtContent | FunctionCallContent | FunctionResultContent | CodeExecutionCallContent | CodeExecutionResultContent | URLContextCallContent | URLContextResultContent | GoogleSearchCallContent | GoogleSearchResultContent | MCPServerToolCallContent | MCPServerToolResultContent | FileSearchCallContent | FileSearchResultContent;
1724
1736
 
1725
1737
  declare interface ContentDelta {
1726
- delta?: ContentDelta.TextDelta | ContentDelta.ImageDelta | ContentDelta.AudioDelta | ContentDelta.DocumentDelta | ContentDelta.VideoDelta | ContentDelta.ThoughtSummaryDelta | ContentDelta.ThoughtSignatureDelta | ContentDelta.FunctionCallDelta | ContentDelta.FunctionResultDelta | ContentDelta.CodeExecutionCallDelta | ContentDelta.CodeExecutionResultDelta | ContentDelta.URLContextCallDelta | ContentDelta.URLContextResultDelta | ContentDelta.GoogleSearchCallDelta | ContentDelta.GoogleSearchResultDelta | ContentDelta.MCPServerToolCallDelta | ContentDelta.MCPServerToolResultDelta | ContentDelta.FileSearchResultDelta;
1738
+ delta?: ContentDelta.TextDelta | ContentDelta.ImageDelta | ContentDelta.AudioDelta | ContentDelta.DocumentDelta | ContentDelta.VideoDelta | ContentDelta.ThoughtSummaryDelta | ContentDelta.ThoughtSignatureDelta | ContentDelta.FunctionCallDelta | ContentDelta.FunctionResultDelta | ContentDelta.CodeExecutionCallDelta | ContentDelta.CodeExecutionResultDelta | ContentDelta.URLContextCallDelta | ContentDelta.URLContextResultDelta | ContentDelta.GoogleSearchCallDelta | ContentDelta.GoogleSearchResultDelta | ContentDelta.MCPServerToolCallDelta | ContentDelta.MCPServerToolResultDelta | ContentDelta.FileSearchCallDelta | ContentDelta.FileSearchResultDelta;
1727
1739
  /**
1728
1740
  * The event_id token to be used to resume the interaction stream, from this event.
1729
1741
  */
@@ -1921,6 +1933,13 @@ declare namespace ContentDelta {
1921
1933
  items?: Array<string | InteractionsAPI.ImageContent | unknown>;
1922
1934
  }
1923
1935
  }
1936
+ interface FileSearchCallDelta {
1937
+ type: 'file_search_call';
1938
+ /**
1939
+ * A unique ID for this specific tool call.
1940
+ */
1941
+ id?: string;
1942
+ }
1924
1943
  interface FileSearchResultDelta {
1925
1944
  type: 'file_search_result';
1926
1945
  result?: Array<FileSearchResultDelta.Result>;
@@ -2103,6 +2122,12 @@ export declare class CountTokensResponse {
2103
2122
  cachedContentTokenCount?: number;
2104
2123
  }
2105
2124
 
2125
+ /** Local tokenizer count tokens result. */
2126
+ export declare interface CountTokensResult {
2127
+ /** The total number of tokens. */
2128
+ totalTokens?: number;
2129
+ }
2130
+
2106
2131
  declare interface CreateAgentInteractionParamsNonStreaming extends BaseCreateAgentInteractionParams {
2107
2132
  /**
2108
2133
  * Body param: Input only. Whether the interaction will be streamed.
@@ -2754,11 +2779,17 @@ export { Document_2 as Document }
2754
2779
  */
2755
2780
  declare interface DocumentContent {
2756
2781
  type: 'document';
2782
+ /**
2783
+ * The document content.
2784
+ */
2757
2785
  data?: string;
2758
2786
  /**
2759
2787
  * The mime type of the document.
2760
2788
  */
2761
2789
  mime_type?: DocumentMimeType;
2790
+ /**
2791
+ * The URI of the document.
2792
+ */
2762
2793
  uri?: string;
2763
2794
  }
2764
2795
 
@@ -3399,6 +3430,17 @@ export declare interface FileSearch {
3399
3430
  metadataFilter?: string;
3400
3431
  }
3401
3432
 
3433
+ /**
3434
+ * File Search content.
3435
+ */
3436
+ declare interface FileSearchCallContent {
3437
+ type: 'file_search_call';
3438
+ /**
3439
+ * A unique ID for this specific tool call.
3440
+ */
3441
+ id?: string;
3442
+ }
3443
+
3402
3444
  /**
3403
3445
  * File Search result content.
3404
3446
  */
@@ -4560,6 +4602,10 @@ export declare interface GenerationConfig {
4560
4602
  * Configuration parameters for model interactions.
4561
4603
  */
4562
4604
  declare interface GenerationConfig_2 {
4605
+ /**
4606
+ * Configuration for image interaction.
4607
+ */
4608
+ image_config?: ImageConfig_2;
4563
4609
  /**
4564
4610
  * The maximum number of tokens to include in the response.
4565
4611
  */
@@ -5443,11 +5489,22 @@ export declare interface ImageConfig {
5443
5489
  outputCompressionQuality?: number;
5444
5490
  }
5445
5491
 
5492
+ /**
5493
+ * The configuration for image interaction.
5494
+ */
5495
+ declare interface ImageConfig_2 {
5496
+ aspect_ratio?: '1:1' | '2:3' | '3:2' | '3:4' | '4:3' | '9:16' | '16:9' | '21:9';
5497
+ image_size?: '1K' | '2K' | '4K';
5498
+ }
5499
+
5446
5500
  /**
5447
5501
  * An image content block.
5448
5502
  */
5449
5503
  declare interface ImageContent {
5450
5504
  type: 'image';
5505
+ /**
5506
+ * The image content.
5507
+ */
5451
5508
  data?: string;
5452
5509
  /**
5453
5510
  * The mime type of the image.
@@ -5457,6 +5514,9 @@ declare interface ImageContent {
5457
5514
  * The resolution of the media.
5458
5515
  */
5459
5516
  resolution?: 'low' | 'medium' | 'high' | 'ultra_high';
5517
+ /**
5518
+ * The URI of the image.
5519
+ */
5460
5520
  uri?: string;
5461
5521
  }
5462
5522
 
@@ -5712,7 +5772,7 @@ export declare class Interactions extends BaseInteractions {
5712
5772
  }
5713
5773
 
5714
5774
  export declare namespace Interactions {
5715
- export { type AllowedTools as AllowedTools, type Annotation as Annotation, type AudioContent as AudioContent, type AudioMimeType as AudioMimeType, type CodeExecutionCallArguments as CodeExecutionCallArguments, type CodeExecutionCallContent as CodeExecutionCallContent, type CodeExecutionResultContent as CodeExecutionResultContent, type Content_2 as Content, type ContentDelta as ContentDelta, type ContentStart as ContentStart, type ContentStop as ContentStop, type DeepResearchAgentConfig as DeepResearchAgentConfig, type DocumentContent as DocumentContent, type DocumentMimeType as DocumentMimeType, type DynamicAgentConfig as DynamicAgentConfig, type ErrorEvent_2 as ErrorEvent, type FileSearchResultContent as FileSearchResultContent, type Function_2 as Function, type FunctionCallContent as FunctionCallContent, type FunctionResultContent as FunctionResultContent, type GenerationConfig_2 as GenerationConfig, type GoogleSearchCallArguments as GoogleSearchCallArguments, type GoogleSearchCallContent as GoogleSearchCallContent, type GoogleSearchResult as GoogleSearchResult, type GoogleSearchResultContent as GoogleSearchResultContent, type ImageContent as ImageContent, type ImageMimeType as ImageMimeType, type Interaction as Interaction, type InteractionEvent as InteractionEvent, type InteractionSSEEvent as InteractionSSEEvent, type InteractionStatusUpdate as InteractionStatusUpdate, type MCPServerToolCallContent as MCPServerToolCallContent, type MCPServerToolResultContent as MCPServerToolResultContent, type Model_2 as Model, type SpeechConfig_2 as SpeechConfig, type TextContent as TextContent, type ThinkingLevel_2 as ThinkingLevel, type ThoughtContent as ThoughtContent, type Tool_2 as Tool, type ToolChoice as ToolChoice, type ToolChoiceConfig as ToolChoiceConfig, type ToolChoiceType as ToolChoiceType, type Turn as Turn, type URLContextCallArguments as URLContextCallArguments, type URLContextCallContent as URLContextCallContent, type URLContextResult as URLContextResult, type URLContextResultContent as URLContextResultContent, type Usage as Usage, type VideoContent as VideoContent, type VideoMimeType as VideoMimeType, type InteractionDeleteResponse as InteractionDeleteResponse, type InteractionCreateParams as InteractionCreateParams, type CreateModelInteractionParamsNonStreaming as CreateModelInteractionParamsNonStreaming, type CreateModelInteractionParamsStreaming as CreateModelInteractionParamsStreaming, type CreateAgentInteractionParamsNonStreaming as CreateAgentInteractionParamsNonStreaming, type CreateAgentInteractionParamsStreaming as CreateAgentInteractionParamsStreaming, type InteractionDeleteParams as InteractionDeleteParams, type InteractionCancelParams as InteractionCancelParams, type InteractionGetParams as InteractionGetParams, type InteractionGetParamsNonStreaming as InteractionGetParamsNonStreaming, type InteractionGetParamsStreaming as InteractionGetParamsStreaming, };
5775
+ export { type AllowedTools as AllowedTools, type Annotation as Annotation, type AudioContent as AudioContent, type AudioMimeType as AudioMimeType, type CodeExecutionCallArguments as CodeExecutionCallArguments, type CodeExecutionCallContent as CodeExecutionCallContent, type CodeExecutionResultContent as CodeExecutionResultContent, type Content_2 as Content, type ContentDelta as ContentDelta, type ContentStart as ContentStart, type ContentStop as ContentStop, type DeepResearchAgentConfig as DeepResearchAgentConfig, type DocumentContent as DocumentContent, type DocumentMimeType as DocumentMimeType, type DynamicAgentConfig as DynamicAgentConfig, type ErrorEvent_2 as ErrorEvent, type FileSearchCallContent as FileSearchCallContent, type FileSearchResultContent as FileSearchResultContent, type Function_2 as Function, type FunctionCallContent as FunctionCallContent, type FunctionResultContent as FunctionResultContent, type GenerationConfig_2 as GenerationConfig, type GoogleSearchCallArguments as GoogleSearchCallArguments, type GoogleSearchCallContent as GoogleSearchCallContent, type GoogleSearchResult as GoogleSearchResult, type GoogleSearchResultContent as GoogleSearchResultContent, type ImageConfig_2 as ImageConfig, type ImageContent as ImageContent, type ImageMimeType as ImageMimeType, type Interaction as Interaction, type InteractionEvent as InteractionEvent, type InteractionSSEEvent as InteractionSSEEvent, type InteractionStatusUpdate as InteractionStatusUpdate, type MCPServerToolCallContent as MCPServerToolCallContent, type MCPServerToolResultContent as MCPServerToolResultContent, type Model_2 as Model, type SpeechConfig_2 as SpeechConfig, type TextContent as TextContent, type ThinkingLevel_2 as ThinkingLevel, type ThoughtContent as ThoughtContent, type Tool_2 as Tool, type ToolChoice as ToolChoice, type ToolChoiceConfig as ToolChoiceConfig, type ToolChoiceType as ToolChoiceType, type Turn as Turn, type URLContextCallArguments as URLContextCallArguments, type URLContextCallContent as URLContextCallContent, type URLContextResult as URLContextResult, type URLContextResultContent as URLContextResultContent, type Usage as Usage, type VideoContent as VideoContent, type VideoMimeType as VideoMimeType, type InteractionDeleteResponse as InteractionDeleteResponse, type InteractionCreateParams as InteractionCreateParams, type CreateModelInteractionParamsNonStreaming as CreateModelInteractionParamsNonStreaming, type CreateModelInteractionParamsStreaming as CreateModelInteractionParamsStreaming, type CreateAgentInteractionParamsNonStreaming as CreateAgentInteractionParamsNonStreaming, type CreateAgentInteractionParamsStreaming as CreateAgentInteractionParamsStreaming, type InteractionDeleteParams as InteractionDeleteParams, type InteractionCancelParams as InteractionCancelParams, type InteractionGetParams as InteractionGetParams, type InteractionGetParamsNonStreaming as InteractionGetParamsNonStreaming, type InteractionGetParamsStreaming as InteractionGetParamsStreaming, };
5716
5776
  }
5717
5777
 
5718
5778
  declare namespace InteractionsAPI {
@@ -5735,6 +5795,7 @@ declare namespace InteractionsAPI {
5735
5795
  DocumentMimeType,
5736
5796
  DynamicAgentConfig,
5737
5797
  ErrorEvent_2 as ErrorEvent,
5798
+ FileSearchCallContent,
5738
5799
  FileSearchResultContent,
5739
5800
  Function_2 as Function,
5740
5801
  FunctionCallContent,
@@ -5744,6 +5805,7 @@ declare namespace InteractionsAPI {
5744
5805
  GoogleSearchCallContent,
5745
5806
  GoogleSearchResult,
5746
5807
  GoogleSearchResultContent,
5808
+ ImageConfig_2 as ImageConfig,
5747
5809
  ImageContent,
5748
5810
  ImageMimeType,
5749
5811
  Interaction,
@@ -6817,8 +6879,10 @@ export declare class LiveServerMessage {
6817
6879
  goAway?: LiveServerGoAway;
6818
6880
  /** Update of the session resumption state. */
6819
6881
  sessionResumptionUpdate?: LiveServerSessionResumptionUpdate;
6820
- /** Voice activity detection signal. */
6882
+ /** Voice activity detection signal. Allowlisted only. */
6821
6883
  voiceActivityDetectionSignal?: VoiceActivityDetectionSignal;
6884
+ /** Voice activity signal. */
6885
+ voiceActivity?: VoiceActivity;
6822
6886
  /**
6823
6887
  * Returns the concatenation of all text parts from the server content if present.
6824
6888
  *
@@ -9835,6 +9899,7 @@ declare namespace types {
9835
9899
  TurnCompleteReason,
9836
9900
  MediaModality,
9837
9901
  VadSignalType,
9902
+ VoiceActivityType,
9838
9903
  StartSensitivity,
9839
9904
  EndSensitivity,
9840
9905
  ActivityHandling,
@@ -10157,6 +10222,7 @@ declare namespace types {
10157
10222
  LiveServerGoAway,
10158
10223
  LiveServerSessionResumptionUpdate,
10159
10224
  VoiceActivityDetectionSignal,
10225
+ VoiceActivity,
10160
10226
  LiveServerMessage,
10161
10227
  OperationFromAPIResponseParameters,
10162
10228
  GenerationConfigThinkingConfig,
@@ -10204,6 +10270,8 @@ declare namespace types {
10204
10270
  CreateAuthTokenConfig,
10205
10271
  CreateAuthTokenParameters,
10206
10272
  OperationGetParameters,
10273
+ CountTokensResult,
10274
+ ComputeTokensResult,
10207
10275
  CreateTuningJobParameters,
10208
10276
  UploadToFileSearchStoreResponse,
10209
10277
  UploadToFileSearchStoreOperation,
@@ -10844,6 +10912,9 @@ export declare enum VideoCompressionQuality {
10844
10912
  */
10845
10913
  declare interface VideoContent {
10846
10914
  type: 'video';
10915
+ /**
10916
+ * The video content.
10917
+ */
10847
10918
  data?: string;
10848
10919
  /**
10849
10920
  * The mime type of the video.
@@ -10853,6 +10924,9 @@ declare interface VideoContent {
10853
10924
  * The resolution of the media.
10854
10925
  */
10855
10926
  resolution?: 'low' | 'medium' | 'high' | 'ultra_high';
10927
+ /**
10928
+ * The URI of the video.
10929
+ */
10856
10930
  uri?: string;
10857
10931
  }
10858
10932
 
@@ -10932,11 +11006,33 @@ export declare interface VideoMetadata {
10932
11006
  */
10933
11007
  declare type VideoMimeType = 'video/mp4' | 'video/mpeg' | 'video/mov' | 'video/avi' | 'video/x-flv' | 'video/mpg' | 'video/webm' | 'video/wmv' | 'video/3gpp' | (string & {});
10934
11008
 
11009
+ /** Voice activity signal. */
11010
+ export declare interface VoiceActivity {
11011
+ /** The type of the voice activity signal. */
11012
+ voiceActivityType?: VoiceActivityType;
11013
+ }
11014
+
10935
11015
  export declare interface VoiceActivityDetectionSignal {
10936
11016
  /** The type of the VAD signal. */
10937
11017
  vadSignalType?: VadSignalType;
10938
11018
  }
10939
11019
 
11020
+ /** The type of the voice activity signal. */
11021
+ export declare enum VoiceActivityType {
11022
+ /**
11023
+ * The default is VOICE_ACTIVITY_TYPE_UNSPECIFIED.
11024
+ */
11025
+ TYPE_UNSPECIFIED = "TYPE_UNSPECIFIED",
11026
+ /**
11027
+ * Start of sentence signal.
11028
+ */
11029
+ ACTIVITY_START = "ACTIVITY_START",
11030
+ /**
11031
+ * End of sentence signal.
11032
+ */
11033
+ ACTIVITY_END = "ACTIVITY_END"
11034
+ }
11035
+
10940
11036
  export declare interface VoiceConfig {
10941
11037
  /** If true, the model will use a replicated voice for the response. */
10942
11038
  replicatedVoiceConfig?: ReplicatedVoiceConfig;