@google/genai 1.48.0 → 1.49.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 CHANGED
@@ -465,6 +465,10 @@ export declare interface AudioChunk {
465
465
  */
466
466
  declare interface AudioContent {
467
467
  type: 'audio';
468
+ /**
469
+ * The number of audio channels.
470
+ */
471
+ channels?: number;
468
472
  /**
469
473
  * The audio content.
470
474
  */
@@ -472,7 +476,11 @@ declare interface AudioContent {
472
476
  /**
473
477
  * The mime type of the audio.
474
478
  */
475
- mime_type?: 'audio/wav' | 'audio/mp3' | 'audio/aiff' | 'audio/aac' | 'audio/ogg' | 'audio/flac' | 'audio/mpeg' | 'audio/m4a';
479
+ mime_type?: 'audio/wav' | 'audio/mp3' | 'audio/aiff' | 'audio/aac' | 'audio/ogg' | 'audio/flac' | 'audio/mpeg' | 'audio/m4a' | 'audio/l16';
480
+ /**
481
+ * The sample rate of the audio.
482
+ */
483
+ rate?: number;
476
484
  /**
477
485
  * The URI of the audio.
478
486
  */
@@ -653,24 +661,26 @@ declare interface BaseCreateAgentInteractionParams {
653
661
  */
654
662
  previous_interaction_id?: string;
655
663
  /**
656
- * Body param: Enforces that the generated response is a JSON object that complies with
657
- * the JSON schema specified in this field.
664
+ * Body param: Enforces that the generated response is a JSON object that complies
665
+ * with the JSON schema specified in this field.
658
666
  */
659
667
  response_format?: unknown;
660
668
  /**
661
- * Body param: The mime type of the response. This is required if response_format is set.
669
+ * Body param: The mime type of the response. This is required if response_format
670
+ * is set.
662
671
  */
663
672
  response_mime_type?: string;
664
673
  /**
665
674
  * Body param: The requested modalities of the response (TEXT, IMAGE, AUDIO).
666
675
  */
667
- response_modalities?: Array<'text' | 'image' | 'audio'>;
676
+ response_modalities?: Array<'text' | 'image' | 'audio' | 'video' | 'document'>;
668
677
  /**
669
678
  * Body param: The service tier for the interaction.
670
679
  */
671
680
  service_tier?: 'flex' | 'standard' | 'priority';
672
681
  /**
673
- * Body param: Input only. Whether to store the response and request for later retrieval.
682
+ * Body param: Input only. Whether to store the response and request for later
683
+ * retrieval.
674
684
  */
675
685
  store?: boolean;
676
686
  /**
@@ -713,24 +723,26 @@ declare interface BaseCreateModelInteractionParams {
713
723
  */
714
724
  previous_interaction_id?: string;
715
725
  /**
716
- * Body param: Enforces that the generated response is a JSON object that complies with
717
- * the JSON schema specified in this field.
726
+ * Body param: Enforces that the generated response is a JSON object that complies
727
+ * with the JSON schema specified in this field.
718
728
  */
719
729
  response_format?: unknown;
720
730
  /**
721
- * Body param: The mime type of the response. This is required if response_format is set.
731
+ * Body param: The mime type of the response. This is required if response_format
732
+ * is set.
722
733
  */
723
734
  response_mime_type?: string;
724
735
  /**
725
736
  * Body param: The requested modalities of the response (TEXT, IMAGE, AUDIO).
726
737
  */
727
- response_modalities?: Array<'text' | 'image' | 'audio'>;
738
+ response_modalities?: Array<'text' | 'image' | 'audio' | 'video' | 'document'>;
728
739
  /**
729
740
  * Body param: The service tier for the interaction.
730
741
  */
731
742
  service_tier?: 'flex' | 'standard' | 'priority';
732
743
  /**
733
- * Body param: Input only. Whether to store the response and request for later retrieval.
744
+ * Body param: Input only. Whether to store the response and request for later
745
+ * retrieval.
734
746
  */
735
747
  store?: boolean;
736
748
  /**
@@ -868,7 +880,8 @@ declare class BaseInteractions extends APIResource {
868
880
  */
869
881
  delete(id: string, params?: InteractionDeleteParams | null | undefined, options?: RequestOptions): APIPromise<unknown>;
870
882
  /**
871
- * Cancels an interaction by id. This only applies to background interactions that are still running.
883
+ * Cancels an interaction by id. This only applies to background interactions that
884
+ * are still running.
872
885
  *
873
886
  * @example
874
887
  * ```ts
@@ -879,7 +892,8 @@ declare class BaseInteractions extends APIResource {
879
892
  */
880
893
  cancel(id: string, params?: InteractionCancelParams | null | undefined, options?: RequestOptions): APIPromise<Interaction>;
881
894
  /**
882
- * Retrieves the full details of a single interaction based on its `Interaction.id`.
895
+ * Retrieves the full details of a single interaction based on its
896
+ * `Interaction.id`.
883
897
  *
884
898
  * @example
885
899
  * ```ts
@@ -1665,7 +1679,7 @@ declare interface ClientOptions {
1665
1679
  /**
1666
1680
  * The adapter to the parent API client instance (for accessing auth, project, location)
1667
1681
  */
1668
- clientAdapter: GeminiNextGenAPIClientAdapter;
1682
+ clientAdapter?: GeminiNextGenAPIClientAdapter | undefined;
1669
1683
  }
1670
1684
 
1671
1685
  /**
@@ -1828,8 +1842,7 @@ declare interface ContentDelta {
1828
1842
  event_type: 'content.delta';
1829
1843
  index: number;
1830
1844
  /**
1831
- * The event_id token to be used to resume the interaction stream, from
1832
- * this event.
1845
+ * The event_id token to be used to resume the interaction stream, from this event.
1833
1846
  */
1834
1847
  event_id?: string;
1835
1848
  }
@@ -1851,8 +1864,16 @@ declare namespace ContentDelta {
1851
1864
  }
1852
1865
  interface Audio {
1853
1866
  type: 'audio';
1867
+ /**
1868
+ * The number of audio channels.
1869
+ */
1870
+ channels?: number;
1854
1871
  data?: string;
1855
- mime_type?: 'audio/wav' | 'audio/mp3' | 'audio/aiff' | 'audio/aac' | 'audio/ogg' | 'audio/flac' | 'audio/mpeg' | 'audio/m4a';
1872
+ mime_type?: 'audio/wav' | 'audio/mp3' | 'audio/aiff' | 'audio/aac' | 'audio/ogg' | 'audio/flac' | 'audio/mpeg' | 'audio/m4a' | 'audio/l16';
1873
+ /**
1874
+ * The sample rate of the audio.
1875
+ */
1876
+ rate?: number;
1856
1877
  uri?: string;
1857
1878
  }
1858
1879
  interface Document {
@@ -2149,8 +2170,7 @@ declare interface ContentStart {
2149
2170
  event_type: 'content.start';
2150
2171
  index: number;
2151
2172
  /**
2152
- * The event_id token to be used to resume the interaction stream, from
2153
- * this event.
2173
+ * The event_id token to be used to resume the interaction stream, from this event.
2154
2174
  */
2155
2175
  event_id?: string;
2156
2176
  }
@@ -2159,8 +2179,7 @@ declare interface ContentStop {
2159
2179
  event_type: 'content.stop';
2160
2180
  index: number;
2161
2181
  /**
2162
- * The event_id token to be used to resume the interaction stream, from
2163
- * this event.
2182
+ * The event_id token to be used to resume the interaction stream, from this event.
2164
2183
  */
2165
2184
  event_id?: string;
2166
2185
  }
@@ -3399,8 +3418,7 @@ declare interface ErrorEvent_2 {
3399
3418
  */
3400
3419
  error?: ErrorEvent_2.Error;
3401
3420
  /**
3402
- * The event_id token to be used to resume the interaction stream, from
3403
- * this event.
3421
+ * The event_id token to be used to resume the interaction stream, from this event.
3404
3422
  */
3405
3423
  event_id?: string;
3406
3424
  }
@@ -5379,8 +5397,8 @@ declare namespace GoogleMapsResult {
5379
5397
  */
5380
5398
  place_id?: string;
5381
5399
  /**
5382
- * Snippets of reviews that are used to generate answers about the
5383
- * features of a given place in Google Maps.
5400
+ * Snippets of reviews that are used to generate answers about the features of a
5401
+ * given place in Google Maps.
5384
5402
  */
5385
5403
  review_snippets?: Array<Place.ReviewSnippet>;
5386
5404
  /**
@@ -5390,8 +5408,8 @@ declare namespace GoogleMapsResult {
5390
5408
  }
5391
5409
  namespace Place {
5392
5410
  /**
5393
- * Encapsulates a snippet of a user review that answers a question about
5394
- * the features of a specific place in Google Maps.
5411
+ * Encapsulates a snippet of a user review that answers a question about the
5412
+ * features of a specific place in Google Maps.
5395
5413
  */
5396
5414
  interface ReviewSnippet {
5397
5415
  /**
@@ -5477,7 +5495,7 @@ declare interface GoogleSearchCallContent {
5477
5495
  /**
5478
5496
  * The type of search grounding enabled.
5479
5497
  */
5480
- search_type?: 'web_search' | 'image_search';
5498
+ search_type?: 'web_search' | 'image_search' | 'enterprise_web_search';
5481
5499
  /**
5482
5500
  * A signature hash for backend validation.
5483
5501
  */
@@ -6223,8 +6241,8 @@ declare interface Interaction {
6223
6241
  */
6224
6242
  id: string;
6225
6243
  /**
6226
- * Required. Output only. The time at which the response was created in ISO 8601 format
6227
- * (YYYY-MM-DDThh:mm:ssZ).
6244
+ * Required. Output only. The time at which the response was created in ISO 8601
6245
+ * format (YYYY-MM-DDThh:mm:ssZ).
6228
6246
  */
6229
6247
  created: string;
6230
6248
  /**
@@ -6232,8 +6250,8 @@ declare interface Interaction {
6232
6250
  */
6233
6251
  status: 'in_progress' | 'requires_action' | 'completed' | 'failed' | 'cancelled' | 'incomplete';
6234
6252
  /**
6235
- * Required. Output only. The time at which the response was last updated in ISO 8601 format
6236
- * (YYYY-MM-DDThh:mm:ssZ).
6253
+ * Required. Output only. The time at which the response was last updated in ISO
6254
+ * 8601 format (YYYY-MM-DDThh:mm:ssZ).
6237
6255
  */
6238
6256
  updated: string;
6239
6257
  /**
@@ -6261,8 +6279,8 @@ declare interface Interaction {
6261
6279
  */
6262
6280
  previous_interaction_id?: string;
6263
6281
  /**
6264
- * Enforces that the generated response is a JSON object that complies with
6265
- * the JSON schema specified in this field.
6282
+ * Enforces that the generated response is a JSON object that complies with the
6283
+ * JSON schema specified in this field.
6266
6284
  */
6267
6285
  response_format?: unknown;
6268
6286
  /**
@@ -6272,7 +6290,7 @@ declare interface Interaction {
6272
6290
  /**
6273
6291
  * The requested modalities of the response (TEXT, IMAGE, AUDIO).
6274
6292
  */
6275
- response_modalities?: Array<'text' | 'image' | 'audio'>;
6293
+ response_modalities?: Array<'text' | 'image' | 'audio' | 'video' | 'document'>;
6276
6294
  /**
6277
6295
  * Output only. The role of the interaction.
6278
6296
  */
@@ -6305,13 +6323,12 @@ declare interface InteractionCancelParams {
6305
6323
  declare interface InteractionCompleteEvent {
6306
6324
  event_type: 'interaction.complete';
6307
6325
  /**
6308
- * Required. The completed interaction with empty outputs to reduce the payload size.
6309
- * Use the preceding ContentDelta events for the actual output.
6326
+ * Required. The completed interaction with empty outputs to reduce the payload
6327
+ * size. Use the preceding ContentDelta events for the actual output.
6310
6328
  */
6311
6329
  interaction: Interaction;
6312
6330
  /**
6313
- * The event_id token to be used to resume the interaction stream, from
6314
- * this event.
6331
+ * The event_id token to be used to resume the interaction stream, from this event.
6315
6332
  */
6316
6333
  event_id?: string;
6317
6334
  }
@@ -6344,25 +6361,30 @@ declare interface InteractionGetParamsBase {
6344
6361
  */
6345
6362
  include_input?: boolean;
6346
6363
  /**
6347
- * Query param: Optional. If set, resumes the interaction stream from the next chunk after the event marked by the event id. Can only be used if `stream` is true.
6364
+ * Query param: Optional. If set, resumes the interaction stream from the next
6365
+ * chunk after the event marked by the event id. Can only be used if `stream` is
6366
+ * true.
6348
6367
  */
6349
6368
  last_event_id?: string;
6350
6369
  /**
6351
- * Query param: If set to true, the generated content will be streamed incrementally.
6370
+ * Query param: If set to true, the generated content will be streamed
6371
+ * incrementally.
6352
6372
  */
6353
6373
  stream?: boolean;
6354
6374
  }
6355
6375
 
6356
6376
  declare interface InteractionGetParamsNonStreaming extends InteractionGetParamsBase {
6357
6377
  /**
6358
- * Query param: If set to true, the generated content will be streamed incrementally.
6378
+ * Query param: If set to true, the generated content will be streamed
6379
+ * incrementally.
6359
6380
  */
6360
6381
  stream?: false;
6361
6382
  }
6362
6383
 
6363
6384
  declare interface InteractionGetParamsStreaming extends InteractionGetParamsBase {
6364
6385
  /**
6365
- * Query param: If set to true, the generated content will be streamed incrementally.
6386
+ * Query param: If set to true, the generated content will be streamed
6387
+ * incrementally.
6366
6388
  */
6367
6389
  stream: true;
6368
6390
  }
@@ -6459,8 +6481,7 @@ declare interface InteractionStartEvent {
6459
6481
  */
6460
6482
  interaction: Interaction;
6461
6483
  /**
6462
- * The event_id token to be used to resume the interaction stream, from
6463
- * this event.
6484
+ * The event_id token to be used to resume the interaction stream, from this event.
6464
6485
  */
6465
6486
  event_id?: string;
6466
6487
  }
@@ -6470,8 +6491,7 @@ declare interface InteractionStatusUpdate {
6470
6491
  interaction_id: string;
6471
6492
  status: 'in_progress' | 'requires_action' | 'completed' | 'failed' | 'cancelled' | 'incomplete';
6472
6493
  /**
6473
- * The event_id token to be used to resume the interaction stream, from
6474
- * this event.
6494
+ * The event_id token to be used to resume the interaction stream, from this event.
6475
6495
  */
6476
6496
  event_id?: string;
6477
6497
  }
@@ -7862,7 +7882,8 @@ export declare interface Model {
7862
7882
  }
7863
7883
 
7864
7884
  /**
7865
- * The model that will complete your prompt.\n\nSee [models](https://ai.google.dev/gemini-api/docs/models) for additional details.
7885
+ * The model that will complete your prompt.\n\nSee
7886
+ * [models](https://ai.google.dev/gemini-api/docs/models) for additional details.
7866
7887
  */
7867
7888
  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' | 'lyria-3-clip-preview' | 'lyria-3-pro-preview' | (string & {});
7868
7889
 
@@ -8125,29 +8146,15 @@ export declare class Models extends BaseModule {
8125
8146
  /**
8126
8147
  * Recontextualizes an image.
8127
8148
  *
8128
- * There are two types of recontextualization currently supported:
8129
- * 1) Imagen Product Recontext - Generate images of products in new scenes
8130
- * and contexts.
8131
- * 2) Virtual Try-On: Generate images of persons modeling fashion products.
8149
+ * There is one type of recontextualization currently supported:
8150
+ * 1) Virtual Try-On: Generate images of persons modeling fashion products.
8132
8151
  *
8133
8152
  * @param params - The parameters for recontextualizing an image.
8134
8153
  * @return The response from the API.
8135
8154
  *
8136
8155
  * @example
8137
8156
  * ```ts
8138
- * const response1 = await ai.models.recontextImage({
8139
- * model: 'imagen-product-recontext-preview-06-30',
8140
- * source: {
8141
- * prompt: 'In a modern kitchen setting.',
8142
- * productImages: [productImage],
8143
- * },
8144
- * config: {
8145
- * numberOfImages: 1,
8146
- * },
8147
- * });
8148
- * console.log(response1?.generatedImages?.[0]?.image?.imageBytes);
8149
- *
8150
- * const response2 = await ai.models.recontextImage({
8157
+ * const response = await ai.models.recontextImage({
8151
8158
  * model: 'virtual-try-on-001',
8152
8159
  * source: {
8153
8160
  * personImage: personImage,
@@ -8157,7 +8164,7 @@ export declare class Models extends BaseModule {
8157
8164
  * numberOfImages: 1,
8158
8165
  * },
8159
8166
  * });
8160
- * console.log(response2?.generatedImages?.[0]?.image?.imageBytes);
8167
+ * console.log(response?.generatedImages?.[0]?.image?.imageBytes);
8161
8168
  * ```
8162
8169
  */
8163
8170
  recontextImage(params: types.RecontextImageParameters): Promise<types.RecontextImageResponse>;
@@ -8816,8 +8823,8 @@ declare interface PlaceCitation {
8816
8823
  */
8817
8824
  place_id?: string;
8818
8825
  /**
8819
- * Snippets of reviews that are used to generate answers about the
8820
- * features of a given place in Google Maps.
8826
+ * Snippets of reviews that are used to generate answers about the features of a
8827
+ * given place in Google Maps.
8821
8828
  */
8822
8829
  review_snippets?: Array<PlaceCitation.ReviewSnippet>;
8823
8830
  /**
@@ -8834,8 +8841,8 @@ declare interface PlaceCitation {
8834
8841
 
8835
8842
  declare namespace PlaceCitation {
8836
8843
  /**
8837
- * Encapsulates a snippet of a user review that answers a question about
8838
- * the features of a specific place in Google Maps.
8844
+ * Encapsulates a snippet of a user review that answers a question about the
8845
+ * features of a specific place in Google Maps.
8839
8846
  */
8840
8847
  interface ReviewSnippet {
8841
8848
  /**
@@ -10323,7 +10330,7 @@ export declare interface Tool {
10323
10330
  /**
10324
10331
  * A tool that can be used by the model.
10325
10332
  */
10326
- declare type Tool_2 = Function_2 | Tool_2.CodeExecution | Tool_2.URLContext | Tool_2.ComputerUse | Tool_2.MCPServer | Tool_2.GoogleSearch | Tool_2.FileSearch | Tool_2.GoogleMaps;
10333
+ declare type Tool_2 = Function_2 | Tool_2.CodeExecution | Tool_2.URLContext | Tool_2.ComputerUse | Tool_2.MCPServer | Tool_2.GoogleSearch | Tool_2.FileSearch | Tool_2.GoogleMaps | Tool_2.Retrieval;
10327
10334
 
10328
10335
  declare namespace Tool_2 {
10329
10336
  /**
@@ -10372,8 +10379,7 @@ declare namespace Tool_2 {
10372
10379
  */
10373
10380
  name?: string;
10374
10381
  /**
10375
- * The full URL for the MCPServer endpoint.
10376
- * Example: "https://api.example.com/mcp"
10382
+ * The full URL for the MCPServer endpoint. Example: "https://api.example.com/mcp"
10377
10383
  */
10378
10384
  url?: string;
10379
10385
  }
@@ -10385,7 +10391,7 @@ declare namespace Tool_2 {
10385
10391
  /**
10386
10392
  * The types of search grounding to enable.
10387
10393
  */
10388
- search_types?: Array<'web_search' | 'image_search'>;
10394
+ search_types?: Array<'web_search' | 'image_search' | 'enterprise_web_search'>;
10389
10395
  }
10390
10396
  /**
10391
10397
  * A tool that can be used by the model to search files.
@@ -10424,6 +10430,35 @@ declare namespace Tool_2 {
10424
10430
  */
10425
10431
  longitude?: number;
10426
10432
  }
10433
+ /**
10434
+ * A tool that can be used by the model to retrieve files.
10435
+ */
10436
+ interface Retrieval {
10437
+ type: 'retrieval';
10438
+ /**
10439
+ * The types of file retrieval to enable.
10440
+ */
10441
+ retrieval_types?: Array<'vertex_ai_search'>;
10442
+ /**
10443
+ * Used to specify configuration for VertexAISearch.
10444
+ */
10445
+ vertex_ai_search_config?: Retrieval.VertexAISearchConfig;
10446
+ }
10447
+ namespace Retrieval {
10448
+ /**
10449
+ * Used to specify configuration for VertexAISearch.
10450
+ */
10451
+ interface VertexAISearchConfig {
10452
+ /**
10453
+ * Optional. Used to specify Vertex AI Search datastores.
10454
+ */
10455
+ datastores?: Array<string>;
10456
+ /**
10457
+ * Optional. Used to specify Vertex AI Search engine.
10458
+ */
10459
+ engine?: string;
10460
+ }
10461
+ }
10427
10462
  }
10428
10463
 
10429
10464
  /** A predicted server-side `ToolCall` returned from the model.
@@ -10864,8 +10899,7 @@ export declare interface TuningValidationDataset {
10864
10899
  declare interface Turn {
10865
10900
  content?: Array<Content_2> | string;
10866
10901
  /**
10867
- * The originator of this turn. Must be user for input or model for
10868
- * model output.
10902
+ * The originator of this turn. Must be user for input or model for model output.
10869
10903
  */
10870
10904
  role?: string;
10871
10905
  }
@@ -11914,7 +11948,7 @@ declare namespace Usage {
11914
11948
  /**
11915
11949
  * The modality associated with the token count.
11916
11950
  */
11917
- modality?: 'text' | 'image' | 'audio';
11951
+ modality?: 'text' | 'image' | 'audio' | 'video' | 'document';
11918
11952
  /**
11919
11953
  * Number of tokens for the modality.
11920
11954
  */
@@ -11927,7 +11961,7 @@ declare namespace Usage {
11927
11961
  /**
11928
11962
  * The modality associated with the token count.
11929
11963
  */
11930
- modality?: 'text' | 'image' | 'audio';
11964
+ modality?: 'text' | 'image' | 'audio' | 'video' | 'document';
11931
11965
  /**
11932
11966
  * Number of tokens for the modality.
11933
11967
  */
@@ -11940,7 +11974,7 @@ declare namespace Usage {
11940
11974
  /**
11941
11975
  * The modality associated with the token count.
11942
11976
  */
11943
- modality?: 'text' | 'image' | 'audio';
11977
+ modality?: 'text' | 'image' | 'audio' | 'video' | 'document';
11944
11978
  /**
11945
11979
  * Number of tokens for the modality.
11946
11980
  */
@@ -11953,7 +11987,7 @@ declare namespace Usage {
11953
11987
  /**
11954
11988
  * The modality associated with the token count.
11955
11989
  */
11956
- modality?: 'text' | 'image' | 'audio';
11990
+ modality?: 'text' | 'image' | 'audio' | 'video' | 'document';
11957
11991
  /**
11958
11992
  * Number of tokens for the modality.
11959
11993
  */
package/dist/index.cjs CHANGED
@@ -7429,7 +7429,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
7429
7429
  const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
7430
7430
  const USER_AGENT_HEADER = 'User-Agent';
7431
7431
  const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
7432
- const SDK_VERSION = '1.48.0'; // x-release-please-version
7432
+ const SDK_VERSION = '1.49.0'; // x-release-please-version
7433
7433
  const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
7434
7434
  const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
7435
7435
  const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';
@@ -9814,7 +9814,8 @@ class BaseInteractions extends APIResource {
9814
9814
  return this._client.delete(path `/${api_version}/interactions/${id}`, options);
9815
9815
  }
9816
9816
  /**
9817
- * Cancels an interaction by id. This only applies to background interactions that are still running.
9817
+ * Cancels an interaction by id. This only applies to background interactions that
9818
+ * are still running.
9818
9819
  *
9819
9820
  * @example
9820
9821
  * ```ts
@@ -10670,7 +10671,7 @@ class BaseGeminiNextGenAPIClient {
10670
10671
  if (this.apiKey) {
10671
10672
  return buildHeaders([{ 'x-goog-api-key': this.apiKey }]);
10672
10673
  }
10673
- if (this.clientAdapter.isVertexAI()) {
10674
+ if (this.clientAdapter && this.clientAdapter.isVertexAI()) {
10674
10675
  return buildHeaders([await this.clientAdapter.getAuthHeaders()]);
10675
10676
  }
10676
10677
  return undefined;
@@ -17782,29 +17783,15 @@ class Models extends BaseModule {
17782
17783
  /**
17783
17784
  * Recontextualizes an image.
17784
17785
  *
17785
- * There are two types of recontextualization currently supported:
17786
- * 1) Imagen Product Recontext - Generate images of products in new scenes
17787
- * and contexts.
17788
- * 2) Virtual Try-On: Generate images of persons modeling fashion products.
17786
+ * There is one type of recontextualization currently supported:
17787
+ * 1) Virtual Try-On: Generate images of persons modeling fashion products.
17789
17788
  *
17790
17789
  * @param params - The parameters for recontextualizing an image.
17791
17790
  * @return The response from the API.
17792
17791
  *
17793
17792
  * @example
17794
17793
  * ```ts
17795
- * const response1 = await ai.models.recontextImage({
17796
- * model: 'imagen-product-recontext-preview-06-30',
17797
- * source: {
17798
- * prompt: 'In a modern kitchen setting.',
17799
- * productImages: [productImage],
17800
- * },
17801
- * config: {
17802
- * numberOfImages: 1,
17803
- * },
17804
- * });
17805
- * console.log(response1?.generatedImages?.[0]?.image?.imageBytes);
17806
- *
17807
- * const response2 = await ai.models.recontextImage({
17794
+ * const response = await ai.models.recontextImage({
17808
17795
  * model: 'virtual-try-on-001',
17809
17796
  * source: {
17810
17797
  * personImage: personImage,
@@ -17814,7 +17801,7 @@ class Models extends BaseModule {
17814
17801
  * numberOfImages: 1,
17815
17802
  * },
17816
17803
  * });
17817
- * console.log(response2?.generatedImages?.[0]?.image?.imageBytes);
17804
+ * console.log(response?.generatedImages?.[0]?.image?.imageBytes);
17818
17805
  * ```
17819
17806
  */
17820
17807
  async recontextImage(params) {
@@ -20615,9 +20602,6 @@ class GoogleGenAI {
20615
20602
  return this._interactions;
20616
20603
  }
20617
20604
  console.warn('GoogleGenAI.interactions: Interactions usage is experimental and may change in future versions.');
20618
- if (this.vertexai) {
20619
- throw new Error('This version of the GenAI SDK does not support Vertex AI API for interactions.');
20620
- }
20621
20605
  const httpOpts = this.httpOptions;
20622
20606
  // Unsupported Options Warnings
20623
20607
  if (httpOpts === null || httpOpts === void 0 ? void 0 : httpOpts.extraBody) {
package/dist/index.mjs CHANGED
@@ -7427,7 +7427,7 @@ const CONTENT_TYPE_HEADER = 'Content-Type';
7427
7427
  const SERVER_TIMEOUT_HEADER = 'X-Server-Timeout';
7428
7428
  const USER_AGENT_HEADER = 'User-Agent';
7429
7429
  const GOOGLE_API_CLIENT_HEADER = 'x-goog-api-client';
7430
- const SDK_VERSION = '1.48.0'; // x-release-please-version
7430
+ const SDK_VERSION = '1.49.0'; // x-release-please-version
7431
7431
  const LIBRARY_LABEL = `google-genai-sdk/${SDK_VERSION}`;
7432
7432
  const VERTEX_AI_API_DEFAULT_VERSION = 'v1beta1';
7433
7433
  const GOOGLE_AI_API_DEFAULT_VERSION = 'v1beta';
@@ -9812,7 +9812,8 @@ class BaseInteractions extends APIResource {
9812
9812
  return this._client.delete(path `/${api_version}/interactions/${id}`, options);
9813
9813
  }
9814
9814
  /**
9815
- * Cancels an interaction by id. This only applies to background interactions that are still running.
9815
+ * Cancels an interaction by id. This only applies to background interactions that
9816
+ * are still running.
9816
9817
  *
9817
9818
  * @example
9818
9819
  * ```ts
@@ -10668,7 +10669,7 @@ class BaseGeminiNextGenAPIClient {
10668
10669
  if (this.apiKey) {
10669
10670
  return buildHeaders([{ 'x-goog-api-key': this.apiKey }]);
10670
10671
  }
10671
- if (this.clientAdapter.isVertexAI()) {
10672
+ if (this.clientAdapter && this.clientAdapter.isVertexAI()) {
10672
10673
  return buildHeaders([await this.clientAdapter.getAuthHeaders()]);
10673
10674
  }
10674
10675
  return undefined;
@@ -17780,29 +17781,15 @@ class Models extends BaseModule {
17780
17781
  /**
17781
17782
  * Recontextualizes an image.
17782
17783
  *
17783
- * There are two types of recontextualization currently supported:
17784
- * 1) Imagen Product Recontext - Generate images of products in new scenes
17785
- * and contexts.
17786
- * 2) Virtual Try-On: Generate images of persons modeling fashion products.
17784
+ * There is one type of recontextualization currently supported:
17785
+ * 1) Virtual Try-On: Generate images of persons modeling fashion products.
17787
17786
  *
17788
17787
  * @param params - The parameters for recontextualizing an image.
17789
17788
  * @return The response from the API.
17790
17789
  *
17791
17790
  * @example
17792
17791
  * ```ts
17793
- * const response1 = await ai.models.recontextImage({
17794
- * model: 'imagen-product-recontext-preview-06-30',
17795
- * source: {
17796
- * prompt: 'In a modern kitchen setting.',
17797
- * productImages: [productImage],
17798
- * },
17799
- * config: {
17800
- * numberOfImages: 1,
17801
- * },
17802
- * });
17803
- * console.log(response1?.generatedImages?.[0]?.image?.imageBytes);
17804
- *
17805
- * const response2 = await ai.models.recontextImage({
17792
+ * const response = await ai.models.recontextImage({
17806
17793
  * model: 'virtual-try-on-001',
17807
17794
  * source: {
17808
17795
  * personImage: personImage,
@@ -17812,7 +17799,7 @@ class Models extends BaseModule {
17812
17799
  * numberOfImages: 1,
17813
17800
  * },
17814
17801
  * });
17815
- * console.log(response2?.generatedImages?.[0]?.image?.imageBytes);
17802
+ * console.log(response?.generatedImages?.[0]?.image?.imageBytes);
17816
17803
  * ```
17817
17804
  */
17818
17805
  async recontextImage(params) {
@@ -20613,9 +20600,6 @@ class GoogleGenAI {
20613
20600
  return this._interactions;
20614
20601
  }
20615
20602
  console.warn('GoogleGenAI.interactions: Interactions usage is experimental and may change in future versions.');
20616
- if (this.vertexai) {
20617
- throw new Error('This version of the GenAI SDK does not support Vertex AI API for interactions.');
20618
- }
20619
20603
  const httpOpts = this.httpOptions;
20620
20604
  // Unsupported Options Warnings
20621
20605
  if (httpOpts === null || httpOpts === void 0 ? void 0 : httpOpts.extraBody) {