@google/genai 2.7.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.
@@ -2762,6 +2762,10 @@ export declare interface CreateTuningJobConfig {
2762
2762
  checkpointInterval?: number;
2763
2763
  /** The maximum number of tokens to generate per prompt. Reinforcement tuning only. */
2764
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;
2765
2769
  }
2766
2770
 
2767
2771
  /** Fine-tuning job creation parameters - optional fields. */
@@ -4451,14 +4455,13 @@ export declare interface FunctionDeclaration {
4451
4455
  behavior?: Behavior;
4452
4456
  }
4453
4457
 
4454
- /** 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. */
4455
4459
  export declare class FunctionResponse {
4456
- /** 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. */
4457
4461
  willContinue?: boolean;
4458
- /** 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. */
4459
4463
  scheduling?: FunctionResponseScheduling;
4460
- /** List of parts that constitute a function response. Each part may
4461
- have a different IANA MIME type. */
4464
+ /** Optional. Ordered `Parts` that constitute a function response. Parts may have different IANA MIME types. */
4462
4465
  parts?: FunctionResponsePart[];
4463
4466
  /** Optional. The id of the function call this response is for. Populated by the client to match the corresponding function call `id`. */
4464
4467
  id?: string;
@@ -4468,49 +4471,36 @@ export declare class FunctionResponse {
4468
4471
  response?: Record<string, unknown>;
4469
4472
  }
4470
4473
 
4471
- /** Raw media bytes for function response.
4472
-
4473
- Text should not be sent as raw bytes, use the FunctionResponse.response
4474
- field. */
4474
+ /** Raw media bytes for function response. Text should not be sent as raw bytes, use the 'text' field. */
4475
4475
  export declare class FunctionResponseBlob {
4476
4476
  /** Required. The IANA standard MIME type of the source data. */
4477
4477
  mimeType?: string;
4478
- /** Required. Inline media bytes.
4478
+ /** Required. Raw bytes.
4479
4479
  * @remarks Encoded as base64 string. */
4480
4480
  data?: string;
4481
- /** Optional. Display name of the blob.
4482
- 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. */
4483
4482
  displayName?: string;
4484
4483
  }
4485
4484
 
4486
- /** URI based data for function response. */
4485
+ /** URI based data for function response. This data type is not supported in Gemini API. */
4487
4486
  export declare class FunctionResponseFileData {
4488
4487
  /** Required. URI. */
4489
4488
  fileUri?: string;
4490
4489
  /** Required. The IANA standard MIME type of the source data. */
4491
4490
  mimeType?: string;
4492
- /** Optional. Display name of the file.
4493
- 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. */
4494
4492
  displayName?: string;
4495
4493
  }
4496
4494
 
4497
- /** A datatype containing media that is part of a `FunctionResponse` message.
4498
-
4499
- A `FunctionResponsePart` consists of data which has an associated datatype. A
4500
- `FunctionResponsePart` can only contain one of the accepted types in
4501
- `FunctionResponsePart.data`.
4502
-
4503
- A `FunctionResponsePart` must have a fixed IANA MIME type identifying the
4504
- type and subtype of the media if the `inline_data` field is filled with raw
4505
- 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. */
4506
4496
  export declare class FunctionResponsePart {
4507
- /** Optional. Inline media bytes. */
4497
+ /** Inline media bytes. */
4508
4498
  inlineData?: FunctionResponseBlob;
4509
- /** Optional. URI based data. */
4499
+ /** URI based data. This field is not supported in Gemini API. */
4510
4500
  fileData?: FunctionResponseFileData;
4511
4501
  }
4512
4502
 
4513
- /** 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. */
4514
4504
  export declare enum FunctionResponseScheduling {
4515
4505
  /**
4516
4506
  * This value is unused.
@@ -5647,7 +5637,7 @@ export declare interface GoogleGenAIOptions {
5647
5637
  export declare interface GoogleMaps {
5648
5638
  /** The authentication config to access the API. Only API key is supported. This field is not supported in Gemini API. */
5649
5639
  authConfig?: AuthConfig;
5650
- /** 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. */
5651
5641
  enableWidget?: boolean;
5652
5642
  }
5653
5643
 
@@ -7636,8 +7626,8 @@ export declare interface LiveConnectConfig {
7636
7626
  response.
7637
7627
  */
7638
7628
  safetySettings?: SafetySetting[];
7639
- /** Config for stream translation. */
7640
- streamTranslationConfig?: StreamTranslationConfig;
7629
+ /** Config for translation. */
7630
+ translationConfig?: TranslationConfig;
7641
7631
  }
7642
7632
 
7643
7633
  /** Config for LiveConnectConstraints for Auth Token creation. */
@@ -8190,6 +8180,26 @@ export declare enum MaskReferenceMode {
8190
8180
  MASK_MODE_SEMANTIC = "MASK_MODE_SEMANTIC"
8191
8181
  }
8192
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
+
8193
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. */
8194
8204
  export declare interface McpServer {
8195
8205
  /** The name of the MCPServer. */
@@ -9743,6 +9753,145 @@ export declare class RegisterFilesResponse {
9743
9753
  export declare interface ReinforcementTuningAutoraterScorer {
9744
9754
  /** Autorater config for evaluation. */
9745
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"
9746
9895
  }
9747
9896
 
9748
9897
  /** Represents a recorded session. */
@@ -9874,6 +10023,22 @@ export declare enum ResourceScope {
9874
10023
  COLLECTION = "COLLECTION"
9875
10024
  }
9876
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
+
9877
10042
  /** Defines a retrieval tool that model can call to access external knowledge. This data type is not supported in Gemini API. */
9878
10043
  export declare interface Retrieval {
9879
10044
  /** Optional. Deprecated. This option is no longer supported. */
@@ -10406,7 +10571,18 @@ export declare class SingleEmbedContentResponse {
10406
10571
 
10407
10572
  /** Single reinforcement tuning reward config. */
10408
10573
  export declare interface SingleReinforcementTuningRewardConfig {
10574
+ /** Scores parsed responses for autorater use cases by using a model to compute the reward. */
10409
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;
10410
10586
  }
10411
10587
 
10412
10588
  /** Context window will be truncated by keeping only suffix of it.
@@ -10800,17 +10976,6 @@ export declare interface StreamableHttpTransport {
10800
10976
  url?: string;
10801
10977
  }
10802
10978
 
10803
- /** Config for stream translation. */
10804
- export declare interface StreamTranslationConfig {
10805
- /** If true, the model will generate audio when the target language is
10806
- spoken, essentially it will parrot the input. If false, we will not produce
10807
- audio for the target language. */
10808
- echoTargetLanguage?: boolean;
10809
- /** The target language for translation. Supported values are BCP-47
10810
- language codes (e.g. "en", "es", "fr"). */
10811
- targetLanguageCode?: string;
10812
- }
10813
-
10814
10979
  /** User provided string values assigned to a single metadata key. This data type is not supported in Vertex AI. */
10815
10980
  export declare interface StringList {
10816
10981
  /** The string values of the metadata to store. */
@@ -11469,6 +11634,19 @@ export declare interface Transcription {
11469
11634
  text?: string;
11470
11635
  /** Optional. The bool indicates the end of the transcription. */
11471
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;
11472
11650
  }
11473
11651
 
11474
11652
  /** TunedModel for the Tuned Model of a Tuning Job. */
@@ -11577,6 +11755,7 @@ export declare interface TuningJob {
11577
11755
  preferenceOptimizationSpec?: PreferenceOptimizationSpec;
11578
11756
  /** Tuning Spec for Distillation. */
11579
11757
  distillationSpec?: DistillationSpec;
11758
+ reinforcementTuningSpec?: ReinforcementTuningSpec;
11580
11759
  /** Output only. The tuning data statistics associated with this TuningJob. */
11581
11760
  tuningDataStats?: TuningDataStats;
11582
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. */
@@ -11752,6 +11931,7 @@ declare class Tunings extends BaseModule {
11752
11931
  cancel(params: types.CancelTuningJobParameters): Promise<types.CancelTuningJobResponse>;
11753
11932
  private tuneInternal;
11754
11933
  private tuneMldevInternal;
11934
+ validateReward(params: types.ValidateRewardParameters): Promise<types.ValidateRewardResponse>;
11755
11935
  }
11756
11936
 
11757
11937
  /** The speed of the tuning job. Only supported for Veo 3.0 models. This enum is not supported in Gemini API. */
@@ -12036,6 +12216,9 @@ declare namespace types {
12036
12216
  VideoGenerationMaskMode,
12037
12217
  VideoCompressionQuality,
12038
12218
  ImageResizeMode,
12219
+ ResponseParseType,
12220
+ MatchOperation,
12221
+ ReinforcementTuningThinkingLevel,
12039
12222
  TuningMethod,
12040
12223
  FileState,
12041
12224
  FileSource,
@@ -12244,6 +12427,21 @@ declare namespace types {
12244
12427
  DistillationHyperParameters,
12245
12428
  DistillationSamplingSpec,
12246
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,
12247
12445
  GoogleRpcStatus,
12248
12446
  PreTunedModel,
12249
12447
  DatasetDistributionDistributionBucket,
@@ -12290,14 +12488,14 @@ declare namespace types {
12290
12488
  TuningExample,
12291
12489
  TuningDataset,
12292
12490
  TuningValidationDataset,
12293
- AutoraterConfig,
12294
- ReinforcementTuningAutoraterScorer,
12295
- SingleReinforcementTuningRewardConfig,
12296
- CompositeReinforcementTuningRewardConfigWeightedRewardConfig,
12297
- CompositeReinforcementTuningRewardConfig,
12298
12491
  CreateTuningJobConfig,
12299
12492
  CreateTuningJobParametersPrivate,
12300
12493
  TuningOperation,
12494
+ ReinforcementTuningExample,
12495
+ ValidateRewardConfig,
12496
+ ValidateRewardParameters,
12497
+ ReinforcementTuningRewardInfo,
12498
+ ValidateRewardResponse,
12301
12499
  CreateCachedContentConfig,
12302
12500
  CreateCachedContentParameters,
12303
12501
  CachedContentUsageMetadata,
@@ -12435,7 +12633,7 @@ declare namespace types {
12435
12633
  LiveClientRealtimeInput,
12436
12634
  LiveClientToolResponse,
12437
12635
  LiveClientMessage,
12438
- StreamTranslationConfig,
12636
+ TranslationConfig,
12439
12637
  LiveConnectConfig,
12440
12638
  LiveConnectParameters,
12441
12639
  CreateChatParameters,
@@ -13096,6 +13294,53 @@ export declare enum VadSignalType {
13096
13294
  VAD_SIGNAL_TYPE_EOS = "VAD_SIGNAL_TYPE_EOS"
13097
13295
  }
13098
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
+
13099
13344
  /** Hyperparameters for Veo. This data type is not supported in Gemini API. */
13100
13345
  export declare interface VeoHyperParameters {
13101
13346
  /** Optional. Number of complete passes the model makes over the entire training dataset during training. */
@@ -65,7 +65,7 @@ var Language;
65
65
  */
66
66
  Language["PYTHON"] = "PYTHON";
67
67
  })(Language || (Language = {}));
68
- /** Specifies how the response should be scheduled in the conversation. */
68
+ /** Specifies how the response should be scheduled in the conversation. Only applicable to NON_BLOCKING function calls, is ignored otherwise. Defaults to WHEN_IDLE. */
69
69
  var FunctionResponseScheduling;
70
70
  (function (FunctionResponseScheduling) {
71
71
  /**
@@ -1261,6 +1261,58 @@ var ImageResizeMode;
1261
1261
  */
1262
1262
  ImageResizeMode["PAD"] = "PAD";
1263
1263
  })(ImageResizeMode || (ImageResizeMode = {}));
1264
+ /** Defines how to parse sample response. */
1265
+ var ResponseParseType;
1266
+ (function (ResponseParseType) {
1267
+ /**
1268
+ * Default value. This value is unused.
1269
+ */
1270
+ ResponseParseType["RESPONSE_PARSE_TYPE_UNSPECIFIED"] = "RESPONSE_PARSE_TYPE_UNSPECIFIED";
1271
+ /**
1272
+ * Use the sample response as is.
1273
+ */
1274
+ ResponseParseType["IDENTITY"] = "IDENTITY";
1275
+ /**
1276
+ * Use regex to extract the important part of sample response.
1277
+ */
1278
+ ResponseParseType["REGEX_EXTRACT"] = "REGEX_EXTRACT";
1279
+ })(ResponseParseType || (ResponseParseType = {}));
1280
+ /** Match operation to use for evaluation. */
1281
+ var MatchOperation;
1282
+ (function (MatchOperation) {
1283
+ /**
1284
+ * Default value. This value is unused.
1285
+ */
1286
+ MatchOperation["MATCH_OPERATION_UNSPECIFIED"] = "MATCH_OPERATION_UNSPECIFIED";
1287
+ /**
1288
+ * Equivalent to GoogleSQL `REGEX_CONTAINS(target, expression)`.
1289
+ */
1290
+ MatchOperation["REGEX_CONTAINS"] = "REGEX_CONTAINS";
1291
+ /**
1292
+ * `expression` is a substring of target.
1293
+ */
1294
+ MatchOperation["PARTIAL_MATCH"] = "PARTIAL_MATCH";
1295
+ /**
1296
+ * `expression` is an exact match of target.
1297
+ */
1298
+ MatchOperation["EXACT_MATCH"] = "EXACT_MATCH";
1299
+ })(MatchOperation || (MatchOperation = {}));
1300
+ /** Represents how much to think for the tuning job. */
1301
+ var ReinforcementTuningThinkingLevel;
1302
+ (function (ReinforcementTuningThinkingLevel) {
1303
+ /**
1304
+ * Unspecified thinking level.
1305
+ */
1306
+ ReinforcementTuningThinkingLevel["REINFORCEMENT_TUNING_THINKING_LEVEL_UNSPECIFIED"] = "REINFORCEMENT_TUNING_THINKING_LEVEL_UNSPECIFIED";
1307
+ /**
1308
+ * Little to no thinking.
1309
+ */
1310
+ ReinforcementTuningThinkingLevel["MINIMAL"] = "MINIMAL";
1311
+ /**
1312
+ * High thinking level.
1313
+ */
1314
+ ReinforcementTuningThinkingLevel["HIGH"] = "HIGH";
1315
+ })(ReinforcementTuningThinkingLevel || (ReinforcementTuningThinkingLevel = {}));
1264
1316
  /** Enum representing the tuning method. */
1265
1317
  var TuningMethod;
1266
1318
  (function (TuningMethod) {
@@ -364,14 +364,13 @@ declare interface FunctionDeclaration {
364
364
  behavior?: Behavior;
365
365
  }
366
366
 
367
- /** A function response. */
367
+ /** 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. */
368
368
  declare class FunctionResponse {
369
- /** 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. */
369
+ /** 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. */
370
370
  willContinue?: boolean;
371
- /** Specifies how the response should be scheduled in the conversation. Only applicable to NON_BLOCKING function calls, is ignored otherwise. Defaults to WHEN_IDLE. */
371
+ /** 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. */
372
372
  scheduling?: FunctionResponseScheduling;
373
- /** List of parts that constitute a function response. Each part may
374
- have a different IANA MIME type. */
373
+ /** Optional. Ordered `Parts` that constitute a function response. Parts may have different IANA MIME types. */
375
374
  parts?: FunctionResponsePart[];
376
375
  /** Optional. The id of the function call this response is for. Populated by the client to match the corresponding function call `id`. */
377
376
  id?: string;
@@ -381,49 +380,36 @@ declare class FunctionResponse {
381
380
  response?: Record<string, unknown>;
382
381
  }
383
382
 
384
- /** Raw media bytes for function response.
385
-
386
- Text should not be sent as raw bytes, use the FunctionResponse.response
387
- field. */
383
+ /** Raw media bytes for function response. Text should not be sent as raw bytes, use the 'text' field. */
388
384
  declare class FunctionResponseBlob {
389
385
  /** Required. The IANA standard MIME type of the source data. */
390
386
  mimeType?: string;
391
- /** Required. Inline media bytes.
387
+ /** Required. Raw bytes.
392
388
  * @remarks Encoded as base64 string. */
393
389
  data?: string;
394
- /** Optional. Display name of the blob.
395
- Used to provide a label or filename to distinguish blobs. */
390
+ /** 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. */
396
391
  displayName?: string;
397
392
  }
398
393
 
399
- /** URI based data for function response. */
394
+ /** URI based data for function response. This data type is not supported in Gemini API. */
400
395
  declare class FunctionResponseFileData {
401
396
  /** Required. URI. */
402
397
  fileUri?: string;
403
398
  /** Required. The IANA standard MIME type of the source data. */
404
399
  mimeType?: string;
405
- /** Optional. Display name of the file.
406
- Used to provide a label or filename to distinguish files. */
400
+ /** 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. */
407
401
  displayName?: string;
408
402
  }
409
403
 
410
- /** A datatype containing media that is part of a `FunctionResponse` message.
411
-
412
- A `FunctionResponsePart` consists of data which has an associated datatype. A
413
- `FunctionResponsePart` can only contain one of the accepted types in
414
- `FunctionResponsePart.data`.
415
-
416
- A `FunctionResponsePart` must have a fixed IANA MIME type identifying the
417
- type and subtype of the media if the `inline_data` field is filled with raw
418
- bytes. */
404
+ /** 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. */
419
405
  declare class FunctionResponsePart {
420
- /** Optional. Inline media bytes. */
406
+ /** Inline media bytes. */
421
407
  inlineData?: FunctionResponseBlob;
422
- /** Optional. URI based data. */
408
+ /** URI based data. This field is not supported in Gemini API. */
423
409
  fileData?: FunctionResponseFileData;
424
410
  }
425
411
 
426
- /** Specifies how the response should be scheduled in the conversation. */
412
+ /** Specifies how the response should be scheduled in the conversation. Only applicable to NON_BLOCKING function calls, is ignored otherwise. Defaults to WHEN_IDLE. */
427
413
  declare enum FunctionResponseScheduling {
428
414
  /**
429
415
  * This value is unused.
@@ -519,7 +505,7 @@ declare interface GenerationConfigRoutingConfigManualRoutingMode {
519
505
  declare interface GoogleMaps {
520
506
  /** The authentication config to access the API. Only API key is supported. This field is not supported in Gemini API. */
521
507
  authConfig?: AuthConfig;
522
- /** 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. */
508
+ /** 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. */
523
509
  enableWidget?: boolean;
524
510
  }
525
511