@google/genai 2.6.0 → 2.8.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/web/web.d.ts CHANGED
@@ -875,6 +875,32 @@ export declare interface AutomaticFunctionCallingConfig {
875
875
  ignoreCallHistory?: boolean;
876
876
  }
877
877
 
878
+ /** Autorater config used for evaluation. */
879
+ export declare interface AutoraterConfig {
880
+ /** Number of samples for each instance in the dataset.
881
+ If not specified, the default is 4. Minimum value is 1, maximum value
882
+ is 32. */
883
+ samplingCount?: number;
884
+ /** Optional. Default is true. Whether to flip the candidate and baseline
885
+ responses. This is only applicable to the pairwise metric. If enabled, also
886
+ provide PairwiseMetricSpec.candidate_response_field_name and
887
+ PairwiseMetricSpec.baseline_response_field_name. When rendering
888
+ PairwiseMetricSpec.metric_prompt_template, the candidate and baseline
889
+ fields will be flipped for half of the samples to reduce bias. */
890
+ flipEnabled?: boolean;
891
+ /** The fully qualified name of the publisher model or tuned autorater
892
+ endpoint to use.
893
+
894
+ Publisher model format:
895
+ `projects/{project}/locations/{location}/publishers/{publisher}/models/{model}`
896
+
897
+ Tuned model endpoint format:
898
+ `projects/{project}/locations/{location}/endpoints/{endpoint}` */
899
+ autoraterModel?: string;
900
+ /** Configuration options for model generation and outputs. */
901
+ generationConfig?: GenerationConfig;
902
+ }
903
+
878
904
  /** Configures the avatar to be used in the session. */
