@google/genai 1.47.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 +127 -90
- package/dist/index.cjs +15 -30
- package/dist/index.mjs +15 -30
- package/dist/index.mjs.map +1 -1
- package/dist/node/index.cjs +15 -27
- package/dist/node/index.mjs +15 -27
- package/dist/node/index.mjs.map +1 -1
- package/dist/node/node.d.ts +127 -90
- package/dist/tokenizer/node.cjs +4 -4
- package/dist/tokenizer/node.mjs +4 -4
- package/dist/tokenizer/node.mjs.map +1 -1
- package/dist/vertex_internal/index.cjs +5 -5
- package/dist/vertex_internal/index.cjs.map +1 -1
- package/dist/vertex_internal/index.d.ts +5 -5
- package/dist/vertex_internal/index.js +5 -5
- package/dist/vertex_internal/index.js.map +1 -1
- package/dist/web/index.mjs +15 -27
- package/dist/web/index.mjs.map +1 -1
- package/dist/web/web.d.ts +127 -90
- package/package.json +1 -1
package/dist/node/node.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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
1682
|
+
clientAdapter?: GeminiNextGenAPIClientAdapter | undefined;
|
|
1669
1683
|
}
|
|
1670
1684
|
|
|
1671
1685
|
/**
|
|
@@ -1824,12 +1838,11 @@ declare interface ContentDelta {
|
|
|
1824
1838
|
/**
|
|
1825
1839
|
* The delta content data for a content block.
|
|
1826
1840
|
*/
|
|
1827
|
-
delta: ContentDelta.Text | ContentDelta.Image | ContentDelta.Audio | ContentDelta.Document | ContentDelta.Video | ContentDelta.ThoughtSummary | ContentDelta.ThoughtSignature | ContentDelta.FunctionCall | ContentDelta.CodeExecutionCall | ContentDelta.URLContextCall | ContentDelta.GoogleSearchCall | ContentDelta.MCPServerToolCall | ContentDelta.FileSearchCall | ContentDelta.GoogleMapsCall | ContentDelta.FunctionResult | ContentDelta.CodeExecutionResult | ContentDelta.URLContextResult | ContentDelta.GoogleSearchResult | ContentDelta.MCPServerToolResult | ContentDelta.FileSearchResult | ContentDelta.GoogleMapsResult;
|
|
1841
|
+
delta: ContentDelta.Text | ContentDelta.Image | ContentDelta.Audio | ContentDelta.Document | ContentDelta.Video | ContentDelta.ThoughtSummary | ContentDelta.ThoughtSignature | ContentDelta.FunctionCall | ContentDelta.CodeExecutionCall | ContentDelta.URLContextCall | ContentDelta.GoogleSearchCall | ContentDelta.MCPServerToolCall | ContentDelta.FileSearchCall | ContentDelta.GoogleMapsCall | ContentDelta.FunctionResult | ContentDelta.CodeExecutionResult | ContentDelta.URLContextResult | ContentDelta.GoogleSearchResult | ContentDelta.MCPServerToolResult | ContentDelta.FileSearchResult | ContentDelta.GoogleMapsResult | ContentDelta.TextAnnotation;
|
|
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
|
}
|
|
@@ -1838,10 +1851,6 @@ declare namespace ContentDelta {
|
|
|
1838
1851
|
interface Text {
|
|
1839
1852
|
text: string;
|
|
1840
1853
|
type: 'text';
|
|
1841
|
-
/**
|
|
1842
|
-
* Citation information for model-generated content.
|
|
1843
|
-
*/
|
|
1844
|
-
annotations?: Array<InteractionsAPI.Annotation>;
|
|
1845
1854
|
}
|
|
1846
1855
|
interface Image {
|
|
1847
1856
|
type: 'image';
|
|
@@ -1855,8 +1864,16 @@ declare namespace ContentDelta {
|
|
|
1855
1864
|
}
|
|
1856
1865
|
interface Audio {
|
|
1857
1866
|
type: 'audio';
|
|
1867
|
+
/**
|
|
1868
|
+
* The number of audio channels.
|
|
1869
|
+
*/
|
|
1870
|
+
channels?: number;
|
|
1858
1871
|
data?: string;
|
|
1859
|
-
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;
|
|
1860
1877
|
uri?: string;
|
|
1861
1878
|
}
|
|
1862
1879
|
interface Document {
|
|
@@ -2096,6 +2113,13 @@ declare namespace ContentDelta {
|
|
|
2096
2113
|
*/
|
|
2097
2114
|
signature?: string;
|
|
2098
2115
|
}
|
|
2116
|
+
interface TextAnnotation {
|
|
2117
|
+
type: 'text_annotation';
|
|
2118
|
+
/**
|
|
2119
|
+
* Citation information for model-generated content.
|
|
2120
|
+
*/
|
|
2121
|
+
annotations?: Array<InteractionsAPI.Annotation>;
|
|
2122
|
+
}
|
|
2099
2123
|
}
|
|
2100
2124
|
|
|
2101
2125
|
/** The embedding generated from an input content. */
|
|
@@ -2146,8 +2170,7 @@ declare interface ContentStart {
|
|
|
2146
2170
|
event_type: 'content.start';
|
|
2147
2171
|
index: number;
|
|
2148
2172
|
/**
|
|
2149
|
-
* The event_id token to be used to resume the interaction stream, from
|
|
2150
|
-
* this event.
|
|
2173
|
+
* The event_id token to be used to resume the interaction stream, from this event.
|
|
2151
2174
|
*/
|
|
2152
2175
|
event_id?: string;
|
|
2153
2176
|
}
|
|
@@ -2156,8 +2179,7 @@ declare interface ContentStop {
|
|
|
2156
2179
|
event_type: 'content.stop';
|
|
2157
2180
|
index: number;
|
|
2158
2181
|
/**
|
|
2159
|
-
* The event_id token to be used to resume the interaction stream, from
|
|
2160
|
-
* this event.
|
|
2182
|
+
* The event_id token to be used to resume the interaction stream, from this event.
|
|
2161
2183
|
*/
|
|
2162
2184
|
event_id?: string;
|
|
2163
2185
|
}
|
|
@@ -3396,8 +3418,7 @@ declare interface ErrorEvent_2 {
|
|
|
3396
3418
|
*/
|
|
3397
3419
|
error?: ErrorEvent_2.Error;
|
|
3398
3420
|
/**
|
|
3399
|
-
* The event_id token to be used to resume the interaction stream, from
|
|
3400
|
-
* this event.
|
|
3421
|
+
* The event_id token to be used to resume the interaction stream, from this event.
|
|
3401
3422
|
*/
|
|
3402
3423
|
event_id?: string;
|
|
3403
3424
|
}
|
|
@@ -4467,7 +4488,7 @@ export declare interface GenerateContentConfig {
|
|
|
4467
4488
|
service. If supplied, safety_settings must not be supplied.
|
|
4468
4489
|
*/
|
|
4469
4490
|
modelArmorConfig?: ModelArmorConfig;
|
|
4470
|
-
/** The service tier to use for the request. For example,
|
|
4491
|
+
/** The service tier to use for the request. For example, ServiceTier.FLEX. */
|
|
4471
4492
|
serviceTier?: ServiceTier;
|
|
4472
4493
|
}
|
|
4473
4494
|
|
|
@@ -5388,8 +5409,8 @@ declare namespace GoogleMapsResult {
|
|
|
5388
5409
|
*/
|
|
5389
5410
|
place_id?: string;
|
|
5390
5411
|
/**
|
|
5391
|
-
* Snippets of reviews that are used to generate answers about the
|
|
5392
|
-
*
|
|
5412
|
+
* Snippets of reviews that are used to generate answers about the features of a
|
|
5413
|
+
* given place in Google Maps.
|
|
5393
5414
|
*/
|
|
5394
5415
|
review_snippets?: Array<Place.ReviewSnippet>;
|
|
5395
5416
|
/**
|
|
@@ -5399,8 +5420,8 @@ declare namespace GoogleMapsResult {
|
|
|
5399
5420
|
}
|
|
5400
5421
|
namespace Place {
|
|
5401
5422
|
/**
|
|
5402
|
-
* Encapsulates a snippet of a user review that answers a question about
|
|
5403
|
-
*
|
|
5423
|
+
* Encapsulates a snippet of a user review that answers a question about the
|
|
5424
|
+
* features of a specific place in Google Maps.
|
|
5404
5425
|
*/
|
|
5405
5426
|
interface ReviewSnippet {
|
|
5406
5427
|
/**
|
|
@@ -5486,7 +5507,7 @@ declare interface GoogleSearchCallContent {
|
|
|
5486
5507
|
/**
|
|
5487
5508
|
* The type of search grounding enabled.
|
|
5488
5509
|
*/
|
|
5489
|
-
search_type?: 'web_search' | 'image_search';
|
|
5510
|
+
search_type?: 'web_search' | 'image_search' | 'enterprise_web_search';
|
|
5490
5511
|
/**
|
|
5491
5512
|
* A signature hash for backend validation.
|
|
5492
5513
|
*/
|
|
@@ -6232,8 +6253,8 @@ declare interface Interaction {
|
|
|
6232
6253
|
*/
|
|
6233
6254
|
id: string;
|
|
6234
6255
|
/**
|
|
6235
|
-
* Required. Output only. The time at which the response was created in ISO 8601
|
|
6236
|
-
* (YYYY-MM-DDThh:mm:ssZ).
|
|
6256
|
+
* Required. Output only. The time at which the response was created in ISO 8601
|
|
6257
|
+
* format (YYYY-MM-DDThh:mm:ssZ).
|
|
6237
6258
|
*/
|
|
6238
6259
|
created: string;
|
|
6239
6260
|
/**
|
|
@@ -6241,8 +6262,8 @@ declare interface Interaction {
|
|
|
6241
6262
|
*/
|
|
6242
6263
|
status: 'in_progress' | 'requires_action' | 'completed' | 'failed' | 'cancelled' | 'incomplete';
|
|
6243
6264
|
/**
|
|
6244
|
-
* Required. Output only. The time at which the response was last updated in ISO
|
|
6245
|
-
* (YYYY-MM-DDThh:mm:ssZ).
|
|
6265
|
+
* Required. Output only. The time at which the response was last updated in ISO
|
|
6266
|
+
* 8601 format (YYYY-MM-DDThh:mm:ssZ).
|
|
6246
6267
|
*/
|
|
6247
6268
|
updated: string;
|
|
6248
6269
|
/**
|
|
@@ -6270,8 +6291,8 @@ declare interface Interaction {
|
|
|
6270
6291
|
*/
|
|
6271
6292
|
previous_interaction_id?: string;
|
|
6272
6293
|
/**
|
|
6273
|
-
* Enforces that the generated response is a JSON object that complies with
|
|
6274
|
-
*
|
|
6294
|
+
* Enforces that the generated response is a JSON object that complies with the
|
|
6295
|
+
* JSON schema specified in this field.
|
|
6275
6296
|
*/
|
|
6276
6297
|
response_format?: unknown;
|
|
6277
6298
|
/**
|
|
@@ -6281,7 +6302,7 @@ declare interface Interaction {
|
|
|
6281
6302
|
/**
|
|
6282
6303
|
* The requested modalities of the response (TEXT, IMAGE, AUDIO).
|
|
6283
6304
|
*/
|
|
6284
|
-
response_modalities?: Array<'text' | 'image' | 'audio'>;
|
|
6305
|
+
response_modalities?: Array<'text' | 'image' | 'audio' | 'video' | 'document'>;
|
|
6285
6306
|
/**
|
|
6286
6307
|
* Output only. The role of the interaction.
|
|
6287
6308
|
*/
|
|
@@ -6314,13 +6335,12 @@ declare interface InteractionCancelParams {
|
|
|
6314
6335
|
declare interface InteractionCompleteEvent {
|
|
6315
6336
|
event_type: 'interaction.complete';
|
|
6316
6337
|
/**
|
|
6317
|
-
* Required. The completed interaction with empty outputs to reduce the payload
|
|
6318
|
-
* Use the preceding ContentDelta events for the actual output.
|
|
6338
|
+
* Required. The completed interaction with empty outputs to reduce the payload
|
|
6339
|
+
* size. Use the preceding ContentDelta events for the actual output.
|
|
6319
6340
|
*/
|
|
6320
6341
|
interaction: Interaction;
|
|
6321
6342
|
/**
|
|
6322
|
-
* The event_id token to be used to resume the interaction stream, from
|
|
6323
|
-
* this event.
|
|
6343
|
+
* The event_id token to be used to resume the interaction stream, from this event.
|
|
6324
6344
|
*/
|
|
6325
6345
|
event_id?: string;
|
|
6326
6346
|
}
|
|
@@ -6353,25 +6373,30 @@ declare interface InteractionGetParamsBase {
|
|
|
6353
6373
|
*/
|
|
6354
6374
|
include_input?: boolean;
|
|
6355
6375
|
/**
|
|
6356
|
-
* Query param: Optional. If set, resumes the interaction stream from the next
|
|
6376
|
+
* Query param: Optional. If set, resumes the interaction stream from the next
|
|
6377
|
+
* chunk after the event marked by the event id. Can only be used if `stream` is
|
|
6378
|
+
* true.
|
|
6357
6379
|
*/
|
|
6358
6380
|
last_event_id?: string;
|
|
6359
6381
|
/**
|
|
6360
|
-
* Query param: If set to true, the generated content will be streamed
|
|
6382
|
+
* Query param: If set to true, the generated content will be streamed
|
|
6383
|
+
* incrementally.
|
|
6361
6384
|
*/
|
|
6362
6385
|
stream?: boolean;
|
|
6363
6386
|
}
|
|
6364
6387
|
|
|
6365
6388
|
declare interface InteractionGetParamsNonStreaming extends InteractionGetParamsBase {
|
|
6366
6389
|
/**
|
|
6367
|
-
* Query param: If set to true, the generated content will be streamed
|
|
6390
|
+
* Query param: If set to true, the generated content will be streamed
|
|
6391
|
+
* incrementally.
|
|
6368
6392
|
*/
|
|
6369
6393
|
stream?: false;
|
|
6370
6394
|
}
|
|
6371
6395
|
|
|
6372
6396
|
declare interface InteractionGetParamsStreaming extends InteractionGetParamsBase {
|
|
6373
6397
|
/**
|
|
6374
|
-
* Query param: If set to true, the generated content will be streamed
|
|
6398
|
+
* Query param: If set to true, the generated content will be streamed
|
|
6399
|
+
* incrementally.
|
|
6375
6400
|
*/
|
|
6376
6401
|
stream: true;
|
|
6377
6402
|
}
|
|
@@ -6468,8 +6493,7 @@ declare interface InteractionStartEvent {
|
|
|
6468
6493
|
*/
|
|
6469
6494
|
interaction: Interaction;
|
|
6470
6495
|
/**
|
|
6471
|
-
* The event_id token to be used to resume the interaction stream, from
|
|
6472
|
-
* this event.
|
|
6496
|
+
* The event_id token to be used to resume the interaction stream, from this event.
|
|
6473
6497
|
*/
|
|
6474
6498
|
event_id?: string;
|
|
6475
6499
|
}
|
|
@@ -6479,8 +6503,7 @@ declare interface InteractionStatusUpdate {
|
|
|
6479
6503
|
interaction_id: string;
|
|
6480
6504
|
status: 'in_progress' | 'requires_action' | 'completed' | 'failed' | 'cancelled' | 'incomplete';
|
|
6481
6505
|
/**
|
|
6482
|
-
* The event_id token to be used to resume the interaction stream, from
|
|
6483
|
-
* this event.
|
|
6506
|
+
* The event_id token to be used to resume the interaction stream, from this event.
|
|
6484
6507
|
*/
|
|
6485
6508
|
event_id?: string;
|
|
6486
6509
|
}
|
|
@@ -7871,7 +7894,8 @@ export declare interface Model {
|
|
|
7871
7894
|
}
|
|
7872
7895
|
|
|
7873
7896
|
/**
|
|
7874
|
-
* The model that will complete your prompt.\n\nSee
|
|
7897
|
+
* The model that will complete your prompt.\n\nSee
|
|
7898
|
+
* [models](https://ai.google.dev/gemini-api/docs/models) for additional details.
|
|
7875
7899
|
*/
|
|
7876
7900
|
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 & {});
|
|
7877
7901
|
|
|
@@ -8134,29 +8158,15 @@ export declare class Models extends BaseModule {
|
|
|
8134
8158
|
/**
|
|
8135
8159
|
* Recontextualizes an image.
|
|
8136
8160
|
*
|
|
8137
|
-
* There
|
|
8138
|
-
* 1)
|
|
8139
|
-
* and contexts.
|
|
8140
|
-
* 2) Virtual Try-On: Generate images of persons modeling fashion products.
|
|
8161
|
+
* There is one type of recontextualization currently supported:
|
|
8162
|
+
* 1) Virtual Try-On: Generate images of persons modeling fashion products.
|
|
8141
8163
|
*
|
|
8142
8164
|
* @param params - The parameters for recontextualizing an image.
|
|
8143
8165
|
* @return The response from the API.
|
|
8144
8166
|
*
|
|
8145
8167
|
* @example
|
|
8146
8168
|
* ```ts
|
|
8147
|
-
* const
|
|
8148
|
-
* model: 'imagen-product-recontext-preview-06-30',
|
|
8149
|
-
* source: {
|
|
8150
|
-
* prompt: 'In a modern kitchen setting.',
|
|
8151
|
-
* productImages: [productImage],
|
|
8152
|
-
* },
|
|
8153
|
-
* config: {
|
|
8154
|
-
* numberOfImages: 1,
|
|
8155
|
-
* },
|
|
8156
|
-
* });
|
|
8157
|
-
* console.log(response1?.generatedImages?.[0]?.image?.imageBytes);
|
|
8158
|
-
*
|
|
8159
|
-
* const response2 = await ai.models.recontextImage({
|
|
8169
|
+
* const response = await ai.models.recontextImage({
|
|
8160
8170
|
* model: 'virtual-try-on-001',
|
|
8161
8171
|
* source: {
|
|
8162
8172
|
* personImage: personImage,
|
|
@@ -8166,7 +8176,7 @@ export declare class Models extends BaseModule {
|
|
|
8166
8176
|
* numberOfImages: 1,
|
|
8167
8177
|
* },
|
|
8168
8178
|
* });
|
|
8169
|
-
* console.log(
|
|
8179
|
+
* console.log(response?.generatedImages?.[0]?.image?.imageBytes);
|
|
8170
8180
|
* ```
|
|
8171
8181
|
*/
|
|
8172
8182
|
recontextImage(params: types.RecontextImageParameters): Promise<types.RecontextImageResponse>;
|
|
@@ -8825,8 +8835,8 @@ declare interface PlaceCitation {
|
|
|
8825
8835
|
*/
|
|
8826
8836
|
place_id?: string;
|
|
8827
8837
|
/**
|
|
8828
|
-
* Snippets of reviews that are used to generate answers about the
|
|
8829
|
-
*
|
|
8838
|
+
* Snippets of reviews that are used to generate answers about the features of a
|
|
8839
|
+
* given place in Google Maps.
|
|
8830
8840
|
*/
|
|
8831
8841
|
review_snippets?: Array<PlaceCitation.ReviewSnippet>;
|
|
8832
8842
|
/**
|
|
@@ -8843,8 +8853,8 @@ declare interface PlaceCitation {
|
|
|
8843
8853
|
|
|
8844
8854
|
declare namespace PlaceCitation {
|
|
8845
8855
|
/**
|
|
8846
|
-
* Encapsulates a snippet of a user review that answers a question about
|
|
8847
|
-
*
|
|
8856
|
+
* Encapsulates a snippet of a user review that answers a question about the
|
|
8857
|
+
* features of a specific place in Google Maps.
|
|
8848
8858
|
*/
|
|
8849
8859
|
interface ReviewSnippet {
|
|
8850
8860
|
/**
|
|
@@ -9660,19 +9670,19 @@ export declare enum ServiceTier {
|
|
|
9660
9670
|
/**
|
|
9661
9671
|
* Default service tier, which is standard.
|
|
9662
9672
|
*/
|
|
9663
|
-
|
|
9673
|
+
UNSPECIFIED = "unspecified",
|
|
9664
9674
|
/**
|
|
9665
9675
|
* Flex service tier.
|
|
9666
9676
|
*/
|
|
9667
|
-
|
|
9677
|
+
FLEX = "flex",
|
|
9668
9678
|
/**
|
|
9669
9679
|
* Standard service tier.
|
|
9670
9680
|
*/
|
|
9671
|
-
|
|
9681
|
+
STANDARD = "standard",
|
|
9672
9682
|
/**
|
|
9673
9683
|
* Priority service tier.
|
|
9674
9684
|
*/
|
|
9675
|
-
|
|
9685
|
+
PRIORITY = "priority"
|
|
9676
9686
|
}
|
|
9677
9687
|
|
|
9678
9688
|
/**
|
|
@@ -10332,7 +10342,7 @@ export declare interface Tool {
|
|
|
10332
10342
|
/**
|
|
10333
10343
|
* A tool that can be used by the model.
|
|
10334
10344
|
*/
|
|
10335
|
-
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;
|
|
10345
|
+
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;
|
|
10336
10346
|
|
|
10337
10347
|
declare namespace Tool_2 {
|
|
10338
10348
|
/**
|
|
@@ -10381,8 +10391,7 @@ declare namespace Tool_2 {
|
|
|
10381
10391
|
*/
|
|
10382
10392
|
name?: string;
|
|
10383
10393
|
/**
|
|
10384
|
-
* The full URL for the MCPServer endpoint.
|
|
10385
|
-
* Example: "https://api.example.com/mcp"
|
|
10394
|
+
* The full URL for the MCPServer endpoint. Example: "https://api.example.com/mcp"
|
|
10386
10395
|
*/
|
|
10387
10396
|
url?: string;
|
|
10388
10397
|
}
|
|
@@ -10394,7 +10403,7 @@ declare namespace Tool_2 {
|
|
|
10394
10403
|
/**
|
|
10395
10404
|
* The types of search grounding to enable.
|
|
10396
10405
|
*/
|
|
10397
|
-
search_types?: Array<'web_search' | 'image_search'>;
|
|
10406
|
+
search_types?: Array<'web_search' | 'image_search' | 'enterprise_web_search'>;
|
|
10398
10407
|
}
|
|
10399
10408
|
/**
|
|
10400
10409
|
* A tool that can be used by the model to search files.
|
|
@@ -10433,6 +10442,35 @@ declare namespace Tool_2 {
|
|
|
10433
10442
|
*/
|
|
10434
10443
|
longitude?: number;
|
|
10435
10444
|
}
|
|
10445
|
+
/**
|
|
10446
|
+
* A tool that can be used by the model to retrieve files.
|
|
10447
|
+
*/
|
|
10448
|
+
interface Retrieval {
|
|
10449
|
+
type: 'retrieval';
|
|
10450
|
+
/**
|
|
10451
|
+
* The types of file retrieval to enable.
|
|
10452
|
+
*/
|
|
10453
|
+
retrieval_types?: Array<'vertex_ai_search'>;
|
|
10454
|
+
/**
|
|
10455
|
+
* Used to specify configuration for VertexAISearch.
|
|
10456
|
+
*/
|
|
10457
|
+
vertex_ai_search_config?: Retrieval.VertexAISearchConfig;
|
|
10458
|
+
}
|
|
10459
|
+
namespace Retrieval {
|
|
10460
|
+
/**
|
|
10461
|
+
* Used to specify configuration for VertexAISearch.
|
|
10462
|
+
*/
|
|
10463
|
+
interface VertexAISearchConfig {
|
|
10464
|
+
/**
|
|
10465
|
+
* Optional. Used to specify Vertex AI Search datastores.
|
|
10466
|
+
*/
|
|
10467
|
+
datastores?: Array<string>;
|
|
10468
|
+
/**
|
|
10469
|
+
* Optional. Used to specify Vertex AI Search engine.
|
|
10470
|
+
*/
|
|
10471
|
+
engine?: string;
|
|
10472
|
+
}
|
|
10473
|
+
}
|
|
10436
10474
|
}
|
|
10437
10475
|
|
|
10438
10476
|
/** A predicted server-side `ToolCall` returned from the model.
|
|
@@ -10873,8 +10911,7 @@ export declare interface TuningValidationDataset {
|
|
|
10873
10911
|
declare interface Turn {
|
|
10874
10912
|
content?: Array<Content_2> | string;
|
|
10875
10913
|
/**
|
|
10876
|
-
* The originator of this turn. Must be user for input or model for
|
|
10877
|
-
* model output.
|
|
10914
|
+
* The originator of this turn. Must be user for input or model for model output.
|
|
10878
10915
|
*/
|
|
10879
10916
|
role?: string;
|
|
10880
10917
|
}
|
|
@@ -11923,7 +11960,7 @@ declare namespace Usage {
|
|
|
11923
11960
|
/**
|
|
11924
11961
|
* The modality associated with the token count.
|
|
11925
11962
|
*/
|
|
11926
|
-
modality?: 'text' | 'image' | 'audio';
|
|
11963
|
+
modality?: 'text' | 'image' | 'audio' | 'video' | 'document';
|
|
11927
11964
|
/**
|
|
11928
11965
|
* Number of tokens for the modality.
|
|
11929
11966
|
*/
|
|
@@ -11936,7 +11973,7 @@ declare namespace Usage {
|
|
|
11936
11973
|
/**
|
|
11937
11974
|
* The modality associated with the token count.
|
|
11938
11975
|
*/
|
|
11939
|
-
modality?: 'text' | 'image' | 'audio';
|
|
11976
|
+
modality?: 'text' | 'image' | 'audio' | 'video' | 'document';
|
|
11940
11977
|
/**
|
|
11941
11978
|
* Number of tokens for the modality.
|
|
11942
11979
|
*/
|
|
@@ -11949,7 +11986,7 @@ declare namespace Usage {
|
|
|
11949
11986
|
/**
|
|
11950
11987
|
* The modality associated with the token count.
|
|
11951
11988
|
*/
|
|
11952
|
-
modality?: 'text' | 'image' | 'audio';
|
|
11989
|
+
modality?: 'text' | 'image' | 'audio' | 'video' | 'document';
|
|
11953
11990
|
/**
|
|
11954
11991
|
* Number of tokens for the modality.
|
|
11955
11992
|
*/
|
|
@@ -11962,7 +11999,7 @@ declare namespace Usage {
|
|
|
11962
11999
|
/**
|
|
11963
12000
|
* The modality associated with the token count.
|
|
11964
12001
|
*/
|
|
11965
|
-
modality?: 'text' | 'image' | 'audio';
|
|
12002
|
+
modality?: 'text' | 'image' | 'audio' | 'video' | 'document';
|
|
11966
12003
|
/**
|
|
11967
12004
|
* Number of tokens for the modality.
|
|
11968
12005
|
*/
|
package/dist/tokenizer/node.cjs
CHANGED
|
@@ -1023,19 +1023,19 @@ var ServiceTier;
|
|
|
1023
1023
|
/**
|
|
1024
1024
|
* Default service tier, which is standard.
|
|
1025
1025
|
*/
|
|
1026
|
-
ServiceTier["
|
|
1026
|
+
ServiceTier["UNSPECIFIED"] = "unspecified";
|
|
1027
1027
|
/**
|
|
1028
1028
|
* Flex service tier.
|
|
1029
1029
|
*/
|
|
1030
|
-
ServiceTier["
|
|
1030
|
+
ServiceTier["FLEX"] = "flex";
|
|
1031
1031
|
/**
|
|
1032
1032
|
* Standard service tier.
|
|
1033
1033
|
*/
|
|
1034
|
-
ServiceTier["
|
|
1034
|
+
ServiceTier["STANDARD"] = "standard";
|
|
1035
1035
|
/**
|
|
1036
1036
|
* Priority service tier.
|
|
1037
1037
|
*/
|
|
1038
|
-
ServiceTier["
|
|
1038
|
+
ServiceTier["PRIORITY"] = "priority";
|
|
1039
1039
|
})(ServiceTier || (ServiceTier = {}));
|
|
1040
1040
|
/** Options for feature selection preference. */
|
|
1041
1041
|
var FeatureSelectionPreference;
|
package/dist/tokenizer/node.mjs
CHANGED
|
@@ -999,19 +999,19 @@ var ServiceTier;
|
|
|
999
999
|
/**
|
|
1000
1000
|
* Default service tier, which is standard.
|
|
1001
1001
|
*/
|
|
1002
|
-
ServiceTier["
|
|
1002
|
+
ServiceTier["UNSPECIFIED"] = "unspecified";
|
|
1003
1003
|
/**
|
|
1004
1004
|
* Flex service tier.
|
|
1005
1005
|
*/
|
|
1006
|
-
ServiceTier["
|
|
1006
|
+
ServiceTier["FLEX"] = "flex";
|
|
1007
1007
|
/**
|
|
1008
1008
|
* Standard service tier.
|
|
1009
1009
|
*/
|
|
1010
|
-
ServiceTier["
|
|
1010
|
+
ServiceTier["STANDARD"] = "standard";
|
|
1011
1011
|
/**
|
|
1012
1012
|
* Priority service tier.
|
|
1013
1013
|
*/
|
|
1014
|
-
ServiceTier["
|
|
1014
|
+
ServiceTier["PRIORITY"] = "priority";
|
|
1015
1015
|
})(ServiceTier || (ServiceTier = {}));
|
|
1016
1016
|
/** Options for feature selection preference. */
|
|
1017
1017
|
var FeatureSelectionPreference;
|