@google/genai 2.10.0 → 2.11.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 +975 -588
- package/dist/index.cjs +446 -77
- package/dist/index.mjs +442 -78
- package/dist/index.mjs.map +1 -1
- package/dist/node/index.cjs +446 -77
- package/dist/node/index.mjs +442 -78
- package/dist/node/index.mjs.map +1 -1
- package/dist/node/node.d.ts +975 -588
- package/dist/tokenizer/node.cjs +157 -53
- package/dist/tokenizer/node.d.ts +204 -4
- package/dist/tokenizer/node.mjs +157 -53
- package/dist/tokenizer/node.mjs.map +1 -1
- package/dist/vertex_internal/index.cjs +158 -54
- package/dist/vertex_internal/index.cjs.map +1 -1
- package/dist/vertex_internal/index.d.ts +292 -67
- package/dist/vertex_internal/index.js +158 -54
- package/dist/vertex_internal/index.js.map +1 -1
- package/dist/web/index.mjs +442 -78
- package/dist/web/index.mjs.map +1 -1
- package/dist/web/web.d.ts +975 -588
- package/package.json +2 -9
|
@@ -309,6 +309,70 @@ declare enum ApiSpec {
|
|
|
309
309
|
ELASTIC_SEARCH = "ELASTIC_SEARCH"
|
|
310
310
|
}
|
|
311
311
|
|
|
312
|
+
/** The aspect ratio for the image output. */
|
|
313
|
+
declare enum AspectRatio {
|
|
314
|
+
/**
|
|
315
|
+
* Default value. This value is unused.
|
|
316
|
+
*/
|
|
317
|
+
ASPECT_RATIO_UNSPECIFIED = "ASPECT_RATIO_UNSPECIFIED",
|
|
318
|
+
/**
|
|
319
|
+
* 1:1 aspect ratio.
|
|
320
|
+
*/
|
|
321
|
+
ASPECT_RATIO_ONE_BY_ONE = "ASPECT_RATIO_ONE_BY_ONE",
|
|
322
|
+
/**
|
|
323
|
+
* 2:3 aspect ratio.
|
|
324
|
+
*/
|
|
325
|
+
ASPECT_RATIO_TWO_BY_THREE = "ASPECT_RATIO_TWO_BY_THREE",
|
|
326
|
+
/**
|
|
327
|
+
* 3:2 aspect ratio.
|
|
328
|
+
*/
|
|
329
|
+
ASPECT_RATIO_THREE_BY_TWO = "ASPECT_RATIO_THREE_BY_TWO",
|
|
330
|
+
/**
|
|
331
|
+
* 3:4 aspect ratio.
|
|
332
|
+
*/
|
|
333
|
+
ASPECT_RATIO_THREE_BY_FOUR = "ASPECT_RATIO_THREE_BY_FOUR",
|
|
334
|
+
/**
|
|
335
|
+
* 4:3 aspect ratio.
|
|
336
|
+
*/
|
|
337
|
+
ASPECT_RATIO_FOUR_BY_THREE = "ASPECT_RATIO_FOUR_BY_THREE",
|
|
338
|
+
/**
|
|
339
|
+
* 4:5 aspect ratio.
|
|
340
|
+
*/
|
|
341
|
+
ASPECT_RATIO_FOUR_BY_FIVE = "ASPECT_RATIO_FOUR_BY_FIVE",
|
|
342
|
+
/**
|
|
343
|
+
* 5:4 aspect ratio.
|
|
344
|
+
*/
|
|
345
|
+
ASPECT_RATIO_FIVE_BY_FOUR = "ASPECT_RATIO_FIVE_BY_FOUR",
|
|
346
|
+
/**
|
|
347
|
+
* 9:16 aspect ratio.
|
|
348
|
+
*/
|
|
349
|
+
ASPECT_RATIO_NINE_BY_SIXTEEN = "ASPECT_RATIO_NINE_BY_SIXTEEN",
|
|
350
|
+
/**
|
|
351
|
+
* 16:9 aspect ratio.
|
|
352
|
+
*/
|
|
353
|
+
ASPECT_RATIO_SIXTEEN_BY_NINE = "ASPECT_RATIO_SIXTEEN_BY_NINE",
|
|
354
|
+
/**
|
|
355
|
+
* 21:9 aspect ratio.
|
|
356
|
+
*/
|
|
357
|
+
ASPECT_RATIO_TWENTY_ONE_BY_NINE = "ASPECT_RATIO_TWENTY_ONE_BY_NINE",
|
|
358
|
+
/**
|
|
359
|
+
* 1:8 aspect ratio.
|
|
360
|
+
*/
|
|
361
|
+
ASPECT_RATIO_ONE_BY_EIGHT = "ASPECT_RATIO_ONE_BY_EIGHT",
|
|
362
|
+
/**
|
|
363
|
+
* 8:1 aspect ratio.
|
|
364
|
+
*/
|
|
365
|
+
ASPECT_RATIO_EIGHT_BY_ONE = "ASPECT_RATIO_EIGHT_BY_ONE",
|
|
366
|
+
/**
|
|
367
|
+
* 1:4 aspect ratio.
|
|
368
|
+
*/
|
|
369
|
+
ASPECT_RATIO_ONE_BY_FOUR = "ASPECT_RATIO_ONE_BY_FOUR",
|
|
370
|
+
/**
|
|
371
|
+
* 4:1 aspect ratio.
|
|
372
|
+
*/
|
|
373
|
+
ASPECT_RATIO_FOUR_BY_ONE = "ASPECT_RATIO_FOUR_BY_ONE"
|
|
374
|
+
}
|
|
375
|
+
|
|
312
376
|
/** Representation of an audio chunk. */
|
|
313
377
|
declare interface AudioChunk {
|
|
314
378
|
/** Raw bytes of audio data.
|
|
@@ -320,6 +384,18 @@ declare interface AudioChunk {
|
|
|
320
384
|
sourceMetadata?: LiveMusicSourceMetadata;
|
|
321
385
|
}
|
|
322
386
|
|
|
387
|
+
/** Configuration for audio-specific output formatting. */
|
|
388
|
+
declare class AudioResponseFormat {
|
|
389
|
+
/** Optional. Bit rate in bits per second (bps). Only applicable for compressed formats (MP3, Opus). */
|
|
390
|
+
bitRate?: number;
|
|
391
|
+
/** Optional. Delivery mode for the generated content. */
|
|
392
|
+
delivery?: Delivery;
|
|
393
|
+
/** Optional. The MIME type of the audio output. */
|
|
394
|
+
mimeType?: string;
|
|
395
|
+
/** Optional. Sample rate for the generated audio in Hertz. */
|
|
396
|
+
sampleRate?: number;
|
|
397
|
+
}
|
|
398
|
+
|
|
323
399
|
/** The audio transcription configuration in Setup. */
|
|
324
400
|
declare interface AudioTranscriptionConfig {
|
|
325
401
|
/** Deprecated: use LanguageAuto or LanguageHints instead. */
|
|
@@ -626,7 +702,7 @@ declare interface BatchJobSource {
|
|
|
626
702
|
|
|
627
703
|
declare type BatchJobSourceUnion = BatchJobSource | InlinedRequest[] | string;
|
|
628
704
|
|
|
629
|
-
/** Specifies the function Behavior.
|
|
705
|
+
/** Specifies the function Behavior. If not specified, the system keeps the current function call behavior. This field is currently only supported by the BidiGenerateContent method. */
|
|
630
706
|
declare enum Behavior {
|
|
631
707
|
/**
|
|
632
708
|
* This value is unspecified.
|
|
@@ -919,13 +995,15 @@ declare interface CompletionStats {
|
|
|
919
995
|
|
|
920
996
|
/** Composite reinforcement tuning reward config. */
|
|
921
997
|
declare interface CompositeReinforcementTuningRewardConfig {
|
|
998
|
+
/** List of reward function configurations with weights. */
|
|
922
999
|
weightedRewardConfigs?: CompositeReinforcementTuningRewardConfigWeightedRewardConfig[];
|
|
923
1000
|
}
|
|
924
1001
|
|
|
925
1002
|
/** Composite reinforcement tuning reward config weighted reward config. */
|
|
926
1003
|
declare interface CompositeReinforcementTuningRewardConfigWeightedRewardConfig {
|
|
1004
|
+
/** Single reward configuration. */
|
|
927
1005
|
rewardConfig?: SingleReinforcementTuningRewardConfig;
|
|
928
|
-
/** How much this single reward contributes to the total overall reward. */
|
|
1006
|
+
/** How much this single reward contributes to the total overall reward. Total reward is a linear combination of single rewards with their corresponding weights, i.e., ``` total_reward = ( weight_a * reward_a + weight_b * reward_b + ... ) / (weight_a + weight_b + ...) ``` */
|
|
929
1007
|
weight?: number;
|
|
930
1008
|
}
|
|
931
1009
|
|
|
@@ -1605,6 +1683,12 @@ declare interface DatasetStats {
|
|
|
1605
1683
|
userMessagePerExampleDistribution?: DatasetDistribution;
|
|
1606
1684
|
/** Output only. Dataset distributions for the user output tokens. */
|
|
1607
1685
|
userOutputTokenDistribution?: DatasetDistribution;
|
|
1686
|
+
/** Output only. Dataset distributions for the number of contents per example. */
|
|
1687
|
+
contentsPerExampleDistribution?: DatasetDistribution;
|
|
1688
|
+
/** Output only. Sample user dataset examples in the training dataset uri for Reinforcement Tuning. */
|
|
1689
|
+
reinforcementTuningUserDatasetExamples?: ReinforcementTuningUserDatasetExamples;
|
|
1690
|
+
/** Output only. Number of billable tokens in the tuning dataset. */
|
|
1691
|
+
totalBillableTokenCount?: string;
|
|
1608
1692
|
}
|
|
1609
1693
|
|
|
1610
1694
|
/** Optional parameters for models.get method. */
|
|
@@ -1773,6 +1857,22 @@ declare interface DeleteResourceJob {
|
|
|
1773
1857
|
error?: JobError;
|
|
1774
1858
|
}
|
|
1775
1859
|
|
|
1860
|
+
/** Delivery mode for the generated content. */
|
|
1861
|
+
declare enum Delivery {
|
|
1862
|
+
/**
|
|
1863
|
+
* Default value. This value is unused.
|
|
1864
|
+
*/
|
|
1865
|
+
DELIVERY_UNSPECIFIED = "DELIVERY_UNSPECIFIED",
|
|
1866
|
+
/**
|
|
1867
|
+
* Generated bytes are returned inline in the response.
|
|
1868
|
+
*/
|
|
1869
|
+
INLINE = "INLINE",
|
|
1870
|
+
/**
|
|
1871
|
+
* Generated content is stored and a URI is returned.
|
|
1872
|
+
*/
|
|
1873
|
+
URI = "URI"
|
|
1874
|
+
}
|
|
1875
|
+
|
|
1776
1876
|
/** Statistics for distillation prompt dataset. These statistics do not include the responses sampled from the teacher model. This data type is not supported in Gemini API. */
|
|
1777
1877
|
declare interface DistillationDataStats {
|
|
1778
1878
|
/** Output only. Statistics computed for the training dataset. */
|
|
@@ -2602,7 +2702,7 @@ declare interface FunctionDeclaration {
|
|
|
2602
2702
|
response?: Schema;
|
|
2603
2703
|
/** Optional. Describes the output from this function in JSON Schema format. The value specified by the schema is the response value of the function. This field is mutually exclusive with `response`. */
|
|
2604
2704
|
responseJsonSchema?: unknown;
|
|
2605
|
-
/** Optional. Specifies the function Behavior.
|
|
2705
|
+
/** Optional. Specifies the function Behavior. If not specified, the system keeps the current function call behavior. This field is currently only supported by the BidiGenerateContent method. */
|
|
2606
2706
|
behavior?: Behavior;
|
|
2607
2707
|
}
|
|
2608
2708
|
|
|
@@ -3319,11 +3419,11 @@ declare interface GenerationConfig {
|
|
|
3319
3419
|
presencePenalty?: number;
|
|
3320
3420
|
/** Optional. If set to true, the log probabilities of the output tokens are returned. Log probabilities are the logarithm of the probability of a token appearing in the output. A higher log probability means the token is more likely to be generated. This can be useful for analyzing the model's confidence in its own output and for debugging. */
|
|
3321
3421
|
responseLogprobs?: boolean;
|
|
3322
|
-
/** Optional. The IANA standard MIME type of the response. The model will generate output that conforms to this MIME type. Supported values include 'text/plain' (default) and 'application/json'. The model needs to be prompted to output the appropriate response type, otherwise the behavior is undefined. */
|
|
3422
|
+
/** Optional. The IANA standard MIME type of the response. The model will generate output that conforms to this MIME type. Supported values include 'text/plain' (default) and 'application/json'. The model needs to be prompted to output the appropriate response type, otherwise the behavior is undefined. Deprecated: Use `response_format` instead. */
|
|
3323
3423
|
responseMimeType?: string;
|
|
3324
3424
|
/** Optional. The modalities of the response. The model will generate a response that includes all the specified modalities. For example, if this is set to `[TEXT, IMAGE]`, the response will include both text and an image. */
|
|
3325
3425
|
responseModalities?: Modality[];
|
|
3326
|
-
/** Optional. Lets you to specify a schema for the model's response, ensuring that the output conforms to a particular structure. This is useful for generating structured data such as JSON. The schema is a subset of the [OpenAPI 3.0 schema object](https://spec.openapis.org/oas/v3.0.3#schema) object. When this field is set, you must also set the `response_mime_type` to `application/json`. */
|
|
3426
|
+
/** Optional. Lets you to specify a schema for the model's response, ensuring that the output conforms to a particular structure. This is useful for generating structured data such as JSON. The schema is a subset of the [OpenAPI 3.0 schema object](https://spec.openapis.org/oas/v3.0.3#schema) object. When this field is set, you must also set the `response_mime_type` to `application/json`. Deprecated: Use `response_format` instead. */
|
|
3327
3427
|
responseSchema?: Schema;
|
|
3328
3428
|
/** Optional. Routing configuration. This field is not supported in Gemini API. */
|
|
3329
3429
|
routingConfig?: GenerationConfigRoutingConfig;
|
|
@@ -3343,6 +3443,10 @@ declare interface GenerationConfig {
|
|
|
3343
3443
|
topP?: number;
|
|
3344
3444
|
/** Optional. Enables enhanced civic answers. It may not be available for all models. This field is not supported in Vertex AI. */
|
|
3345
3445
|
enableEnhancedCivicAnswers?: boolean;
|
|
3446
|
+
/** Optional. New response format field for the model to configure output formatting and delivery. */
|
|
3447
|
+
responseFormat?: ResponseFormat[];
|
|
3448
|
+
/** Optional. Config for translation. This field is not supported in Vertex AI. */
|
|
3449
|
+
translationConfig?: TranslationConfig;
|
|
3346
3450
|
}
|
|
3347
3451
|
|
|
3348
3452
|
/** The configuration for routing the request to a specific model. This can be used to control which model is used for the generation, either automatically or by specifying a model name. This data type is not supported in Gemini API. */
|
|
@@ -3766,7 +3870,7 @@ declare interface GroundingMetadata {
|
|
|
3766
3870
|
searchEntryPoint?: SearchEntryPoint;
|
|
3767
3871
|
/** Web search queries for the following-up web search. */
|
|
3768
3872
|
webSearchQueries?: string[];
|
|
3769
|
-
/** Optional. Output only. A token that can be used to render a Google Maps widget with the contextual data. This field is populated only when the grounding source is Google Maps. */
|
|
3873
|
+
/** Optional. Output only. Deprecated: The Google Maps contextual widget behavior in Grounding with Google Maps is being deprecated; this field is planned for removal and will no longer be populated once removed. A token that can be used to render a Google Maps widget with the contextual data. This field is populated only when the grounding source is Google Maps. */
|
|
3770
3874
|
googleMapsWidgetContextToken?: string;
|
|
3771
3875
|
/** Optional. The queries that were executed by the retrieval tools. This field is populated only when the grounding source is a retrieval tool, such as Vertex AI Search. This field is not supported in Gemini API. */
|
|
3772
3876
|
retrievalQueries?: string[];
|
|
@@ -4149,10 +4253,46 @@ declare enum ImageResizeMode {
|
|
|
4149
4253
|
PAD = "PAD"
|
|
4150
4254
|
}
|
|
4151
4255
|
|
|
4256
|
+
/** Configuration for image-specific output formatting. */
|
|
4257
|
+
declare class ImageResponseFormat {
|
|
4258
|
+
/** Optional. The aspect ratio for the image output. */
|
|
4259
|
+
aspectRatio?: AspectRatio;
|
|
4260
|
+
/** Optional. Delivery mode for the generated content. */
|
|
4261
|
+
delivery?: Delivery;
|
|
4262
|
+
/** Optional. The size of the image output. */
|
|
4263
|
+
imageSize?: ImageSize;
|
|
4264
|
+
/** Optional. The MIME type of the image output. */
|
|
4265
|
+
mimeType?: string;
|
|
4266
|
+
}
|
|
4267
|
+
|
|
4152
4268
|
/** Image search for grounding and related configurations. */
|
|
4153
4269
|
declare interface ImageSearch {
|
|
4154
4270
|
}
|
|
4155
4271
|
|
|
4272
|
+
/** The size of the image output. */
|
|
4273
|
+
declare enum ImageSize {
|
|
4274
|
+
/**
|
|
4275
|
+
* Default value. This value is unused.
|
|
4276
|
+
*/
|
|
4277
|
+
IMAGE_SIZE_UNSPECIFIED = "IMAGE_SIZE_UNSPECIFIED",
|
|
4278
|
+
/**
|
|
4279
|
+
* 512px image size.
|
|
4280
|
+
*/
|
|
4281
|
+
IMAGE_SIZE_FIVE_TWELVE = "IMAGE_SIZE_FIVE_TWELVE",
|
|
4282
|
+
/**
|
|
4283
|
+
* 1K image size.
|
|
4284
|
+
*/
|
|
4285
|
+
IMAGE_SIZE_ONE_K = "IMAGE_SIZE_ONE_K",
|
|
4286
|
+
/**
|
|
4287
|
+
* 2K image size.
|
|
4288
|
+
*/
|
|
4289
|
+
IMAGE_SIZE_TWO_K = "IMAGE_SIZE_TWO_K",
|
|
4290
|
+
/**
|
|
4291
|
+
* 4K image size.
|
|
4292
|
+
*/
|
|
4293
|
+
IMAGE_SIZE_FOUR_K = "IMAGE_SIZE_FOUR_K"
|
|
4294
|
+
}
|
|
4295
|
+
|
|
4156
4296
|
/** Optional parameters for importing a file. */
|
|
4157
4297
|
declare interface ImportFileConfig {
|
|
4158
4298
|
/** Used to override HTTP request options. */
|
|
@@ -5165,6 +5305,11 @@ declare interface LiveServerSessionResumptionUpdate {
|
|
|
5165
5305
|
declare interface LiveServerSetupComplete {
|
|
5166
5306
|
/** The session id of the live session. */
|
|
5167
5307
|
sessionId?: string;
|
|
5308
|
+
/** Signature of the verified consent audio. This is populated when the
|
|
5309
|
+
request has a ReplicatedVoiceConfig with consent_audio set, if the consent
|
|
5310
|
+
verification was successful. This may be used in a subsequent request
|
|
5311
|
+
instead of the consent_audio to verify the same consent. */
|
|
5312
|
+
voiceConsentSignature?: VoiceConsentSignature;
|
|
5168
5313
|
}
|
|
5169
5314
|
|
|
5170
5315
|
/** Request for the client to execute the `function_calls` and return the responses with the matching `id`s. */
|
|
@@ -5253,22 +5398,22 @@ declare enum MaskReferenceMode {
|
|
|
5253
5398
|
MASK_MODE_SEMANTIC = "MASK_MODE_SEMANTIC"
|
|
5254
5399
|
}
|
|
5255
5400
|
|
|
5256
|
-
/** Match operation to use for
|
|
5401
|
+
/** Match operation to use for evaluating rewards. This enum is not supported in Gemini API. */
|
|
5257
5402
|
declare enum MatchOperation {
|
|
5258
5403
|
/**
|
|
5259
|
-
* Default value.
|
|
5404
|
+
* Default value. A user error will be returned if not set.
|
|
5260
5405
|
*/
|
|
5261
5406
|
MATCH_OPERATION_UNSPECIFIED = "MATCH_OPERATION_UNSPECIFIED",
|
|
5262
5407
|
/**
|
|
5263
|
-
* Equivalent to GoogleSQL `REGEX_CONTAINS(target, expression)`.
|
|
5408
|
+
* Equivalent to [GoogleSQL](https://cloud.google.com/bigquery/docs/reference/standard-sql/string_functions#regexp_contains) `REGEX_CONTAINS(target, expression)`.
|
|
5264
5409
|
*/
|
|
5265
5410
|
REGEX_CONTAINS = "REGEX_CONTAINS",
|
|
5266
5411
|
/**
|
|
5267
|
-
* `
|
|
5412
|
+
* The match operation returns `true` if expression is a substring of the target.
|
|
5268
5413
|
*/
|
|
5269
5414
|
PARTIAL_MATCH = "PARTIAL_MATCH",
|
|
5270
5415
|
/**
|
|
5271
|
-
* `
|
|
5416
|
+
* The match operation returns `true` expression is an exact match of the target.
|
|
5272
5417
|
*/
|
|
5273
5418
|
EXACT_MATCH = "EXACT_MATCH"
|
|
5274
5419
|
}
|
|
@@ -6133,39 +6278,39 @@ declare class RegisterFilesResponse {
|
|
|
6133
6278
|
declare interface ReinforcementTuningAutoraterScorer {
|
|
6134
6279
|
/** Autorater config for evaluation. */
|
|
6135
6280
|
autoraterConfig?: AutoraterConfig;
|
|
6136
|
-
/**
|
|
6281
|
+
/** The prompt for an autorater to scorer the parsed sample response. This field supports the following placeholders that will be replaced before scoring: - {{prompt}} - {{response}} - {{system_instruction}} - {{references.key}} */
|
|
6137
6282
|
autoraterPrompt?: string;
|
|
6138
|
-
/** Parses autorater returned response. */
|
|
6283
|
+
/** Parses autorater returned response for scoring. For example, if the autorater response has reward stored in the `2.0` block, defining a parsing response config using regex `".*(.*?)"` will return a score `"2.0"`. */
|
|
6139
6284
|
autoraterResponseParseConfig?: ReinforcementTuningParseResponseConfig;
|
|
6140
|
-
/** Scores autorater responses by directly converting parsed autorater response to float reward. */
|
|
6285
|
+
/** Scores autorater responses by directly converting parsed autorater response to a float reward. Note: Reward is clipped to be within `[-1, 1]`, i.e., `reward = max(min(reward, 1.0), -1.0)`. */
|
|
6141
6286
|
parsedResponseConversionScorer?: ReinforcementTuningAutoraterScorerParsedResponseConversionScorer;
|
|
6142
|
-
/** Scores autorater responses by using
|
|
6287
|
+
/** Scores autorater responses by using string match reward scorer. */
|
|
6143
6288
|
exactMatchScorer?: ReinforcementTuningAutoraterScorerExactMatchScorer;
|
|
6144
6289
|
}
|
|
6145
6290
|
|
|
6146
|
-
/** Scores autorater responses by using exact string match reward scorer. */
|
|
6291
|
+
/** Scores autorater responses by using exact string match reward scorer. This data type is not supported in Gemini API. */
|
|
6147
6292
|
declare interface ReinforcementTuningAutoraterScorerExactMatchScorer {
|
|
6148
|
-
/** Assigns this reward score if parsed response string equals the expression. */
|
|
6293
|
+
/** Assigns this reward score if the parsed response string equals the expression. */
|
|
6149
6294
|
correctAnswerReward?: number;
|
|
6150
|
-
/** Assigns this reward score if parsed reward value does not equal the expression. */
|
|
6295
|
+
/** Assigns this reward score if the parsed reward value does not equal the expression. */
|
|
6151
6296
|
wrongAnswerReward?: number;
|
|
6152
|
-
/** The string expression to match against.
|
|
6297
|
+
/** The string expression to match against for scoring. This field supports placeholders in the format of {{references.key}} that will be replaced before matching. Regex is not supported for this expression. For example, users can define an ExactMatchScorer as follows: { "correctAnswerReward": 1.0, "wrongAnswerReward": -1.0, "expression": "{{references.concise_answer}}" } When evaluating the reward for each parsed autorater response, if the prompt references in the training/validation dataset has the following fields: ``` { "example": ..., "references": { "concise_ansser": "Yes", "verbose_answer": "The answer is Yes" } } ``` The above ExactMatchScorer will be replaced as follows for scoring: ``` { "correctAnswerReward": 1.0, "wrongAnswerReward": -1.0, "expression": "Yes" } ``` If the *parsed* autorater response is equal to the string `"Yes"`, then the reward is `1.0`, otherwise the reward is `-1.0`. */
|
|
6153
6298
|
expression?: string;
|
|
6154
6299
|
}
|
|
6155
6300
|
|
|
6156
|
-
/** Scores responses by directly converting parsed autorater response to float reward
|
|
6301
|
+
/** Scores responses by directly converting the parsed autorater response to a float reward. Note: Reward is clipped to be within `[-1, 1]`, i.e., `reward = max(min(reward, 1.0), -1.0)`. This data type is not supported in Gemini API. */
|
|
6157
6302
|
declare class ReinforcementTuningAutoraterScorerParsedResponseConversionScorer {
|
|
6158
6303
|
}
|
|
6159
6304
|
|
|
6160
|
-
/**
|
|
6305
|
+
/** ReinforcementTuningCloudRunRewardScorer allows users to implement a reward function through GCP Cloud Run. Comparing with ReinforcementTuningCodeExecutionRewardScorer that runs in a Sandbox and has no internet access, Cloud Run reward scorer is fully controlled by users. The Cloud Run service should implement the following HTTP API: HTTP method: `POST` HTTP request body: ``` { "example": ReinforcementTuningExample, "response": Content, "metadata": { "step": int "tuning_job_id": int64 } } ``` * `example` is a ReinforcementTuningExample in ProtoJSON format, (i.e., the format is the same as as one line in the training/validation dataset except that the keys must be in camel case). System instructions (i.e., `example.get("systemInstruction")`) and references (i.e., `example.get("references")`) are also included in the `example` provided that they are set in the training/validation dataset. * `response` is a Content in ProtoJSON format (i.e., keys must be in camel case), which is the same as the Online Prediction response for Gemini models. HTTP response body: { "reward": float, "user_requested_aux_info": str // Optional } where the field "user_requested_aux_info" is any (optional) string provided by users for assisting debugging. It's in snake case. This field is mostly useful when calling the GenAiTuningService.ValidateReinforcementTuningReward API, where the proto field (not Cloud Run HTTP response body) userRequestedAuxInfo will be populated if the Cloud Run reward function sets this field in the HTTP response. The following are examples for the HTTP request and response body. Example HTTP request body: ``` { "example": { "contents": [ { "role": "user", "parts": [ { "text": "What is the capital of France?" } ] } ], "references": { "answer": "Paris" } }, "response": { "parts": [ { "text": "London" } ] }, "metadata": { "step": 1, "tuning_job_id": 123456789 } } ``` Example HTTP response body: ``` { "reward": -1.0 } ``` Note: Reward output by Cloud Run reward function is clipped to be within `[-1, 1]`, i.e., `reward = max(min(reward, 1.0), -1.0)`. This data type is not supported in Gemini API. */
|
|
6161
6306
|
declare interface ReinforcementTuningCloudRunRewardScorer {
|
|
6162
|
-
/** URI of the Cloud Run service that will be used to compute the reward. The Vertex AI Secure Fine Tuning Service Agent (`service
|
|
6307
|
+
/** URI of the Cloud Run service that will be used to compute the reward. The [Vertex AI Secure Fine Tuning Service Agent](https://docs.cloud.google.com/iam/docs/service-agents#vertex-ai-secure-fine-tuning-service-agent) (`service-@gcp-sa-vertex-tune.iam.gserviceaccount.com`) must be granted the permission (e.g. by granting `roles/run.invoker` in IAM) to invoke the Cloud Run service. */
|
|
6163
6308
|
cloudRunUri?: string;
|
|
6164
6309
|
}
|
|
6165
6310
|
|
|
6166
|
-
/**
|
|
6311
|
+
/** ReinforcementTuningCodeExecutionRewardScorer allows users to implement a function to evaluate rewards for the sample response. The function signature is as follows: ``` def evaluate(example: dict[str, Any], response: dict[str, Any]) -> float: ... ``` `example` is a ReinforcementTuningExample in ProtoJSON format, (i.e., the format is the same as as one line in the training/validation dataset except that the keys must be in camel case). System instructions (i.e., `example.get("systemInstruction")`) and references (i.e., `example.get("references")`) are also included in the `example` provided that they are set in the training/validation dataset. `response` is a Content in ProtoJSON format (i.e., keys must be in camel case), which is the same as the Online Prediction response for Gemini models. Note: Reward output by the `evaluate` function is clipped to be within `[-1, 1]`, i.e., `reward = max(min(reward, 1.0), -1.0)`. This data type is not supported in Gemini API. */
|
|
6167
6312
|
declare interface ReinforcementTuningCodeExecutionRewardScorer {
|
|
6168
|
-
/**
|
|
6313
|
+
/** The python code snippet as a string for evaluating rewards. The following is an example python code snippet that returns a reward `1.0` for a parsed response matching the user-provided reference answer in per prompt references map. ``` def evaluate(example, response) -> float: response_str = response.get("parts", [])0 references = example.get("references", {}) if response_str == references.get("concise_answer"): return 1.0 return -1.0 ``` Note: Reward output by the evaluate function is clipped to be within `[-1, 1]`, i.e., `reward = max(min(reward, 1.0), -1.0)`. */
|
|
6169
6314
|
pythonCodeSnippet?: string;
|
|
6170
6315
|
}
|
|
6171
6316
|
|
|
@@ -6175,37 +6320,39 @@ declare interface ReinforcementTuningExample {
|
|
|
6175
6320
|
contents?: Content[];
|
|
6176
6321
|
/** References for the given prompt. The key is the name of the reference, and the value is the reference itself. */
|
|
6177
6322
|
references?: Record<string, string>;
|
|
6178
|
-
/** Corresponds to
|
|
6323
|
+
/** Corresponds to system_instruction in user-facing GenerateContentRequest. */
|
|
6179
6324
|
systemInstruction?: Content;
|
|
6180
6325
|
}
|
|
6181
6326
|
|
|
6182
6327
|
/** Hyperparameters for Reinforcement Tuning. */
|
|
6183
6328
|
declare interface ReinforcementTuningHyperParameters {
|
|
6184
|
-
/** Number of training
|
|
6329
|
+
/** Optional. Number of training epoches for the tuning job. */
|
|
6185
6330
|
epochCount?: string;
|
|
6186
6331
|
/** Learning rate multiplier for Reinforcement Learning. */
|
|
6187
6332
|
learningRateMultiplier?: number;
|
|
6188
|
-
/** Adapter size for Reinforcement Tuning. */
|
|
6333
|
+
/** Optional. Adapter size for Reinforcement Tuning. */
|
|
6189
6334
|
adapterSize?: AdapterSize;
|
|
6190
|
-
/** Number of different responses to generate per prompt during tuning. */
|
|
6335
|
+
/** Optional. Number of different responses to generate per prompt during tuning. */
|
|
6191
6336
|
samplesPerPrompt?: number;
|
|
6192
|
-
/** Batch size for the tuning job. How many prompts to process at a train step. If not set, the batch size will be determined automatically. */
|
|
6337
|
+
/** Optional. Batch size for the tuning job. How many prompts to process at a train step. If not set, the batch size will be determined automatically. */
|
|
6193
6338
|
batchSize?: number;
|
|
6194
|
-
/** How often
|
|
6339
|
+
/** Optional. How often at steps to evaluate the tuning job during training. If not set, evel will be run per epoch. `total_steps = epoch_count * samples_per_prompt / total_prompts_in_dataset` */
|
|
6195
6340
|
evaluateInterval?: number;
|
|
6196
|
-
/** How often
|
|
6341
|
+
/** Optional. How often at steps to save checkpoints during training. If not set, one checkpoint per epoch will be set. ```total_steps = epoch_count * samples_per_prompt / total_prompts_in_dataset``` */
|
|
6197
6342
|
checkpointInterval?: number;
|
|
6198
|
-
/** The maximum number of tokens to generate per prompt.
|
|
6343
|
+
/** Optional. The maximum number of tokens to generate per prompt. Default to 32768. */
|
|
6199
6344
|
maxOutputTokens?: number;
|
|
6200
|
-
/** Indicates the maximum thinking depth.
|
|
6345
|
+
/** Indicates the maximum thinking depth during tuning. Starting from Gemini 3.5 models, the old thinking_budget will no longer be supported and will result in a user error if set. Instead, users should use the thinking_level parameter to control the maximum thinking depth. */
|
|
6201
6346
|
thinkingLevel?: ReinforcementTuningThinkingLevel;
|
|
6347
|
+
/** Optional. The thinking budget for the tuning job to optimize for (Gemini 2.5 only). * -1 means dynamic thinking * 0 means no thinking * > 0 means thinking budget in tokens If not set, default to -1 (dynamic thinking). */
|
|
6348
|
+
thinkingBudget?: number;
|
|
6202
6349
|
}
|
|
6203
6350
|
|
|
6204
|
-
/** Defines how to parse sample response for reinforcement tuning. */
|
|
6351
|
+
/** Defines how to parse sample response config for reinforcement tuning. The parsed response (i.e., substring) will be passed to the reward functions. For example, the input prompt might be: > "Perform step-by-step thoughts first to problem A, finally output answer in the <ans> </ans> block." The sample response from the model under tuning might look like: > "<ans>Yes</ans>" Here, users can define the following parse config: ``` { "parseType": "REGEX_EXTRACT", "regexExtractExpression": ".*(.*?)" } ``` The resulting parsed response would be `"Yes"` and will be passed to the reward functions for evaluating rewards. This data type is not supported in Gemini API. */
|
|
6205
6352
|
declare class ReinforcementTuningParseResponseConfig {
|
|
6206
|
-
/** Defines
|
|
6353
|
+
/** Defines the type for parsing sample response. */
|
|
6207
6354
|
parseType?: ResponseParseType;
|
|
6208
|
-
/** Defines the regex
|
|
6355
|
+
/** Defines the regex for extracting the important part of sample response. This field is only used when parse_type is ResponseParseType.REGEX_EXTRACT. */
|
|
6209
6356
|
regexExtractExpression?: string;
|
|
6210
6357
|
}
|
|
6211
6358
|
|
|
@@ -6213,16 +6360,17 @@ declare class ReinforcementTuningParseResponseConfig {
|
|
|
6213
6360
|
declare interface ReinforcementTuningRewardInfo {
|
|
6214
6361
|
/** Output only. The calculated reward for the reward function. */
|
|
6215
6362
|
reward?: number;
|
|
6216
|
-
/** Output only. The user-requested auxiliary info for the reward function. */
|
|
6363
|
+
/** Output only. The user-requested auxiliary info for the reward function. This field is set only if the Cloud Run reward function configured by user returns a "user_requested_aux_info". Refer to ReinforcementTuningCloudRunRewardScorer for more details. */
|
|
6217
6364
|
userRequestedAuxInfo?: string;
|
|
6218
6365
|
}
|
|
6219
6366
|
|
|
6220
6367
|
/** Reinforcement tuning spec for tuning. */
|
|
6221
6368
|
declare interface ReinforcementTuningSpec {
|
|
6369
|
+
/** Composite reward function configuration for reinforcement tuning. */
|
|
6222
6370
|
compositeRewardConfig?: CompositeReinforcementTuningRewardConfig;
|
|
6223
|
-
/** Cloud Storage path to file containing training dataset for tuning. The dataset must be formatted as a JSONL file. */
|
|
6371
|
+
/** Cloud Storage path to the file containing training dataset for tuning. The dataset must be formatted as a JSONL file. */
|
|
6224
6372
|
trainingDatasetUri?: string;
|
|
6225
|
-
/** Cloud Storage path to file containing validation dataset for tuning. The dataset must be formatted as a JSONL file.
|
|
6373
|
+
/** Cloud Storage path to the file containing validation dataset for tuning. The dataset must be formatted as a JSONL file. */
|
|
6226
6374
|
validationDatasetUri?: string;
|
|
6227
6375
|
/** Additional hyper-parameters to use during tuning. */
|
|
6228
6376
|
hyperParameters?: ReinforcementTuningHyperParameters;
|
|
@@ -6230,11 +6378,11 @@ declare interface ReinforcementTuningSpec {
|
|
|
6230
6378
|
singleRewardConfig?: SingleReinforcementTuningRewardConfig;
|
|
6231
6379
|
}
|
|
6232
6380
|
|
|
6233
|
-
/**
|
|
6381
|
+
/** ReinforcementTuningStringMatchRewardScorer is used to score parsed responses for string matching use cases. For example, for math problems, users can use string match scorer to check if the correct exact answer is generated. Note: Reward returned by the string match reward function is clipped to be within `[-1, 1]` if wrongAnswerReward or correctAnswerReward are beyond the range, i.e., `reward = max(min(reward, 1.0), -1.0)`. This data type is not supported in Gemini API. */
|
|
6234
6382
|
declare interface ReinforcementTuningStringMatchRewardScorer {
|
|
6235
|
-
/** Wrong answer reward is returned if
|
|
6383
|
+
/** Wrong answer reward is returned if the parsed response is evaluated as `false`. All wrong answers get the same reward. */
|
|
6236
6384
|
wrongAnswerReward?: number;
|
|
6237
|
-
/** Correct answer
|
|
6385
|
+
/** Correct answer rewawrd is returned if the parsed response is evaluated as `true`. All correct answers get the same reward. */
|
|
6238
6386
|
correctAnswerReward?: number;
|
|
6239
6387
|
/** Uses string match expression to evaluate parsed response. */
|
|
6240
6388
|
stringMatchExpression?: ReinforcementTuningStringMatchRewardScorerStringMatchExpression;
|
|
@@ -6242,19 +6390,19 @@ declare interface ReinforcementTuningStringMatchRewardScorer {
|
|
|
6242
6390
|
jsonMatchExpression?: ReinforcementTuningStringMatchRewardScorerJsonMatchExpression;
|
|
6243
6391
|
}
|
|
6244
6392
|
|
|
6245
|
-
/**
|
|
6393
|
+
/** JsonMatchExpression supports converting the parsed responses to JSON format, finding the value in the JSON response that matches the key_name in the first level, and performing StringMatchExpression operation on the matched JSON value. This data type is not supported in Gemini API. */
|
|
6246
6394
|
declare interface ReinforcementTuningStringMatchRewardScorerJsonMatchExpression {
|
|
6247
|
-
/**
|
|
6395
|
+
/** The key name to find the value in the parsed response that's in JSON format. Only first-level key matching is supported. */
|
|
6248
6396
|
keyName?: string;
|
|
6249
|
-
/** String match expression to match against the value of
|
|
6397
|
+
/** String match expression to match against the extracted value from the JSON representation of the parsed response. */
|
|
6250
6398
|
valueStringMatchExpression?: ReinforcementTuningStringMatchRewardScorerStringMatchExpression;
|
|
6251
6399
|
}
|
|
6252
6400
|
|
|
6253
|
-
/** Evaluates parsed response using match type against expression. */
|
|
6401
|
+
/** Evaluates parsed response using match type against the expression. Returns `true` if `MatchOperation(target, expression)` evaluates to `true`, and `false` otherwise. This data type is not supported in Gemini API. */
|
|
6254
6402
|
declare interface ReinforcementTuningStringMatchRewardScorerStringMatchExpression {
|
|
6255
|
-
/** Match operation to use for
|
|
6403
|
+
/** Match operation to use for evaluating rewards. */
|
|
6256
6404
|
matchOperation?: MatchOperation;
|
|
6257
|
-
/**
|
|
6405
|
+
/** A string or a regular expression to match against for evaluating rewards. Users can also provide a references map of `{key: value}` whose `value` will be used to replace the placeholder {{references.key}} in the expression. For example, if the following `references` are defined in the training / validation dataset: ``` { "systemInstruction": ..., "contents": ..., "references": { "concise_answer": "Yes", "verbose_answer": "The answer is Yes" } } ``` and if users define the following StringMatchExpression: { "matchOperation": "REGEX_CONTAINS", "expression": ".*{{references.concise_answer}}.*" } On evaluating the reward for each sample response, this StringMatchExpression will be substituted as: ``` { "matchOperation": "REGEX_CONTAINS", "expression": ".*Yes.*" } ``` */
|
|
6258
6406
|
expression?: string;
|
|
6259
6407
|
}
|
|
6260
6408
|
|
|
@@ -6274,6 +6422,12 @@ declare enum ReinforcementTuningThinkingLevel {
|
|
|
6274
6422
|
HIGH = "HIGH"
|
|
6275
6423
|
}
|
|
6276
6424
|
|
|
6425
|
+
/** Sample reinforcement tuning user data in the training dataset. The contents are truncated for better UI showing. This data type is not supported in Gemini API. */
|
|
6426
|
+
declare interface ReinforcementTuningUserDatasetExamples {
|
|
6427
|
+
/** List of user datasset examples showing to user. */
|
|
6428
|
+
userDatasetExamples?: ReinforcementTuningExample[];
|
|
6429
|
+
}
|
|
6430
|
+
|
|
6277
6431
|
/** Represents a recorded session. */
|
|
6278
6432
|
declare interface ReplayFile {
|
|
6279
6433
|
replayId?: string;
|
|
@@ -6313,6 +6467,17 @@ declare interface ReplicatedVoiceConfig {
|
|
|
6313
6467
|
|
|
6314
6468
|
* @remarks Encoded as base64 string. */
|
|
6315
6469
|
voiceSampleAudio?: string;
|
|
6470
|
+
/** Recorded consent verifying ownership of the voice. This
|
|
6471
|
+
represents 16-bit signed little-endian wav data, with a 24kHz sampling
|
|
6472
|
+
rate.
|
|
6473
|
+
* @remarks Encoded as base64 string. */
|
|
6474
|
+
consentAudio?: string;
|
|
6475
|
+
/** Signature of a previously verified consent audio. This should be
|
|
6476
|
+
populated with a signature generated by the server for a previous
|
|
6477
|
+
request containing the consent_audio field. When provided, the
|
|
6478
|
+
signature is verified instead of the consent_audio field to reduce
|
|
6479
|
+
latency. Requests will fail if the signature is invalid or expired. */
|
|
6480
|
+
voiceConsentSignature?: VoiceConsentSignature;
|
|
6316
6481
|
}
|
|
6317
6482
|
|
|
6318
6483
|
/** Resource scope. */
|
|
@@ -6327,18 +6492,30 @@ declare enum ResourceScope {
|
|
|
6327
6492
|
COLLECTION = "COLLECTION"
|
|
6328
6493
|
}
|
|
6329
6494
|
|
|
6330
|
-
/**
|
|
6495
|
+
/** Configuration for the model to configure output formatting and delivery. This data type is not supported in Gemini API. */
|
|
6496
|
+
declare class ResponseFormat {
|
|
6497
|
+
/** Audio output format. */
|
|
6498
|
+
audio?: AudioResponseFormat;
|
|
6499
|
+
/** Image output format. */
|
|
6500
|
+
image?: ImageResponseFormat;
|
|
6501
|
+
/** Text output format. */
|
|
6502
|
+
text?: TextResponseFormat;
|
|
6503
|
+
/** Video output format. */
|
|
6504
|
+
video?: VideoResponseFormat;
|
|
6505
|
+
}
|
|
6506
|
+
|
|
6507
|
+
/** Defines the type for parsing sample response. This enum is not supported in Gemini API. */
|
|
6331
6508
|
declare enum ResponseParseType {
|
|
6332
6509
|
/**
|
|
6333
|
-
* Default value.
|
|
6510
|
+
* Default value. Fallback to IDENTITY
|
|
6334
6511
|
*/
|
|
6335
6512
|
RESPONSE_PARSE_TYPE_UNSPECIFIED = "RESPONSE_PARSE_TYPE_UNSPECIFIED",
|
|
6336
6513
|
/**
|
|
6337
|
-
*
|
|
6514
|
+
* Returns the sample response as is.
|
|
6338
6515
|
*/
|
|
6339
6516
|
IDENTITY = "IDENTITY",
|
|
6340
6517
|
/**
|
|
6341
|
-
*
|
|
6518
|
+
* Uses regex to extract the important part of sample response. Similar to [GoogleSQL](https://cloud.google.com/bigquery/docs/reference/standard-sql/string_functions#regexp_extract) `REGEX_EXTRACT(response, regex_extract_expression)`, but different in that if there are multiple matches, the last match will be returned.
|
|
6342
6519
|
*/
|
|
6343
6520
|
REGEX_EXTRACT = "REGEX_EXTRACT"
|
|
6344
6521
|
}
|
|
@@ -6754,15 +6931,15 @@ declare class SingleEmbedContentResponse {
|
|
|
6754
6931
|
declare interface SingleReinforcementTuningRewardConfig {
|
|
6755
6932
|
/** Scores parsed responses for autorater use cases by using a model to compute the reward. */
|
|
6756
6933
|
autoraterScorer?: ReinforcementTuningAutoraterScorer;
|
|
6757
|
-
/** A unique reward name
|
|
6934
|
+
/** A unique reward name for identifying each single reinforcement tuning reward. */
|
|
6758
6935
|
rewardName?: string;
|
|
6759
|
-
/** Defines how to parse sample response. */
|
|
6936
|
+
/** Defines how to parse sample response. For example, given a sample response for evaluating the reward, users might want to extract the text only between `` and `` in the sample response, and keeps only the last one in case there are multiple such tags. To achieve such a purpose, they can define a regex `".*(.*?)"` using the ReinforcementTuningParseResponseConfig.ResponseParseType.REGEX_EXTRACT parse type. */
|
|
6760
6937
|
parseResponseConfig?: ReinforcementTuningParseResponseConfig;
|
|
6761
|
-
/**
|
|
6938
|
+
/** ReinforcementTuningCodeExecutionRewardScorer is used to score parsed responses for code execution use cases. */
|
|
6762
6939
|
codeExecutionRewardScorer?: ReinforcementTuningCodeExecutionRewardScorer;
|
|
6763
|
-
/**
|
|
6940
|
+
/** ReinforcementTuningStringMatchRewardScorer is used to score parsed responses for simple string matching use cases against reference answers. */
|
|
6764
6941
|
stringMatchRewardScorer?: ReinforcementTuningStringMatchRewardScorer;
|
|
6765
|
-
/**
|
|
6942
|
+
/** ReinforcementTuningCloudRunRewardScorer is used to score parsed responses by calling a Cloud Run service. */
|
|
6766
6943
|
cloudRunRewardScorer?: ReinforcementTuningCloudRunRewardScorer;
|
|
6767
6944
|
}
|
|
6768
6945
|
|
|
@@ -7008,6 +7185,14 @@ declare interface TestTableItem {
|
|
|
7008
7185
|
ignoreKeys?: string[];
|
|
7009
7186
|
}
|
|
7010
7187
|
|
|
7188
|
+
/** Configuration for text-specific output formatting. */
|
|
7189
|
+
declare class TextResponseFormat {
|
|
7190
|
+
/** Optional. The IANA standard MIME type of the response. */
|
|
7191
|
+
mimeType?: string;
|
|
7192
|
+
/** Optional. The JSON schema that the output should conform to. Only applicable when mime_type is APPLICATION_JSON. */
|
|
7193
|
+
schema?: unknown;
|
|
7194
|
+
}
|
|
7195
|
+
|
|
7011
7196
|
/** The thinking features configuration. */
|
|
7012
7197
|
declare interface ThinkingConfig {
|
|
7013
7198
|
/** Indicates whether to include thoughts in the response. If true, thoughts are returned only if the model supports thought and thoughts are available.
|
|
@@ -7082,6 +7267,8 @@ declare interface Tool {
|
|
|
7082
7267
|
urlContext?: UrlContext;
|
|
7083
7268
|
/** Optional. MCP Servers to connect to. This field is not supported in Vertex AI. */
|
|
7084
7269
|
mcpServers?: McpServer[];
|
|
7270
|
+
/** Optional. Uses Exa.ai to search for information to answer user queries. The search results will be grounded on Exa.ai and presented to the model for response generation. This field is not supported in Gemini API. */
|
|
7271
|
+
exaAiSearch?: ToolExaAiSearch;
|
|
7085
7272
|
}
|
|
7086
7273
|
|
|
7087
7274
|
/** A predicted server-side `ToolCall` returned from the model.
|
|
@@ -7113,6 +7300,14 @@ declare interface ToolConfig {
|
|
|
7113
7300
|
includeServerSideToolInvocations?: boolean;
|
|
7114
7301
|
}
|
|
7115
7302
|
|
|
7303
|
+
/** ExaAiSearch tool type. A tool that uses the Exa.ai search engine for grounding. This data type is not supported in Gemini API. */
|
|
7304
|
+
declare interface ToolExaAiSearch {
|
|
7305
|
+
/** Required. The API key for ExaAiSearch. */
|
|
7306
|
+
apiKey?: string;
|
|
7307
|
+
/** Optional. This field can be used to pass any parameter from the Exa.ai Search API. */
|
|
7308
|
+
customConfigs?: Record<string, unknown>;
|
|
7309
|
+
}
|
|
7310
|
+
|
|
7116
7311
|
declare type ToolListUnion = ToolUnion[];
|
|
7117
7312
|
|
|
7118
7313
|
/** ParallelAiSearch tool type. A tool that uses the Parallel.ai search engine for grounding. This data type is not supported in Gemini API. */
|
|
@@ -7204,12 +7399,9 @@ declare interface Transcription {
|
|
|
7204
7399
|
|
|
7205
7400
|
/** Config for stream translation. */
|
|
7206
7401
|
declare interface TranslationConfig {
|
|
7207
|
-
/** If true, the model will generate audio when the target language is
|
|
7208
|
-
spoken, essentially it will parrot the input. If false, we will not produce
|
|
7209
|
-
audio for the target language. */
|
|
7402
|
+
/** Optional. If true, the model will generate audio when the target language is spoken, essentially it will parrot the input. If false, we will not produce audio for the target language. */
|
|
7210
7403
|
echoTargetLanguage?: boolean;
|
|
7211
|
-
/** The target language for translation. Supported values are BCP-47
|
|
7212
|
-
language codes (e.g. "en", "es", "fr"). */
|
|
7404
|
+
/** Required. The target language for translation. Supported values are BCP-47 language codes (e.g. "en", "es", "fr"). */
|
|
7213
7405
|
targetLanguageCode?: string;
|
|
7214
7406
|
}
|
|
7215
7407
|
|
|
@@ -7277,6 +7469,8 @@ declare interface TuningDataStats {
|
|
|
7277
7469
|
preferenceOptimizationDataStats?: PreferenceOptimizationDataStats;
|
|
7278
7470
|
/** The SFT Tuning data stats. */
|
|
7279
7471
|
supervisedTuningDataStats?: SupervisedTuningDataStats;
|
|
7472
|
+
/** Output only. Statistics for reinforcement tuning. */
|
|
7473
|
+
reinforcementTuningDataStats?: DatasetStats;
|
|
7280
7474
|
}
|
|
7281
7475
|
|
|
7282
7476
|
/** A single example for tuning. This data type is not supported in Vertex AI. */
|
|
@@ -7319,6 +7513,7 @@ declare interface TuningJob {
|
|
|
7319
7513
|
preferenceOptimizationSpec?: PreferenceOptimizationSpec;
|
|
7320
7514
|
/** Tuning Spec for Distillation. */
|
|
7321
7515
|
distillationSpec?: DistillationSpec;
|
|
7516
|
+
/** Tuning Spec for Reinforcement Tuning. */
|
|
7322
7517
|
reinforcementTuningSpec?: ReinforcementTuningSpec;
|
|
7323
7518
|
/** Output only. The tuning data statistics associated with this TuningJob. */
|
|
7324
7519
|
tuningDataStats?: TuningDataStats;
|
|
@@ -7698,8 +7893,14 @@ declare namespace types {
|
|
|
7698
7893
|
ModelStage,
|
|
7699
7894
|
MediaResolution,
|
|
7700
7895
|
Modality,
|
|
7896
|
+
Delivery,
|
|
7897
|
+
AspectRatio,
|
|
7898
|
+
ImageSize,
|
|
7701
7899
|
TuningMode,
|
|
7702
7900
|
AdapterSize,
|
|
7901
|
+
ResponseParseType,
|
|
7902
|
+
MatchOperation,
|
|
7903
|
+
ReinforcementTuningThinkingLevel,
|
|
7703
7904
|
JobState,
|
|
7704
7905
|
TuningJobState,
|
|
7705
7906
|
AggregationMetric,
|
|
@@ -7725,9 +7926,6 @@ declare namespace types {
|
|
|
7725
7926
|
VideoGenerationMaskMode,
|
|
7726
7927
|
VideoCompressionQuality,
|
|
7727
7928
|
ImageResizeMode,
|
|
7728
|
-
ResponseParseType,
|
|
7729
|
-
MatchOperation,
|
|
7730
|
-
ReinforcementTuningThinkingLevel,
|
|
7731
7929
|
TuningMethod,
|
|
7732
7930
|
FileState,
|
|
7733
7931
|
FileSource,
|
|
@@ -7800,7 +7998,9 @@ declare namespace types {
|
|
|
7800
7998
|
UrlContext,
|
|
7801
7999
|
StreamableHttpTransport,
|
|
7802
8000
|
McpServer,
|
|
8001
|
+
ToolExaAiSearch,
|
|
7803
8002
|
Tool,
|
|
8003
|
+
VoiceConsentSignature,
|
|
7804
8004
|
ReplicatedVoiceConfig,
|
|
7805
8005
|
PrebuiltVoiceConfig,
|
|
7806
8006
|
VoiceConfig,
|
|
@@ -7905,6 +8105,12 @@ declare namespace types {
|
|
|
7905
8105
|
DeleteModelConfig,
|
|
7906
8106
|
DeleteModelParameters,
|
|
7907
8107
|
DeleteModelResponse,
|
|
8108
|
+
AudioResponseFormat,
|
|
8109
|
+
ImageResponseFormat,
|
|
8110
|
+
TextResponseFormat,
|
|
8111
|
+
VideoResponseFormat,
|
|
8112
|
+
ResponseFormat,
|
|
8113
|
+
TranslationConfig,
|
|
7908
8114
|
GenerationConfig,
|
|
7909
8115
|
CountTokensConfig,
|
|
7910
8116
|
CountTokensParameters,
|
|
@@ -7954,6 +8160,8 @@ declare namespace types {
|
|
|
7954
8160
|
PreTunedModel,
|
|
7955
8161
|
DatasetDistributionDistributionBucket,
|
|
7956
8162
|
DatasetDistribution,
|
|
8163
|
+
ReinforcementTuningExample,
|
|
8164
|
+
ReinforcementTuningUserDatasetExamples,
|
|
7957
8165
|
DatasetStats,
|
|
7958
8166
|
DistillationDataStats,
|
|
7959
8167
|
GeminiPreferenceExampleCompletion,
|
|
@@ -7999,7 +8207,6 @@ declare namespace types {
|
|
|
7999
8207
|
CreateTuningJobConfig,
|
|
8000
8208
|
CreateTuningJobParametersPrivate,
|
|
8001
8209
|
TuningOperation,
|
|
8002
|
-
ReinforcementTuningExample,
|
|
8003
8210
|
ValidateRewardConfig,
|
|
8004
8211
|
ValidateRewardParameters,
|
|
8005
8212
|
ReinforcementTuningRewardInfo,
|
|
@@ -8143,7 +8350,6 @@ declare namespace types {
|
|
|
8143
8350
|
LiveClientRealtimeInput,
|
|
8144
8351
|
LiveClientToolResponse,
|
|
8145
8352
|
LiveClientMessage,
|
|
8146
|
-
TranslationConfig,
|
|
8147
8353
|
LiveConnectConfig,
|
|
8148
8354
|
LiveConnectParameters,
|
|
8149
8355
|
CreateChatParameters,
|
|
@@ -8781,6 +8987,18 @@ declare enum VideoOrientation {
|
|
|
8781
8987
|
PORTRAIT = "PORTRAIT"
|
|
8782
8988
|
}
|
|
8783
8989
|
|
|
8990
|
+
/** Configuration for video-specific output formatting. This data type is not supported in Gemini API. */
|
|
8991
|
+
declare class VideoResponseFormat {
|
|
8992
|
+
/** The aspect ratio for the video output. */
|
|
8993
|
+
aspectRatio?: AspectRatio;
|
|
8994
|
+
/** Optional. Delivery mode for the generated content. */
|
|
8995
|
+
delivery?: Delivery;
|
|
8996
|
+
/** Optional. The duration for the video output. */
|
|
8997
|
+
duration?: string;
|
|
8998
|
+
/** Optional. The Google Cloud Storage URI to store the video output. Required for Vertex if delivery is URI. */
|
|
8999
|
+
gcsUri?: string;
|
|
9000
|
+
}
|
|
9001
|
+
|
|
8784
9002
|
/** Voice activity signal. */
|
|
8785
9003
|
declare interface VoiceActivity {
|
|
8786
9004
|
/** The type of the voice activity signal. */
|
|
@@ -8820,6 +9038,13 @@ declare interface VoiceConfig {
|
|
|
8820
9038
|
prebuiltVoiceConfig?: PrebuiltVoiceConfig;
|
|
8821
9039
|
}
|
|
8822
9040
|
|
|
9041
|
+
/** The signature of the voice consent check. */
|
|
9042
|
+
declare interface VoiceConsentSignature {
|
|
9043
|
+
/** The signature string.
|
|
9044
|
+
*/
|
|
9045
|
+
signature?: string;
|
|
9046
|
+
}
|
|
9047
|
+
|
|
8823
9048
|
/** Configuration for webhook notifications.
|
|
8824
9049
|
|
|
8825
9050
|
Used to configure webhook endpoints that will receive notifications
|