@google/genai 0.13.0 → 0.14.1
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/README.md +27 -1
- package/dist/genai.d.ts +237 -21
- package/dist/index.js +917 -120
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +911 -121
- package/dist/index.mjs.map +1 -1
- package/dist/node/index.js +917 -120
- package/dist/node/index.js.map +1 -1
- package/dist/node/node.d.ts +237 -21
- package/dist/web/index.mjs +911 -121
- package/dist/web/index.mjs.map +1 -1
- package/dist/web/web.d.ts +237 -21
- package/package.json +4 -1
package/dist/web/web.d.ts
CHANGED
|
@@ -274,6 +274,8 @@ export declare interface BaseUrlParameters {
|
|
|
274
274
|
|
|
275
275
|
/** Content blob. */
|
|
276
276
|
declare interface Blob_2 {
|
|
277
|
+
/** Optional. Display name of the blob. Used to provide a label or filename to distinguish blobs. This field is not currently used in the Gemini GenerateContent calls. */
|
|
278
|
+
displayName?: string;
|
|
277
279
|
/** Required. Raw bytes. */
|
|
278
280
|
data?: string;
|
|
279
281
|
/** Required. The IANA standard MIME type of the source data. */
|
|
@@ -560,6 +562,19 @@ export declare class Chats {
|
|
|
560
562
|
create(params: types.CreateChatParameters): Chat;
|
|
561
563
|
}
|
|
562
564
|
|
|
565
|
+
/** Describes the machine learning model version checkpoint. */
|
|
566
|
+
export declare interface Checkpoint {
|
|
567
|
+
/** The ID of the checkpoint.
|
|
568
|
+
*/
|
|
569
|
+
checkpointId?: string;
|
|
570
|
+
/** The epoch of the checkpoint.
|
|
571
|
+
*/
|
|
572
|
+
epoch?: string;
|
|
573
|
+
/** The step of the checkpoint.
|
|
574
|
+
*/
|
|
575
|
+
step?: string;
|
|
576
|
+
}
|
|
577
|
+
|
|
563
578
|
/** Source attributions for content. */
|
|
564
579
|
export declare interface Citation {
|
|
565
580
|
/** Output only. End index into the content. */
|
|
@@ -689,7 +704,7 @@ export declare interface ControlReferenceConfig {
|
|
|
689
704
|
A control image is an image that represents a sketch image of areas for the
|
|
690
705
|
model to fill in based on the prompt.
|
|
691
706
|
*/
|
|
692
|
-
export declare
|
|
707
|
+
export declare class ControlReferenceImage {
|
|
693
708
|
/** The reference image for the editing operation. */
|
|
694
709
|
referenceImage?: Image_2;
|
|
695
710
|
/** The id of the reference image. */
|
|
@@ -698,6 +713,8 @@ export declare interface ControlReferenceImage {
|
|
|
698
713
|
referenceType?: string;
|
|
699
714
|
/** Configuration for the control reference image. */
|
|
700
715
|
config?: ControlReferenceConfig;
|
|
716
|
+
/** Internal method to convert to ReferenceImageAPIInternal. */
|
|
717
|
+
toReferenceImageAPI(): any;
|
|
701
718
|
}
|
|
702
719
|
|
|
703
720
|
/** Enum representing the control type of a control reference image. */
|
|
@@ -912,6 +929,8 @@ export declare interface CreateTuningJobConfig {
|
|
|
912
929
|
epochCount?: number;
|
|
913
930
|
/** Multiplier for adjusting the default learning rate. */
|
|
914
931
|
learningRateMultiplier?: number;
|
|
932
|
+
/** If set to true, disable intermediate checkpoints for SFT and only the last checkpoint will be exported. Otherwise, enable intermediate checkpoints for SFT. */
|
|
933
|
+
exportLastCheckpointOnly?: boolean;
|
|
915
934
|
/** Adapter size for tuning. */
|
|
916
935
|
adapterSize?: AdapterSize;
|
|
917
936
|
/** The batch size hyperparameter for tuning. If not set, a default of 4 or 16 will be used based on the number of training examples. */
|
|
@@ -1144,6 +1163,100 @@ export declare enum DynamicRetrievalConfigMode {
|
|
|
1144
1163
|
MODE_DYNAMIC = "MODE_DYNAMIC"
|
|
1145
1164
|
}
|
|
1146
1165
|
|
|
1166
|
+
/** Configuration for editing an image. */
|
|
1167
|
+
export declare interface EditImageConfig {
|
|
1168
|
+
/** Used to override HTTP request options. */
|
|
1169
|
+
httpOptions?: HttpOptions;
|
|
1170
|
+
/** Abort signal which can be used to cancel the request.
|
|
1171
|
+
|
|
1172
|
+
NOTE: AbortSignal is a client-only operation. Using it to cancel an
|
|
1173
|
+
operation will not cancel the request in the service. You will still
|
|
1174
|
+
be charged usage for any applicable operations.
|
|
1175
|
+
*/
|
|
1176
|
+
abortSignal?: AbortSignal;
|
|
1177
|
+
/** Cloud Storage URI used to store the generated images.
|
|
1178
|
+
*/
|
|
1179
|
+
outputGcsUri?: string;
|
|
1180
|
+
/** Description of what to discourage in the generated images.
|
|
1181
|
+
*/
|
|
1182
|
+
negativePrompt?: string;
|
|
1183
|
+
/** Number of images to generate.
|
|
1184
|
+
*/
|
|
1185
|
+
numberOfImages?: number;
|
|
1186
|
+
/** Aspect ratio of the generated images.
|
|
1187
|
+
*/
|
|
1188
|
+
aspectRatio?: string;
|
|
1189
|
+
/** Controls how much the model adheres to the text prompt. Large
|
|
1190
|
+
values increase output and prompt alignment, but may compromise image
|
|
1191
|
+
quality.
|
|
1192
|
+
*/
|
|
1193
|
+
guidanceScale?: number;
|
|
1194
|
+
/** Random seed for image generation. This is not available when
|
|
1195
|
+
``add_watermark`` is set to true.
|
|
1196
|
+
*/
|
|
1197
|
+
seed?: number;
|
|
1198
|
+
/** Filter level for safety filtering.
|
|
1199
|
+
*/
|
|
1200
|
+
safetyFilterLevel?: SafetyFilterLevel;
|
|
1201
|
+
/** Allows generation of people by the model.
|
|
1202
|
+
*/
|
|
1203
|
+
personGeneration?: PersonGeneration;
|
|
1204
|
+
/** Whether to report the safety scores of each generated image and
|
|
1205
|
+
the positive prompt in the response.
|
|
1206
|
+
*/
|
|
1207
|
+
includeSafetyAttributes?: boolean;
|
|
1208
|
+
/** Whether to include the Responsible AI filter reason if the image
|
|
1209
|
+
is filtered out of the response.
|
|
1210
|
+
*/
|
|
1211
|
+
includeRaiReason?: boolean;
|
|
1212
|
+
/** Language of the text in the prompt.
|
|
1213
|
+
*/
|
|
1214
|
+
language?: ImagePromptLanguage;
|
|
1215
|
+
/** MIME type of the generated image.
|
|
1216
|
+
*/
|
|
1217
|
+
outputMimeType?: string;
|
|
1218
|
+
/** Compression quality of the generated image (for ``image/jpeg``
|
|
1219
|
+
only).
|
|
1220
|
+
*/
|
|
1221
|
+
outputCompressionQuality?: number;
|
|
1222
|
+
/** Describes the editing mode for the request. */
|
|
1223
|
+
editMode?: EditMode;
|
|
1224
|
+
/** The number of sampling steps. A higher value has better image
|
|
1225
|
+
quality, while a lower value has better latency. */
|
|
1226
|
+
baseSteps?: number;
|
|
1227
|
+
}
|
|
1228
|
+
|
|
1229
|
+
/** Parameters for the request to edit an image. */
|
|
1230
|
+
export declare interface EditImageParameters {
|
|
1231
|
+
/** The model to use. */
|
|
1232
|
+
model: string;
|
|
1233
|
+
/** A text description of the edit to apply to the image. */
|
|
1234
|
+
prompt: string;
|
|
1235
|
+
/** The reference images for Imagen 3 editing. */
|
|
1236
|
+
referenceImages: ReferenceImage[];
|
|
1237
|
+
/** Configuration for editing. */
|
|
1238
|
+
config?: EditImageConfig;
|
|
1239
|
+
}
|
|
1240
|
+
|
|
1241
|
+
/** Response for the request to edit an image. */
|
|
1242
|
+
export declare class EditImageResponse {
|
|
1243
|
+
/** Generated images. */
|
|
1244
|
+
generatedImages?: GeneratedImage[];
|
|
1245
|
+
}
|
|
1246
|
+
|
|
1247
|
+
/** Enum representing the Imagen 3 Edit mode. */
|
|
1248
|
+
export declare enum EditMode {
|
|
1249
|
+
EDIT_MODE_DEFAULT = "EDIT_MODE_DEFAULT",
|
|
1250
|
+
EDIT_MODE_INPAINT_REMOVAL = "EDIT_MODE_INPAINT_REMOVAL",
|
|
1251
|
+
EDIT_MODE_INPAINT_INSERTION = "EDIT_MODE_INPAINT_INSERTION",
|
|
1252
|
+
EDIT_MODE_OUTPAINT = "EDIT_MODE_OUTPAINT",
|
|
1253
|
+
EDIT_MODE_CONTROLLED_EDITING = "EDIT_MODE_CONTROLLED_EDITING",
|
|
1254
|
+
EDIT_MODE_STYLE = "EDIT_MODE_STYLE",
|
|
1255
|
+
EDIT_MODE_BGSWAP = "EDIT_MODE_BGSWAP",
|
|
1256
|
+
EDIT_MODE_PRODUCT_IMAGE = "EDIT_MODE_PRODUCT_IMAGE"
|
|
1257
|
+
}
|
|
1258
|
+
|
|
1259
|
+
/** Optional parameters for the embed_content method. */
|
|
1147
1260
|
export declare interface EmbedContentConfig {
|
|
1148
1261
|
/** Used to override HTTP request options. */
|
|
1149
1262
|
httpOptions?: HttpOptions;
|
|
@@ -1610,10 +1723,21 @@ export declare interface GenerateContentConfig {
|
|
|
1610
1723
|
random number is used.
|
|
1611
1724
|
*/
|
|
1612
1725
|
seed?: number;
|
|
1613
|
-
/** Output response
|
|
1726
|
+
/** Output response mimetype of the generated candidate text.
|
|
1727
|
+
Supported mimetype:
|
|
1728
|
+
- `text/plain`: (default) Text output.
|
|
1729
|
+
- `application/json`: JSON response in the candidates.
|
|
1730
|
+
The model needs to be prompted to output the appropriate response type,
|
|
1731
|
+
otherwise the behavior is undefined.
|
|
1732
|
+
This is a preview feature.
|
|
1614
1733
|
*/
|
|
1615
1734
|
responseMimeType?: string;
|
|
1616
|
-
/** Schema
|
|
1735
|
+
/** The `Schema` object allows the definition of input and output data types.
|
|
1736
|
+
These types can be objects, but also primitives and arrays.
|
|
1737
|
+
Represents a select subset of an [OpenAPI 3.0 schema
|
|
1738
|
+
object](https://spec.openapis.org/oas/v3.0.3#schema).
|
|
1739
|
+
If set, a compatible response_mime_type must also be set.
|
|
1740
|
+
Compatible mimetypes: `application/json`: Schema for JSON response.
|
|
1617
1741
|
*/
|
|
1618
1742
|
responseSchema?: SchemaUnion;
|
|
1619
1743
|
/** Configuration for model router requests.
|
|
@@ -3111,7 +3235,6 @@ export declare interface LiveServerSessionResumptionUpdate {
|
|
|
3111
3235
|
lastConsumedClientMessageIndex?: string;
|
|
3112
3236
|
}
|
|
3113
3237
|
|
|
3114
|
-
/** Sent in response to a `LiveGenerateContentSetup` message from the client. */
|
|
3115
3238
|
export declare interface LiveServerSetupComplete {
|
|
3116
3239
|
}
|
|
3117
3240
|
|
|
@@ -3179,7 +3302,7 @@ export declare interface MaskReferenceConfig {
|
|
|
3179
3302
|
image. If the user provides a mask image, the mask must be in the same
|
|
3180
3303
|
dimensions as the raw image.
|
|
3181
3304
|
*/
|
|
3182
|
-
export declare
|
|
3305
|
+
export declare class MaskReferenceImage {
|
|
3183
3306
|
/** The reference image for the editing operation. */
|
|
3184
3307
|
referenceImage?: Image_2;
|
|
3185
3308
|
/** The id of the reference image. */
|
|
@@ -3188,6 +3311,8 @@ export declare interface MaskReferenceImage {
|
|
|
3188
3311
|
referenceType?: string;
|
|
3189
3312
|
/** Configuration for the mask reference image. */
|
|
3190
3313
|
config?: MaskReferenceConfig;
|
|
3314
|
+
/** Internal method to convert to ReferenceImageAPIInternal. */
|
|
3315
|
+
toReferenceImageAPI(): any;
|
|
3191
3316
|
}
|
|
3192
3317
|
|
|
3193
3318
|
/** Enum representing the mask mode of a mask reference image. */
|
|
@@ -3265,6 +3390,11 @@ export declare interface Model {
|
|
|
3265
3390
|
outputTokenLimit?: number;
|
|
3266
3391
|
/** List of actions that are supported by the model. */
|
|
3267
3392
|
supportedActions?: string[];
|
|
3393
|
+
/** The default checkpoint id of a model version.
|
|
3394
|
+
*/
|
|
3395
|
+
defaultCheckpointId?: string;
|
|
3396
|
+
/** The checkpoints of the model. */
|
|
3397
|
+
checkpoints?: Checkpoint[];
|
|
3268
3398
|
}
|
|
3269
3399
|
|
|
3270
3400
|
export declare class Models extends BaseModule {
|
|
@@ -3354,9 +3484,7 @@ export declare class Models extends BaseModule {
|
|
|
3354
3484
|
/**
|
|
3355
3485
|
* Generates an image based on a text description and configuration.
|
|
3356
3486
|
*
|
|
3357
|
-
* @param
|
|
3358
|
-
* @param prompt - A text description of the image to generate.
|
|
3359
|
-
* @param [config] - The config for image generation.
|
|
3487
|
+
* @param params - The parameters for generating images.
|
|
3360
3488
|
* @return The response from the API.
|
|
3361
3489
|
*
|
|
3362
3490
|
* @example
|
|
@@ -3374,6 +3502,48 @@ export declare class Models extends BaseModule {
|
|
|
3374
3502
|
*/
|
|
3375
3503
|
generateImages: (params: types.GenerateImagesParameters) => Promise<types.GenerateImagesResponse>;
|
|
3376
3504
|
list: (params?: types.ListModelsParameters) => Promise<Pager<types.Model>>;
|
|
3505
|
+
/**
|
|
3506
|
+
* Edits an image based on a prompt, list of reference images, and configuration.
|
|
3507
|
+
*
|
|
3508
|
+
* @param params - The parameters for editing an image.
|
|
3509
|
+
* @return The response from the API.
|
|
3510
|
+
*
|
|
3511
|
+
* @example
|
|
3512
|
+
* ```ts
|
|
3513
|
+
* const response = await client.models.editImage({
|
|
3514
|
+
* model: 'imagen-3.0-capability-001',
|
|
3515
|
+
* prompt: 'Generate an image containing a mug with the product logo [1] visible on the side of the mug.',
|
|
3516
|
+
* referenceImages: [subjectReferenceImage]
|
|
3517
|
+
* config: {
|
|
3518
|
+
* numberOfImages: 1,
|
|
3519
|
+
* includeRaiReason: true,
|
|
3520
|
+
* },
|
|
3521
|
+
* });
|
|
3522
|
+
* console.log(response?.generatedImages?.[0]?.image?.imageBytes);
|
|
3523
|
+
* ```
|
|
3524
|
+
*/
|
|
3525
|
+
editImage: (params: types.EditImageParameters) => Promise<types.EditImageResponse>;
|
|
3526
|
+
/**
|
|
3527
|
+
* Upscales an image based on an image, upscale factor, and configuration.
|
|
3528
|
+
* Only supported in Vertex AI currently.
|
|
3529
|
+
*
|
|
3530
|
+
* @param params - The parameters for upscaling an image.
|
|
3531
|
+
* @return The response from the API.
|
|
3532
|
+
*
|
|
3533
|
+
* @example
|
|
3534
|
+
* ```ts
|
|
3535
|
+
* const response = await client.models.upscaleImage({
|
|
3536
|
+
* model: 'imagen-3.0-generate-002',
|
|
3537
|
+
* image: image,
|
|
3538
|
+
* upscaleFactor: 'x2',
|
|
3539
|
+
* config: {
|
|
3540
|
+
* includeRaiReason: true,
|
|
3541
|
+
* },
|
|
3542
|
+
* });
|
|
3543
|
+
* console.log(response?.generatedImages?.[0]?.image?.imageBytes);
|
|
3544
|
+
* ```
|
|
3545
|
+
*/
|
|
3546
|
+
upscaleImage: (params: types.UpscaleImageParameters) => Promise<types.UpscaleImageResponse>;
|
|
3377
3547
|
private generateContentInternal;
|
|
3378
3548
|
private generateContentStreamInternal;
|
|
3379
3549
|
/**
|
|
@@ -3418,6 +3588,8 @@ export declare class Models extends BaseModule {
|
|
|
3418
3588
|
* ```
|
|
3419
3589
|
*/
|
|
3420
3590
|
private generateImagesInternal;
|
|
3591
|
+
private editImageInternal;
|
|
3592
|
+
private upscaleImageInternal;
|
|
3421
3593
|
/**
|
|
3422
3594
|
* Fetches information about a model by name.
|
|
3423
3595
|
*
|
|
@@ -3711,6 +3883,8 @@ export declare interface Part {
|
|
|
3711
3883
|
videoMetadata?: VideoMetadata;
|
|
3712
3884
|
/** Indicates if the part is thought from the model. */
|
|
3713
3885
|
thought?: boolean;
|
|
3886
|
+
/** Optional. Inlined bytes data. */
|
|
3887
|
+
inlineData?: Blob_2;
|
|
3714
3888
|
/** Optional. Result of executing the [ExecutableCode]. */
|
|
3715
3889
|
codeExecutionResult?: CodeExecutionResult;
|
|
3716
3890
|
/** Optional. Code generated by the model that is meant to be executed. */
|
|
@@ -3721,8 +3895,6 @@ export declare interface Part {
|
|
|
3721
3895
|
functionCall?: FunctionCall;
|
|
3722
3896
|
/** Optional. The result output of a [FunctionCall] that contains a string representing the [FunctionDeclaration.name] and a structured JSON object containing any output from the function call. It is used as context to the model. */
|
|
3723
3897
|
functionResponse?: FunctionResponse;
|
|
3724
|
-
/** Optional. Inlined bytes data. */
|
|
3725
|
-
inlineData?: Blob_2;
|
|
3726
3898
|
/** Optional. Text part (can be code). */
|
|
3727
3899
|
text?: string;
|
|
3728
3900
|
}
|
|
@@ -3809,13 +3981,15 @@ export declare interface RagRetrievalConfigRankingRankService {
|
|
|
3809
3981
|
It can optionally be provided in addition to a mask reference image or
|
|
3810
3982
|
a style reference image.
|
|
3811
3983
|
*/
|
|
3812
|
-
export declare
|
|
3984
|
+
export declare class RawReferenceImage {
|
|
3813
3985
|
/** The reference image for the editing operation. */
|
|
3814
3986
|
referenceImage?: Image_2;
|
|
3815
3987
|
/** The id of the reference image. */
|
|
3816
3988
|
referenceId?: number;
|
|
3817
3989
|
/** The type of the reference image. Only set by the SDK. */
|
|
3818
3990
|
referenceType?: string;
|
|
3991
|
+
/** Internal method to convert to ReferenceImageAPIInternal. */
|
|
3992
|
+
toReferenceImageAPI(): any;
|
|
3819
3993
|
}
|
|
3820
3994
|
|
|
3821
3995
|
/** Marks the end of user activity.
|
|
@@ -3832,6 +4006,8 @@ export declare interface RealtimeInputConfig {
|
|
|
3832
4006
|
turnCoverage?: TurnCoverage;
|
|
3833
4007
|
}
|
|
3834
4008
|
|
|
4009
|
+
export declare type ReferenceImage = RawReferenceImage | MaskReferenceImage | ControlReferenceImage | StyleReferenceImage | SubjectReferenceImage;
|
|
4010
|
+
|
|
3835
4011
|
/** Represents a recorded session. */
|
|
3836
4012
|
export declare interface ReplayFile {
|
|
3837
4013
|
replayId?: string;
|
|
@@ -4229,7 +4405,7 @@ export declare interface StyleReferenceConfig {
|
|
|
4229
4405
|
A raw reference image can also be provided as a destination for the style to
|
|
4230
4406
|
be applied to.
|
|
4231
4407
|
*/
|
|
4232
|
-
export declare
|
|
4408
|
+
export declare class StyleReferenceImage {
|
|
4233
4409
|
/** The reference image for the editing operation. */
|
|
4234
4410
|
referenceImage?: Image_2;
|
|
4235
4411
|
/** The id of the reference image. */
|
|
@@ -4238,6 +4414,8 @@ export declare interface StyleReferenceImage {
|
|
|
4238
4414
|
referenceType?: string;
|
|
4239
4415
|
/** Configuration for the style reference image. */
|
|
4240
4416
|
config?: StyleReferenceConfig;
|
|
4417
|
+
/** Internal method to convert to ReferenceImageAPIInternal. */
|
|
4418
|
+
toReferenceImageAPI(): any;
|
|
4241
4419
|
}
|
|
4242
4420
|
|
|
4243
4421
|
/** Configuration for a Subject reference image. */
|
|
@@ -4256,7 +4434,7 @@ export declare interface SubjectReferenceConfig {
|
|
|
4256
4434
|
A raw reference image can also be provided as a destination for the subject to
|
|
4257
4435
|
be applied to.
|
|
4258
4436
|
*/
|
|
4259
|
-
export declare
|
|
4437
|
+
export declare class SubjectReferenceImage {
|
|
4260
4438
|
/** The reference image for the editing operation. */
|
|
4261
4439
|
referenceImage?: Image_2;
|
|
4262
4440
|
/** The id of the reference image. */
|
|
@@ -4265,6 +4443,7 @@ export declare interface SubjectReferenceImage {
|
|
|
4265
4443
|
referenceType?: string;
|
|
4266
4444
|
/** Configuration for the subject reference image. */
|
|
4267
4445
|
config?: SubjectReferenceConfig;
|
|
4446
|
+
toReferenceImageAPI(): any;
|
|
4268
4447
|
}
|
|
4269
4448
|
|
|
4270
4449
|
/** Enum representing the subject type of a subject reference image. */
|
|
@@ -4351,6 +4530,8 @@ export declare interface SupervisedTuningSpec {
|
|
|
4351
4530
|
trainingDatasetUri?: string;
|
|
4352
4531
|
/** Optional. Cloud Storage path to file containing validation dataset for tuning. The dataset must be formatted as a JSONL file. */
|
|
4353
4532
|
validationDatasetUri?: string;
|
|
4533
|
+
/** Optional. If set to true, disable intermediate checkpoints for SFT and only the last checkpoint will be exported. */
|
|
4534
|
+
exportLastCheckpointOnly?: boolean;
|
|
4354
4535
|
}
|
|
4355
4536
|
|
|
4356
4537
|
export declare interface TestTableFile {
|
|
@@ -4459,6 +4640,27 @@ export declare interface TunedModel {
|
|
|
4459
4640
|
model?: string;
|
|
4460
4641
|
/** Output only. A resource name of an Endpoint. Format: `projects/{project}/locations/{location}/endpoints/{endpoint}`. */
|
|
4461
4642
|
endpoint?: string;
|
|
4643
|
+
/** The checkpoints associated with this TunedModel.
|
|
4644
|
+
This field is only populated for tuning jobs that enable intermediate
|
|
4645
|
+
checkpoints. */
|
|
4646
|
+
checkpoints?: TunedModelCheckpoint[];
|
|
4647
|
+
}
|
|
4648
|
+
|
|
4649
|
+
/** TunedModelCheckpoint for the Tuned Model of a Tuning Job. */
|
|
4650
|
+
export declare interface TunedModelCheckpoint {
|
|
4651
|
+
/** The ID of the checkpoint.
|
|
4652
|
+
*/
|
|
4653
|
+
checkpointId?: string;
|
|
4654
|
+
/** The epoch of the checkpoint.
|
|
4655
|
+
*/
|
|
4656
|
+
epoch?: string;
|
|
4657
|
+
/** The step of the checkpoint.
|
|
4658
|
+
*/
|
|
4659
|
+
step?: string;
|
|
4660
|
+
/** The Endpoint resource name that the checkpoint is deployed to.
|
|
4661
|
+
Format: `projects/{project}/locations/{location}/endpoints/{endpoint}`.
|
|
4662
|
+
*/
|
|
4663
|
+
endpoint?: string;
|
|
4462
4664
|
}
|
|
4463
4665
|
|
|
4464
4666
|
/** A tuned machine learning model. */
|
|
@@ -4632,23 +4834,24 @@ declare namespace types {
|
|
|
4632
4834
|
SafetyFilterLevel,
|
|
4633
4835
|
PersonGeneration,
|
|
4634
4836
|
ImagePromptLanguage,
|
|
4635
|
-
FileState,
|
|
4636
|
-
FileSource,
|
|
4637
4837
|
MaskReferenceMode,
|
|
4638
4838
|
ControlReferenceType,
|
|
4639
4839
|
SubjectReferenceType,
|
|
4840
|
+
EditMode,
|
|
4841
|
+
FileState,
|
|
4842
|
+
FileSource,
|
|
4640
4843
|
MediaModality,
|
|
4641
4844
|
StartSensitivity,
|
|
4642
4845
|
EndSensitivity,
|
|
4643
4846
|
ActivityHandling,
|
|
4644
4847
|
TurnCoverage,
|
|
4848
|
+
Blob_2 as Blob,
|
|
4645
4849
|
VideoMetadata,
|
|
4646
4850
|
CodeExecutionResult,
|
|
4647
4851
|
ExecutableCode,
|
|
4648
4852
|
FileData,
|
|
4649
4853
|
FunctionCall,
|
|
4650
4854
|
FunctionResponse,
|
|
4651
|
-
Blob_2 as Blob,
|
|
4652
4855
|
Part,
|
|
4653
4856
|
Content,
|
|
4654
4857
|
HttpOptions,
|
|
@@ -4712,6 +4915,8 @@ declare namespace types {
|
|
|
4712
4915
|
ModalityTokenCount,
|
|
4713
4916
|
GenerateContentResponseUsageMetadata,
|
|
4714
4917
|
GenerateContentResponse,
|
|
4918
|
+
ReferenceImage,
|
|
4919
|
+
EditImageParameters,
|
|
4715
4920
|
EmbedContentConfig,
|
|
4716
4921
|
EmbedContentParameters,
|
|
4717
4922
|
ContentEmbeddingStatistics,
|
|
@@ -4724,10 +4929,18 @@ declare namespace types {
|
|
|
4724
4929
|
SafetyAttributes,
|
|
4725
4930
|
GeneratedImage,
|
|
4726
4931
|
GenerateImagesResponse,
|
|
4932
|
+
MaskReferenceConfig,
|
|
4933
|
+
ControlReferenceConfig,
|
|
4934
|
+
StyleReferenceConfig,
|
|
4935
|
+
SubjectReferenceConfig,
|
|
4936
|
+
EditImageConfig,
|
|
4937
|
+
EditImageResponse,
|
|
4938
|
+
UpscaleImageResponse,
|
|
4727
4939
|
GetModelConfig,
|
|
4728
4940
|
GetModelParameters,
|
|
4729
4941
|
Endpoint,
|
|
4730
4942
|
TunedModelInfo,
|
|
4943
|
+
Checkpoint,
|
|
4731
4944
|
Model,
|
|
4732
4945
|
ListModelsConfig,
|
|
4733
4946
|
ListModelsParameters,
|
|
@@ -4753,6 +4966,7 @@ declare namespace types {
|
|
|
4753
4966
|
GenerateVideosOperation,
|
|
4754
4967
|
GetTuningJobConfig,
|
|
4755
4968
|
GetTuningJobParameters,
|
|
4969
|
+
TunedModelCheckpoint,
|
|
4756
4970
|
TunedModel,
|
|
4757
4971
|
GoogleRpcStatus,
|
|
4758
4972
|
SupervisedHyperParameters,
|
|
@@ -4825,13 +5039,9 @@ declare namespace types {
|
|
|
4825
5039
|
UpscaleImageConfig,
|
|
4826
5040
|
UpscaleImageParameters,
|
|
4827
5041
|
RawReferenceImage,
|
|
4828
|
-
MaskReferenceConfig,
|
|
4829
5042
|
MaskReferenceImage,
|
|
4830
|
-
ControlReferenceConfig,
|
|
4831
5043
|
ControlReferenceImage,
|
|
4832
|
-
StyleReferenceConfig,
|
|
4833
5044
|
StyleReferenceImage,
|
|
4834
|
-
SubjectReferenceConfig,
|
|
4835
5045
|
SubjectReferenceImage,
|
|
4836
5046
|
LiveServerSetupComplete,
|
|
4837
5047
|
Transcription,
|
|
@@ -4853,6 +5063,7 @@ declare namespace types {
|
|
|
4853
5063
|
ActivityStart,
|
|
4854
5064
|
ActivityEnd,
|
|
4855
5065
|
LiveClientRealtimeInput,
|
|
5066
|
+
LiveSendRealtimeInputParameters,
|
|
4856
5067
|
LiveClientToolResponse,
|
|
4857
5068
|
LiveClientMessage,
|
|
4858
5069
|
LiveConnectConfig,
|
|
@@ -4860,7 +5071,6 @@ declare namespace types {
|
|
|
4860
5071
|
CreateChatParameters,
|
|
4861
5072
|
SendMessageParameters,
|
|
4862
5073
|
LiveSendClientContentParameters,
|
|
4863
|
-
LiveSendRealtimeInputParameters,
|
|
4864
5074
|
LiveSendToolResponseParameters,
|
|
4865
5075
|
OperationGetParameters,
|
|
4866
5076
|
BlobImageUnion,
|
|
@@ -4914,6 +5124,7 @@ export declare interface UpdateModelConfig {
|
|
|
4914
5124
|
abortSignal?: AbortSignal;
|
|
4915
5125
|
displayName?: string;
|
|
4916
5126
|
description?: string;
|
|
5127
|
+
defaultCheckpointId?: string;
|
|
4917
5128
|
}
|
|
4918
5129
|
|
|
4919
5130
|
/** Configuration for updating a tuned model. */
|
|
@@ -5010,6 +5221,11 @@ export declare interface UpscaleImageParameters {
|
|
|
5010
5221
|
config?: UpscaleImageConfig;
|
|
5011
5222
|
}
|
|
5012
5223
|
|
|
5224
|
+
export declare class UpscaleImageResponse {
|
|
5225
|
+
/** Generated images. */
|
|
5226
|
+
generatedImages?: GeneratedImage[];
|
|
5227
|
+
}
|
|
5228
|
+
|
|
5013
5229
|
/** Usage metadata about response(s). */
|
|
5014
5230
|
export declare interface UsageMetadata {
|
|
5015
5231
|
/** Number of tokens in the prompt. When `cached_content` is set, this is still the total effective prompt size meaning this includes the number of tokens in the cached content. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@google/genai",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/node/index.js",
|
|
6
6
|
"module": "dist/web/index.mjs",
|
|
@@ -40,6 +40,8 @@
|
|
|
40
40
|
"build-prod": "rollup -c && api-extractor run --verbose && api-extractor run -c api-extractor.node.json --verbose && api-extractor run -c api-extractor.web.json --verbose",
|
|
41
41
|
"unit-test": "ts-node node_modules/jasmine/bin/jasmine test/unit/**/*_test.ts test/unit/*_test.ts",
|
|
42
42
|
"system-test": "ts-node node_modules/jasmine/bin/jasmine test/system/**/*_test.ts",
|
|
43
|
+
"test-server-tests": "GOOGLE_CLOUD_PROJECT=googcloudproj GOOGLE_CLOUD_LOCATION=googcloudloc ts-node node_modules/jasmine/bin/jasmine test/system/node/*_test.ts !test/system/node/live_test.ts",
|
|
44
|
+
"test-server-tests:record": "ts-node node_modules/jasmine/bin/jasmine --fail-fast test/system/node/*_test.ts !test/system/node/live_test.ts -- --record",
|
|
43
45
|
"docs": "typedoc && ts-node scripts/add_docsite_license_headers.ts",
|
|
44
46
|
"pages-main": "ts-node scripts/generate_pages.ts main",
|
|
45
47
|
"pages-release": "ts-node scripts/generate_pages.ts release",
|
|
@@ -85,6 +87,7 @@
|
|
|
85
87
|
"prettier": "3.3.3",
|
|
86
88
|
"prettier-plugin-organize-imports": "^4.1.0",
|
|
87
89
|
"rollup-plugin-typescript2": "^0.36.0",
|
|
90
|
+
"test-server-sdk": "^0.2.1",
|
|
88
91
|
"ts-node": "^10.9.2",
|
|
89
92
|
"tslib": "^2.8.1",
|
|
90
93
|
"typedoc": "^0.27.0",
|