@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.
@@ -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.
@@ -5581,7 +5637,7 @@ export declare interface GoogleGenAIOptions {
5581
5637
  export declare interface GoogleMaps {
5582
5638
  /** The authentication config to access the API. Only API key is supported. This field is not supported in Gemini API. */
5583
5639
  authConfig?: AuthConfig;
5584
- /** 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. */
5640
+ /** 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. */
5585
5641
  enableWidget?: boolean;
5586
5642
  }
5587
5643
 
@@ -6725,6 +6781,22 @@ declare interface InteractionCompletedEvent {
6725
6781
  * The event_id token to be used to resume the interaction stream, from this event.
6726
6782
  */
6727
6783
  event_id?: string;
6784
+ /**
6785
+ * Optional metadata accompanying ANY streamed event.
6786
+ */
6787
+ metadata?: InteractionCompletedEvent.Metadata;
6788
+ }
6789
+
6790
+ declare namespace InteractionCompletedEvent {
6791
+ /**
6792
+ * Optional metadata accompanying ANY streamed event.
6793
+ */
6794
+ interface Metadata {
6795
+ /**
6796
+ * Statistics on the interaction request's token usage.
6797
+ */
6798
+ usage?: InteractionsAPI.Usage;
6799
+ }
6728
6800
  }
6729
6801
 
6730
6802
  declare interface InteractionCreatedEvent {
@@ -6737,6 +6809,22 @@ declare interface InteractionCreatedEvent {
6737
6809
  * The event_id token to be used to resume the interaction stream, from this event.
6738
6810
  */
6739
6811
  event_id?: string;
6812
+ /**
6813
+ * Optional metadata accompanying ANY streamed event.
6814
+ */
6815
+ metadata?: InteractionCreatedEvent.Metadata;
6816
+ }
6817
+
6818
+ declare namespace InteractionCreatedEvent {
6819
+ /**
6820
+ * Optional metadata accompanying ANY streamed event.
6821
+ */
6822
+ interface Metadata {
6823
+ /**
6824
+ * Statistics on the interaction request's token usage.
6825
+ */
6826
+ usage?: InteractionsAPI.Usage;
6827
+ }
6740
6828
  }
6741
6829
 
6742
6830
  declare type InteractionCreateParams = CreateModelInteractionParamsNonStreaming | CreateModelInteractionParamsStreaming | CreateAgentInteractionParamsNonStreaming | CreateAgentInteractionParamsStreaming;
@@ -6895,6 +6983,22 @@ declare interface InteractionStatusUpdate {
6895
6983
  * The event_id token to be used to resume the interaction stream, from this event.
6896
6984
  */
6897
6985
  event_id?: string;
6986
+ /**
6987
+ * Optional metadata accompanying ANY streamed event.
6988
+ */
6989
+ metadata?: InteractionStatusUpdate.Metadata;
6990
+ }
6991
+
6992
+ declare namespace InteractionStatusUpdate {
6993
+ /**
6994
+ * Optional metadata accompanying ANY streamed event.
6995
+ */
6996
+ interface Metadata {
6997
+ /**
6998
+ * Statistics on the interaction request's token usage.
6999
+ */
7000
+ usage?: InteractionsAPI.Usage;
7001
+ }
6898
7002
  }
6899
7003
 
6900
7004
  /** Parameters for the private _Register method. */
@@ -6990,16 +7094,11 @@ export declare enum Language {
6990
7094
  PYTHON = "PYTHON"
6991
7095
  }
6992
7096
 
6993
- /** An object that represents a latitude/longitude pair.
6994
-
6995
- This is expressed as a pair of doubles to represent degrees latitude and
6996
- degrees longitude. Unless specified otherwise, this object must conform to the
6997
- <a href="https://en.wikipedia.org/wiki/World_Geodetic_System#1984_version">
6998
- WGS84 standard</a>. Values must be within normalized ranges. */
7097
+ /** 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. */
6999
7098
  export declare interface LatLng {
7000
7099
  /** The latitude in degrees. It must be in the range [-90.0, +90.0]. */
7001
7100
  latitude?: number;
7002
- /** The longitude in degrees. It must be in the range [-180.0, +180.0] */
7101
+ /** The longitude in degrees. It must be in the range [-180.0, +180.0]. */
7003
7102
  longitude?: number;
7004
7103
  }
7005
7104
 
@@ -7527,8 +7626,8 @@ export declare interface LiveConnectConfig {
7527
7626
  response.
7528
7627
  */
7529
7628
  safetySettings?: SafetySetting[];
7530
- /** Config for stream translation. */
7531
- streamTranslationConfig?: StreamTranslationConfig;
7629
+ /** Config for translation. */
7630
+ translationConfig?: TranslationConfig;
7532
7631
  }
7533
7632
 
7534
7633
  /** Config for LiveConnectConstraints for Auth Token creation. */
@@ -8081,6 +8180,26 @@ export declare enum MaskReferenceMode {
8081
8180
  MASK_MODE_SEMANTIC = "MASK_MODE_SEMANTIC"
8082
8181
  }
8083
8182
 
8183
+ /** Match operation to use for evaluation. */
8184
+ export declare enum MatchOperation {
8185
+ /**
8186
+ * Default value. This value is unused.
8187
+ */
8188
+ MATCH_OPERATION_UNSPECIFIED = "MATCH_OPERATION_UNSPECIFIED",
8189
+ /**
8190
+ * Equivalent to GoogleSQL `REGEX_CONTAINS(target, expression)`.
8191
+ */
8192
+ REGEX_CONTAINS = "REGEX_CONTAINS",
8193
+ /**
8194
+ * `expression` is a substring of target.
8195
+ */
8196
+ PARTIAL_MATCH = "PARTIAL_MATCH",
8197
+ /**
8198
+ * `expression` is an exact match of target.
8199
+ */
8200
+ EXACT_MATCH = "EXACT_MATCH"
8201
+ }
8202
+
8084
8203
  /** 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. */
8085
8204
  export declare interface McpServer {
8086
8205
  /** The name of the MCPServer. */
@@ -8926,7 +9045,8 @@ export declare enum PagedItem {
8926
9045
  PAGED_ITEM_FILES = "files",
8927
9046
  PAGED_ITEM_CACHED_CONTENTS = "cachedContents",
8928
9047
  PAGED_ITEM_FILE_SEARCH_STORES = "fileSearchStores",
8929
- PAGED_ITEM_DOCUMENTS = "documents"
9048
+ PAGED_ITEM_DOCUMENTS = "documents",
9049
+ PAGED_ITEM_SKILLS = "skills"
8930
9050
  }
8931
9051
 
8932
9052
  declare interface PagedItemConfig {
@@ -8947,6 +9067,7 @@ declare interface PagedItemResponse<T> {
8947
9067
  cachedContents?: T[];
8948
9068
  fileSearchStores?: T[];
8949
9069
  documents?: T[];
9070
+ skills?: T[];
8950
9071
  }
8951
9072
 
8952
9073
  /**
@@ -9628,6 +9749,151 @@ export declare class RegisterFilesResponse {
9628
9749
  files?: File_2[];
9629
9750
  }
9630
9751
 
9752
+ /** Reinforcement tuning autorater scorer. */
9753
+ export declare interface ReinforcementTuningAutoraterScorer {
9754
+ /** Autorater config for evaluation. */
9755
+ autoraterConfig?: AutoraterConfig;
9756
+ /** Allows substituting `prompt`, `response`, `system_instruction` and `references.reference` (each wrapped in double curly braces) into the autorater prompt. */
9757
+ autoraterPrompt?: string;
9758
+ /** Parses autorater returned response. */
9759
+ autoraterResponseParseConfig?: ReinforcementTuningParseResponseConfig;
9760
+ /** Scores autorater responses by directly converting parsed autorater response to float reward. */
9761
+ parsedResponseConversionScorer?: ReinforcementTuningAutoraterScorerParsedResponseConversionScorer;
9762
+ /** Scores autorater responses by using exact string match reward scorer. */
9763
+ exactMatchScorer?: ReinforcementTuningAutoraterScorerExactMatchScorer;
9764
+ }
9765
+
9766
+ /** Scores autorater responses by using exact string match reward scorer. */
9767
+ export declare interface ReinforcementTuningAutoraterScorerExactMatchScorer {
9768
+ /** Assigns this reward score if parsed response string equals the expression. */
9769
+ correctAnswerReward?: number;
9770
+ /** Assigns this reward score if parsed reward value does not equal the expression. */
9771
+ wrongAnswerReward?: number;
9772
+ /** The string expression to match against. Supports substitution in the format of `references.reference` (wrapped in double curly braces) before matching. No regex support. */
9773
+ expression?: string;
9774
+ }
9775
+
9776
+ /** Scores responses by directly converting parsed autorater response to float reward (reward is clipped to be within [-1, 1]). */
9777
+ export declare class ReinforcementTuningAutoraterScorerParsedResponseConversionScorer {
9778
+ }
9779
+
9780
+ /** Scores parsed responses by calling a Cloud Run service. */
9781
+ export declare interface ReinforcementTuningCloudRunRewardScorer {
9782
+ /** 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. */
9783
+ cloudRunUri?: string;
9784
+ }
9785
+
9786
+ /** Scores parsed responses for code execution use cases. */
9787
+ export declare interface ReinforcementTuningCodeExecutionRewardScorer {
9788
+ /** Example python code snippet which assigns reward of 1 to answer matching user provided reference answer in per prompt references map. */
9789
+ pythonCodeSnippet?: string;
9790
+ }
9791
+
9792
+ /** User-facing format for Gemini Reinforcement Tuning examples on Vertex. */
9793
+ export declare interface ReinforcementTuningExample {
9794
+ /** Multi-turn contents that represents the Prompt. */
9795
+ contents?: Content[];
9796
+ /** References for the given prompt. The key is the name of the reference, and the value is the reference itself. */
9797
+ references?: Record<string, string>;
9798
+ /** Corresponds to `system_instruction` in user-facing GenerateContentRequest. */
9799
+ systemInstruction?: Content;
9800
+ }
9801
+
9802
+ /** Hyperparameters for Reinforcement Tuning. */
9803
+ export declare interface ReinforcementTuningHyperParameters {
9804
+ /** Number of training epochs for the tuning job. */
9805
+ epochCount?: string;
9806
+ /** Learning rate multiplier for Reinforcement Learning. */
9807
+ learningRateMultiplier?: number;
9808
+ /** Adapter size for Reinforcement Tuning. */
9809
+ adapterSize?: AdapterSize;
9810
+ /** Number of different responses to generate per prompt during tuning. */
9811
+ samplesPerPrompt?: number;
9812
+ /** 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. */
9813
+ batchSize?: number;
9814
+ /** How often (in steps) to evaluate the tuning job during training. If not set, evaluation will run per epoch. */
9815
+ evaluateInterval?: number;
9816
+ /** How often (in steps) to save checkpoints during training. If not set, one checkpoint per epoch will be saved. */
9817
+ checkpointInterval?: number;
9818
+ /** The maximum number of tokens to generate per prompt. If not set, defaults to 32768. */
9819
+ maxOutputTokens?: number;
9820
+ /** Indicates the maximum thinking depth. Use with earlier models shall result in error. */
9821
+ thinkingLevel?: ReinforcementTuningThinkingLevel;
9822
+ }
9823
+
9824
+ /** Defines how to parse sample response for reinforcement tuning. */
9825
+ export declare class ReinforcementTuningParseResponseConfig {
9826
+ /** Defines how to parse sample response. */
9827
+ parseType?: ResponseParseType;
9828
+ /** Defines the regex to extract the important part of sample response. This field is only used when `parse_type` is `REGEX_EXTRACT`. */
9829
+ regexExtractExpression?: string;
9830
+ }
9831
+
9832
+ /** The reward info for a reward function. */
9833
+ export declare interface ReinforcementTuningRewardInfo {
9834
+ /** Output only. The calculated reward for the reward function. */
9835
+ reward?: number;
9836
+ /** Output only. The user-requested auxiliary info for the reward function. */
9837
+ userRequestedAuxInfo?: string;
9838
+ }
9839
+
9840
+ /** Reinforcement tuning spec for tuning. */
9841
+ export declare interface ReinforcementTuningSpec {
9842
+ compositeRewardConfig?: CompositeReinforcementTuningRewardConfig;
9843
+ /** Cloud Storage path to file containing training dataset for tuning. The dataset must be formatted as a JSONL file. */
9844
+ trainingDatasetUri?: string;
9845
+ /** 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. */
9846
+ validationDatasetUri?: string;
9847
+ /** Additional hyper-parameters to use during tuning. */
9848
+ hyperParameters?: ReinforcementTuningHyperParameters;
9849
+ /** Single reward function configuration for reinforcement tuning. */
9850
+ singleRewardConfig?: SingleReinforcementTuningRewardConfig;
9851
+ }
9852
+
9853
+ /** Scores parsed responses for string matching use cases. */
9854
+ export declare interface ReinforcementTuningStringMatchRewardScorer {
9855
+ /** Wrong answer reward is returned if evaluator evaluates to `false`. All wrong answers get the same reward. */
9856
+ wrongAnswerReward?: number;
9857
+ /** Correct answer reward is returned if evaluator evaluates to `true`. All correct answers get the same reward. */
9858
+ correctAnswerReward?: number;
9859
+ /** Uses string match expression to evaluate parsed response. */
9860
+ stringMatchExpression?: ReinforcementTuningStringMatchRewardScorerStringMatchExpression;
9861
+ /** Uses json match expression to evaluate parsed response. */
9862
+ jsonMatchExpression?: ReinforcementTuningStringMatchRewardScorerJsonMatchExpression;
9863
+ }
9864
+
9865
+ /** Converts parsed responses to JSON format, finds the first-level matching key, then performs StringMatchExpression on the value. */
9866
+ export declare interface ReinforcementTuningStringMatchRewardScorerJsonMatchExpression {
9867
+ /** Json key name to find the value to match against. */
9868
+ keyName?: string;
9869
+ /** String match expression to match against the value of json key. */
9870
+ valueStringMatchExpression?: ReinforcementTuningStringMatchRewardScorerStringMatchExpression;
9871
+ }
9872
+
9873
+ /** Evaluates parsed response using match type against expression. */
9874
+ export declare interface ReinforcementTuningStringMatchRewardScorerStringMatchExpression {
9875
+ /** Match operation to use for evaluation. */
9876
+ matchOperation?: MatchOperation;
9877
+ /** 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). */
9878
+ expression?: string;
9879
+ }
9880
+
9881
+ /** Represents how much to think for the tuning job. */
9882
+ export declare enum ReinforcementTuningThinkingLevel {
9883
+ /**
9884
+ * Unspecified thinking level.
9885
+ */
9886
+ REINFORCEMENT_TUNING_THINKING_LEVEL_UNSPECIFIED = "REINFORCEMENT_TUNING_THINKING_LEVEL_UNSPECIFIED",
9887
+ /**
9888
+ * Little to no thinking.
9889
+ */
9890
+ MINIMAL = "MINIMAL",
9891
+ /**
9892
+ * High thinking level.
9893
+ */
9894
+ HIGH = "HIGH"
9895
+ }
9896
+
9631
9897
  /** Represents a recorded session. */
9632
9898
  export declare interface ReplayFile {
9633
9899
  replayId?: string;
@@ -9757,6 +10023,22 @@ export declare enum ResourceScope {
9757
10023
  COLLECTION = "COLLECTION"
9758
10024
  }
9759
10025
 
10026
+ /** Defines how to parse sample response. */
10027
+ export declare enum ResponseParseType {
10028
+ /**
10029
+ * Default value. This value is unused.
10030
+ */
10031
+ RESPONSE_PARSE_TYPE_UNSPECIFIED = "RESPONSE_PARSE_TYPE_UNSPECIFIED",
10032
+ /**
10033
+ * Use the sample response as is.
10034
+ */
10035
+ IDENTITY = "IDENTITY",
10036
+ /**
10037
+ * Use regex to extract the important part of sample response.
10038
+ */
10039
+ REGEX_EXTRACT = "REGEX_EXTRACT"
10040
+ }
10041
+
9760
10042
  /** Defines a retrieval tool that model can call to access external knowledge. This data type is not supported in Gemini API. */
9761
10043
  export declare interface Retrieval {
9762
10044
  /** Optional. Deprecated. This option is no longer supported. */
@@ -9769,10 +10051,9 @@ export declare interface Retrieval {
9769
10051
  vertexRagStore?: VertexRagStore;
9770
10052
  }
9771
10053
 
9772
- /** Retrieval config.
9773
- */
10054
+ /** Retrieval config. */
9774
10055
  export declare interface RetrievalConfig {
9775
- /** Optional. The location of the user. */
10056
+ /** The location of the user. */
9776
10057
  latLng?: LatLng;
9777
10058
  /** The language code of the user. */
9778
10059
  languageCode?: string;
@@ -10288,6 +10569,22 @@ export declare class SingleEmbedContentResponse {
10288
10569
  tokenCount?: string;
10289
10570
  }
10290
10571
 
10572
+ /** Single reinforcement tuning reward config. */
10573
+ export declare interface SingleReinforcementTuningRewardConfig {
10574
+ /** Scores parsed responses for autorater use cases by using a model to compute the reward. */
10575
+ autoraterScorer?: ReinforcementTuningAutoraterScorer;
10576
+ /** A unique reward name used to identify each single reinforcement tuning reward. */
10577
+ rewardName?: string;
10578
+ /** Defines how to parse sample response. */
10579
+ parseResponseConfig?: ReinforcementTuningParseResponseConfig;
10580
+ /** Scores parsed responses for code execution use cases. */
10581
+ codeExecutionRewardScorer?: ReinforcementTuningCodeExecutionRewardScorer;
10582
+ /** Scores parsed responses for simple string matching use cases against reference answer without writing python code. */
10583
+ stringMatchRewardScorer?: ReinforcementTuningStringMatchRewardScorer;
10584
+ /** Scores parsed responses by calling a Cloud Run service. */
10585
+ cloudRunRewardScorer?: ReinforcementTuningCloudRunRewardScorer;
10586
+ }
10587
+
10291
10588
  /** Context window will be truncated by keeping only suffix of it.
10292
10589
 
10293
10590
  Context window will always be cut at start of USER role turn. System
@@ -10366,6 +10663,10 @@ declare interface StepDelta {
10366
10663
  * The event_id token to be used to resume the interaction stream, from this event.
10367
10664
  */
10368
10665
  event_id?: string;
10666
+ /**
10667
+ * Optional metadata accompanying ANY streamed event.
10668
+ */
10669
+ metadata?: StepDelta.Metadata;
10369
10670
  }
10370
10671
 
10371
10672
  declare namespace StepDelta {
@@ -10404,7 +10705,7 @@ declare namespace StepDelta {
10404
10705
  interface Document {
10405
10706
  type: 'document';
10406
10707
  data?: string;
10407
- mime_type?: 'application/pdf';
10708
+ mime_type?: 'application/pdf' | 'text/csv';
10408
10709
  uri?: string;
10409
10710
  }
10410
10711
  interface Video {
@@ -10571,6 +10872,15 @@ declare namespace StepDelta {
10571
10872
  is_error?: boolean;
10572
10873
  name?: string;
10573
10874
  }
10875
+ /**
10876
+ * Optional metadata accompanying ANY streamed event.
10877
+ */
10878
+ interface Metadata {
10879
+ /**
10880
+ * Statistics on the interaction request's token usage.
10881
+ */
10882
+ usage?: InteractionsAPI.Usage;
10883
+ }
10574
10884
  }
10575
10885
 
10576
10886
  declare interface StepStart {
@@ -10584,6 +10894,22 @@ declare interface StepStart {
10584
10894
  * The event_id token to be used to resume the interaction stream, from this event.
10585
10895
  */
10586
10896
  event_id?: string;
10897
+ /**
10898
+ * Optional metadata accompanying ANY streamed event.
10899
+ */
10900
+ metadata?: StepStart.Metadata;
10901
+ }
10902
+
10903
+ declare namespace StepStart {
10904
+ /**
10905
+ * Optional metadata accompanying ANY streamed event.
10906
+ */
10907
+ interface Metadata {
10908
+ /**
10909
+ * Statistics on the interaction request's token usage.
10910
+ */
10911
+ usage?: InteractionsAPI.Usage;
10912
+ }
10587
10913
  }
10588
10914
 
10589
10915
  declare interface StepStop {
@@ -10593,6 +10919,22 @@ declare interface StepStop {
10593
10919
  * The event_id token to be used to resume the interaction stream, from this event.
10594
10920
  */
10595
10921
  event_id?: string;
10922
+ /**
10923
+ * Optional metadata accompanying ANY streamed event.
10924
+ */
10925
+ metadata?: StepStop.Metadata;
10926
+ }
10927
+
10928
+ declare namespace StepStop {
10929
+ /**
10930
+ * Optional metadata accompanying ANY streamed event.
10931
+ */
10932
+ interface Metadata {
10933
+ /**
10934
+ * Statistics on the interaction request's token usage.
10935
+ */
10936
+ usage?: InteractionsAPI.Usage;
10937
+ }
10596
10938
  }
10597
10939
 
10598
10940
  declare class Stream<Item> implements AsyncIterable<Item> {
@@ -10634,17 +10976,6 @@ export declare interface StreamableHttpTransport {
10634
10976
  url?: string;
10635
10977
  }
10636
10978
 
10637
- /** Config for stream translation. */
10638
- export declare interface StreamTranslationConfig {
10639
- /** If true, the model will generate audio when the target language is
10640
- spoken, essentially it will parrot the input. If false, we will not produce
10641
- audio for the target language. */
10642
- echoTargetLanguage?: boolean;
10643
- /** The target language for translation. Supported values are BCP-47
10644
- language codes (e.g. "en", "es", "fr"). */
10645
- targetLanguageCode?: string;
10646
- }
10647
-
10648
10979
  /** User provided string values assigned to a single metadata key. This data type is not supported in Vertex AI. */
10649
10980
  export declare interface StringList {
10650
10981
  /** The string values of the metadata to store. */
@@ -11208,15 +11539,13 @@ declare type ToolChoiceType = 'auto' | 'any' | 'none' | 'validated';
11208
11539
  export declare interface ToolCodeExecution {
11209
11540
  }
11210
11541
 
11211
- /** Tool config.
11212
-
11213
- This config is shared for all tools provided in the request. */
11542
+ /** Tool config. This config is shared for all tools provided in the request. */
11214
11543
  export declare interface ToolConfig {
11215
11544
  /** Optional. Retrieval config. */
11216
11545
  retrievalConfig?: RetrievalConfig;
11217
11546
  /** Optional. Function calling config. */
11218
11547
  functionCallingConfig?: FunctionCallingConfig;
11219
- /** 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. */
11548
+ /** 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. */
11220
11549
  includeServerSideToolInvocations?: boolean;
11221
11550
  }
11222
11551
 
@@ -11305,6 +11634,19 @@ export declare interface Transcription {
11305
11634
  text?: string;
11306
11635
  /** Optional. The bool indicates the end of the transcription. */
11307
11636
  finished?: boolean;
11637
+ /** The BCP-47 language code of the transcription. */
11638
+ languageCode?: string;
11639
+ }
11640
+
11641
+ /** Config for stream translation. */
11642
+ export declare interface TranslationConfig {
11643
+ /** If true, the model will generate audio when the target language is
11644
+ spoken, essentially it will parrot the input. If false, we will not produce
11645
+ audio for the target language. */
11646
+ echoTargetLanguage?: boolean;
11647
+ /** The target language for translation. Supported values are BCP-47
11648
+ language codes (e.g. "en", "es", "fr"). */
11649
+ targetLanguageCode?: string;
11308
11650
  }
11309
11651
 
11310
11652
  /** TunedModel for the Tuned Model of a Tuning Job. */
@@ -11413,6 +11755,7 @@ export declare interface TuningJob {
11413
11755
  preferenceOptimizationSpec?: PreferenceOptimizationSpec;
11414
11756
  /** Tuning Spec for Distillation. */
11415
11757
  distillationSpec?: DistillationSpec;
11758
+ reinforcementTuningSpec?: ReinforcementTuningSpec;
11416
11759
  /** Output only. The tuning data statistics associated with this TuningJob. */
11417
11760
  tuningDataStats?: TuningDataStats;
11418
11761
  /** 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. */
@@ -11497,7 +11840,11 @@ export declare enum TuningMethod {
11497
11840
  /**
11498
11841
  * Distillation tuning.
11499
11842
  */
11500
- DISTILLATION = "DISTILLATION"
11843
+ DISTILLATION = "DISTILLATION",
11844
+ /**
11845
+ * Reinforcement tuning.
11846
+ */
11847
+ REINFORCEMENT_TUNING = "REINFORCEMENT_TUNING"
11501
11848
  }
11502
11849
 
11503
11850
  /** Tuning mode. This enum is not supported in Gemini API. */
@@ -11584,6 +11931,7 @@ declare class Tunings extends BaseModule {
11584
11931
  cancel(params: types.CancelTuningJobParameters): Promise<types.CancelTuningJobResponse>;
11585
11932
  private tuneInternal;
11586
11933
  private tuneMldevInternal;
11934
+ validateReward(params: types.ValidateRewardParameters): Promise<types.ValidateRewardResponse>;
11587
11935
  }
11588
11936
 
11589
11937
  /** The speed of the tuning job. Only supported for Veo 3.0 models. This enum is not supported in Gemini API. */
@@ -11825,13 +12173,13 @@ declare namespace types {
11825
12173
  PhishBlockThreshold,
11826
12174
  Behavior,
11827
12175
  DynamicRetrievalConfigMode,
11828
- FunctionCallingConfigMode,
11829
12176
  ThinkingLevel,
11830
12177
  PersonGeneration,
11831
12178
  ProminentPeople,
11832
12179
  HarmCategory,
11833
12180
  HarmBlockMethod,
11834
12181
  HarmBlockThreshold,
12182
+ FunctionCallingConfigMode,
11835
12183
  FinishReason,
11836
12184
  HarmProbability,
11837
12185
  HarmSeverity,
@@ -11868,6 +12216,9 @@ declare namespace types {
11868
12216
  VideoGenerationMaskMode,
11869
12217
  VideoCompressionQuality,
11870
12218
  ImageResizeMode,
12219
+ ResponseParseType,
12220
+ MatchOperation,
12221
+ ReinforcementTuningThinkingLevel,
11871
12222
  TuningMethod,
11872
12223
  FileState,
11873
12224
  FileSource,
@@ -11942,10 +12293,6 @@ declare namespace types {
11942
12293
  StreamableHttpTransport,
11943
12294
  McpServer,
11944
12295
  Tool,
11945
- LatLng,
11946
- RetrievalConfig,
11947
- FunctionCallingConfig,
11948
- ToolConfig,
11949
12296
  ReplicatedVoiceConfig,
11950
12297
  PrebuiltVoiceConfig,
11951
12298
  VoiceConfig,
@@ -11960,6 +12307,10 @@ declare namespace types {
11960
12307
  GenerationConfigRoutingConfigManualRoutingMode,
11961
12308
  GenerationConfigRoutingConfig,
11962
12309
  SafetySetting,
12310
+ LatLng,
12311
+ RetrievalConfig,
12312
+ FunctionCallingConfig,
12313
+ ToolConfig,
11963
12314
  ModelArmorConfig,
11964
12315
  GenerateContentConfig,
11965
12316
  GenerateContentParameters,
@@ -12076,6 +12427,21 @@ declare namespace types {
12076
12427
  DistillationHyperParameters,
12077
12428
  DistillationSamplingSpec,
12078
12429
  DistillationSpec,
12430
+ AutoraterConfig,
12431
+ ReinforcementTuningParseResponseConfig,
12432
+ ReinforcementTuningAutoraterScorerParsedResponseConversionScorer,
12433
+ ReinforcementTuningAutoraterScorerExactMatchScorer,
12434
+ ReinforcementTuningAutoraterScorer,
12435
+ ReinforcementTuningCodeExecutionRewardScorer,
12436
+ ReinforcementTuningStringMatchRewardScorerStringMatchExpression,
12437
+ ReinforcementTuningStringMatchRewardScorerJsonMatchExpression,
12438
+ ReinforcementTuningStringMatchRewardScorer,
12439
+ ReinforcementTuningCloudRunRewardScorer,
12440
+ SingleReinforcementTuningRewardConfig,
12441
+ CompositeReinforcementTuningRewardConfigWeightedRewardConfig,
12442
+ CompositeReinforcementTuningRewardConfig,
12443
+ ReinforcementTuningHyperParameters,
12444
+ ReinforcementTuningSpec,
12079
12445
  GoogleRpcStatus,
12080
12446
  PreTunedModel,
12081
12447
  DatasetDistributionDistributionBucket,
@@ -12125,6 +12491,11 @@ declare namespace types {
12125
12491
  CreateTuningJobConfig,
12126
12492
  CreateTuningJobParametersPrivate,
12127
12493
  TuningOperation,
12494
+ ReinforcementTuningExample,
12495
+ ValidateRewardConfig,
12496
+ ValidateRewardParameters,
12497
+ ReinforcementTuningRewardInfo,
12498
+ ValidateRewardResponse,
12128
12499
  CreateCachedContentConfig,
12129
12500
  CreateCachedContentParameters,
12130
12501
  CachedContentUsageMetadata,
@@ -12262,7 +12633,7 @@ declare namespace types {
12262
12633
  LiveClientRealtimeInput,
12263
12634
  LiveClientToolResponse,
12264
12635
  LiveClientMessage,
12265
- StreamTranslationConfig,
12636
+ TranslationConfig,
12266
12637
  LiveConnectConfig,
12267
12638
  LiveConnectParameters,
12268
12639
  CreateChatParameters,
@@ -12923,6 +13294,53 @@ export declare enum VadSignalType {
12923
13294
  VAD_SIGNAL_TYPE_EOS = "VAD_SIGNAL_TYPE_EOS"
12924
13295
  }
12925
13296
 
13297
+ /** Optional parameters for tunings.validate_reward. */
13298
+ export declare interface ValidateRewardConfig {
13299
+ /** Used to override HTTP request options. */
13300
+ httpOptions?: HttpOptions;
13301
+ /** Abort signal which can be used to cancel the request.
13302
+
13303
+ NOTE: AbortSignal is a client-only operation. Using it to cancel an
13304
+ operation will not cancel the request in the service. You will still
13305
+ be charged usage for any applicable operations.
13306
+ */
13307
+ abortSignal?: AbortSignal;
13308
+ }
13309
+
13310
+ /** Parameters for the validate_reward method.
13311
+
13312
+ Validates a reinforcement tuning reward configuration against a sample
13313
+ response and example before creating a reinforcement tuning job. */
13314
+ export declare interface ValidateRewardParameters {
13315
+ /** Required. The resource name of the Location to validate the reward in, e.g. `projects/{project}/locations/{location}`. */
13316
+ parent: string;
13317
+ /** Required. The sample response for validating the reward configuration. */
13318
+ sampleResponse: Content;
13319
+ /** Required. The example to validate the reward configuration. */
13320
+ example: ReinforcementTuningExample;
13321
+ /** Single reward function configuration for reinforcement tuning. Mutually exclusive with composite_reward_config. */
13322
+ singleRewardConfig?: SingleReinforcementTuningRewardConfig;
13323
+ /** Composite reward function configuration for reinforcement tuning. Mutually exclusive with single_reward_config. */
13324
+ compositeRewardConfig?: CompositeReinforcementTuningRewardConfig;
13325
+ /** Optional parameters for the request. */
13326
+ config?: ValidateRewardConfig;
13327
+ }
13328
+
13329
+ /** Response for the validate_reward method.
13330
+
13331
+ Contains the computed reward for a reinforcement tuning reward
13332
+ configuration. */
13333
+ export declare class ValidateRewardResponse {
13334
+ /** Used to retain the full HTTP response. */
13335
+ sdkHttpResponse?: HttpResponse;
13336
+ /** 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. */
13337
+ overallReward?: number;
13338
+ /** Output only. In case of an error, this field will be populated with a detailed error message to help with debugging. */
13339
+ error?: string;
13340
+ /** A map from reward name to reward info. */
13341
+ rewardInfoDetails?: Record<string, ReinforcementTuningRewardInfo>;
13342
+ }
13343
+
12926
13344
  /** Hyperparameters for Veo. This data type is not supported in Gemini API. */
12927
13345
  export declare interface VeoHyperParameters {
12928
13346
  /** Optional. Number of complete passes the model makes over the entire training dataset during training. */