879
905
  export declare interface AvatarConfig {
880
906
  /** Pre-built avatar id. */
@@ -2124,6 +2150,18 @@ export declare interface CompletionStats {
2124
2150
  successfulForecastPointCount?: string;
2125
2151
  }
2126
2152
 
2153
+ /** Composite reinforcement tuning reward config. */
2154
+ export declare interface CompositeReinforcementTuningRewardConfig {
2155
+ weightedRewardConfigs?: CompositeReinforcementTuningRewardConfigWeightedRewardConfig[];
2156
+ }
2157
+
2158
+ /** Composite reinforcement tuning reward config weighted reward config. */
2159
+ export declare interface CompositeReinforcementTuningRewardConfigWeightedRewardConfig {
2160
+ rewardConfig?: SingleReinforcementTuningRewardConfig;
2161
+ /** How much this single reward contributes to the total overall reward. */
2162
+ weight?: number;
2163
+ }
2164
+
2127
2165
  /** Tool to support computer use. */
2128
2166
  export declare interface ComputerUse {
2129
2167
  /** Required. The environment being operated. */
@@ -2672,7 +2710,7 @@ export declare interface CreateTuningJobConfig {
2672
2710
  be charged usage for any applicable operations.
2673
2711
  */
2674
2712
  abortSignal?: AbortSignal;
2675
- /** The method to use for tuning (SUPERVISED_FINE_TUNING or PREFERENCE_TUNING or DISTILLATION). If not set, the default method (SFT) will be used. */
2713
+ /** The method to use for tuning (SUPERVISED_FINE_TUNING or PREFERENCE_TUNING or DISTILLATION or REINFORCEMENT_TUNING). If not set, the default method (SFT) will be used. */
2676
2714
  method?: TuningMethod;
2677
2715
  /** Validation dataset for tuning. The dataset must be formatted as a JSONL file. */
2678
2716
  validationDataset?: TuningValidationDataset;
@@ -2712,6 +2750,22 @@ export declare interface CreateTuningJobConfig {
2712
2750
  outputUri?: string;
2713
2751
  /** The encryption spec of the tuning job. Customer-managed encryption key options for a TuningJob. If this is set, then all resources created by the TuningJob will be encrypted with provided encryption key. */
2714
2752
  encryptionSpec?: EncryptionSpec;
2753
+ /** Reward function configuration for reinforcement tuning. Reinforcement tuning only. */
2754
+ rewardConfig?: SingleReinforcementTuningRewardConfig;
2755
+ /** Composite reward function configuration for reinforcement tuning. Reinforcement tuning only. */
2756
+ compositeRewardConfig?: CompositeReinforcementTuningRewardConfig;
2757
+ /** Number of different responses to generate per prompt during tuning. Reinforcement tuning only. */
2758
+ samplesPerPrompt?: number;
2759
+ /** How often at steps to evaluate the tuning job during training. Reinforcement tuning only. */
2760
+ evaluateInterval?: number;
2761
+ /** How often at steps to save checkpoints during training. Reinforcement tuning only. */
2762
+ checkpointInterval?: number;
2763
+ /** The maximum number of tokens to generate per prompt. Reinforcement tuning only. */
2764
+ maxOutputTokens?: number;
2765
+ /** Indicates the maximum thinking depth. Use with earlier models shall result in error. Reinforcement tuning only. */
2766
+ thinkingLevel?: ReinforcementTuningThinkingLevel;
2767
+ /** Cloud Storage path to file containing validation dataset for tuning. The dataset must be formatted as a JSONL file. If no validation dataset is provided, by default the API splits 25% of the training dataset or 50 examples, whichever is larger, as the validation dataset. Reinforcement tuning only. */
2768
+ validationDatasetUri?: string;
2715
2769
  }
2716
2770
 
2717
2771
  /** Fine-tuning job creation parameters - optional fields. */
@@ -2840,6 +2894,10 @@ declare interface DeepResearchAgentConfig {
2840
2894
  * will then proceed only if the user confirms the plan in the next turn.
2841
2895
  */
2842
2896
  collaborative_planning?: boolean;
2897
+ /**
2898
+ * Enables bigquery tool for the Deep Research agent.
2899
+ */
2900
+ enable_bigquery_tool?: boolean;
2843
2901
  /**
2844
2902
  * Whether to include thought summaries in the response.
2845
2903
  */
@@ -3119,7 +3177,7 @@ declare interface DocumentContent {
3119
3177
  /**
3120
3178
  * The mime type of the document.
3121
3179
  */
3122
- mime_type?: 'application/pdf';
3180
+ mime_type?: 'application/pdf' | 'text/csv';
3123
3181
  /**
3124
3182
  * The URI of the document.
3125
3183
  */
@@ -3621,6 +3679,10 @@ declare interface ErrorEvent_2 {
3621
3679
  * The event_id token to be used to resume the interaction stream, from this event.
3622
3680
  */
3623
3681
  event_id?: string;
3682
+ /**
3683
+ * Optional metadata accompanying ANY streamed event.
3684
+ */
3685
+ metadata?: ErrorEvent_2.Metadata;
3624
3686
  }
3625
3687
 
3626
3688
  declare namespace ErrorEvent_2 {
@@ -3637,6 +3699,15 @@ declare namespace ErrorEvent_2 {
3637
3699
  */
3638
3700
  message?: string;
3639
3701
  }
3702
+ /**
3703
+ * Optional metadata accompanying ANY streamed event.
3704
+ */
3705
+ interface Metadata {
3706
+ /**
3707
+ * Statistics on the interaction request's token usage.
3708
+ */
3709
+ usage?: InteractionsAPI.Usage;
3710
+ }
3640
3711
  }
3641
3712
 
3642
3713
  declare namespace Errors {
@@ -4293,10 +4364,9 @@ declare interface Function_2 {
4293
4364
  parameters?: unknown;
4294
4365
  }
4295
4366
 
4296
- /** A function call. */
4367
+ /** A predicted FunctionCall returned from the model that contains a string representing the FunctionDeclaration.name and a structured JSON object containing the parameters and their values. */
4297
4368
  export declare interface FunctionCall {
4298
- /** The unique id of the function call. If populated, the client to execute the
4299
- `function_call` and return the response with the matching `id`. */
4369
+ /** Optional. The unique id of the function call. If populated, the client to execute the `function_call` and return the response with the matching `id`. */
4300
4370
  id?: string;
4301
4371
  /** Optional. The function parameters and values in JSON object format. See FunctionDeclaration.parameters for parameter details. */
4302
4372
  args?: Record<string, unknown>;
@@ -4385,14 +4455,13 @@ export declare interface FunctionDeclaration {
4385
4455
  behavior?: Behavior;
4386
4456
  }
4387
4457
 
4388
- /** A function response. */
4458
+ /** The result output from a FunctionCall that contains a string representing the FunctionDeclaration.name and a structured JSON object containing any output from the function is used as context to the model. This should contain the result of a `FunctionCall` made based on model prediction. */
4389
4459
  export declare class FunctionResponse {
4390
- /** Signals that function call continues, and more responses will be returned, turning the function call into a generator. Is only applicable to NON_BLOCKING function calls (see FunctionDeclaration.behavior for details), ignored otherwise. If false, the default, future responses will not be considered. Is only applicable to NON_BLOCKING function calls, is ignored otherwise. If set to false, future responses will not be considered. It is allowed to return empty `response` with `will_continue=False` to signal that the function call is finished. */
4460
+ /** Optional. Signals that function call continues, and more responses will be returned, turning the function call into a generator. Is only applicable to NON_BLOCKING function calls, is ignored otherwise. If set to false, future responses will not be considered. It is allowed to return empty `response` with `will_continue=False` to signal that the function call is finished. This may still trigger the model generation. To avoid triggering the generation and finish the function call, additionally set `scheduling` to `SILENT`. This field is not supported in Vertex AI. */
4391
4461
  willContinue?: boolean;
4392
- /** Specifies how the response should be scheduled in the conversation. Only applicable to NON_BLOCKING function calls, is ignored otherwise. Defaults to WHEN_IDLE. */
4462
+ /** Optional. Specifies how the response should be scheduled in the conversation. Only applicable to NON_BLOCKING function calls, is ignored otherwise. Defaults to WHEN_IDLE. */
4393
4463
  scheduling?: FunctionResponseScheduling;
4394
- /** List of parts that constitute a function response. Each part may
4395
- have a different IANA MIME type. */
4464
+ /** Optional. Ordered `Parts` that constitute a function response. Parts may have different IANA MIME types. */
4396
4465
  parts?: FunctionResponsePart[];
4397
4466
  /** Optional. The id of the function call this response is for. Populated by the client to match the corresponding function call `id`. */
4398
4467
  id?: string;
@@ -4402,49 +4471,36 @@ export declare class FunctionResponse {
4402
4471
  response?: Record<string, unknown>;
4403
4472
  }
4404
4473
 
4405
- /** Raw media bytes for function response.
4406
-
4407
- Text should not be sent as raw bytes, use the FunctionResponse.response
4408
- field. */
4474
+ /** Raw media bytes for function response. Text should not be sent as raw bytes, use the 'text' field. */
4409
4475
  export declare class FunctionResponseBlob {
4410
4476
  /** Required. The IANA standard MIME type of the source data. */
4411
4477
  mimeType?: string;
4412
- /** Required. Inline media bytes.
4478
+ /** Required. Raw bytes.
4413
4479
  * @remarks Encoded as base64 string. */
4414
4480
  data?: string;
4415
- /** Optional. Display name of the blob.
4416
- Used to provide a label or filename to distinguish blobs. */
4481
+ /** Optional. Display name of the blob. Used to provide a label or filename to distinguish blobs. This field is only returned in PromptMessage for prompt management. It is currently used in the Gemini GenerateContent calls only when server side tools (code_execution, google_search, and url_context) are enabled. This field is not supported in Gemini API. */
4417
4482
  displayName?: string;
4418
4483
  }
4419
4484
 
4420
- /** URI based data for function response. */
4485
+ /** URI based data for function response. This data type is not supported in Gemini API. */
4421
4486
  export declare class FunctionResponseFileData {
4422
4487
  /** Required. URI. */
4423
4488
  fileUri?: string;
4424
4489
  /** Required. The IANA standard MIME type of the source data. */
4425
4490
  mimeType?: string;
4426
- /** Optional. Display name of the file.
4427
- Used to provide a label or filename to distinguish files. */
4491
+ /** Optional. Display name of the file data. Used to provide a label or filename to distinguish file datas. This field is only returned in PromptMessage for prompt management. It is currently used in the Gemini GenerateContent calls only when server side tools (code_execution, google_search, and url_context) are enabled. */
4428
4492
  displayName?: string;
4429
4493
  }
4430
4494
 
4431
- /** A datatype containing media that is part of a `FunctionResponse` message.
4432
-
4433
- A `FunctionResponsePart` consists of data which has an associated datatype. A
4434
- `FunctionResponsePart` can only contain one of the accepted types in
4435
- `FunctionResponsePart.data`.
4436
-
4437
- A `FunctionResponsePart` must have a fixed IANA MIME type identifying the
4438
- type and subtype of the media if the `inline_data` field is filled with raw
4439
- bytes. */
4495
+ /** A datatype containing media that is part of a `FunctionResponse` message. A `FunctionResponsePart` consists of data which has an associated datatype. A `FunctionResponsePart` can only contain one of the accepted types in `FunctionResponsePart.data`. A `FunctionResponsePart` must have a fixed IANA MIME type identifying the type and subtype of the media if the `inline_data` field is filled with raw bytes. */
4440
4496
  export declare class FunctionResponsePart {
4441
- /** Optional. Inline media bytes. */
4497
+ /** Inline media bytes. */
4442
4498
  inlineData?: FunctionResponseBlob;
4443
- /** Optional. URI based data. */
4499
+ /** URI based data. This field is not supported in Gemini API. */
4444
4500
  fileData?: FunctionResponseFileData;
4445
4501
  }
4446
4502
 
4447
- /** Specifies how the response should be scheduled in the conversation. */
4503
+ /** Specifies how the response should be scheduled in the conversation. Only applicable to NON_BLOCKING function calls, is ignored otherwise. Defaults to WHEN_IDLE. */
4448
4504
  export declare enum FunctionResponseScheduling {
4449
4505
  /**
4450
4506
  * This value is unused.
@@ -5574,7 +5630,7 @@ export declare interface GoogleGenAIOptions {
5574
5630
  export declare interface GoogleMaps {
5575
5631
  /** The authentication config to access the API. Only API key is supported. This field is not supported in Gemini API. */
5576
5632
  authConfig?: AuthConfig;
5577
- /** Optional. Whether to return a widget context token in the GroundingMetadata of the response. Developers can use the widget context token to render a Google Maps widget with geospatial context related to the places that the model references in the response. */
5633
+ /** Deprecated. The Google Maps contextual widget behavior in Grounding with Google Maps is being deprecated; this field is planned for removal and no longer has any effect once removed. Optional. Whether to return a widget context token in the GroundingMetadata of the response. */
5578
5634
  enableWidget?: boolean;
5579
5635
  }
5580
5636
 
@@ -6718,6 +6774,22 @@ declare interface InteractionCompletedEvent {
6718
6774
  * The event_id token to be used to resume the interaction stream, from this event.
6719
6775
  */
6720
6776
  event_id?: string;
6777
+ /**
6778
+ * Optional metadata accompanying ANY streamed event.
6779
+ */
6780
+ metadata?: InteractionCompletedEvent.Metadata;
6781
+ }
6782
+
6783
+ declare namespace InteractionCompletedEvent {
6784
+ /**
6785
+ * Optional metadata accompanying ANY streamed event.
6786
+ */
6787
+ interface Metadata {
6788
+ /**
6789
+ * Statistics on the interaction request's token usage.
6790
+ */
6791
+ usage?: InteractionsAPI.Usage;
6792
+ }
6721
6793
  }
6722
6794
 
6723
6795
  declare interface InteractionCreatedEvent {
@@ -6730,6 +6802,22 @@ declare interface InteractionCreatedEvent {
6730
6802
  * The event_id token to be used to resume the interaction stream, from this event.
6731
6803
  */
6732
6804
  event_id?: string;
6805
+ /**
6806
+ * Optional metadata accompanying ANY streamed event.
6807
+ */
6808
+ metadata?: InteractionCreatedEvent.Metadata;
6809
+ }
6810
+
6811
+ declare namespace InteractionCreatedEvent {
6812
+ /**
6813
+ * Optional metadata accompanying ANY streamed event.
6814
+ */
6815
+ interface Metadata {
6816
+ /**
6817
+ * Statistics on the interaction request's token usage.
6818
+ */
6819
+ usage?: InteractionsAPI.Usage;
6820
+ }
6733
6821
  }
6734
6822
 
6735
6823
  declare type InteractionCreateParams = CreateModelInteractionParamsNonStreaming | CreateModelInteractionParamsStreaming | CreateAgentInteractionParamsNonStreaming | CreateAgentInteractionParamsStreaming;
@@ -6888,6 +6976,22 @@ declare interface InteractionStatusUpdate {
6888
6976
  * The event_id token to be used to resume the interaction stream, from this event.
6889
6977
  */
6890
6978
  event_id?: string;
6979
+ /**
6980
+ * Optional metadata accompanying ANY streamed event.
6981
+ */
6982
+ metadata?: InteractionStatusUpdate.Metadata;
6983
+ }
6984
+
6985
+ declare namespace InteractionStatusUpdate {
6986
+ /**
6987
+ * Optional metadata accompanying ANY streamed event.
6988
+ */
6989
+ interface Metadata {
6990
+ /**
6991
+ * Statistics on the interaction request's token usage.
6992
+ */
6993
+ usage?: InteractionsAPI.Usage;
6994
+ }
6891
6995
  }
6892
6996
 
6893
6997
  /** Parameters for the private _Register method. */
@@ -6983,16 +7087,11 @@ export declare enum Language {
6983
7087
  PYTHON = "PYTHON"
6984
7088
  }
6985
7089
 
6986
- /** An object that represents a latitude/longitude pair.
6987
-
6988
- This is expressed as a pair of doubles to represent degrees latitude and
6989
- degrees longitude. Unless specified otherwise, this object must conform to the
6990
- <a href="https://en.wikipedia.org/wiki/World_Geodetic_System#1984_version">
6991
- WGS84 standard</a>. Values must be within normalized ranges. */
7090
+ /** An object that represents a latitude/longitude pair. This is expressed as a pair of doubles to represent degrees latitude and degrees longitude. Unless specified otherwise, this object must conform to the WGS84 standard. Values must be within normalized ranges. */
6992
7091
  export declare interface LatLng {
6993
7092
  /** The latitude in degrees. It must be in the range [-90.0, +90.0]. */
6994
7093
  latitude?: number;
6995
- /** The longitude in degrees. It must be in the range [-180.0, +180.0] */
7094
+ /** The longitude in degrees. It must be in the range [-180.0, +180.0]. */
6996
7095
  longitude?: number;
6997
7096
  }
6998
7097
 
@@ -7520,8 +7619,8 @@ export declare interface LiveConnectConfig {
7520
7619
  response.
7521
7620
  */
7522
7621
  safetySettings?: SafetySetting[];
7523
- /** Config for stream translation. */
7524
- streamTranslationConfig?: StreamTranslationConfig;
7622
+ /** Config for translation. */
7623
+ translationConfig?: TranslationConfig;
7525
7624
  }
7526
7625
 
7527
7626
  /** Config for LiveConnectConstraints for Auth Token creation. */
@@ -8074,6 +8173,26 @@ export declare enum MaskReferenceMode {
8074
8173
  MASK_MODE_SEMANTIC = "MASK_MODE_SEMANTIC"
8075
8174
  }
8076
8175
 
8176
+ /** Match operation to use for evaluation. */
8177
+ export declare enum MatchOperation {
8178
+ /**
8179
+ * Default value. This value is unused.
8180
+ */
8181
+ MATCH_OPERATION_UNSPECIFIED = "MATCH_OPERATION_UNSPECIFIED",
8182
+ /**
8183
+ * Equivalent to GoogleSQL `REGEX_CONTAINS(target, expression)`.
8184
+ */
8185
+ REGEX_CONTAINS = "REGEX_CONTAINS",
8186
+ /**
8187
+ * `expression` is a substring of target.
8188
+ */
8189
+ PARTIAL_MATCH = "PARTIAL_MATCH",
8190
+ /**
8191
+ * `expression` is an exact match of target.
8192
+ */
8193
+ EXACT_MATCH = "EXACT_MATCH"
8194
+ }
8195
+
8077
8196
  /** A MCPServer is a server that can be called by the model to perform actions. It is a server that implements the MCP protocol. Next ID: 6. This data type is not supported in Vertex AI. */
8078
8197
  export declare interface McpServer {
8079
8198
  /** The name of the MCPServer. */
@@ -8919,7 +9038,8 @@ export declare enum PagedItem {
8919
9038
  PAGED_ITEM_FILES = "files",
8920
9039
  PAGED_ITEM_CACHED_CONTENTS = "cachedContents",
8921
9040
  PAGED_ITEM_FILE_SEARCH_STORES = "fileSearchStores",
8922
- PAGED_ITEM_DOCUMENTS = "documents"
9041
+ PAGED_ITEM_DOCUMENTS = "documents",
9042
+ PAGED_ITEM_SKILLS = "skills"
8923
9043
  }
8924
9044
 
8925
9045
  declare interface PagedItemConfig {
@@ -8940,6 +9060,7 @@ declare interface PagedItemResponse<T> {
8940
9060
  cachedContents?: T[];
8941
9061
  fileSearchStores?: T[];
8942
9062
  documents?: T[];
9063
+ skills?: T[];
8943
9064
  }
8944
9065
 
8945
9066
  /**
@@ -9621,6 +9742,151 @@ export declare class RegisterFilesResponse {
9621
9742
  files?: File_2[];
9622
9743
  }
9623
9744
 
9745
+ /** Reinforcement tuning autorater scorer. */
9746
+ export declare interface ReinforcementTuningAutoraterScorer {
9747
+ /** Autorater config for evaluation. */
9748
+ autoraterConfig?: AutoraterConfig;
9749
+ /** Allows substituting `prompt`, `response`, `system_instruction` and `references.reference` (each wrapped in double curly braces) into the autorater prompt. */
9750
+ autoraterPrompt?: string;
9751
+ /** Parses autorater returned response. */
9752
+ autoraterResponseParseConfig?: ReinforcementTuningParseResponseConfig;
9753
+ /** Scores autorater responses by directly converting parsed autorater response to float reward. */
9754
+ parsedResponseConversionScorer?: ReinforcementTuningAutoraterScorerParsedResponseConversionScorer;
9755
+ /** Scores autorater responses by using exact string match reward scorer. */
9756
+ exactMatchScorer?: ReinforcementTuningAutoraterScorerExactMatchScorer;
9757
+ }
9758
+
9759
+ /** Scores autorater responses by using exact string match reward scorer. */
9760
+ export declare interface ReinforcementTuningAutoraterScorerExactMatchScorer {
9761
+ /** Assigns this reward score if parsed response string equals the expression. */
9762
+ correctAnswerReward?: number;
9763
+ /** Assigns this reward score if parsed reward value does not equal the expression. */
9764
+ wrongAnswerReward?: number;
9765
+ /** The string expression to match against. Supports substitution in the format of `references.reference` (wrapped in double curly braces) before matching. No regex support. */
9766
+ expression?: string;
9767
+ }
9768
+
9769
+ /** Scores responses by directly converting parsed autorater response to float reward (reward is clipped to be within [-1, 1]). */
9770
+ export declare class ReinforcementTuningAutoraterScorerParsedResponseConversionScorer {
9771
+ }
9772
+
9773
+ /** Scores parsed responses by calling a Cloud Run service. */
9774
+ export declare interface ReinforcementTuningCloudRunRewardScorer {
9775
+ /** URI of the Cloud Run service that will be used to compute the reward. The Vertex AI Secure Fine Tuning Service Agent (`service-PROJECT_NUMBER@gcp-sa-vertex-tune.iam.gserviceaccount.com`, where `PROJECT_NUMBER` is the numeric project number) must be granted the permission (e.g. by granting `roles/run.invoker` in IAM) to invoke the Cloud Run service. */
9776
+ cloudRunUri?: string;
9777
+ }
9778
+
9779
+ /** Scores parsed responses for code execution use cases. */
9780
+ export declare interface ReinforcementTuningCodeExecutionRewardScorer {
9781
+ /** Example python code snippet which assigns reward of 1 to answer matching user provided reference answer in per prompt references map. */
9782
+ pythonCodeSnippet?: string;
9783
+ }
9784
+
9785
+ /** User-facing format for Gemini Reinforcement Tuning examples on Vertex. */
9786
+ export declare interface ReinforcementTuningExample {
9787
+ /** Multi-turn contents that represents the Prompt. */
9788
+ contents?: Content[];
9789
+ /** References for the given prompt. The key is the name of the reference, and the value is the reference itself. */
9790
+ references?: Record<string, string>;
9791
+ /** Corresponds to `system_instruction` in user-facing GenerateContentRequest. */
9792
+ systemInstruction?: Content;
9793
+ }
9794
+
9795
+ /** Hyperparameters for Reinforcement Tuning. */
9796
+ export declare interface ReinforcementTuningHyperParameters {
9797
+ /** Number of training epochs for the tuning job. */
9798
+ epochCount?: string;
9799
+ /** Learning rate multiplier for Reinforcement Learning. */
9800
+ learningRateMultiplier?: number;
9801
+ /** Adapter size for Reinforcement Tuning. */
9802
+ adapterSize?: AdapterSize;
9803
+ /** Number of different responses to generate per prompt during tuning. */
9804
+ samplesPerPrompt?: number;
9805
+ /** 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. */
9806
+ batchSize?: number;
9807
+ /** How often (in steps) to evaluate the tuning job during training. If not set, evaluation will run per epoch. */
9808
+ evaluateInterval?: number;
9809
+ /** How often (in steps) to save checkpoints during training. If not set, one checkpoint per epoch will be saved. */
9810
+ checkpointInterval?: number;
9811
+ /** The maximum number of tokens to generate per prompt. If not set, defaults to 32768. */
9812
+ maxOutputTokens?: number;
9813
+ /** Indicates the maximum thinking depth. Use with earlier models shall result in error. */
9814
+ thinkingLevel?: ReinforcementTuningThinkingLevel;
9815
+ }
9816
+
9817
+ /** Defines how to parse sample response for reinforcement tuning. */
9818
+ export declare class ReinforcementTuningParseResponseConfig {
9819
+ /** Defines how to parse sample response. */
9820
+ parseType?: ResponseParseType;
9821
+ /** Defines the regex to extract the important part of sample response. This field is only used when `parse_type` is `REGEX_EXTRACT`. */
9822
+ regexExtractExpression?: string;
9823
+ }
9824
+
9825
+ /** The reward info for a reward function. */
9826
+ export declare interface ReinforcementTuningRewardInfo {
9827
+ /** Output only. The calculated reward for the reward function. */
9828
+ reward?: number;
9829
+ /** Output only. The user-requested auxiliary info for the reward function. */
9830
+ userRequestedAuxInfo?: string;
9831
+ }
9832
+
9833
+ /** Reinforcement tuning spec for tuning. */
9834
+ export declare interface ReinforcementTuningSpec {
9835
+ compositeRewardConfig?: CompositeReinforcementTuningRewardConfig;
9836
+ /** Cloud Storage path to file containing training dataset for tuning. The dataset must be formatted as a JSONL file. */
9837
+ trainingDatasetUri?: string;
9838
+ /** Cloud Storage path to file containing validation dataset for tuning. The dataset must be formatted as a JSONL file. If no validation dataset is provided, by default the API splits 25% of the training dataset or 50 examples, whichever is larger, as the validation dataset. */
9839
+ validationDatasetUri?: string;
9840
+ /** Additional hyper-parameters to use during tuning. */
9841
+ hyperParameters?: ReinforcementTuningHyperParameters;
9842
+ /** Single reward function configuration for reinforcement tuning. */
9843
+ singleRewardConfig?: SingleReinforcementTuningRewardConfig;
9844
+ }
9845
+
9846
+ /** Scores parsed responses for string matching use cases. */
9847
+ export declare interface ReinforcementTuningStringMatchRewardScorer {
9848
+ /** Wrong answer reward is returned if evaluator evaluates to `false`. All wrong answers get the same reward. */
9849
+ wrongAnswerReward?: number;
9850
+ /** Correct answer reward is returned if evaluator evaluates to `true`. All correct answers get the same reward. */
9851
+ correctAnswerReward?: number;
9852
+ /** Uses string match expression to evaluate parsed response. */
9853
+ stringMatchExpression?: ReinforcementTuningStringMatchRewardScorerStringMatchExpression;
9854
+ /** Uses json match expression to evaluate parsed response. */
9855
+ jsonMatchExpression?: ReinforcementTuningStringMatchRewardScorerJsonMatchExpression;
9856
+ }
9857
+
9858
+ /** Converts parsed responses to JSON format, finds the first-level matching key, then performs StringMatchExpression on the value. */
9859
+ export declare interface ReinforcementTuningStringMatchRewardScorerJsonMatchExpression {
9860
+ /** Json key name to find the value to match against. */
9861
+ keyName?: string;
9862
+ /** String match expression to match against the value of json key. */
9863
+ valueStringMatchExpression?: ReinforcementTuningStringMatchRewardScorerStringMatchExpression;
9864
+ }
9865
+
9866
+ /** Evaluates parsed response using match type against expression. */
9867
+ export declare interface ReinforcementTuningStringMatchRewardScorerStringMatchExpression {
9868
+ /** Match operation to use for evaluation. */
9869
+ matchOperation?: MatchOperation;
9870
+ /** String or regular expression to match against. Customer can also provide a references map (key/value pairs) whose value will be substituted into the expression by referencing `references.key_name` (wrapped in double curly braces). */
9871
+ expression?: string;
9872
+ }
9873
+
9874
+ /** Represents how much to think for the tuning job. */
9875
+ export declare enum ReinforcementTuningThinkingLevel {
9876
+ /**
9877
+ * Unspecified thinking level.
9878
+ */
9879
+ REINFORCEMENT_TUNING_THINKING_LEVEL_UNSPECIFIED = "REINFORCEMENT_TUNING_THINKING_LEVEL_UNSPECIFIED",
9880
+ /**
9881
+ * Little to no thinking.
9882
+ */
9883
+ MINIMAL = "MINIMAL",
9884
+ /**
9885
+ * High thinking level.
9886
+ */
9887
+ HIGH = "HIGH"
9888
+ }
9889
+
9624
9890
  /** Represents a recorded session. */
9625
9891
  export declare interface ReplayFile {
9626
9892
  replayId?: string;
@@ -9750,6 +10016,22 @@ export declare enum ResourceScope {
9750
10016
  COLLECTION = "COLLECTION"
9751
10017
  }
9752
10018
 
10019
+ /** Defines how to parse sample response. */
10020
+ export declare enum ResponseParseType {
10021
+ /**
10022
+ * Default value. This value is unused.
10023
+ */
10024
+ RESPONSE_PARSE_TYPE_UNSPECIFIED = "RESPONSE_PARSE_TYPE_UNSPECIFIED",
10025
+ /**
10026
+ * Use the sample response as is.
10027
+ */
10028
+ IDENTITY = "IDENTITY",
10029
+ /**
10030
+ * Use regex to extract the important part of sample response.
10031
+ */
10032
+ REGEX_EXTRACT = "REGEX_EXTRACT"
10033
+ }
10034
+
9753
10035
  /** Defines a retrieval tool that model can call to access external knowledge. This data type is not supported in Gemini API. */
9754
10036
  export declare interface Retrieval {
9755
10037
  /** Optional. Deprecated. This option is no longer supported. */
@@ -9762,10 +10044,9 @@ export declare interface Retrieval {
9762
10044
  vertexRagStore?: VertexRagStore;
9763
10045
  }
9764
10046
 
9765
- /** Retrieval config.
9766
- */
10047
+ /** Retrieval config. */
9767
10048
  export declare interface RetrievalConfig {
9768
- /** Optional. The location of the user. */
10049
+ /** The location of the user. */
9769
10050
  latLng?: LatLng;
9770
10051
  /** The language code of the user. */
9771
10052
  languageCode?: string;
@@ -10281,6 +10562,22 @@ export declare class SingleEmbedContentResponse {
10281
10562
  tokenCount?: string;
10282
10563
  }
10283
10564
 
10565
+ /** Single reinforcement tuning reward config. */
10566
+ export declare interface SingleReinforcementTuningRewardConfig {
10567
+ /** Scores parsed responses for autorater use cases by using a model to compute the reward. */
10568
+ autoraterScorer?: ReinforcementTuningAutoraterScorer;
10569
+ /** A unique reward name used to identify each single reinforcement tuning reward. */
10570
+ rewardName?: string;
10571
+ /** Defines how to parse sample response. */
10572
+ parseResponseConfig?: ReinforcementTuningParseResponseConfig;
10573
+ /** Scores parsed responses for code execution use cases. */
10574
+ codeExecutionRewardScorer?: ReinforcementTuningCodeExecutionRewardScorer;
10575
+ /** Scores parsed responses for simple string matching use cases against reference answer without writing python code. */
10576
+ stringMatchRewardScorer?: ReinforcementTuningStringMatchRewardScorer;
10577
+ /** Scores parsed responses by calling a Cloud Run service. */
10578
+ cloudRunRewardScorer?: ReinforcementTuningCloudRunRewardScorer;
10579
+ }
10580
+
10284
10581
  /** Context window will be truncated by keeping only suffix of it.
10285
10582
 
10286
10583
  Context window will always be cut at start of USER role turn. System
@@ -10359,6 +10656,10 @@ declare interface StepDelta {
10359
10656
  * The event_id token to be used to resume the interaction stream, from this event.
10360
10657
  */
10361
10658
  event_id?: string;
10659
+ /**
10660
+ * Optional metadata accompanying ANY streamed event.
10661
+ */
10662
+ metadata?: StepDelta.Metadata;
10362
10663
  }
10363
10664
 
10364
10665
  declare namespace StepDelta {
@@ -10397,7 +10698,7 @@ declare namespace StepDelta {
10397
10698
  interface Document {
10398
10699
  type: 'document';
10399
10700
  data?: string;
10400
- mime_type?: 'application/pdf';
10701
+ mime_type?: 'application/pdf' | 'text/csv';
10401
10702
  uri?: string;
10402
10703
  }
10403
10704
  interface Video {
@@ -10564,6 +10865,15 @@ declare namespace StepDelta {
10564
10865
  is_error?: boolean;
10565
10866
  name?: string;
10566
10867
  }
10868
+ /**
10869
+ * Optional metadata accompanying ANY streamed event.
10870
+ */
10871
+ interface Metadata {
10872
+ /**
10873
+ * Statistics on the interaction request's token usage.
10874
+ */
10875
+ usage?: InteractionsAPI.Usage;
10876
+ }
10567
10877
  }
10568
10878
 
10569
10879
  declare interface StepStart {
@@ -10577,6 +10887,22 @@ declare interface StepStart {
10577
10887
  * The event_id token to be used to resume the interaction stream, from this event.
10578
10888
  */
10579
10889
  event_id?: string;
10890
+ /**
10891
+ * Optional metadata accompanying ANY streamed event.
10892
+ */
10893
+ metadata?: StepStart.Metadata;
10894
+ }
10895
+
10896
+ declare namespace StepStart {
10897
+ /**
10898
+ * Optional metadata accompanying ANY streamed event.
10899
+ */
10900
+ interface Metadata {
10901
+ /**
10902
+ * Statistics on the interaction request's token usage.
10903
+ */
10904
+ usage?: InteractionsAPI.Usage;
10905
+ }
10580
10906
  }
10581
10907
 
10582
10908
  declare interface StepStop {
@@ -10586,6 +10912,22 @@ declare interface StepStop {
10586
10912
  * The event_id token to be used to resume the interaction stream, from this event.
10587
10913
  */
10588
10914
  event_id?: string;
10915
+ /**
10916
+ * Optional metadata accompanying ANY streamed event.
10917
+ */
10918
+ metadata?: StepStop.Metadata;
10919
+ }
10920
+
10921
+ declare namespace StepStop {
10922
+ /**
10923
+ * Optional metadata accompanying ANY streamed event.
10924
+ */
10925
+ interface Metadata {
10926
+ /**
10927
+ * Statistics on the interaction request's token usage.
10928
+ */
10929
+ usage?: InteractionsAPI.Usage;
10930
+ }
10589
10931
  }
10590
10932
 
10591
10933
  declare class Stream<Item> implements AsyncIterable<Item> {
@@ -10627,17 +10969,6 @@ export declare interface StreamableHttpTransport {
10627
10969
  url?: string;
10628
10970
  }
10629
10971
 
10630
- /** Config for stream translation. */
10631
- export declare interface StreamTranslationConfig {
10632
- /** If true, the model will generate audio when the target language is
10633
- spoken, essentially it will parrot the input. If false, we will not produce
10634
- audio for the target language. */
10635
- echoTargetLanguage?: boolean;
10636
- /** The target language for translation. Supported values are BCP-47
10637
- language codes (e.g. "en", "es", "fr"). */
10638
- targetLanguageCode?: string;
10639
- }
10640
-
10641
10972
  /** User provided string values assigned to a single metadata key. This data type is not supported in Vertex AI. */
10642
10973
  export declare interface StringList {
10643
10974
  /** The string values of the metadata to store. */
@@ -11201,15 +11532,13 @@ declare type ToolChoiceType = 'auto' | 'any' | 'none' | 'validated';
11201
11532
  export declare interface ToolCodeExecution {
11202
11533
  }
11203
11534
 
11204
- /** Tool config.
11205
-
11206
- This config is shared for all tools provided in the request. */
11535
+ /** Tool config. This config is shared for all tools provided in the request. */
11207
11536
  export declare interface ToolConfig {
11208
11537
  /** Optional. Retrieval config. */
11209
11538
  retrievalConfig?: RetrievalConfig;
11210
11539
  /** Optional. Function calling config. */
11211
11540
  functionCallingConfig?: FunctionCallingConfig;
11212
- /** If true, the API response will include the server-side tool calls and responses within the `Content` message. This allows clients to observe the server's tool invocations. */
11541
+ /** Optional. If true, the API response will include the server-side tool calls and responses within the `Content` message. This allows clients to observe the server's tool interactions. This field is not supported in Vertex AI. */
11213
11542
  includeServerSideToolInvocations?: boolean;
11214
11543
  }
11215
11544
 
@@ -11298,6 +11627,19 @@ export declare interface Transcription {
11298
11627
  text?: string;
11299
11628
  /** Optional. The bool indicates the end of the transcription. */
11300
11629
  finished?: boolean;
11630
+ /** The BCP-47 language code of the transcription. */
11631
+ languageCode?: string;
11632
+ }
11633
+
11634
+ /** Config for stream translation. */
11635
+ export declare interface TranslationConfig {
11636
+ /** If true, the model will generate audio when the target language is
11637
+ spoken, essentially it will parrot the input. If false, we will not produce
11638
+ audio for the target language. */
11639
+ echoTargetLanguage?: boolean;
11640
+ /** The target language for translation. Supported values are BCP-47
11641
+ language codes (e.g. "en", "es", "fr"). */
11642
+ targetLanguageCode?: string;
11301
11643
  }
11302
11644
 
11303
11645
  /** TunedModel for the Tuned Model of a Tuning Job. */
@@ -11406,6 +11748,7 @@ export declare interface TuningJob {
11406
11748
  preferenceOptimizationSpec?: PreferenceOptimizationSpec;
11407
11749
  /** Tuning Spec for Distillation. */
11408
11750
  distillationSpec?: DistillationSpec;
11751
+ reinforcementTuningSpec?: ReinforcementTuningSpec;
11409
11752
  /** Output only. The tuning data statistics associated with this TuningJob. */
11410
11753
  tuningDataStats?: TuningDataStats;
11411
11754
  /** Customer-managed encryption key options for a TuningJob. If this is set, then all resources created by the TuningJob will be encrypted with the provided encryption key. */
@@ -11490,7 +11833,11 @@ export declare enum TuningMethod {
11490
11833
  /**
11491
11834
  * Distillation tuning.
11492
11835
  */
11493
- DISTILLATION = "DISTILLATION"
11836
+ DISTILLATION = "DISTILLATION",
11837
+ /**
11838
+ * Reinforcement tuning.
11839
+ */
11840
+ REINFORCEMENT_TUNING = "REINFORCEMENT_TUNING"
11494
11841
  }
11495
11842
 
11496
11843
  /** Tuning mode. This enum is not supported in Gemini API. */
@@ -11577,6 +11924,7 @@ declare class Tunings extends BaseModule {
11577
11924
  cancel(params: types.CancelTuningJobParameters): Promise<types.CancelTuningJobResponse>;
11578
11925
  private tuneInternal;
11579
11926
  private tuneMldevInternal;
11927
+ validateReward(params: types.ValidateRewardParameters): Promise<types.ValidateRewardResponse>;
11580
11928
  }
11581
11929
 
11582
11930
  /** The speed of the tuning job. Only supported for Veo 3.0 models. This enum is not supported in Gemini API. */
@@ -11818,13 +12166,13 @@ declare namespace types {
11818
12166
  PhishBlockThreshold,
11819
12167
  Behavior,
11820
12168
  DynamicRetrievalConfigMode,
11821
- FunctionCallingConfigMode,
11822
12169
  ThinkingLevel,
11823
12170
  PersonGeneration,
11824
12171
  ProminentPeople,
11825
12172
  HarmCategory,
11826
12173
  HarmBlockMethod,
11827
12174
  HarmBlockThreshold,
12175
+ FunctionCallingConfigMode,
11828
12176
  FinishReason,
11829
12177
  HarmProbability,
11830
12178
  HarmSeverity,
@@ -11861,6 +12209,9 @@ declare namespace types {
11861
12209
  VideoGenerationMaskMode,
11862
12210
  VideoCompressionQuality,
11863
12211
  ImageResizeMode,
12212
+ ResponseParseType,
12213
+ MatchOperation,
12214
+ ReinforcementTuningThinkingLevel,
11864
12215
  TuningMethod,
11865
12216
  FileState,
11866
12217
  FileSource,
@@ -11935,10 +12286,6 @@ declare namespace types {
11935
12286
  StreamableHttpTransport,
11936
12287
  McpServer,
11937
12288
  Tool,
11938
- LatLng,
11939
- RetrievalConfig,
11940
- FunctionCallingConfig,
11941
- ToolConfig,
11942
12289
  ReplicatedVoiceConfig,
11943
12290
  PrebuiltVoiceConfig,
11944
12291
  VoiceConfig,
@@ -11953,6 +12300,10 @@ declare namespace types {
11953
12300
  GenerationConfigRoutingConfigManualRoutingMode,
11954
12301
  GenerationConfigRoutingConfig,
11955
12302
  SafetySetting,
12303
+ LatLng,
12304
+ RetrievalConfig,
12305
+ FunctionCallingConfig,
12306
+ ToolConfig,
11956
12307
  ModelArmorConfig,
11957
12308
  GenerateContentConfig,
11958
12309
  GenerateContentParameters,
@@ -12069,6 +12420,21 @@ declare namespace types {
12069
12420
  DistillationHyperParameters,
12070
12421
  DistillationSamplingSpec,
12071
12422
  DistillationSpec,
12423
+ AutoraterConfig,
12424
+ ReinforcementTuningParseResponseConfig,
12425
+ ReinforcementTuningAutoraterScorerParsedResponseConversionScorer,
12426
+ ReinforcementTuningAutoraterScorerExactMatchScorer,
12427
+ ReinforcementTuningAutoraterScorer,
12428
+ ReinforcementTuningCodeExecutionRewardScorer,
12429
+ ReinforcementTuningStringMatchRewardScorerStringMatchExpression,
12430
+ ReinforcementTuningStringMatchRewardScorerJsonMatchExpression,
12431
+ ReinforcementTuningStringMatchRewardScorer,
12432
+ ReinforcementTuningCloudRunRewardScorer,
12433
+ SingleReinforcementTuningRewardConfig,
12434
+ CompositeReinforcementTuningRewardConfigWeightedRewardConfig,
12435
+ CompositeReinforcementTuningRewardConfig,
12436
+ ReinforcementTuningHyperParameters,
12437
+ ReinforcementTuningSpec,
12072
12438
  GoogleRpcStatus,
12073
12439
  PreTunedModel,
12074
12440
  DatasetDistributionDistributionBucket,
@@ -12118,6 +12484,11 @@ declare namespace types {
12118
12484
  CreateTuningJobConfig,
12119
12485
  CreateTuningJobParametersPrivate,
12120
12486
  TuningOperation,
12487
+ ReinforcementTuningExample,
12488
+ ValidateRewardConfig,
12489
+ ValidateRewardParameters,
12490
+ ReinforcementTuningRewardInfo,
12491
+ ValidateRewardResponse,
12121
12492
  CreateCachedContentConfig,
12122
12493
  CreateCachedContentParameters,
12123
12494
  CachedContentUsageMetadata,
@@ -12255,7 +12626,7 @@ declare namespace types {
12255
12626
  LiveClientRealtimeInput,
12256
12627
  LiveClientToolResponse,
12257
12628
  LiveClientMessage,
12258
- StreamTranslationConfig,
12629
+ TranslationConfig,
12259
12630
  LiveConnectConfig,
12260
12631
  LiveConnectParameters,
12261
12632
  CreateChatParameters,
@@ -12916,6 +13287,53 @@ export declare enum VadSignalType {
12916
13287
  VAD_SIGNAL_TYPE_EOS = "VAD_SIGNAL_TYPE_EOS"
12917
13288
  }
12918
13289
 
13290
+ /** Optional parameters for tunings.validate_reward. */
13291
+ export declare interface ValidateRewardConfig {
13292
+ /** Used to override HTTP request options. */
13293
+ httpOptions?: HttpOptions;
13294
+ /** Abort signal which can be used to cancel the request.
13295
+
13296
+ NOTE: AbortSignal is a client-only operation. Using it to cancel an
13297
+ operation will not cancel the request in the service. You will still
13298
+ be charged usage for any applicable operations.
13299
+ */
13300
+ abortSignal?: AbortSignal;
13301
+ }
13302
+
13303
+ /** Parameters for the validate_reward method.
13304
+
13305
+ Validates a reinforcement tuning reward configuration against a sample
13306
+ response and example before creating a reinforcement tuning job. */
13307
+ export declare interface ValidateRewardParameters {
13308
+ /** Required. The resource name of the Location to validate the reward in, e.g. `projects/{project}/locations/{location}`. */
13309
+ parent: string;
13310
+ /** Required. The sample response for validating the reward configuration. */
13311
+ sampleResponse: Content;
13312
+ /** Required. The example to validate the reward configuration. */
13313
+ example: ReinforcementTuningExample;
13314
+ /** Single reward function configuration for reinforcement tuning. Mutually exclusive with composite_reward_config. */
13315
+ singleRewardConfig?: SingleReinforcementTuningRewardConfig;
13316
+ /** Composite reward function configuration for reinforcement tuning. Mutually exclusive with single_reward_config. */
13317
+ compositeRewardConfig?: CompositeReinforcementTuningRewardConfig;
13318
+ /** Optional parameters for the request. */
13319
+ config?: ValidateRewardConfig;
13320
+ }
13321
+
13322
+ /** Response for the validate_reward method.
13323
+
13324
+ Contains the computed reward for a reinforcement tuning reward
13325
+ configuration. */
13326
+ export declare class ValidateRewardResponse {
13327
+ /** Used to retain the full HTTP response. */
13328
+ sdkHttpResponse?: HttpResponse;
13329
+ /** Output only. The overall weighted reward. For a `CompositeReinforcementTuningRewardConfig`, this is the weighted average of all rewards. For a `SingleReinforcementTuningRewardConfig`, this will be the value of the single reward. */
13330
+ overallReward?: number;
13331
+ /** Output only. In case of an error, this field will be populated with a detailed error message to help with debugging. */
13332
+ error?: string;
13333
+ /** A map from reward name to reward info. */
13334
+ rewardInfoDetails?: Record<string, ReinforcementTuningRewardInfo>;
13335
+ }
13336
+
12919
13337
  /** Hyperparameters for Veo. This data type is not supported in Gemini API. */
12920
13338
  export declare interface VeoHyperParameters {
12921
13339
  /** Optional. Number of complete passes the model makes over the entire training dataset during training. */