@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/genai.d.ts +292 -47
- package/dist/index.cjs +432 -64
- package/dist/index.mjs +430 -65
- package/dist/index.mjs.map +1 -1
- package/dist/node/index.cjs +432 -64
- package/dist/node/index.mjs +430 -65
- package/dist/node/index.mjs.map +1 -1
- package/dist/node/node.d.ts +292 -47
- package/dist/tokenizer/node.cjs +53 -1
- package/dist/tokenizer/node.d.ts +14 -28
- package/dist/tokenizer/node.mjs +53 -1
- package/dist/tokenizer/node.mjs.map +1 -1
- package/dist/vertex_internal/index.cjs +54 -2
- package/dist/vertex_internal/index.cjs.map +1 -1
- package/dist/vertex_internal/index.d.ts +291 -47
- package/dist/vertex_internal/index.js +54 -2
- package/dist/vertex_internal/index.js.map +1 -1
- package/dist/web/index.mjs +430 -65
- package/dist/web/index.mjs.map +1 -1
- package/dist/web/web.d.ts +292 -47
- package/package.json +1 -1
package/dist/genai.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
|
-
/**
|
|
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
|
|
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
|
-
/**
|
|
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.
|
|
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
|
-
/**
|
|
4497
|
+
/** Inline media bytes. */
|
|
4508
4498
|
inlineData?: FunctionResponseBlob;
|
|
4509
|
-
/**
|
|
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.
|
|
@@ -5635,7 +5625,7 @@ export declare interface GoogleGenAIOptions {
|
|
|
5635
5625
|
export declare interface GoogleMaps {
|
|
5636
5626
|
/** The authentication config to access the API. Only API key is supported. This field is not supported in Gemini API. */
|
|
5637
5627
|
authConfig?: AuthConfig;
|
|
5638
|
-
/**
|
|
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. */
|
|
5639
5629
|
enableWidget?: boolean;
|
|
5640
5630
|
}
|
|
5641
5631
|
|
|
@@ -7624,8 +7614,8 @@ export declare interface LiveConnectConfig {
|
|
|
7624
7614
|
response.
|
|
7625
7615
|
*/
|
|
7626
7616
|
safetySettings?: SafetySetting[];
|
|
7627
|
-
/** Config for
|
|
7628
|
-
|
|
7617
|
+
/** Config for translation. */
|
|
7618
|
+
translationConfig?: TranslationConfig;
|
|
7629
7619
|
}
|
|
7630
7620
|
|
|
7631
7621
|
/** Config for LiveConnectConstraints for Auth Token creation. */
|
|
@@ -8178,6 +8168,26 @@ export declare enum MaskReferenceMode {
|
|
|
8178
8168
|
MASK_MODE_SEMANTIC = "MASK_MODE_SEMANTIC"
|
|
8179
8169
|
}
|
|
8180
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
|
+
|
|
8181
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. */
|
|
8182
8192
|
export declare interface McpServer {
|
|
8183
8193
|
/** The name of the MCPServer. */
|
|
@@ -9731,6 +9741,145 @@ export declare class RegisterFilesResponse {
|
|
|
9731
9741
|
export declare interface ReinforcementTuningAutoraterScorer {
|
|
9732
9742
|
/** Autorater config for evaluation. */
|
|
9733
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"
|
|
9734
9883
|
}
|
|
9735
9884
|
|
|
9736
9885
|
/** Represents a recorded session. */
|
|
@@ -9862,6 +10011,22 @@ export declare enum ResourceScope {
|
|
|
9862
10011
|
COLLECTION = "COLLECTION"
|
|
9863
10012
|
}
|
|
9864
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
|
+
|
|
9865
10030
|
/** Defines a retrieval tool that model can call to access external knowledge. This data type is not supported in Gemini API. */
|
|
9866
10031
|
export declare interface Retrieval {
|
|
9867
10032
|
/** Optional. Deprecated. This option is no longer supported. */
|
|
@@ -10394,7 +10559,18 @@ export declare class SingleEmbedContentResponse {
|
|
|
10394
10559
|
|
|
10395
10560
|
/** Single reinforcement tuning reward config. */
|
|
10396
10561
|
export declare interface SingleReinforcementTuningRewardConfig {
|
|
10562
|
+
/** Scores parsed responses for autorater use cases by using a model to compute the reward. */
|
|
10397
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;
|
|
10398
10574
|
}
|
|
10399
10575
|
|
|
10400
10576
|
/** Context window will be truncated by keeping only suffix of it.
|
|
@@ -10788,17 +10964,6 @@ export declare interface StreamableHttpTransport {
|
|
|
10788
10964
|
url?: string;
|
|
10789
10965
|
}
|
|
10790
10966
|
|
|
10791
|
-
/** Config for stream translation. */
|
|
10792
|
-
export declare interface StreamTranslationConfig {
|
|
10793
|
-
/** If true, the model will generate audio when the target language is
|
|
10794
|
-
spoken, essentially it will parrot the input. If false, we will not produce
|
|
10795
|
-
audio for the target language. */
|
|
10796
|
-
echoTargetLanguage?: boolean;
|
|
10797
|
-
/** The target language for translation. Supported values are BCP-47
|
|
10798
|
-
language codes (e.g. "en", "es", "fr"). */
|
|
10799
|
-
targetLanguageCode?: string;
|
|
10800
|
-
}
|
|
10801
|
-
|
|
10802
10967
|
/** User provided string values assigned to a single metadata key. This data type is not supported in Vertex AI. */
|
|
10803
10968
|
export declare interface StringList {
|
|
10804
10969
|
/** The string values of the metadata to store. */
|
|
@@ -11457,6 +11622,19 @@ export declare interface Transcription {
|
|
|
11457
11622
|
text?: string;
|
|
11458
11623
|
/** Optional. The bool indicates the end of the transcription. */
|
|
11459
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;
|
|
11460
11638
|
}
|
|
11461
11639
|
|
|
11462
11640
|
/** TunedModel for the Tuned Model of a Tuning Job. */
|
|
@@ -11565,6 +11743,7 @@ export declare interface TuningJob {
|
|
|
11565
11743
|
preferenceOptimizationSpec?: PreferenceOptimizationSpec;
|
|
11566
11744
|
/** Tuning Spec for Distillation. */
|
|
11567
11745
|
distillationSpec?: DistillationSpec;
|
|
11746
|
+
reinforcementTuningSpec?: ReinforcementTuningSpec;
|
|
11568
11747
|
/** Output only. The tuning data statistics associated with this TuningJob. */
|
|
11569
11748
|
tuningDataStats?: TuningDataStats;
|
|
11570
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. */
|
|
@@ -11740,6 +11919,7 @@ declare class Tunings extends BaseModule {
|
|
|
11740
11919
|
cancel(params: types.CancelTuningJobParameters): Promise<types.CancelTuningJobResponse>;
|
|
11741
11920
|
private tuneInternal;
|
|
11742
11921
|
private tuneMldevInternal;
|
|
11922
|
+
validateReward(params: types.ValidateRewardParameters): Promise<types.ValidateRewardResponse>;
|
|
11743
11923
|
}
|
|
11744
11924
|
|
|
11745
11925
|
/** The speed of the tuning job. Only supported for Veo 3.0 models. This enum is not supported in Gemini API. */
|
|
@@ -12024,6 +12204,9 @@ declare namespace types {
|
|
|
12024
12204
|
VideoGenerationMaskMode,
|
|
12025
12205
|
VideoCompressionQuality,
|
|
12026
12206
|
ImageResizeMode,
|
|
12207
|
+
ResponseParseType,
|
|
12208
|
+
MatchOperation,
|
|
12209
|
+
ReinforcementTuningThinkingLevel,
|
|
12027
12210
|
TuningMethod,
|
|
12028
12211
|
FileState,
|
|
12029
12212
|
FileSource,
|
|
@@ -12232,6 +12415,21 @@ declare namespace types {
|
|
|
12232
12415
|
DistillationHyperParameters,
|
|
12233
12416
|
DistillationSamplingSpec,
|
|
12234
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,
|
|
12235
12433
|
GoogleRpcStatus,
|
|
12236
12434
|
PreTunedModel,
|
|
12237
12435
|
DatasetDistributionDistributionBucket,
|
|
@@ -12278,14 +12476,14 @@ declare namespace types {
|
|
|
12278
12476
|
TuningExample,
|
|
12279
12477
|
TuningDataset,
|
|
12280
12478
|
TuningValidationDataset,
|
|
12281
|
-
AutoraterConfig,
|
|
12282
|
-
ReinforcementTuningAutoraterScorer,
|
|
12283
|
-
SingleReinforcementTuningRewardConfig,
|
|
12284
|
-
CompositeReinforcementTuningRewardConfigWeightedRewardConfig,
|
|
12285
|
-
CompositeReinforcementTuningRewardConfig,
|
|
12286
12479
|
CreateTuningJobConfig,
|
|
12287
12480
|
CreateTuningJobParametersPrivate,
|
|
12288
12481
|
TuningOperation,
|
|
12482
|
+
ReinforcementTuningExample,
|
|
12483
|
+
ValidateRewardConfig,
|
|
12484
|
+
ValidateRewardParameters,
|
|
12485
|
+
ReinforcementTuningRewardInfo,
|
|
12486
|
+
ValidateRewardResponse,
|
|
12289
12487
|
CreateCachedContentConfig,
|
|
12290
12488
|
CreateCachedContentParameters,
|
|
12291
12489
|
CachedContentUsageMetadata,
|
|
@@ -12423,7 +12621,7 @@ declare namespace types {
|
|
|
12423
12621
|
LiveClientRealtimeInput,
|
|
12424
12622
|
LiveClientToolResponse,
|
|
12425
12623
|
LiveClientMessage,
|
|
12426
|
-
|
|
12624
|
+
TranslationConfig,
|
|
12427
12625
|
LiveConnectConfig,
|
|
12428
12626
|
LiveConnectParameters,
|
|
12429
12627
|
CreateChatParameters,
|
|
@@ -13084,6 +13282,53 @@ export declare enum VadSignalType {
|
|
|
13084
13282
|
VAD_SIGNAL_TYPE_EOS = "VAD_SIGNAL_TYPE_EOS"
|
|
13085
13283
|
}
|
|
13086
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
|
+
|
|
13087
13332
|
/** Hyperparameters for Veo. This data type is not supported in Gemini API. */
|
|
13088
13333
|
export declare interface VeoHyperParameters {
|
|
13089
13334
|
/** Optional. Number of complete passes the model makes over the entire training dataset during training. */
|