@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.
package/dist/web/web.d.ts CHANGED
@@ -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.
@@ -5640,7 +5630,7 @@ export declare interface GoogleGenAIOptions {
5640
5630
  export declare interface GoogleMaps {
5641
5631
  /** The authentication config to access the API. Only API key is supported. This field is not supported in Gemini API. */
5642
5632
  authConfig?: AuthConfig;
5643
- /** Optional. Whether to return a widget context token in the GroundingMetadata of the response. Developers can use the widget context token to render a Google Maps widget with geospatial context related to the places that the model references in the response. */
5633
+ /** Deprecated. The Google Maps contextual widget behavior in Grounding with Google Maps is being deprecated; this field is planned for removal and no longer has any effect once removed. Optional. Whether to return a widget context token in the GroundingMetadata of the response. */
5644
5634
  enableWidget?: boolean;
5645
5635
  }
5646
5636
 
@@ -7629,8 +7619,8 @@ export declare interface LiveConnectConfig {
7629
7619
  response.
7630
7620
  */
7631
7621
  safetySettings?: SafetySetting[];
7632
- /** Config for stream translation. */
7633
- streamTranslationConfig?: StreamTranslationConfig;
7622
+ /** Config for translation. */
7623
+ translationConfig?: TranslationConfig;
7634
7624
  }
7635
7625
 
7636
7626
  /** Config for LiveConnectConstraints for Auth Token creation. */
@@ -8183,6 +8173,26 @@ export declare enum MaskReferenceMode {
8183
8173
  MASK_MODE_SEMANTIC = "MASK_MODE_SEMANTIC"
8184
8174
  }
8185
8175
 
8176
+ /** Match operation to use for evaluation. */
8177
+ export declare enum MatchOperation {
8178
+ /**
8179
+ * Default value. This value is unused.
8180
+ */
8181
+ MATCH_OPERATION_UNSPECIFIED = "MATCH_OPERATION_UNSPECIFIED",
8182
+ /**
8183
+ * Equivalent to GoogleSQL `REGEX_CONTAINS(target, expression)`.
8184
+ */
8185
+ REGEX_CONTAINS = "REGEX_CONTAINS",
8186
+ /**
8187
+ * `expression` is a substring of target.
8188
+ */
8189
+ PARTIAL_MATCH = "PARTIAL_MATCH",
8190
+ /**
8191
+ * `expression` is an exact match of target.
8192
+ */
8193
+ EXACT_MATCH = "EXACT_MATCH"
8194
+ }
8195
+
8186
8196
  /** A MCPServer is a server that can be called by the model to perform actions. It is a server that implements the MCP protocol. Next ID: 6. This data type is not supported in Vertex AI. */
8187
8197
  export declare interface McpServer {
8188
8198
  /** The name of the MCPServer. */
@@ -9736,6 +9746,145 @@ export declare class RegisterFilesResponse {
9736
9746
  export declare interface ReinforcementTuningAutoraterScorer {
9737
9747
  /** Autorater config for evaluation. */
9738
9748
  autoraterConfig?: AutoraterConfig;
9749
+ /** Allows substituting `prompt`, `response`, `system_instruction` and `references.reference` (each wrapped in double curly braces) into the autorater prompt. */
9750
+ autoraterPrompt?: string;
9751
+ /** Parses autorater returned response. */
9752
+ autoraterResponseParseConfig?: ReinforcementTuningParseResponseConfig;
9753
+ /** Scores autorater responses by directly converting parsed autorater response to float reward. */
9754
+ parsedResponseConversionScorer?: ReinforcementTuningAutoraterScorerParsedResponseConversionScorer;
9755
+ /** Scores autorater responses by using exact string match reward scorer. */
9756
+ exactMatchScorer?: ReinforcementTuningAutoraterScorerExactMatchScorer;
9757
+ }
9758
+
9759
+ /** Scores autorater responses by using exact string match reward scorer. */
9760
+ export declare interface ReinforcementTuningAutoraterScorerExactMatchScorer {
9761
+ /** Assigns this reward score if parsed response string equals the expression. */
9762
+ correctAnswerReward?: number;
9763
+ /** Assigns this reward score if parsed reward value does not equal the expression. */
9764
+ wrongAnswerReward?: number;
9765
+ /** The string expression to match against. Supports substitution in the format of `references.reference` (wrapped in double curly braces) before matching. No regex support. */
9766
+ expression?: string;
9767
+ }
9768
+
9769
+ /** Scores responses by directly converting parsed autorater response to float reward (reward is clipped to be within [-1, 1]). */
9770
+ export declare class ReinforcementTuningAutoraterScorerParsedResponseConversionScorer {
9771
+ }
9772
+
9773
+ /** Scores parsed responses by calling a Cloud Run service. */
9774
+ export declare interface ReinforcementTuningCloudRunRewardScorer {
9775
+ /** URI of the Cloud Run service that will be used to compute the reward. The Vertex AI Secure Fine Tuning Service Agent (`service-PROJECT_NUMBER@gcp-sa-vertex-tune.iam.gserviceaccount.com`, where `PROJECT_NUMBER` is the numeric project number) must be granted the permission (e.g. by granting `roles/run.invoker` in IAM) to invoke the Cloud Run service. */
9776
+ cloudRunUri?: string;
9777
+ }
9778
+
9779
+ /** Scores parsed responses for code execution use cases. */
9780
+ export declare interface ReinforcementTuningCodeExecutionRewardScorer {
9781
+ /** Example python code snippet which assigns reward of 1 to answer matching user provided reference answer in per prompt references map. */
9782
+ pythonCodeSnippet?: string;
9783
+ }
9784
+
9785
+ /** User-facing format for Gemini Reinforcement Tuning examples on Vertex. */
9786
+ export declare interface ReinforcementTuningExample {
9787
+ /** Multi-turn contents that represents the Prompt. */
9788
+ contents?: Content[];
9789
+ /** References for the given prompt. The key is the name of the reference, and the value is the reference itself. */
9790
+ references?: Record<string, string>;
9791
+ /** Corresponds to `system_instruction` in user-facing GenerateContentRequest. */
9792
+ systemInstruction?: Content;
9793
+ }
9794
+
9795
+ /** Hyperparameters for Reinforcement Tuning. */
9796
+ export declare interface ReinforcementTuningHyperParameters {
9797
+ /** Number of training epochs for the tuning job. */
9798
+ epochCount?: string;
9799
+ /** Learning rate multiplier for Reinforcement Learning. */
9800
+ learningRateMultiplier?: number;
9801
+ /** Adapter size for Reinforcement Tuning. */
9802
+ adapterSize?: AdapterSize;
9803
+ /** Number of different responses to generate per prompt during tuning. */
9804
+ samplesPerPrompt?: number;
9805
+ /** Batch size for the tuning job. How many prompts to process at a train step. If not set, the batch size will be determined automatically. */
9806
+ batchSize?: number;
9807
+ /** How often (in steps) to evaluate the tuning job during training. If not set, evaluation will run per epoch. */
9808
+ evaluateInterval?: number;
9809
+ /** How often (in steps) to save checkpoints during training. If not set, one checkpoint per epoch will be saved. */
9810
+ checkpointInterval?: number;
9811
+ /** The maximum number of tokens to generate per prompt. If not set, defaults to 32768. */
9812
+ maxOutputTokens?: number;
9813
+ /** Indicates the maximum thinking depth. Use with earlier models shall result in error. */
9814
+ thinkingLevel?: ReinforcementTuningThinkingLevel;
9815
+ }
9816
+
9817
+ /** Defines how to parse sample response for reinforcement tuning. */
9818
+ export declare class ReinforcementTuningParseResponseConfig {
9819
+ /** Defines how to parse sample response. */
9820
+ parseType?: ResponseParseType;
9821
+ /** Defines the regex to extract the important part of sample response. This field is only used when `parse_type` is `REGEX_EXTRACT`. */
9822
+ regexExtractExpression?: string;
9823
+ }
9824
+
9825
+ /** The reward info for a reward function. */
9826
+ export declare interface ReinforcementTuningRewardInfo {
9827
+ /** Output only. The calculated reward for the reward function. */
9828
+ reward?: number;
9829
+ /** Output only. The user-requested auxiliary info for the reward function. */
9830
+ userRequestedAuxInfo?: string;
9831
+ }
9832
+
9833
+ /** Reinforcement tuning spec for tuning. */
9834
+ export declare interface ReinforcementTuningSpec {
9835
+ compositeRewardConfig?: CompositeReinforcementTuningRewardConfig;
9836
+ /** Cloud Storage path to file containing training dataset for tuning. The dataset must be formatted as a JSONL file. */
9837
+ trainingDatasetUri?: string;
9838
+ /** Cloud Storage path to file containing validation dataset for tuning. The dataset must be formatted as a JSONL file. If no validation dataset is provided, by default the API splits 25% of the training dataset or 50 examples, whichever is larger, as the validation dataset. */
9839
+ validationDatasetUri?: string;
9840
+ /** Additional hyper-parameters to use during tuning. */
9841
+ hyperParameters?: ReinforcementTuningHyperParameters;
9842
+ /** Single reward function configuration for reinforcement tuning. */
9843
+ singleRewardConfig?: SingleReinforcementTuningRewardConfig;
9844
+ }
9845
+
9846
+ /** Scores parsed responses for string matching use cases. */
9847
+ export declare interface ReinforcementTuningStringMatchRewardScorer {
9848
+ /** Wrong answer reward is returned if evaluator evaluates to `false`. All wrong answers get the same reward. */
9849
+ wrongAnswerReward?: number;
9850
+ /** Correct answer reward is returned if evaluator evaluates to `true`. All correct answers get the same reward. */
9851
+ correctAnswerReward?: number;
9852
+ /** Uses string match expression to evaluate parsed response. */
9853
+ stringMatchExpression?: ReinforcementTuningStringMatchRewardScorerStringMatchExpression;
9854
+ /** Uses json match expression to evaluate parsed response. */
9855
+ jsonMatchExpression?: ReinforcementTuningStringMatchRewardScorerJsonMatchExpression;
9856
+ }
9857
+
9858
+ /** Converts parsed responses to JSON format, finds the first-level matching key, then performs StringMatchExpression on the value. */
9859
+ export declare interface ReinforcementTuningStringMatchRewardScorerJsonMatchExpression {
9860
+ /** Json key name to find the value to match against. */
9861
+ keyName?: string;
9862
+ /** String match expression to match against the value of json key. */
9863
+ valueStringMatchExpression?: ReinforcementTuningStringMatchRewardScorerStringMatchExpression;
9864
+ }
9865
+
9866
+ /** Evaluates parsed response using match type against expression. */
9867
+ export declare interface ReinforcementTuningStringMatchRewardScorerStringMatchExpression {
9868
+ /** Match operation to use for evaluation. */
9869
+ matchOperation?: MatchOperation;
9870
+ /** String or regular expression to match against. Customer can also provide a references map (key/value pairs) whose value will be substituted into the expression by referencing `references.key_name` (wrapped in double curly braces). */
9871
+ expression?: string;
9872
+ }
9873
+
9874
+ /** Represents how much to think for the tuning job. */
9875
+ export declare enum ReinforcementTuningThinkingLevel {
9876
+ /**
9877
+ * Unspecified thinking level.
9878
+ */
9879
+ REINFORCEMENT_TUNING_THINKING_LEVEL_UNSPECIFIED = "REINFORCEMENT_TUNING_THINKING_LEVEL_UNSPECIFIED",
9880
+ /**
9881
+ * Little to no thinking.
9882
+ */
9883
+ MINIMAL = "MINIMAL",
9884
+ /**
9885
+ * High thinking level.
9886
+ */
9887
+ HIGH = "HIGH"
9739
9888
  }
9740
9889
 
9741
9890
  /** Represents a recorded session. */
@@ -9867,6 +10016,22 @@ export declare enum ResourceScope {
9867
10016
  COLLECTION = "COLLECTION"
9868
10017
  }
9869
10018
 
10019
+ /** Defines how to parse sample response. */
10020
+ export declare enum ResponseParseType {
10021
+ /**
10022
+ * Default value. This value is unused.
10023
+ */
10024
+ RESPONSE_PARSE_TYPE_UNSPECIFIED = "RESPONSE_PARSE_TYPE_UNSPECIFIED",
10025
+ /**
10026
+ * Use the sample response as is.
10027
+ */
10028
+ IDENTITY = "IDENTITY",
10029
+ /**
10030
+ * Use regex to extract the important part of sample response.
10031
+ */
10032
+ REGEX_EXTRACT = "REGEX_EXTRACT"
10033
+ }
10034
+
9870
10035
  /** Defines a retrieval tool that model can call to access external knowledge. This data type is not supported in Gemini API. */
9871
10036
  export declare interface Retrieval {
9872
10037
  /** Optional. Deprecated. This option is no longer supported. */
@@ -10399,7 +10564,18 @@ export declare class SingleEmbedContentResponse {
10399
10564
 
10400
10565
  /** Single reinforcement tuning reward config. */
10401
10566
  export declare interface SingleReinforcementTuningRewardConfig {
10567
+ /** Scores parsed responses for autorater use cases by using a model to compute the reward. */
10402
10568
  autoraterScorer?: ReinforcementTuningAutoraterScorer;
10569
+ /** A unique reward name used to identify each single reinforcement tuning reward. */
10570
+ rewardName?: string;
10571
+ /** Defines how to parse sample response. */
10572
+ parseResponseConfig?: ReinforcementTuningParseResponseConfig;
10573
+ /** Scores parsed responses for code execution use cases. */
10574
+ codeExecutionRewardScorer?: ReinforcementTuningCodeExecutionRewardScorer;
10575
+ /** Scores parsed responses for simple string matching use cases against reference answer without writing python code. */
10576
+ stringMatchRewardScorer?: ReinforcementTuningStringMatchRewardScorer;
10577
+ /** Scores parsed responses by calling a Cloud Run service. */
10578
+ cloudRunRewardScorer?: ReinforcementTuningCloudRunRewardScorer;
10403
10579
  }
10404
10580
 
10405
10581
  /** Context window will be truncated by keeping only suffix of it.
@@ -10793,17 +10969,6 @@ export declare interface StreamableHttpTransport {
10793
10969
  url?: string;
10794
10970
  }
10795
10971
 
10796
- /** Config for stream translation. */
10797
- export declare interface StreamTranslationConfig {
10798
- /** If true, the model will generate audio when the target language is
10799
- spoken, essentially it will parrot the input. If false, we will not produce
10800
- audio for the target language. */
10801
- echoTargetLanguage?: boolean;
10802
- /** The target language for translation. Supported values are BCP-47
10803
- language codes (e.g. "en", "es", "fr"). */
10804
- targetLanguageCode?: string;
10805
- }
10806
-
10807
10972
  /** User provided string values assigned to a single metadata key. This data type is not supported in Vertex AI. */
10808
10973
  export declare interface StringList {
10809
10974
  /** The string values of the metadata to store. */
@@ -11462,6 +11627,19 @@ export declare interface Transcription {
11462
11627
  text?: string;
11463
11628
  /** Optional. The bool indicates the end of the transcription. */
11464
11629
  finished?: boolean;
11630
+ /** The BCP-47 language code of the transcription. */
11631
+ languageCode?: string;
11632
+ }
11633
+
11634
+ /** Config for stream translation. */
11635
+ export declare interface TranslationConfig {
11636
+ /** If true, the model will generate audio when the target language is
11637
+ spoken, essentially it will parrot the input. If false, we will not produce
11638
+ audio for the target language. */
11639
+ echoTargetLanguage?: boolean;
11640
+ /** The target language for translation. Supported values are BCP-47
11641
+ language codes (e.g. "en", "es", "fr"). */
11642
+ targetLanguageCode?: string;
11465
11643
  }
11466
11644
 
11467
11645
  /** TunedModel for the Tuned Model of a Tuning Job. */
@@ -11570,6 +11748,7 @@ export declare interface TuningJob {
11570
11748
  preferenceOptimizationSpec?: PreferenceOptimizationSpec;
11571
11749
  /** Tuning Spec for Distillation. */
11572
11750
  distillationSpec?: DistillationSpec;
11751
+ reinforcementTuningSpec?: ReinforcementTuningSpec;
11573
11752
  /** Output only. The tuning data statistics associated with this TuningJob. */
11574
11753
  tuningDataStats?: TuningDataStats;
11575
11754
  /** Customer-managed encryption key options for a TuningJob. If this is set, then all resources created by the TuningJob will be encrypted with the provided encryption key. */
@@ -11745,6 +11924,7 @@ declare class Tunings extends BaseModule {
11745
11924
  cancel(params: types.CancelTuningJobParameters): Promise<types.CancelTuningJobResponse>;
11746
11925
  private tuneInternal;
11747
11926
  private tuneMldevInternal;
11927
+ validateReward(params: types.ValidateRewardParameters): Promise<types.ValidateRewardResponse>;
11748
11928
  }
11749
11929
 
11750
11930
  /** The speed of the tuning job. Only supported for Veo 3.0 models. This enum is not supported in Gemini API. */
@@ -12029,6 +12209,9 @@ declare namespace types {
12029
12209
  VideoGenerationMaskMode,
12030
12210
  VideoCompressionQuality,
12031
12211
  ImageResizeMode,
12212
+ ResponseParseType,
12213
+ MatchOperation,
12214
+ ReinforcementTuningThinkingLevel,
12032
12215
  TuningMethod,
12033
12216
  FileState,
12034
12217
  FileSource,
@@ -12237,6 +12420,21 @@ declare namespace types {
12237
12420
  DistillationHyperParameters,
12238
12421
  DistillationSamplingSpec,
12239
12422
  DistillationSpec,
12423
+ AutoraterConfig,
12424
+ ReinforcementTuningParseResponseConfig,
12425
+ ReinforcementTuningAutoraterScorerParsedResponseConversionScorer,
12426
+ ReinforcementTuningAutoraterScorerExactMatchScorer,
12427
+ ReinforcementTuningAutoraterScorer,
12428
+ ReinforcementTuningCodeExecutionRewardScorer,
12429
+ ReinforcementTuningStringMatchRewardScorerStringMatchExpression,
12430
+ ReinforcementTuningStringMatchRewardScorerJsonMatchExpression,
12431
+ ReinforcementTuningStringMatchRewardScorer,
12432
+ ReinforcementTuningCloudRunRewardScorer,
12433
+ SingleReinforcementTuningRewardConfig,
12434
+ CompositeReinforcementTuningRewardConfigWeightedRewardConfig,
12435
+ CompositeReinforcementTuningRewardConfig,
12436
+ ReinforcementTuningHyperParameters,
12437
+ ReinforcementTuningSpec,
12240
12438
  GoogleRpcStatus,
12241
12439
  PreTunedModel,
12242
12440
  DatasetDistributionDistributionBucket,
@@ -12283,14 +12481,14 @@ declare namespace types {
12283
12481
  TuningExample,
12284
12482
  TuningDataset,
12285
12483
  TuningValidationDataset,
12286
- AutoraterConfig,
12287
- ReinforcementTuningAutoraterScorer,
12288
- SingleReinforcementTuningRewardConfig,
12289
- CompositeReinforcementTuningRewardConfigWeightedRewardConfig,
12290
- CompositeReinforcementTuningRewardConfig,
12291
12484
  CreateTuningJobConfig,
12292
12485
  CreateTuningJobParametersPrivate,
12293
12486
  TuningOperation,
12487
+ ReinforcementTuningExample,
12488
+ ValidateRewardConfig,
12489
+ ValidateRewardParameters,
12490
+ ReinforcementTuningRewardInfo,
12491
+ ValidateRewardResponse,
12294
12492
  CreateCachedContentConfig,
12295
12493
  CreateCachedContentParameters,
12296
12494
  CachedContentUsageMetadata,
@@ -12428,7 +12626,7 @@ declare namespace types {
12428
12626
  LiveClientRealtimeInput,
12429
12627
  LiveClientToolResponse,
12430
12628
  LiveClientMessage,
12431
- StreamTranslationConfig,
12629
+ TranslationConfig,
12432
12630
  LiveConnectConfig,
12433
12631
  LiveConnectParameters,
12434
12632
  CreateChatParameters,
@@ -13089,6 +13287,53 @@ export declare enum VadSignalType {
13089
13287
  VAD_SIGNAL_TYPE_EOS = "VAD_SIGNAL_TYPE_EOS"
13090
13288
  }
13091
13289
 
13290
+ /** Optional parameters for tunings.validate_reward. */
13291
+ export declare interface ValidateRewardConfig {
13292
+ /** Used to override HTTP request options. */
13293
+ httpOptions?: HttpOptions;
13294
+ /** Abort signal which can be used to cancel the request.
13295
+
13296
+ NOTE: AbortSignal is a client-only operation. Using it to cancel an
13297
+ operation will not cancel the request in the service. You will still
13298
+ be charged usage for any applicable operations.
13299
+ */
13300
+ abortSignal?: AbortSignal;
13301
+ }
13302
+
13303
+ /** Parameters for the validate_reward method.
13304
+
13305
+ Validates a reinforcement tuning reward configuration against a sample
13306
+ response and example before creating a reinforcement tuning job. */
13307
+ export declare interface ValidateRewardParameters {
13308
+ /** Required. The resource name of the Location to validate the reward in, e.g. `projects/{project}/locations/{location}`. */
13309
+ parent: string;
13310
+ /** Required. The sample response for validating the reward configuration. */
13311
+ sampleResponse: Content;
13312
+ /** Required. The example to validate the reward configuration. */
13313
+ example: ReinforcementTuningExample;
13314
+ /** Single reward function configuration for reinforcement tuning. Mutually exclusive with composite_reward_config. */
13315
+ singleRewardConfig?: SingleReinforcementTuningRewardConfig;
13316
+ /** Composite reward function configuration for reinforcement tuning. Mutually exclusive with single_reward_config. */
13317
+ compositeRewardConfig?: CompositeReinforcementTuningRewardConfig;
13318
+ /** Optional parameters for the request. */
13319
+ config?: ValidateRewardConfig;
13320
+ }
13321
+
13322
+ /** Response for the validate_reward method.
13323
+
13324
+ Contains the computed reward for a reinforcement tuning reward
13325
+ configuration. */
13326
+ export declare class ValidateRewardResponse {
13327
+ /** Used to retain the full HTTP response. */
13328
+ sdkHttpResponse?: HttpResponse;
13329
+ /** Output only. The overall weighted reward. For a `CompositeReinforcementTuningRewardConfig`, this is the weighted average of all rewards. For a `SingleReinforcementTuningRewardConfig`, this will be the value of the single reward. */
13330
+ overallReward?: number;
13331
+ /** Output only. In case of an error, this field will be populated with a detailed error message to help with debugging. */
13332
+ error?: string;
13333
+ /** A map from reward name to reward info. */
13334
+ rewardInfoDetails?: Record<string, ReinforcementTuningRewardInfo>;
13335
+ }
13336
+
13092
13337
  /** Hyperparameters for Veo. This data type is not supported in Gemini API. */
13093
13338
  export declare interface VeoHyperParameters {
13094
13339
  /** Optional. Number of complete passes the model makes over the entire training dataset during training. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@google/genai",
3
- "version": "2.7.0",
3
+ "version": "2.8.0",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "dist/node/index.mjs",