@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/genai.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.
@@ -5569,7 +5625,7 @@ export declare interface GoogleGenAIOptions {
5569
5625
  export declare interface GoogleMaps {
5570
5626
  /** The authentication config to access the API. Only API key is supported. This field is not supported in Gemini API. */
5571
5627
  authConfig?: AuthConfig;
5572
- /** 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. */
5628
+ /** 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. */
5573
5629
  enableWidget?: boolean;
5574
5630
  }
5575
5631
 
@@ -6713,6 +6769,22 @@ declare interface InteractionCompletedEvent {
6713
6769
  * The event_id token to be used to resume the interaction stream, from this event.
6714
6770
  */
6715
6771
  event_id?: string;
6772
+ /**
6773
+ * Optional metadata accompanying ANY streamed event.
6774
+ */
6775
+ metadata?: InteractionCompletedEvent.Metadata;
6776
+ }
6777
+
6778
+ declare namespace InteractionCompletedEvent {
6779
+ /**
6780
+ * Optional metadata accompanying ANY streamed event.
6781
+ */
6782
+ interface Metadata {
6783
+ /**
6784
+ * Statistics on the interaction request's token usage.
6785
+ */
6786
+ usage?: InteractionsAPI.Usage;
6787
+ }
6716
6788
  }
6717
6789
 
6718
6790
  declare interface InteractionCreatedEvent {
@@ -6725,6 +6797,22 @@ declare interface InteractionCreatedEvent {
6725
6797
  * The event_id token to be used to resume the interaction stream, from this event.
6726
6798
  */
6727
6799
  event_id?: string;
6800
+ /**
6801
+ * Optional metadata accompanying ANY streamed event.
6802
+ */
6803
+ metadata?: InteractionCreatedEvent.Metadata;
6804
+ }
6805
+
6806
+ declare namespace InteractionCreatedEvent {
6807
+ /**
6808
+ * Optional metadata accompanying ANY streamed event.
6809
+ */
6810
+ interface Metadata {
6811
+ /**
6812
+ * Statistics on the interaction request's token usage.
6813
+ */
6814
+ usage?: InteractionsAPI.Usage;
6815
+ }
6728
6816
  }
6729
6817
 
6730
6818
  declare type InteractionCreateParams = CreateModelInteractionParamsNonStreaming | CreateModelInteractionParamsStreaming | CreateAgentInteractionParamsNonStreaming | CreateAgentInteractionParamsStreaming;
@@ -6883,6 +6971,22 @@ declare interface InteractionStatusUpdate {
6883
6971
  * The event_id token to be used to resume the interaction stream, from this event.
6884
6972
  */
6885
6973
  event_id?: string;
6974
+ /**
6975
+ * Optional metadata accompanying ANY streamed event.
6976
+ */
6977
+ metadata?: InteractionStatusUpdate.Metadata;
6978
+ }
6979
+
6980
+ declare namespace InteractionStatusUpdate {
6981
+ /**
6982
+ * Optional metadata accompanying ANY streamed event.
6983
+ */
6984
+ interface Metadata {
6985
+ /**
6986
+ * Statistics on the interaction request's token usage.
6987
+ */
6988
+ usage?: InteractionsAPI.Usage;
6989
+ }
6886
6990
  }
6887
6991
 
6888
6992
  /** Parameters for the private _Register method. */
@@ -6978,16 +7082,11 @@ export declare enum Language {
6978
7082
  PYTHON = "PYTHON"
6979
7083
  }
6980
7084
 
6981
- /** An object that represents a latitude/longitude pair.
6982
-
6983
- This is expressed as a pair of doubles to represent degrees latitude and
6984
- degrees longitude. Unless specified otherwise, this object must conform to the
6985
- <a href="https://en.wikipedia.org/wiki/World_Geodetic_System#1984_version">
6986
- WGS84 standard</a>. Values must be within normalized ranges. */
7085
+ /** 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. */
6987
7086
  export declare interface LatLng {
6988
7087
  /** The latitude in degrees. It must be in the range [-90.0, +90.0]. */
6989
7088
  latitude?: number;
6990
- /** The longitude in degrees. It must be in the range [-180.0, +180.0] */
7089
+ /** The longitude in degrees. It must be in the range [-180.0, +180.0]. */
6991
7090
  longitude?: number;
6992
7091
  }
6993
7092
 
@@ -7515,8 +7614,8 @@ export declare interface LiveConnectConfig {
7515
7614
  response.
7516
7615
  */
7517
7616
  safetySettings?: SafetySetting[];
7518
- /** Config for stream translation. */
7519
- streamTranslationConfig?: StreamTranslationConfig;
7617
+ /** Config for translation. */
7618
+ translationConfig?: TranslationConfig;
7520
7619
  }
7521
7620
 
7522
7621
  /** Config for LiveConnectConstraints for Auth Token creation. */
@@ -8069,6 +8168,26 @@ export declare enum MaskReferenceMode {
8069
8168
  MASK_MODE_SEMANTIC = "MASK_MODE_SEMANTIC"
8070
8169
  }
8071
8170
 
8171
+ /** Match operation to use for evaluation. */
8172
+ export declare enum MatchOperation {
8173
+ /**
8174
+ * Default value. This value is unused.
8175
+ */
8176
+ MATCH_OPERATION_UNSPECIFIED = "MATCH_OPERATION_UNSPECIFIED",
8177
+ /**
8178
+ * Equivalent to GoogleSQL `REGEX_CONTAINS(target, expression)`.
8179
+ */
8180
+ REGEX_CONTAINS = "REGEX_CONTAINS",
8181
+ /**
8182
+ * `expression` is a substring of target.
8183
+ */
8184
+ PARTIAL_MATCH = "PARTIAL_MATCH",
8185
+ /**
8186
+ * `expression` is an exact match of target.
8187
+ */
8188
+ EXACT_MATCH = "EXACT_MATCH"
8189
+ }
8190
+
8072
8191
  /** 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. */
8073
8192
  export declare interface McpServer {
8074
8193
  /** The name of the MCPServer. */
@@ -8914,7 +9033,8 @@ export declare enum PagedItem {
8914
9033
  PAGED_ITEM_FILES = "files",
8915
9034
  PAGED_ITEM_CACHED_CONTENTS = "cachedContents",
8916
9035
  PAGED_ITEM_FILE_SEARCH_STORES = "fileSearchStores",
8917
- PAGED_ITEM_DOCUMENTS = "documents"
9036
+ PAGED_ITEM_DOCUMENTS = "documents",
9037
+ PAGED_ITEM_SKILLS = "skills"
8918
9038
  }
8919
9039
 
8920
9040
  declare interface PagedItemConfig {
@@ -8935,6 +9055,7 @@ declare interface PagedItemResponse<T> {
8935
9055
  cachedContents?: T[];
8936
9056
  fileSearchStores?: T[];
8937
9057
  documents?: T[];
9058
+ skills?: T[];
8938
9059
  }
8939
9060
 
8940
9061
  /**
@@ -9616,6 +9737,151 @@ export declare class RegisterFilesResponse {
9616
9737
  files?: File_2[];
9617
9738
  }
9618
9739
 
9740
+ /** Reinforcement tuning autorater scorer. */
9741
+ export declare interface ReinforcementTuningAutoraterScorer {
9742
+ /** Autorater config for evaluation. */
9743
+ autoraterConfig?: AutoraterConfig;
9744
+ /** Allows substituting `prompt`, `response`, `system_instruction` and `references.reference` (each wrapped in double curly braces) into the autorater prompt. */
9745
+ autoraterPrompt?: string;
9746
+ /** Parses autorater returned response. */
9747
+ autoraterResponseParseConfig?: ReinforcementTuningParseResponseConfig;
9748
+ /** Scores autorater responses by directly converting parsed autorater response to float reward. */
9749
+ parsedResponseConversionScorer?: ReinforcementTuningAutoraterScorerParsedResponseConversionScorer;
9750
+ /** Scores autorater responses by using exact string match reward scorer. */
9751
+ exactMatchScorer?: ReinforcementTuningAutoraterScorerExactMatchScorer;
9752
+ }
9753
+
9754
+ /** Scores autorater responses by using exact string match reward scorer. */
9755
+ export declare interface ReinforcementTuningAutoraterScorerExactMatchScorer {
9756
+ /** Assigns this reward score if parsed response string equals the expression. */
9757
+ correctAnswerReward?: number;
9758
+ /** Assigns this reward score if parsed reward value does not equal the expression. */
9759
+ wrongAnswerReward?: number;
9760
+ /** The string expression to match against. Supports substitution in the format of `references.reference` (wrapped in double curly braces) before matching. No regex support. */
9761
+ expression?: string;
9762
+ }
9763
+
9764
+ /** Scores responses by directly converting parsed autorater response to float reward (reward is clipped to be within [-1, 1]). */
9765
+ export declare class ReinforcementTuningAutoraterScorerParsedResponseConversionScorer {
9766
+ }
9767
+
9768
+ /** Scores parsed responses by calling a Cloud Run service. */
9769
+ export declare interface ReinforcementTuningCloudRunRewardScorer {
9770
+ /** 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. */
9771
+ cloudRunUri?: string;
9772
+ }
9773
+
9774
+ /** Scores parsed responses for code execution use cases. */
9775
+ export declare interface ReinforcementTuningCodeExecutionRewardScorer {
9776
+ /** Example python code snippet which assigns reward of 1 to answer matching user provided reference answer in per prompt references map. */
9777
+ pythonCodeSnippet?: string;
9778
+ }
9779
+
9780
+ /** User-facing format for Gemini Reinforcement Tuning examples on Vertex. */
9781
+ export declare interface ReinforcementTuningExample {
9782
+ /** Multi-turn contents that represents the Prompt. */
9783
+ contents?: Content[];
9784
+ /** References for the given prompt. The key is the name of the reference, and the value is the reference itself. */
9785
+ references?: Record<string, string>;
9786
+ /** Corresponds to `system_instruction` in user-facing GenerateContentRequest. */
9787
+ systemInstruction?: Content;
9788
+ }
9789
+
9790
+ /** Hyperparameters for Reinforcement Tuning. */
9791
+ export declare interface ReinforcementTuningHyperParameters {
9792
+ /** Number of training epochs for the tuning job. */
9793
+ epochCount?: string;
9794
+ /** Learning rate multiplier for Reinforcement Learning. */
9795
+ learningRateMultiplier?: number;
9796
+ /** Adapter size for Reinforcement Tuning. */
9797
+ adapterSize?: AdapterSize;
9798
+ /** Number of different responses to generate per prompt during tuning. */
9799
+ samplesPerPrompt?: number;
9800
+ /** 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. */
9801
+ batchSize?: number;
9802
+ /** How often (in steps) to evaluate the tuning job during training. If not set, evaluation will run per epoch. */
9803
+ evaluateInterval?: number;
9804
+ /** How often (in steps) to save checkpoints during training. If not set, one checkpoint per epoch will be saved. */
9805
+ checkpointInterval?: number;
9806
+ /** The maximum number of tokens to generate per prompt. If not set, defaults to 32768. */
9807
+ maxOutputTokens?: number;
9808
+ /** Indicates the maximum thinking depth. Use with earlier models shall result in error. */
9809
+ thinkingLevel?: ReinforcementTuningThinkingLevel;
9810
+ }
9811
+
9812
+ /** Defines how to parse sample response for reinforcement tuning. */
9813
+ export declare class ReinforcementTuningParseResponseConfig {
9814
+ /** Defines how to parse sample response. */
9815
+ parseType?: ResponseParseType;
9816
+ /** Defines the regex to extract the important part of sample response. This field is only used when `parse_type` is `REGEX_EXTRACT`. */
9817
+ regexExtractExpression?: string;
9818
+ }
9819
+
9820
+ /** The reward info for a reward function. */
9821
+ export declare interface ReinforcementTuningRewardInfo {
9822
+ /** Output only. The calculated reward for the reward function. */
9823
+ reward?: number;
9824
+ /** Output only. The user-requested auxiliary info for the reward function. */
9825
+ userRequestedAuxInfo?: string;
9826
+ }
9827
+
9828
+ /** Reinforcement tuning spec for tuning. */
9829
+ export declare interface ReinforcementTuningSpec {
9830
+ compositeRewardConfig?: CompositeReinforcementTuningRewardConfig;
9831
+ /** Cloud Storage path to file containing training dataset for tuning. The dataset must be formatted as a JSONL file. */
9832
+ trainingDatasetUri?: string;
9833
+ /** 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. */
9834
+ validationDatasetUri?: string;
9835
+ /** Additional hyper-parameters to use during tuning. */
9836
+ hyperParameters?: ReinforcementTuningHyperParameters;
9837
+ /** Single reward function configuration for reinforcement tuning. */
9838
+ singleRewardConfig?: SingleReinforcementTuningRewardConfig;
9839
+ }
9840
+
9841
+ /** Scores parsed responses for string matching use cases. */
9842
+ export declare interface ReinforcementTuningStringMatchRewardScorer {
9843
+ /** Wrong answer reward is returned if evaluator evaluates to `false`. All wrong answers get the same reward. */
9844
+ wrongAnswerReward?: number;
9845
+ /** Correct answer reward is returned if evaluator evaluates to `true`. All correct answers get the same reward. */
9846
+ correctAnswerReward?: number;
9847
+ /** Uses string match expression to evaluate parsed response. */
9848
+ stringMatchExpression?: ReinforcementTuningStringMatchRewardScorerStringMatchExpression;
9849
+ /** Uses json match expression to evaluate parsed response. */
9850
+ jsonMatchExpression?: ReinforcementTuningStringMatchRewardScorerJsonMatchExpression;
9851
+ }
9852
+
9853
+ /** Converts parsed responses to JSON format, finds the first-level matching key, then performs StringMatchExpression on the value. */
9854
+ export declare interface ReinforcementTuningStringMatchRewardScorerJsonMatchExpression {
9855
+ /** Json key name to find the value to match against. */
9856
+ keyName?: string;
9857
+ /** String match expression to match against the value of json key. */
9858
+ valueStringMatchExpression?: ReinforcementTuningStringMatchRewardScorerStringMatchExpression;
9859
+ }
9860
+
9861
+ /** Evaluates parsed response using match type against expression. */
9862
+ export declare interface ReinforcementTuningStringMatchRewardScorerStringMatchExpression {
9863
+ /** Match operation to use for evaluation. */
9864
+ matchOperation?: MatchOperation;
9865
+ /** 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). */
9866
+ expression?: string;
9867
+ }
9868
+
9869
+ /** Represents how much to think for the tuning job. */
9870
+ export declare enum ReinforcementTuningThinkingLevel {
9871
+ /**
9872
+ * Unspecified thinking level.
9873
+ */
9874
+ REINFORCEMENT_TUNING_THINKING_LEVEL_UNSPECIFIED = "REINFORCEMENT_TUNING_THINKING_LEVEL_UNSPECIFIED",
9875
+ /**
9876
+ * Little to no thinking.
9877
+ */
9878
+ MINIMAL = "MINIMAL",
9879
+ /**
9880
+ * High thinking level.
9881
+ */
9882
+ HIGH = "HIGH"
9883
+ }
9884
+
9619
9885
  /** Represents a recorded session. */
9620
9886
  export declare interface ReplayFile {
9621
9887
  replayId?: string;
@@ -9745,6 +10011,22 @@ export declare enum ResourceScope {
9745
10011
  COLLECTION = "COLLECTION"
9746
10012
  }
9747
10013
 
10014
+ /** Defines how to parse sample response. */
10015
+ export declare enum ResponseParseType {
10016
+ /**
10017
+ * Default value. This value is unused.
10018
+ */
10019
+ RESPONSE_PARSE_TYPE_UNSPECIFIED = "RESPONSE_PARSE_TYPE_UNSPECIFIED",
10020
+ /**
10021
+ * Use the sample response as is.
10022
+ */
10023
+ IDENTITY = "IDENTITY",
10024
+ /**
10025
+ * Use regex to extract the important part of sample response.
10026
+ */
10027
+ REGEX_EXTRACT = "REGEX_EXTRACT"
10028
+ }
10029
+
9748
10030
  /** Defines a retrieval tool that model can call to access external knowledge. This data type is not supported in Gemini API. */
9749
10031
  export declare interface Retrieval {
9750
10032
  /** Optional. Deprecated. This option is no longer supported. */
@@ -9757,10 +10039,9 @@ export declare interface Retrieval {
9757
10039
  vertexRagStore?: VertexRagStore;
9758
10040
  }
9759
10041
 
9760
- /** Retrieval config.
9761
- */
10042
+ /** Retrieval config. */
9762
10043
  export declare interface RetrievalConfig {
9763
- /** Optional. The location of the user. */
10044
+ /** The location of the user. */
9764
10045
  latLng?: LatLng;
9765
10046
  /** The language code of the user. */
9766
10047
  languageCode?: string;
@@ -10276,6 +10557,22 @@ export declare class SingleEmbedContentResponse {
10276
10557
  tokenCount?: string;
10277
10558
  }
10278
10559
 
10560
+ /** Single reinforcement tuning reward config. */
10561
+ export declare interface SingleReinforcementTuningRewardConfig {
10562
+ /** Scores parsed responses for autorater use cases by using a model to compute the reward. */
10563
+ autoraterScorer?: ReinforcementTuningAutoraterScorer;
10564
+ /** A unique reward name used to identify each single reinforcement tuning reward. */
10565
+ rewardName?: string;
10566
+ /** Defines how to parse sample response. */
10567
+ parseResponseConfig?: ReinforcementTuningParseResponseConfig;
10568
+ /** Scores parsed responses for code execution use cases. */
10569
+ codeExecutionRewardScorer?: ReinforcementTuningCodeExecutionRewardScorer;
10570
+ /** Scores parsed responses for simple string matching use cases against reference answer without writing python code. */
10571
+ stringMatchRewardScorer?: ReinforcementTuningStringMatchRewardScorer;
10572
+ /** Scores parsed responses by calling a Cloud Run service. */
10573
+ cloudRunRewardScorer?: ReinforcementTuningCloudRunRewardScorer;
10574
+ }
10575
+
10279
10576
  /** Context window will be truncated by keeping only suffix of it.
10280
10577
 
10281
10578
  Context window will always be cut at start of USER role turn. System
@@ -10354,6 +10651,10 @@ declare interface StepDelta {
10354
10651
  * The event_id token to be used to resume the interaction stream, from this event.
10355
10652
  */
10356
10653
  event_id?: string;
10654
+ /**
10655
+ * Optional metadata accompanying ANY streamed event.
10656
+ */
10657
+ metadata?: StepDelta.Metadata;
10357
10658
  }
10358
10659
 
10359
10660
  declare namespace StepDelta {
@@ -10392,7 +10693,7 @@ declare namespace StepDelta {
10392
10693
  interface Document {
10393
10694
  type: 'document';
10394
10695
  data?: string;
10395
- mime_type?: 'application/pdf';
10696
+ mime_type?: 'application/pdf' | 'text/csv';
10396
10697
  uri?: string;
10397
10698
  }
10398
10699
  interface Video {
@@ -10559,6 +10860,15 @@ declare namespace StepDelta {
10559
10860
  is_error?: boolean;
10560
10861
  name?: string;
10561
10862
  }
10863
+ /**
10864
+ * Optional metadata accompanying ANY streamed event.
10865
+ */
10866
+ interface Metadata {
10867
+ /**
10868
+ * Statistics on the interaction request's token usage.
10869
+ */
10870
+ usage?: InteractionsAPI.Usage;
10871
+ }
10562
10872
  }
10563
10873
 
10564
10874
  declare interface StepStart {
@@ -10572,6 +10882,22 @@ declare interface StepStart {
10572
10882
  * The event_id token to be used to resume the interaction stream, from this event.
10573
10883
  */
10574
10884
  event_id?: string;
10885
+ /**
10886
+ * Optional metadata accompanying ANY streamed event.
10887
+ */
10888
+ metadata?: StepStart.Metadata;
10889
+ }
10890
+
10891
+ declare namespace StepStart {
10892
+ /**
10893
+ * Optional metadata accompanying ANY streamed event.
10894
+ */
10895
+ interface Metadata {
10896
+ /**
10897
+ * Statistics on the interaction request's token usage.
10898
+ */
10899
+ usage?: InteractionsAPI.Usage;
10900
+ }
10575
10901
  }
10576
10902
 
10577
10903
  declare interface StepStop {
@@ -10581,6 +10907,22 @@ declare interface StepStop {
10581
10907
  * The event_id token to be used to resume the interaction stream, from this event.
10582
10908
  */
10583
10909
  event_id?: string;
10910
+ /**
10911
+ * Optional metadata accompanying ANY streamed event.
10912
+ */
10913
+ metadata?: StepStop.Metadata;
10914
+ }
10915
+
10916
+ declare namespace StepStop {
10917
+ /**
10918
+ * Optional metadata accompanying ANY streamed event.
10919
+ */
10920
+ interface Metadata {
10921
+ /**
10922
+ * Statistics on the interaction request's token usage.
10923
+ */
10924
+ usage?: InteractionsAPI.Usage;
10925
+ }
10584
10926
  }
10585
10927
 
10586
10928
  declare class Stream<Item> implements AsyncIterable<Item> {
@@ -10622,17 +10964,6 @@ export declare interface StreamableHttpTransport {
10622
10964
  url?: string;
10623
10965
  }
10624
10966
 
10625
- /** Config for stream translation. */
10626
- export declare interface StreamTranslationConfig {
10627
- /** If true, the model will generate audio when the target language is
10628
- spoken, essentially it will parrot the input. If false, we will not produce
10629
- audio for the target language. */
10630
- echoTargetLanguage?: boolean;
10631
- /** The target language for translation. Supported values are BCP-47
10632
- language codes (e.g. "en", "es", "fr"). */
10633
- targetLanguageCode?: string;
10634
- }
10635
-
10636
10967
  /** User provided string values assigned to a single metadata key. This data type is not supported in Vertex AI. */
10637
10968
  export declare interface StringList {
10638
10969
  /** The string values of the metadata to store. */
@@ -11196,15 +11527,13 @@ declare type ToolChoiceType = 'auto' | 'any' | 'none' | 'validated';
11196
11527
  export declare interface ToolCodeExecution {
11197
11528
  }
11198
11529
 
11199
- /** Tool config.
11200
-
11201
- This config is shared for all tools provided in the request. */
11530
+ /** Tool config. This config is shared for all tools provided in the request. */
11202
11531
  export declare interface ToolConfig {
11203
11532
  /** Optional. Retrieval config. */
11204
11533
  retrievalConfig?: RetrievalConfig;
11205
11534
  /** Optional. Function calling config. */
11206
11535
  functionCallingConfig?: FunctionCallingConfig;
11207
- /** 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. */
11536
+ /** 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. */
11208
11537
  includeServerSideToolInvocations?: boolean;
11209
11538
  }
11210
11539
 
@@ -11293,6 +11622,19 @@ export declare interface Transcription {
11293
11622
  text?: string;
11294
11623
  /** Optional. The bool indicates the end of the transcription. */
11295
11624
  finished?: boolean;
11625
+ /** The BCP-47 language code of the transcription. */
11626
+ languageCode?: string;
11627
+ }
11628
+
11629
+ /** Config for stream translation. */
11630
+ export declare interface TranslationConfig {
11631
+ /** If true, the model will generate audio when the target language is
11632
+ spoken, essentially it will parrot the input. If false, we will not produce
11633
+ audio for the target language. */
11634
+ echoTargetLanguage?: boolean;
11635
+ /** The target language for translation. Supported values are BCP-47
11636
+ language codes (e.g. "en", "es", "fr"). */
11637
+ targetLanguageCode?: string;
11296
11638
  }
11297
11639
 
11298
11640
  /** TunedModel for the Tuned Model of a Tuning Job. */
@@ -11401,6 +11743,7 @@ export declare interface TuningJob {
11401
11743
  preferenceOptimizationSpec?: PreferenceOptimizationSpec;
11402
11744
  /** Tuning Spec for Distillation. */
11403
11745
  distillationSpec?: DistillationSpec;
11746
+ reinforcementTuningSpec?: ReinforcementTuningSpec;
11404
11747
  /** Output only. The tuning data statistics associated with this TuningJob. */
11405
11748
  tuningDataStats?: TuningDataStats;
11406
11749
  /** 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. */
@@ -11485,7 +11828,11 @@ export declare enum TuningMethod {
11485
11828
  /**
11486
11829
  * Distillation tuning.
11487
11830
  */
11488
- DISTILLATION = "DISTILLATION"
11831
+ DISTILLATION = "DISTILLATION",
11832
+ /**
11833
+ * Reinforcement tuning.
11834
+ */
11835
+ REINFORCEMENT_TUNING = "REINFORCEMENT_TUNING"
11489
11836
  }
11490
11837
 
11491
11838
  /** Tuning mode. This enum is not supported in Gemini API. */
@@ -11572,6 +11919,7 @@ declare class Tunings extends BaseModule {
11572
11919
  cancel(params: types.CancelTuningJobParameters): Promise<types.CancelTuningJobResponse>;
11573
11920
  private tuneInternal;
11574
11921
  private tuneMldevInternal;
11922
+ validateReward(params: types.ValidateRewardParameters): Promise<types.ValidateRewardResponse>;
11575
11923
  }
11576
11924
 
11577
11925
  /** The speed of the tuning job. Only supported for Veo 3.0 models. This enum is not supported in Gemini API. */
@@ -11813,13 +12161,13 @@ declare namespace types {
11813
12161
  PhishBlockThreshold,
11814
12162
  Behavior,
11815
12163
  DynamicRetrievalConfigMode,
11816
- FunctionCallingConfigMode,
11817
12164
  ThinkingLevel,
11818
12165
  PersonGeneration,
11819
12166
  ProminentPeople,
11820
12167
  HarmCategory,
11821
12168
  HarmBlockMethod,
11822
12169
  HarmBlockThreshold,
12170
+ FunctionCallingConfigMode,
11823
12171
  FinishReason,
11824
12172
  HarmProbability,
11825
12173
  HarmSeverity,
@@ -11856,6 +12204,9 @@ declare namespace types {
11856
12204
  VideoGenerationMaskMode,
11857
12205
  VideoCompressionQuality,
11858
12206
  ImageResizeMode,
12207
+ ResponseParseType,
12208
+ MatchOperation,
12209
+ ReinforcementTuningThinkingLevel,
11859
12210
  TuningMethod,
11860
12211
  FileState,
11861
12212
  FileSource,
@@ -11930,10 +12281,6 @@ declare namespace types {
11930
12281
  StreamableHttpTransport,
11931
12282
  McpServer,
11932
12283
  Tool,
11933
- LatLng,
11934
- RetrievalConfig,
11935
- FunctionCallingConfig,
11936
- ToolConfig,
11937
12284
  ReplicatedVoiceConfig,
11938
12285
  PrebuiltVoiceConfig,
11939
12286
  VoiceConfig,
@@ -11948,6 +12295,10 @@ declare namespace types {
11948
12295
  GenerationConfigRoutingConfigManualRoutingMode,
11949
12296
  GenerationConfigRoutingConfig,
11950
12297
  SafetySetting,
12298
+ LatLng,
12299
+ RetrievalConfig,
12300
+ FunctionCallingConfig,
12301
+ ToolConfig,
11951
12302
  ModelArmorConfig,
11952
12303
  GenerateContentConfig,
11953
12304
  GenerateContentParameters,
@@ -12064,6 +12415,21 @@ declare namespace types {
12064
12415
  DistillationHyperParameters,
12065
12416
  DistillationSamplingSpec,
12066
12417
  DistillationSpec,
12418
+ AutoraterConfig,
12419
+ ReinforcementTuningParseResponseConfig,
12420
+ ReinforcementTuningAutoraterScorerParsedResponseConversionScorer,
12421
+ ReinforcementTuningAutoraterScorerExactMatchScorer,
12422
+ ReinforcementTuningAutoraterScorer,
12423
+ ReinforcementTuningCodeExecutionRewardScorer,
12424
+ ReinforcementTuningStringMatchRewardScorerStringMatchExpression,
12425
+ ReinforcementTuningStringMatchRewardScorerJsonMatchExpression,
12426
+ ReinforcementTuningStringMatchRewardScorer,
12427
+ ReinforcementTuningCloudRunRewardScorer,
12428
+ SingleReinforcementTuningRewardConfig,
12429
+ CompositeReinforcementTuningRewardConfigWeightedRewardConfig,
12430
+ CompositeReinforcementTuningRewardConfig,
12431
+ ReinforcementTuningHyperParameters,
12432
+ ReinforcementTuningSpec,
12067
12433
  GoogleRpcStatus,
12068
12434
  PreTunedModel,
12069
12435
  DatasetDistributionDistributionBucket,
@@ -12113,6 +12479,11 @@ declare namespace types {
12113
12479
  CreateTuningJobConfig,
12114
12480
  CreateTuningJobParametersPrivate,
12115
12481
  TuningOperation,
12482
+ ReinforcementTuningExample,
12483
+ ValidateRewardConfig,
12484
+ ValidateRewardParameters,
12485
+ ReinforcementTuningRewardInfo,
12486
+ ValidateRewardResponse,
12116
12487
  CreateCachedContentConfig,
12117
12488
  CreateCachedContentParameters,
12118
12489
  CachedContentUsageMetadata,
@@ -12250,7 +12621,7 @@ declare namespace types {
12250
12621
  LiveClientRealtimeInput,
12251
12622
  LiveClientToolResponse,
12252
12623
  LiveClientMessage,
12253
- StreamTranslationConfig,
12624
+ TranslationConfig,
12254
12625
  LiveConnectConfig,
12255
12626
  LiveConnectParameters,
12256
12627
  CreateChatParameters,
@@ -12911,6 +13282,53 @@ export declare enum VadSignalType {
12911
13282
  VAD_SIGNAL_TYPE_EOS = "VAD_SIGNAL_TYPE_EOS"
12912
13283
  }
12913
13284
 
13285
+ /** Optional parameters for tunings.validate_reward. */
13286
+ export declare interface ValidateRewardConfig {
13287
+ /** Used to override HTTP request options. */
13288
+ httpOptions?: HttpOptions;
13289
+ /** Abort signal which can be used to cancel the request.
13290
+
13291
+ NOTE: AbortSignal is a client-only operation. Using it to cancel an
13292
+ operation will not cancel the request in the service. You will still
13293
+ be charged usage for any applicable operations.
13294
+ */
13295
+ abortSignal?: AbortSignal;
13296
+ }
13297
+
13298
+ /** Parameters for the validate_reward method.
13299
+
13300
+ Validates a reinforcement tuning reward configuration against a sample
13301
+ response and example before creating a reinforcement tuning job. */
13302
+ export declare interface ValidateRewardParameters {
13303
+ /** Required. The resource name of the Location to validate the reward in, e.g. `projects/{project}/locations/{location}`. */
13304
+ parent: string;
13305
+ /** Required. The sample response for validating the reward configuration. */
13306
+ sampleResponse: Content;
13307
+ /** Required. The example to validate the reward configuration. */
13308
+ example: ReinforcementTuningExample;
13309
+ /** Single reward function configuration for reinforcement tuning. Mutually exclusive with composite_reward_config. */
13310
+ singleRewardConfig?: SingleReinforcementTuningRewardConfig;
13311
+ /** Composite reward function configuration for reinforcement tuning. Mutually exclusive with single_reward_config. */
13312
+ compositeRewardConfig?: CompositeReinforcementTuningRewardConfig;
13313
+ /** Optional parameters for the request. */
13314
+ config?: ValidateRewardConfig;
13315
+ }
13316
+
13317
+ /** Response for the validate_reward method.
13318
+
13319
+ Contains the computed reward for a reinforcement tuning reward
13320
+ configuration. */
13321
+ export declare class ValidateRewardResponse {
13322
+ /** Used to retain the full HTTP response. */
13323
+ sdkHttpResponse?: HttpResponse;
13324
+ /** 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. */
13325
+ overallReward?: number;
13326
+ /** Output only. In case of an error, this field will be populated with a detailed error message to help with debugging. */
13327
+ error?: string;
13328
+ /** A map from reward name to reward info. */
13329
+ rewardInfoDetails?: Record<string, ReinforcementTuningRewardInfo>;
13330
+ }
13331
+
12914
13332
  /** Hyperparameters for Veo. This data type is not supported in Gemini API. */
12915
13333
  export declare interface VeoHyperParameters {
12916
13334
  /** Optional. Number of complete passes the model makes over the entire training dataset during training. */