diff --git a/docs/genai.html b/docs/genai.html index 4536cb5a1..0a15c20c8 100644 --- a/docs/genai.html +++ b/docs/genai.html @@ -3879,7 +3879,7 @@
# Case 2: If LiveEphemeralParameters is set, lock all fields in
@@ -3887,7 +3887,7 @@ Submodules# example, changing `output_audio_transcription` in the Live API
# connection will be ignored by the API.
-auth_token = client.tokens.create(
+auth_token = client.auth_tokens.create(
config=types.CreateAuthTokenConfig(
uses=10,
live_constrained_parameters=types.LiveEphemeralParameters(
@@ -3904,7 +3904,7 @@ Submodules# empty, lock LiveConnectConfig with set fields (e.g.
# system_instruction in this example) when using the token in Live API
# sessions.
-auth_token = client.tokens.create(
+auth_token = client.auth_tokens.create(
config=types.CreateAuthTokenConfig(
uses=10,
live_constrained_parameters=types.LiveEphemeralParameters(
@@ -3921,7 +3921,7 @@ Submodules# set, lock LiveConnectConfig with set and additional fields (e.g.
# system_instruction, temperature in this example) when using the token
# in Live API sessions.
-auth_token = client.tokens.create(
+auth_token = client.auth_tokens.create(
config=types.CreateAuthTokenConfig(
uses=10,
live_constrained_parameters=types.LiveEphemeralParameters(
@@ -3999,6 +3999,38 @@ Submodules
+
+async validate_reward(*, parent, sample_response, example, single_reward_config=None, composite_reward_config=None, config=None)¶
+Validates a reinforcement tuning reward configuration.
+Allows users to validate a reinforcement tuning reward configuration
+against a sample response and example before creating a reinforcement
+tuning job, so that they can iterate on the reward configuration without
+having to create a tuning job each time.
+
+- Return type:
+-
+
+- Parameters:
+
+parent – The resource name of the Location to validate the reward in, e.g.
+projects/{project}/locations/{location}.
+sample_response – The sample response for validating the reward
+configuration.
+example – The example to validate the reward configuration.
+single_reward_config – Single reward function configuration for
+reinforcement tuning. Mutually exclusive with composite_reward_config.
+composite_reward_config – Composite reward function configuration for
+reinforcement tuning. Mutually exclusive with single_reward_config.
+config – Optional parameters for the request.
+
+
+- Returns:
+A ValidateRewardResponse with the computed reward(s).
+
+
+
+
@@ -4058,6 +4090,38 @@ Submodules
+-
+validate_reward(*, parent, sample_response, example, single_reward_config=None, composite_reward_config=None, config=None)¶
+Validates a reinforcement tuning reward configuration.
+Allows users to validate a reinforcement tuning reward configuration
+against a sample response and example before creating a reinforcement
+tuning job, so that they can iterate on the reward configuration without
+having to create a tuning job each time.
+
+- Return type:
+-
+
+- Parameters:
+
+parent – The resource name of the Location to validate the reward in, e.g.
+projects/{project}/locations/{location}.
+sample_response – The sample response for validating the reward
+configuration.
+example – The example to validate the reward configuration.
+single_reward_config – Single reward function configuration for
+reinforcement tuning. Mutually exclusive with composite_reward_config.
+composite_reward_config – Composite reward function configuration for
+reinforcement tuning. Mutually exclusive with single_reward_config.
+config – Optional parameters for the request.
+
+
+- Returns:
+A ValidateRewardResponse with the computed reward(s).
+
+
+
+
@@ -10134,7 +10198,7 @@ Submodules },
"FunctionResponse": {
"additionalProperties": false,
- "description": "A function response.",
+ "description": "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.\n\nThis should contain the result of a `FunctionCall` made based on model\nprediction.",
"properties": {
"willContinue": {
"anyOf": [
@@ -10146,7 +10210,7 @@ Submodules }
],
"default": null,
- "description": "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.",
+ "description": "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.",
"title": "Willcontinue"
},
"scheduling": {
@@ -10159,7 +10223,7 @@ Submodules }
],
"default": null,
- "description": "Specifies how the response should be scheduled in the conversation. Only applicable to NON_BLOCKING function calls, is ignored otherwise. Defaults to WHEN_IDLE."
+ "description": "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."
},
"parts": {
"anyOf": [
@@ -10174,7 +10238,7 @@ Submodules }
],
"default": null,
- "description": "List of parts that constitute a function response. Each part may\n have a different IANA MIME type.",
+ "description": "Optional. Ordered `Parts` that constitute a function response. Parts may have different IANA MIME types.",
"title": "Parts"
},
"id": {
@@ -10223,7 +10287,7 @@ Submodules },
"FunctionResponseBlob": {
"additionalProperties": false,
- "description": "Raw media bytes for function response.\n\nText should not be sent as raw bytes, use the FunctionResponse.response\nfield.",
+ "description": "Raw media bytes for function response.\n\nText should not be sent as raw bytes, use the 'text' field.",
"properties": {
"mimeType": {
"anyOf": [
@@ -10249,7 +10313,7 @@ Submodules }
],
"default": null,
- "description": "Required. Inline media bytes.",
+ "description": "Required. Raw bytes.",
"title": "Data"
},
"displayName": {
@@ -10262,7 +10326,7 @@ Submodules }
],
"default": null,
- "description": "Optional. Display name of the blob.\n Used to provide a label or filename to distinguish blobs.",
+ "description": "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.",
"title": "Displayname"
}
},
@@ -10271,7 +10335,7 @@ Submodules },
"FunctionResponseFileData": {
"additionalProperties": false,
- "description": "URI based data for function response.",
+ "description": "URI based data for function response.\n\nThis data type is not supported in Gemini API.",
"properties": {
"fileUri": {
"anyOf": [
@@ -10309,7 +10373,7 @@ Submodules }
],
"default": null,
- "description": "Optional. Display name of the file.\n Used to provide a label or filename to distinguish files.",
+ "description": "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.",
"title": "Displayname"
}
},
@@ -10318,7 +10382,7 @@ Submodules },
"FunctionResponsePart": {
"additionalProperties": false,
- "description": "A datatype containing media that is part of a `FunctionResponse` message.\n\nA `FunctionResponsePart` consists of data which has an associated datatype. A\n`FunctionResponsePart` can only contain one of the accepted types in\n`FunctionResponsePart.data`.\n\nA `FunctionResponsePart` must have a fixed IANA MIME type identifying the\ntype and subtype of the media if the `inline_data` field is filled with raw\nbytes.",
+ "description": "A datatype containing media that is part of a `FunctionResponse` message.\n\nA `FunctionResponsePart` consists of data which has an associated datatype. A\n`FunctionResponsePart` can only contain one of the accepted types in\n`FunctionResponsePart.data`. A `FunctionResponsePart` must have a fixed IANA\nMIME type identifying the type and subtype of the media if the `inline_data`\nfield is filled with raw bytes.",
"properties": {
"inlineData": {
"anyOf": [
@@ -10330,7 +10394,7 @@ Submodules }
],
"default": null,
- "description": "Optional. Inline media bytes."
+ "description": "Inline media bytes."
},
"fileData": {
"anyOf": [
@@ -10342,14 +10406,14 @@ Submodules }
],
"default": null,
- "description": "Optional. URI based data."
+ "description": "URI based data. This field is not supported in Gemini API."
}
},
"title": "FunctionResponsePart",
"type": "object"
},
"FunctionResponseScheduling": {
- "description": "Specifies how the response should be scheduled in the conversation.",
+ "description": "Specifies how the response should be scheduled in the conversation.\n\nOnly applicable to NON_BLOCKING function calls, is ignored otherwise. Defaults\nto WHEN_IDLE.",
"enum": [
"SCHEDULING_UNSPECIFIED",
"SILENT",
@@ -14128,7 +14192,7 @@ Submodules },
"FunctionResponse": {
"additionalProperties": false,
- "description": "A function response.",
+ "description": "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.\n\nThis should contain the result of a `FunctionCall` made based on model\nprediction.",
"properties": {
"willContinue": {
"anyOf": [
@@ -14140,7 +14204,7 @@ Submodules }
],
"default": null,
- "description": "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.",
+ "description": "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.",
"title": "Willcontinue"
},
"scheduling": {
@@ -14153,7 +14217,7 @@ Submodules }
],
"default": null,
- "description": "Specifies how the response should be scheduled in the conversation. Only applicable to NON_BLOCKING function calls, is ignored otherwise. Defaults to WHEN_IDLE."
+ "description": "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."
},
"parts": {
"anyOf": [
@@ -14168,7 +14232,7 @@ Submodules }
],
"default": null,
- "description": "List of parts that constitute a function response. Each part may\n have a different IANA MIME type.",
+ "description": "Optional. Ordered `Parts` that constitute a function response. Parts may have different IANA MIME types.",
"title": "Parts"
},
"id": {
@@ -14217,7 +14281,7 @@ Submodules },
"FunctionResponseBlob": {
"additionalProperties": false,
- "description": "Raw media bytes for function response.\n\nText should not be sent as raw bytes, use the FunctionResponse.response\nfield.",
+ "description": "Raw media bytes for function response.\n\nText should not be sent as raw bytes, use the 'text' field.",
"properties": {
"mimeType": {
"anyOf": [
@@ -14243,7 +14307,7 @@ Submodules }
],
"default": null,
- "description": "Required. Inline media bytes.",
+ "description": "Required. Raw bytes.",
"title": "Data"
},
"displayName": {
@@ -14256,7 +14320,7 @@ Submodules }
],
"default": null,
- "description": "Optional. Display name of the blob.\n Used to provide a label or filename to distinguish blobs.",
+ "description": "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.",
"title": "Displayname"
}
},
@@ -14265,7 +14329,7 @@ Submodules },
"FunctionResponseFileData": {
"additionalProperties": false,
- "description": "URI based data for function response.",
+ "description": "URI based data for function response.\n\nThis data type is not supported in Gemini API.",
"properties": {
"fileUri": {
"anyOf": [
@@ -14303,7 +14367,7 @@ Submodules }
],
"default": null,
- "description": "Optional. Display name of the file.\n Used to provide a label or filename to distinguish files.",
+ "description": "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.",
"title": "Displayname"
}
},
@@ -14312,7 +14376,7 @@ Submodules },
"FunctionResponsePart": {
"additionalProperties": false,
- "description": "A datatype containing media that is part of a `FunctionResponse` message.\n\nA `FunctionResponsePart` consists of data which has an associated datatype. A\n`FunctionResponsePart` can only contain one of the accepted types in\n`FunctionResponsePart.data`.\n\nA `FunctionResponsePart` must have a fixed IANA MIME type identifying the\ntype and subtype of the media if the `inline_data` field is filled with raw\nbytes.",
+ "description": "A datatype containing media that is part of a `FunctionResponse` message.\n\nA `FunctionResponsePart` consists of data which has an associated datatype. A\n`FunctionResponsePart` can only contain one of the accepted types in\n`FunctionResponsePart.data`. A `FunctionResponsePart` must have a fixed IANA\nMIME type identifying the type and subtype of the media if the `inline_data`\nfield is filled with raw bytes.",
"properties": {
"inlineData": {
"anyOf": [
@@ -14324,7 +14388,7 @@ Submodules }
],
"default": null,
- "description": "Optional. Inline media bytes."
+ "description": "Inline media bytes."
},
"fileData": {
"anyOf": [
@@ -14336,14 +14400,14 @@ Submodules }
],
"default": null,
- "description": "Optional. URI based data."
+ "description": "URI based data. This field is not supported in Gemini API."
}
},
"title": "FunctionResponsePart",
"type": "object"
},
"FunctionResponseScheduling": {
- "description": "Specifies how the response should be scheduled in the conversation.",
+ "description": "Specifies how the response should be scheduled in the conversation.\n\nOnly applicable to NON_BLOCKING function calls, is ignored otherwise. Defaults\nto WHEN_IDLE.",
"enum": [
"SCHEDULING_UNSPECIFIED",
"SILENT",
@@ -19573,7 +19637,7 @@ Submodules },
"FunctionResponse": {
"additionalProperties": false,
- "description": "A function response.",
+ "description": "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.\n\nThis should contain the result of a `FunctionCall` made based on model\nprediction.",
"properties": {
"willContinue": {
"anyOf": [
@@ -19585,7 +19649,7 @@ Submodules }
],
"default": null,
- "description": "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.",
+ "description": "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.",
"title": "Willcontinue"
},
"scheduling": {
@@ -19598,7 +19662,7 @@ Submodules }
],
"default": null,
- "description": "Specifies how the response should be scheduled in the conversation. Only applicable to NON_BLOCKING function calls, is ignored otherwise. Defaults to WHEN_IDLE."
+ "description": "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."
},
"parts": {
"anyOf": [
@@ -19613,7 +19677,7 @@ Submodules }
],
"default": null,
- "description": "List of parts that constitute a function response. Each part may\n have a different IANA MIME type.",
+ "description": "Optional. Ordered `Parts` that constitute a function response. Parts may have different IANA MIME types.",
"title": "Parts"
},
"id": {
@@ -19662,7 +19726,7 @@ Submodules },
"FunctionResponseBlob": {
"additionalProperties": false,
- "description": "Raw media bytes for function response.\n\nText should not be sent as raw bytes, use the FunctionResponse.response\nfield.",
+ "description": "Raw media bytes for function response.\n\nText should not be sent as raw bytes, use the 'text' field.",
"properties": {
"mimeType": {
"anyOf": [
@@ -19688,7 +19752,7 @@ Submodules }
],
"default": null,
- "description": "Required. Inline media bytes.",
+ "description": "Required. Raw bytes.",
"title": "Data"
},
"displayName": {
@@ -19701,7 +19765,7 @@ Submodules }
],
"default": null,
- "description": "Optional. Display name of the blob.\n Used to provide a label or filename to distinguish blobs.",
+ "description": "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.",
"title": "Displayname"
}
},
@@ -19710,7 +19774,7 @@ Submodules },
"FunctionResponseFileData": {
"additionalProperties": false,
- "description": "URI based data for function response.",
+ "description": "URI based data for function response.\n\nThis data type is not supported in Gemini API.",
"properties": {
"fileUri": {
"anyOf": [
@@ -19748,7 +19812,7 @@ Submodules }
],
"default": null,
- "description": "Optional. Display name of the file.\n Used to provide a label or filename to distinguish files.",
+ "description": "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.",
"title": "Displayname"
}
},
@@ -19757,7 +19821,7 @@ Submodules },
"FunctionResponsePart": {
"additionalProperties": false,
- "description": "A datatype containing media that is part of a `FunctionResponse` message.\n\nA `FunctionResponsePart` consists of data which has an associated datatype. A\n`FunctionResponsePart` can only contain one of the accepted types in\n`FunctionResponsePart.data`.\n\nA `FunctionResponsePart` must have a fixed IANA MIME type identifying the\ntype and subtype of the media if the `inline_data` field is filled with raw\nbytes.",
+ "description": "A datatype containing media that is part of a `FunctionResponse` message.\n\nA `FunctionResponsePart` consists of data which has an associated datatype. A\n`FunctionResponsePart` can only contain one of the accepted types in\n`FunctionResponsePart.data`. A `FunctionResponsePart` must have a fixed IANA\nMIME type identifying the type and subtype of the media if the `inline_data`\nfield is filled with raw bytes.",
"properties": {
"inlineData": {
"anyOf": [
@@ -19769,7 +19833,7 @@ Submodules }
],
"default": null,
- "description": "Optional. Inline media bytes."
+ "description": "Inline media bytes."
},
"fileData": {
"anyOf": [
@@ -19781,14 +19845,14 @@ Submodules }
],
"default": null,
- "description": "Optional. URI based data."
+ "description": "URI based data. This field is not supported in Gemini API."
}
},
"title": "FunctionResponsePart",
"type": "object"
},
"FunctionResponseScheduling": {
- "description": "Specifies how the response should be scheduled in the conversation.",
+ "description": "Specifies how the response should be scheduled in the conversation.\n\nOnly applicable to NON_BLOCKING function calls, is ignored otherwise. Defaults\nto WHEN_IDLE.",
"enum": [
"SCHEDULING_UNSPECIFIED",
"SILENT",
@@ -23659,6 +23723,17 @@ Submodules "title": "GenerationConfigRoutingConfigManualRoutingMode",
"type": "object"
},
+ "MatchOperation": {
+ "description": "Match operation to use for evaluation.",
+ "enum": [
+ "MATCH_OPERATION_UNSPECIFIED",
+ "REGEX_CONTAINS",
+ "PARTIAL_MATCH",
+ "EXACT_MATCH"
+ ],
+ "title": "MatchOperation",
+ "type": "string"
+ },
"MediaResolution": {
"description": "The media resolution to use.",
"enum": [
@@ -23762,11 +23837,313 @@ Submodules ],
"default": null,
"description": "Autorater config for evaluation."
+ },
+ "autoraterPrompt": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Allows substituting `prompt`, `response`, `system_instruction` and `references.reference` (each wrapped in double curly braces) into the autorater prompt.",
+ "title": "Autoraterprompt"
+ },
+ "autoraterResponseParseConfig": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/ReinforcementTuningParseResponseConfig"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Parses autorater returned response."
+ },
+ "parsedResponseConversionScorer": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/ReinforcementTuningAutoraterScorerParsedResponseConversionScorer"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Scores autorater responses by directly converting parsed autorater response to float reward."
+ },
+ "exactMatchScorer": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/ReinforcementTuningAutoraterScorerExactMatchScorer"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Scores autorater responses by using exact string match reward scorer."
}
},
"title": "ReinforcementTuningAutoraterScorer",
"type": "object"
},
+ "ReinforcementTuningAutoraterScorerExactMatchScorer": {
+ "additionalProperties": false,
+ "description": "Scores autorater responses by using exact string match reward scorer.",
+ "properties": {
+ "correctAnswerReward": {
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Assigns this reward score if parsed response string equals the expression.",
+ "title": "Correctanswerreward"
+ },
+ "wrongAnswerReward": {
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Assigns this reward score if parsed reward value does not equal the expression.",
+ "title": "Wronganswerreward"
+ },
+ "expression": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "The string expression to match against. Supports substitution in the format of `references.reference` (wrapped in double curly braces) before matching. No regex support.",
+ "title": "Expression"
+ }
+ },
+ "title": "ReinforcementTuningAutoraterScorerExactMatchScorer",
+ "type": "object"
+ },
+ "ReinforcementTuningAutoraterScorerParsedResponseConversionScorer": {
+ "additionalProperties": false,
+ "description": "Scores responses by directly converting parsed autorater response to float reward (reward is clipped to be within [-1, 1]).",
+ "properties": {},
+ "title": "ReinforcementTuningAutoraterScorerParsedResponseConversionScorer",
+ "type": "object"
+ },
+ "ReinforcementTuningCloudRunRewardScorer": {
+ "additionalProperties": false,
+ "description": "Scores parsed responses by calling a Cloud Run service.",
+ "properties": {
+ "cloudRunUri": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "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.",
+ "title": "Cloudrunuri"
+ }
+ },
+ "title": "ReinforcementTuningCloudRunRewardScorer",
+ "type": "object"
+ },
+ "ReinforcementTuningCodeExecutionRewardScorer": {
+ "additionalProperties": false,
+ "description": "Scores parsed responses for code execution use cases.",
+ "properties": {
+ "pythonCodeSnippet": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Example python code snippet which assigns reward of 1 to answer matching user provided reference answer in per prompt references map.",
+ "title": "Pythoncodesnippet"
+ }
+ },
+ "title": "ReinforcementTuningCodeExecutionRewardScorer",
+ "type": "object"
+ },
+ "ReinforcementTuningParseResponseConfig": {
+ "additionalProperties": false,
+ "description": "Defines how to parse sample response for reinforcement tuning.",
+ "properties": {
+ "parseType": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/ResponseParseType"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Defines how to parse sample response."
+ },
+ "regexExtractExpression": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Defines the regex to extract the important part of sample response. This field is only used when `parse_type` is `REGEX_EXTRACT`.",
+ "title": "Regexextractexpression"
+ }
+ },
+ "title": "ReinforcementTuningParseResponseConfig",
+ "type": "object"
+ },
+ "ReinforcementTuningStringMatchRewardScorer": {
+ "additionalProperties": false,
+ "description": "Scores parsed responses for string matching use cases.",
+ "properties": {
+ "wrongAnswerReward": {
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Wrong answer reward is returned if evaluator evaluates to `false`. All wrong answers get the same reward.",
+ "title": "Wronganswerreward"
+ },
+ "correctAnswerReward": {
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Correct answer reward is returned if evaluator evaluates to `true`. All correct answers get the same reward.",
+ "title": "Correctanswerreward"
+ },
+ "stringMatchExpression": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/ReinforcementTuningStringMatchRewardScorerStringMatchExpression"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Uses string match expression to evaluate parsed response."
+ },
+ "jsonMatchExpression": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/ReinforcementTuningStringMatchRewardScorerJsonMatchExpression"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Uses json match expression to evaluate parsed response."
+ }
+ },
+ "title": "ReinforcementTuningStringMatchRewardScorer",
+ "type": "object"
+ },
+ "ReinforcementTuningStringMatchRewardScorerJsonMatchExpression": {
+ "additionalProperties": false,
+ "description": "Converts parsed responses to JSON format, finds the first-level matching key, then performs StringMatchExpression on the value.",
+ "properties": {
+ "keyName": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Json key name to find the value to match against.",
+ "title": "Keyname"
+ },
+ "valueStringMatchExpression": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/ReinforcementTuningStringMatchRewardScorerStringMatchExpression"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "String match expression to match against the value of json key."
+ }
+ },
+ "title": "ReinforcementTuningStringMatchRewardScorerJsonMatchExpression",
+ "type": "object"
+ },
+ "ReinforcementTuningStringMatchRewardScorerStringMatchExpression": {
+ "additionalProperties": false,
+ "description": "Evaluates parsed response using match type against expression.",
+ "properties": {
+ "matchOperation": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/MatchOperation"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Match operation to use for evaluation."
+ },
+ "expression": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "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).",
+ "title": "Expression"
+ }
+ },
+ "title": "ReinforcementTuningStringMatchRewardScorerStringMatchExpression",
+ "type": "object"
+ },
"ReplicatedVoiceConfig": {
"additionalProperties": false,
"description": "The configuration for the replicated voice to use.",
@@ -23828,6 +24205,16 @@ Submodules "title": "ReplicatedVoiceConfig",
"type": "object"
},
+ "ResponseParseType": {
+ "description": "Defines how to parse sample response.",
+ "enum": [
+ "RESPONSE_PARSE_TYPE_UNSPECIFIED",
+ "IDENTITY",
+ "REGEX_EXTRACT"
+ ],
+ "title": "ResponseParseType",
+ "type": "string"
+ },
"Schema": {
"additionalProperties": false,
"description": "Schema is used to define the format of input/output data.\n\nRepresents a select subset of an [OpenAPI 3.0 schema\nobject](https://spec.openapis.org/oas/v3.0.3#schema-object). More fields may\nbe added in the future as needed.",
@@ -24185,7 +24572,68 @@ Submodules }
],
"default": null,
- "description": ""
+ "description": "Scores parsed responses for autorater use cases by using a model to compute the reward."
+ },
+ "rewardName": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "A unique reward name used to identify each single reinforcement tuning reward.",
+ "title": "Rewardname"
+ },
+ "parseResponseConfig": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/ReinforcementTuningParseResponseConfig"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Defines how to parse sample response."
+ },
+ "codeExecutionRewardScorer": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/ReinforcementTuningCodeExecutionRewardScorer"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Scores parsed responses for code execution use cases."
+ },
+ "stringMatchRewardScorer": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/ReinforcementTuningStringMatchRewardScorer"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Scores parsed responses for simple string matching use cases against reference answer without writing python code."
+ },
+ "cloudRunRewardScorer": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/ReinforcementTuningCloudRunRewardScorer"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Scores parsed responses by calling a Cloud Run service."
}
},
"title": "SingleReinforcementTuningRewardConfig",
@@ -24932,6 +25380,17 @@ Submodules "title": "GenerationConfigRoutingConfigManualRoutingMode",
"type": "object"
},
+ "MatchOperation": {
+ "description": "Match operation to use for evaluation.",
+ "enum": [
+ "MATCH_OPERATION_UNSPECIFIED",
+ "REGEX_CONTAINS",
+ "PARTIAL_MATCH",
+ "EXACT_MATCH"
+ ],
+ "title": "MatchOperation",
+ "type": "string"
+ },
"MediaResolution": {
"description": "The media resolution to use.",
"enum": [
@@ -25035,11 +25494,313 @@ Submodules ],
"default": null,
"description": "Autorater config for evaluation."
+ },
+ "autoraterPrompt": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Allows substituting `prompt`, `response`, `system_instruction` and `references.reference` (each wrapped in double curly braces) into the autorater prompt.",
+ "title": "Autoraterprompt"
+ },
+ "autoraterResponseParseConfig": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/ReinforcementTuningParseResponseConfig"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Parses autorater returned response."
+ },
+ "parsedResponseConversionScorer": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/ReinforcementTuningAutoraterScorerParsedResponseConversionScorer"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Scores autorater responses by directly converting parsed autorater response to float reward."
+ },
+ "exactMatchScorer": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/ReinforcementTuningAutoraterScorerExactMatchScorer"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Scores autorater responses by using exact string match reward scorer."
}
},
"title": "ReinforcementTuningAutoraterScorer",
"type": "object"
},
+ "ReinforcementTuningAutoraterScorerExactMatchScorer": {
+ "additionalProperties": false,
+ "description": "Scores autorater responses by using exact string match reward scorer.",
+ "properties": {
+ "correctAnswerReward": {
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Assigns this reward score if parsed response string equals the expression.",
+ "title": "Correctanswerreward"
+ },
+ "wrongAnswerReward": {
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Assigns this reward score if parsed reward value does not equal the expression.",
+ "title": "Wronganswerreward"
+ },
+ "expression": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "The string expression to match against. Supports substitution in the format of `references.reference` (wrapped in double curly braces) before matching. No regex support.",
+ "title": "Expression"
+ }
+ },
+ "title": "ReinforcementTuningAutoraterScorerExactMatchScorer",
+ "type": "object"
+ },
+ "ReinforcementTuningAutoraterScorerParsedResponseConversionScorer": {
+ "additionalProperties": false,
+ "description": "Scores responses by directly converting parsed autorater response to float reward (reward is clipped to be within [-1, 1]).",
+ "properties": {},
+ "title": "ReinforcementTuningAutoraterScorerParsedResponseConversionScorer",
+ "type": "object"
+ },
+ "ReinforcementTuningCloudRunRewardScorer": {
+ "additionalProperties": false,
+ "description": "Scores parsed responses by calling a Cloud Run service.",
+ "properties": {
+ "cloudRunUri": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "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.",
+ "title": "Cloudrunuri"
+ }
+ },
+ "title": "ReinforcementTuningCloudRunRewardScorer",
+ "type": "object"
+ },
+ "ReinforcementTuningCodeExecutionRewardScorer": {
+ "additionalProperties": false,
+ "description": "Scores parsed responses for code execution use cases.",
+ "properties": {
+ "pythonCodeSnippet": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Example python code snippet which assigns reward of 1 to answer matching user provided reference answer in per prompt references map.",
+ "title": "Pythoncodesnippet"
+ }
+ },
+ "title": "ReinforcementTuningCodeExecutionRewardScorer",
+ "type": "object"
+ },
+ "ReinforcementTuningParseResponseConfig": {
+ "additionalProperties": false,
+ "description": "Defines how to parse sample response for reinforcement tuning.",
+ "properties": {
+ "parseType": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/ResponseParseType"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Defines how to parse sample response."
+ },
+ "regexExtractExpression": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Defines the regex to extract the important part of sample response. This field is only used when `parse_type` is `REGEX_EXTRACT`.",
+ "title": "Regexextractexpression"
+ }
+ },
+ "title": "ReinforcementTuningParseResponseConfig",
+ "type": "object"
+ },
+ "ReinforcementTuningStringMatchRewardScorer": {
+ "additionalProperties": false,
+ "description": "Scores parsed responses for string matching use cases.",
+ "properties": {
+ "wrongAnswerReward": {
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Wrong answer reward is returned if evaluator evaluates to `false`. All wrong answers get the same reward.",
+ "title": "Wronganswerreward"
+ },
+ "correctAnswerReward": {
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Correct answer reward is returned if evaluator evaluates to `true`. All correct answers get the same reward.",
+ "title": "Correctanswerreward"
+ },
+ "stringMatchExpression": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/ReinforcementTuningStringMatchRewardScorerStringMatchExpression"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Uses string match expression to evaluate parsed response."
+ },
+ "jsonMatchExpression": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/ReinforcementTuningStringMatchRewardScorerJsonMatchExpression"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Uses json match expression to evaluate parsed response."
+ }
+ },
+ "title": "ReinforcementTuningStringMatchRewardScorer",
+ "type": "object"
+ },
+ "ReinforcementTuningStringMatchRewardScorerJsonMatchExpression": {
+ "additionalProperties": false,
+ "description": "Converts parsed responses to JSON format, finds the first-level matching key, then performs StringMatchExpression on the value.",
+ "properties": {
+ "keyName": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Json key name to find the value to match against.",
+ "title": "Keyname"
+ },
+ "valueStringMatchExpression": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/ReinforcementTuningStringMatchRewardScorerStringMatchExpression"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "String match expression to match against the value of json key."
+ }
+ },
+ "title": "ReinforcementTuningStringMatchRewardScorerJsonMatchExpression",
+ "type": "object"
+ },
+ "ReinforcementTuningStringMatchRewardScorerStringMatchExpression": {
+ "additionalProperties": false,
+ "description": "Evaluates parsed response using match type against expression.",
+ "properties": {
+ "matchOperation": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/MatchOperation"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Match operation to use for evaluation."
+ },
+ "expression": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "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).",
+ "title": "Expression"
+ }
+ },
+ "title": "ReinforcementTuningStringMatchRewardScorerStringMatchExpression",
+ "type": "object"
+ },
"ReplicatedVoiceConfig": {
"additionalProperties": false,
"description": "The configuration for the replicated voice to use.",
@@ -25101,6 +25862,16 @@ Submodules "title": "ReplicatedVoiceConfig",
"type": "object"
},
+ "ResponseParseType": {
+ "description": "Defines how to parse sample response.",
+ "enum": [
+ "RESPONSE_PARSE_TYPE_UNSPECIFIED",
+ "IDENTITY",
+ "REGEX_EXTRACT"
+ ],
+ "title": "ResponseParseType",
+ "type": "string"
+ },
"Schema": {
"additionalProperties": false,
"description": "Schema is used to define the format of input/output data.\n\nRepresents a select subset of an [OpenAPI 3.0 schema\nobject](https://spec.openapis.org/oas/v3.0.3#schema-object). More fields may\nbe added in the future as needed.",
@@ -25458,7 +26229,68 @@ Submodules }
],
"default": null,
- "description": ""
+ "description": "Scores parsed responses for autorater use cases by using a model to compute the reward."
+ },
+ "rewardName": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "A unique reward name used to identify each single reinforcement tuning reward.",
+ "title": "Rewardname"
+ },
+ "parseResponseConfig": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/ReinforcementTuningParseResponseConfig"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Defines how to parse sample response."
+ },
+ "codeExecutionRewardScorer": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/ReinforcementTuningCodeExecutionRewardScorer"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Scores parsed responses for code execution use cases."
+ },
+ "stringMatchRewardScorer": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/ReinforcementTuningStringMatchRewardScorer"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Scores parsed responses for simple string matching use cases against reference answer without writing python code."
+ },
+ "cloudRunRewardScorer": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/ReinforcementTuningCloudRunRewardScorer"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Scores parsed responses by calling a Cloud Run service."
}
},
"title": "SingleReinforcementTuningRewardConfig",
@@ -26749,7 +27581,7 @@ Submodules },
"FunctionResponse": {
"additionalProperties": false,
- "description": "A function response.",
+ "description": "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.\n\nThis should contain the result of a `FunctionCall` made based on model\nprediction.",
"properties": {
"willContinue": {
"anyOf": [
@@ -26761,7 +27593,7 @@ Submodules }
],
"default": null,
- "description": "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.",
+ "description": "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.",
"title": "Willcontinue"
},
"scheduling": {
@@ -26774,7 +27606,7 @@ Submodules }
],
"default": null,
- "description": "Specifies how the response should be scheduled in the conversation. Only applicable to NON_BLOCKING function calls, is ignored otherwise. Defaults to WHEN_IDLE."
+ "description": "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."
},
"parts": {
"anyOf": [
@@ -26789,7 +27621,7 @@ Submodules }
],
"default": null,
- "description": "List of parts that constitute a function response. Each part may\n have a different IANA MIME type.",
+ "description": "Optional. Ordered `Parts` that constitute a function response. Parts may have different IANA MIME types.",
"title": "Parts"
},
"id": {
@@ -26838,7 +27670,7 @@ Submodules },
"FunctionResponseBlob": {
"additionalProperties": false,
- "description": "Raw media bytes for function response.\n\nText should not be sent as raw bytes, use the FunctionResponse.response\nfield.",
+ "description": "Raw media bytes for function response.\n\nText should not be sent as raw bytes, use the 'text' field.",
"properties": {
"mimeType": {
"anyOf": [
@@ -26864,7 +27696,7 @@ Submodules }
],
"default": null,
- "description": "Required. Inline media bytes.",
+ "description": "Required. Raw bytes.",
"title": "Data"
},
"displayName": {
@@ -26877,7 +27709,7 @@ Submodules }
],
"default": null,
- "description": "Optional. Display name of the blob.\n Used to provide a label or filename to distinguish blobs.",
+ "description": "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.",
"title": "Displayname"
}
},
@@ -26886,7 +27718,7 @@ Submodules },
"FunctionResponseFileData": {
"additionalProperties": false,
- "description": "URI based data for function response.",
+ "description": "URI based data for function response.\n\nThis data type is not supported in Gemini API.",
"properties": {
"fileUri": {
"anyOf": [
@@ -26924,7 +27756,7 @@ Submodules }
],
"default": null,
- "description": "Optional. Display name of the file.\n Used to provide a label or filename to distinguish files.",
+ "description": "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.",
"title": "Displayname"
}
},
@@ -26933,7 +27765,7 @@ Submodules },
"FunctionResponsePart": {
"additionalProperties": false,
- "description": "A datatype containing media that is part of a `FunctionResponse` message.\n\nA `FunctionResponsePart` consists of data which has an associated datatype. A\n`FunctionResponsePart` can only contain one of the accepted types in\n`FunctionResponsePart.data`.\n\nA `FunctionResponsePart` must have a fixed IANA MIME type identifying the\ntype and subtype of the media if the `inline_data` field is filled with raw\nbytes.",
+ "description": "A datatype containing media that is part of a `FunctionResponse` message.\n\nA `FunctionResponsePart` consists of data which has an associated datatype. A\n`FunctionResponsePart` can only contain one of the accepted types in\n`FunctionResponsePart.data`. A `FunctionResponsePart` must have a fixed IANA\nMIME type identifying the type and subtype of the media if the `inline_data`\nfield is filled with raw bytes.",
"properties": {
"inlineData": {
"anyOf": [
@@ -26945,7 +27777,7 @@ Submodules }
],
"default": null,
- "description": "Optional. Inline media bytes."
+ "description": "Inline media bytes."
},
"fileData": {
"anyOf": [
@@ -26957,14 +27789,14 @@ Submodules }
],
"default": null,
- "description": "Optional. URI based data."
+ "description": "URI based data. This field is not supported in Gemini API."
}
},
"title": "FunctionResponsePart",
"type": "object"
},
"FunctionResponseScheduling": {
- "description": "Specifies how the response should be scheduled in the conversation.",
+ "description": "Specifies how the response should be scheduled in the conversation.\n\nOnly applicable to NON_BLOCKING function calls, is ignored otherwise. Defaults\nto WHEN_IDLE.",
"enum": [
"SCHEDULING_UNSPECIFIED",
"SILENT",
@@ -29972,7 +30804,7 @@ Submodules },
"FunctionResponse": {
"additionalProperties": false,
- "description": "A function response.",
+ "description": "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.\n\nThis should contain the result of a `FunctionCall` made based on model\nprediction.",
"properties": {
"willContinue": {
"anyOf": [
@@ -29984,7 +30816,7 @@ Submodules }
],
"default": null,
- "description": "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.",
+ "description": "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.",
"title": "Willcontinue"
},
"scheduling": {
@@ -29997,7 +30829,7 @@ Submodules }
],
"default": null,
- "description": "Specifies how the response should be scheduled in the conversation. Only applicable to NON_BLOCKING function calls, is ignored otherwise. Defaults to WHEN_IDLE."
+ "description": "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."
},
"parts": {
"anyOf": [
@@ -30012,7 +30844,7 @@ Submodules }
],
"default": null,
- "description": "List of parts that constitute a function response. Each part may\n have a different IANA MIME type.",
+ "description": "Optional. Ordered `Parts` that constitute a function response. Parts may have different IANA MIME types.",
"title": "Parts"
},
"id": {
@@ -30061,7 +30893,7 @@ Submodules },
"FunctionResponseBlob": {
"additionalProperties": false,
- "description": "Raw media bytes for function response.\n\nText should not be sent as raw bytes, use the FunctionResponse.response\nfield.",
+ "description": "Raw media bytes for function response.\n\nText should not be sent as raw bytes, use the 'text' field.",
"properties": {
"mimeType": {
"anyOf": [
@@ -30087,7 +30919,7 @@ Submodules }
],
"default": null,
- "description": "Required. Inline media bytes.",
+ "description": "Required. Raw bytes.",
"title": "Data"
},
"displayName": {
@@ -30100,7 +30932,7 @@ Submodules }
],
"default": null,
- "description": "Optional. Display name of the blob.\n Used to provide a label or filename to distinguish blobs.",
+ "description": "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.",
"title": "Displayname"
}
},
@@ -30109,7 +30941,7 @@ Submodules },
"FunctionResponseFileData": {
"additionalProperties": false,
- "description": "URI based data for function response.",
+ "description": "URI based data for function response.\n\nThis data type is not supported in Gemini API.",
"properties": {
"fileUri": {
"anyOf": [
@@ -30147,7 +30979,7 @@ Submodules }
],
"default": null,
- "description": "Optional. Display name of the file.\n Used to provide a label or filename to distinguish files.",
+ "description": "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.",
"title": "Displayname"
}
},
@@ -30156,7 +30988,7 @@ Submodules },
"FunctionResponsePart": {
"additionalProperties": false,
- "description": "A datatype containing media that is part of a `FunctionResponse` message.\n\nA `FunctionResponsePart` consists of data which has an associated datatype. A\n`FunctionResponsePart` can only contain one of the accepted types in\n`FunctionResponsePart.data`.\n\nA `FunctionResponsePart` must have a fixed IANA MIME type identifying the\ntype and subtype of the media if the `inline_data` field is filled with raw\nbytes.",
+ "description": "A datatype containing media that is part of a `FunctionResponse` message.\n\nA `FunctionResponsePart` consists of data which has an associated datatype. A\n`FunctionResponsePart` can only contain one of the accepted types in\n`FunctionResponsePart.data`. A `FunctionResponsePart` must have a fixed IANA\nMIME type identifying the type and subtype of the media if the `inline_data`\nfield is filled with raw bytes.",
"properties": {
"inlineData": {
"anyOf": [
@@ -30168,7 +31000,7 @@ Submodules }
],
"default": null,
- "description": "Optional. Inline media bytes."
+ "description": "Inline media bytes."
},
"fileData": {
"anyOf": [
@@ -30180,14 +31012,14 @@ Submodules }
],
"default": null,
- "description": "Optional. URI based data."
+ "description": "URI based data. This field is not supported in Gemini API."
}
},
"title": "FunctionResponsePart",
"type": "object"
},
"FunctionResponseScheduling": {
- "description": "Specifies how the response should be scheduled in the conversation.",
+ "description": "Specifies how the response should be scheduled in the conversation.\n\nOnly applicable to NON_BLOCKING function calls, is ignored otherwise. Defaults\nto WHEN_IDLE.",
"enum": [
"SCHEDULING_UNSPECIFIED",
"SILENT",
@@ -30608,7 +31440,7 @@ Submodules }
],
"default": null,
- "description": "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.",
+ "description": "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.",
"title": "Enablewidget"
}
},
@@ -34288,7 +35120,7 @@ Submodules },
"FunctionResponse": {
"additionalProperties": false,
- "description": "A function response.",
+ "description": "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.\n\nThis should contain the result of a `FunctionCall` made based on model\nprediction.",
"properties": {
"willContinue": {
"anyOf": [
@@ -34300,7 +35132,7 @@ Submodules }
],
"default": null,
- "description": "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.",
+ "description": "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.",
"title": "Willcontinue"
},
"scheduling": {
@@ -34313,7 +35145,7 @@ Submodules }
],
"default": null,
- "description": "Specifies how the response should be scheduled in the conversation. Only applicable to NON_BLOCKING function calls, is ignored otherwise. Defaults to WHEN_IDLE."
+ "description": "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."
},
"parts": {
"anyOf": [
@@ -34328,7 +35160,7 @@ Submodules }
],
"default": null,
- "description": "List of parts that constitute a function response. Each part may\n have a different IANA MIME type.",
+ "description": "Optional. Ordered `Parts` that constitute a function response. Parts may have different IANA MIME types.",
"title": "Parts"
},
"id": {
@@ -34377,7 +35209,7 @@ Submodules },
"FunctionResponseBlob": {
"additionalProperties": false,
- "description": "Raw media bytes for function response.\n\nText should not be sent as raw bytes, use the FunctionResponse.response\nfield.",
+ "description": "Raw media bytes for function response.\n\nText should not be sent as raw bytes, use the 'text' field.",
"properties": {
"mimeType": {
"anyOf": [
@@ -34403,7 +35235,7 @@ Submodules }
],
"default": null,
- "description": "Required. Inline media bytes.",
+ "description": "Required. Raw bytes.",
"title": "Data"
},
"displayName": {
@@ -34416,7 +35248,7 @@ Submodules }
],
"default": null,
- "description": "Optional. Display name of the blob.\n Used to provide a label or filename to distinguish blobs.",
+ "description": "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.",
"title": "Displayname"
}
},
@@ -34425,7 +35257,7 @@ Submodules },
"FunctionResponseFileData": {
"additionalProperties": false,
- "description": "URI based data for function response.",
+ "description": "URI based data for function response.\n\nThis data type is not supported in Gemini API.",
"properties": {
"fileUri": {
"anyOf": [
@@ -34463,7 +35295,7 @@ Submodules }
],
"default": null,
- "description": "Optional. Display name of the file.\n Used to provide a label or filename to distinguish files.",
+ "description": "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.",
"title": "Displayname"
}
},
@@ -34472,7 +35304,7 @@ Submodules },
"FunctionResponsePart": {
"additionalProperties": false,
- "description": "A datatype containing media that is part of a `FunctionResponse` message.\n\nA `FunctionResponsePart` consists of data which has an associated datatype. A\n`FunctionResponsePart` can only contain one of the accepted types in\n`FunctionResponsePart.data`.\n\nA `FunctionResponsePart` must have a fixed IANA MIME type identifying the\ntype and subtype of the media if the `inline_data` field is filled with raw\nbytes.",
+ "description": "A datatype containing media that is part of a `FunctionResponse` message.\n\nA `FunctionResponsePart` consists of data which has an associated datatype. A\n`FunctionResponsePart` can only contain one of the accepted types in\n`FunctionResponsePart.data`. A `FunctionResponsePart` must have a fixed IANA\nMIME type identifying the type and subtype of the media if the `inline_data`\nfield is filled with raw bytes.",
"properties": {
"inlineData": {
"anyOf": [
@@ -34484,7 +35316,7 @@ Submodules }
],
"default": null,
- "description": "Optional. Inline media bytes."
+ "description": "Inline media bytes."
},
"fileData": {
"anyOf": [
@@ -34496,14 +35328,14 @@ Submodules }
],
"default": null,
- "description": "Optional. URI based data."
+ "description": "URI based data. This field is not supported in Gemini API."
}
},
"title": "FunctionResponsePart",
"type": "object"
},
"FunctionResponseScheduling": {
- "description": "Specifies how the response should be scheduled in the conversation.",
+ "description": "Specifies how the response should be scheduled in the conversation.\n\nOnly applicable to NON_BLOCKING function calls, is ignored otherwise. Defaults\nto WHEN_IDLE.",
"enum": [
"SCHEDULING_UNSPECIFIED",
"SILENT",
@@ -39022,7 +39854,7 @@ Submodules },
"FunctionResponse": {
"additionalProperties": false,
- "description": "A function response.",
+ "description": "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.\n\nThis should contain the result of a `FunctionCall` made based on model\nprediction.",
"properties": {
"willContinue": {
"anyOf": [
@@ -39034,7 +39866,7 @@ Submodules }
],
"default": null,
- "description": "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.",
+ "description": "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.",
"title": "Willcontinue"
},
"scheduling": {
@@ -39047,7 +39879,7 @@ Submodules }
],
"default": null,
- "description": "Specifies how the response should be scheduled in the conversation. Only applicable to NON_BLOCKING function calls, is ignored otherwise. Defaults to WHEN_IDLE."
+ "description": "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."
},
"parts": {
"anyOf": [
@@ -39062,7 +39894,7 @@ Submodules }
],
"default": null,
- "description": "List of parts that constitute a function response. Each part may\n have a different IANA MIME type.",
+ "description": "Optional. Ordered `Parts` that constitute a function response. Parts may have different IANA MIME types.",
"title": "Parts"
},
"id": {
@@ -39111,7 +39943,7 @@ Submodules },
"FunctionResponseBlob": {
"additionalProperties": false,
- "description": "Raw media bytes for function response.\n\nText should not be sent as raw bytes, use the FunctionResponse.response\nfield.",
+ "description": "Raw media bytes for function response.\n\nText should not be sent as raw bytes, use the 'text' field.",
"properties": {
"mimeType": {
"anyOf": [
@@ -39137,7 +39969,7 @@ Submodules }
],
"default": null,
- "description": "Required. Inline media bytes.",
+ "description": "Required. Raw bytes.",
"title": "Data"
},
"displayName": {
@@ -39150,7 +39982,7 @@ Submodules }
],
"default": null,
- "description": "Optional. Display name of the blob.\n Used to provide a label or filename to distinguish blobs.",
+ "description": "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.",
"title": "Displayname"
}
},
@@ -39159,7 +39991,7 @@ Submodules },
"FunctionResponseFileData": {
"additionalProperties": false,
- "description": "URI based data for function response.",
+ "description": "URI based data for function response.\n\nThis data type is not supported in Gemini API.",
"properties": {
"fileUri": {
"anyOf": [
@@ -39197,7 +40029,7 @@ Submodules }
],
"default": null,
- "description": "Optional. Display name of the file.\n Used to provide a label or filename to distinguish files.",
+ "description": "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.",
"title": "Displayname"
}
},
@@ -39206,7 +40038,7 @@ Submodules },
"FunctionResponsePart": {
"additionalProperties": false,
- "description": "A datatype containing media that is part of a `FunctionResponse` message.\n\nA `FunctionResponsePart` consists of data which has an associated datatype. A\n`FunctionResponsePart` can only contain one of the accepted types in\n`FunctionResponsePart.data`.\n\nA `FunctionResponsePart` must have a fixed IANA MIME type identifying the\ntype and subtype of the media if the `inline_data` field is filled with raw\nbytes.",
+ "description": "A datatype containing media that is part of a `FunctionResponse` message.\n\nA `FunctionResponsePart` consists of data which has an associated datatype. A\n`FunctionResponsePart` can only contain one of the accepted types in\n`FunctionResponsePart.data`. A `FunctionResponsePart` must have a fixed IANA\nMIME type identifying the type and subtype of the media if the `inline_data`\nfield is filled with raw bytes.",
"properties": {
"inlineData": {
"anyOf": [
@@ -39218,7 +40050,7 @@ Submodules }
],
"default": null,
- "description": "Optional. Inline media bytes."
+ "description": "Inline media bytes."
},
"fileData": {
"anyOf": [
@@ -39230,14 +40062,14 @@ Submodules }
],
"default": null,
- "description": "Optional. URI based data."
+ "description": "URI based data. This field is not supported in Gemini API."
}
},
"title": "FunctionResponsePart",
"type": "object"
},
"FunctionResponseScheduling": {
- "description": "Specifies how the response should be scheduled in the conversation.",
+ "description": "Specifies how the response should be scheduled in the conversation.\n\nOnly applicable to NON_BLOCKING function calls, is ignored otherwise. Defaults\nto WHEN_IDLE.",
"enum": [
"SCHEDULING_UNSPECIFIED",
"SILENT",
@@ -39273,7 +40105,7 @@ Submodules }
],
"default": null,
- "description": "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.",
+ "description": "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.",
"title": "Enablewidget"
}
},
@@ -42256,6 +43088,31 @@ Submodules "default": null,
"description": "The maximum number of tokens to generate per prompt. Reinforcement tuning only.",
"title": "Maxoutputtokens"
+ },
+ "thinkingLevel": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/ReinforcementTuningThinkingLevel"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Indicates the maximum thinking depth. Use with earlier models shall result in error. Reinforcement tuning only."
+ },
+ "validationDatasetUri": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "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.",
+ "title": "Validationdataseturi"
}
},
"$defs": {
@@ -43145,6 +44002,17 @@ Submodules "title": "LLMBasedMetricSpec",
"type": "object"
},
+ "MatchOperation": {
+ "description": "Match operation to use for evaluation.",
+ "enum": [
+ "MATCH_OPERATION_UNSPECIFIED",
+ "REGEX_CONTAINS",
+ "PARTIAL_MATCH",
+ "EXACT_MATCH"
+ ],
+ "title": "MatchOperation",
+ "type": "string"
+ },
"MediaResolution": {
"description": "The media resolution to use.",
"enum": [
@@ -43349,11 +44217,323 @@ Submodules ],
"default": null,
"description": "Autorater config for evaluation."
+ },
+ "autoraterPrompt": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Allows substituting `prompt`, `response`, `system_instruction` and `references.reference` (each wrapped in double curly braces) into the autorater prompt.",
+ "title": "Autoraterprompt"
+ },
+ "autoraterResponseParseConfig": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/ReinforcementTuningParseResponseConfig"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Parses autorater returned response."
+ },
+ "parsedResponseConversionScorer": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/ReinforcementTuningAutoraterScorerParsedResponseConversionScorer"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Scores autorater responses by directly converting parsed autorater response to float reward."
+ },
+ "exactMatchScorer": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/ReinforcementTuningAutoraterScorerExactMatchScorer"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Scores autorater responses by using exact string match reward scorer."
}
},
"title": "ReinforcementTuningAutoraterScorer",
"type": "object"
},
+ "ReinforcementTuningAutoraterScorerExactMatchScorer": {
+ "additionalProperties": false,
+ "description": "Scores autorater responses by using exact string match reward scorer.",
+ "properties": {
+ "correctAnswerReward": {
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Assigns this reward score if parsed response string equals the expression.",
+ "title": "Correctanswerreward"
+ },
+ "wrongAnswerReward": {
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Assigns this reward score if parsed reward value does not equal the expression.",
+ "title": "Wronganswerreward"
+ },
+ "expression": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "The string expression to match against. Supports substitution in the format of `references.reference` (wrapped in double curly braces) before matching. No regex support.",
+ "title": "Expression"
+ }
+ },
+ "title": "ReinforcementTuningAutoraterScorerExactMatchScorer",
+ "type": "object"
+ },
+ "ReinforcementTuningAutoraterScorerParsedResponseConversionScorer": {
+ "additionalProperties": false,
+ "description": "Scores responses by directly converting parsed autorater response to float reward (reward is clipped to be within [-1, 1]).",
+ "properties": {},
+ "title": "ReinforcementTuningAutoraterScorerParsedResponseConversionScorer",
+ "type": "object"
+ },
+ "ReinforcementTuningCloudRunRewardScorer": {
+ "additionalProperties": false,
+ "description": "Scores parsed responses by calling a Cloud Run service.",
+ "properties": {
+ "cloudRunUri": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "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.",
+ "title": "Cloudrunuri"
+ }
+ },
+ "title": "ReinforcementTuningCloudRunRewardScorer",
+ "type": "object"
+ },
+ "ReinforcementTuningCodeExecutionRewardScorer": {
+ "additionalProperties": false,
+ "description": "Scores parsed responses for code execution use cases.",
+ "properties": {
+ "pythonCodeSnippet": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Example python code snippet which assigns reward of 1 to answer matching user provided reference answer in per prompt references map.",
+ "title": "Pythoncodesnippet"
+ }
+ },
+ "title": "ReinforcementTuningCodeExecutionRewardScorer",
+ "type": "object"
+ },
+ "ReinforcementTuningParseResponseConfig": {
+ "additionalProperties": false,
+ "description": "Defines how to parse sample response for reinforcement tuning.",
+ "properties": {
+ "parseType": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/ResponseParseType"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Defines how to parse sample response."
+ },
+ "regexExtractExpression": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Defines the regex to extract the important part of sample response. This field is only used when `parse_type` is `REGEX_EXTRACT`.",
+ "title": "Regexextractexpression"
+ }
+ },
+ "title": "ReinforcementTuningParseResponseConfig",
+ "type": "object"
+ },
+ "ReinforcementTuningStringMatchRewardScorer": {
+ "additionalProperties": false,
+ "description": "Scores parsed responses for string matching use cases.",
+ "properties": {
+ "wrongAnswerReward": {
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Wrong answer reward is returned if evaluator evaluates to `false`. All wrong answers get the same reward.",
+ "title": "Wronganswerreward"
+ },
+ "correctAnswerReward": {
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Correct answer reward is returned if evaluator evaluates to `true`. All correct answers get the same reward.",
+ "title": "Correctanswerreward"
+ },
+ "stringMatchExpression": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/ReinforcementTuningStringMatchRewardScorerStringMatchExpression"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Uses string match expression to evaluate parsed response."
+ },
+ "jsonMatchExpression": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/ReinforcementTuningStringMatchRewardScorerJsonMatchExpression"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Uses json match expression to evaluate parsed response."
+ }
+ },
+ "title": "ReinforcementTuningStringMatchRewardScorer",
+ "type": "object"
+ },
+ "ReinforcementTuningStringMatchRewardScorerJsonMatchExpression": {
+ "additionalProperties": false,
+ "description": "Converts parsed responses to JSON format, finds the first-level matching key, then performs StringMatchExpression on the value.",
+ "properties": {
+ "keyName": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Json key name to find the value to match against.",
+ "title": "Keyname"
+ },
+ "valueStringMatchExpression": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/ReinforcementTuningStringMatchRewardScorerStringMatchExpression"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "String match expression to match against the value of json key."
+ }
+ },
+ "title": "ReinforcementTuningStringMatchRewardScorerJsonMatchExpression",
+ "type": "object"
+ },
+ "ReinforcementTuningStringMatchRewardScorerStringMatchExpression": {
+ "additionalProperties": false,
+ "description": "Evaluates parsed response using match type against expression.",
+ "properties": {
+ "matchOperation": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/MatchOperation"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Match operation to use for evaluation."
+ },
+ "expression": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "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).",
+ "title": "Expression"
+ }
+ },
+ "title": "ReinforcementTuningStringMatchRewardScorerStringMatchExpression",
+ "type": "object"
+ },
+ "ReinforcementTuningThinkingLevel": {
+ "description": "Represents how much to think for the tuning job.",
+ "enum": [
+ "REINFORCEMENT_TUNING_THINKING_LEVEL_UNSPECIFIED",
+ "MINIMAL",
+ "HIGH"
+ ],
+ "title": "ReinforcementTuningThinkingLevel",
+ "type": "string"
+ },
"ReplicatedVoiceConfig": {
"additionalProperties": false,
"description": "The configuration for the replicated voice to use.",
@@ -43415,6 +44595,16 @@ Submodules "title": "ReplicatedVoiceConfig",
"type": "object"
},
+ "ResponseParseType": {
+ "description": "Defines how to parse sample response.",
+ "enum": [
+ "RESPONSE_PARSE_TYPE_UNSPECIFIED",
+ "IDENTITY",
+ "REGEX_EXTRACT"
+ ],
+ "title": "ResponseParseType",
+ "type": "string"
+ },
"RougeSpec": {
"additionalProperties": false,
"description": "Spec for rouge metric.",
@@ -43879,7 +45069,68 @@ Submodules }
],
"default": null,
- "description": ""
+ "description": "Scores parsed responses for autorater use cases by using a model to compute the reward."
+ },
+ "rewardName": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "A unique reward name used to identify each single reinforcement tuning reward.",
+ "title": "Rewardname"
+ },
+ "parseResponseConfig": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/ReinforcementTuningParseResponseConfig"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Defines how to parse sample response."
+ },
+ "codeExecutionRewardScorer": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/ReinforcementTuningCodeExecutionRewardScorer"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Scores parsed responses for code execution use cases."
+ },
+ "stringMatchRewardScorer": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/ReinforcementTuningStringMatchRewardScorer"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Scores parsed responses for simple string matching use cases against reference answer without writing python code."
+ },
+ "cloudRunRewardScorer": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/ReinforcementTuningCloudRunRewardScorer"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "description": "Scores parsed responses by calling a Cloud Run service."
}
},
"title": "SingleReinforcementTuningRewardConfig",
@@ -44267,10 +45518,12 @@ Submodulesreward_config (genai.types.SingleReinforcementTuningRewardConfig | None)
+thinking_level (genai.types.ReinforcementTuningThinkingLevel | None)
validation_dataset (genai.types.TuningValidationDataset | None)
+
Validators:
@@ -44588,6 +45841,19 @@ Submodules
+
+field thinking_level: Optional[ReinforcementTuningThinkingLevel] = None (alias 'thinkingLevel')¶
+Indicates the maximum thinking depth. Use with earlier models shall result in error. Reinforcement tuning only.
+
+- Validated by:
+
+_check_field_type_mismatches
+
+
+
+
+
-
field tuned_model_display_name:
Optional[str] = None (alias 'tunedModelDisplayName')¶
@@ -44640,6 +45906,19 @@ Submodules
+-
+field validation_dataset_uri:
Optional[str] = None (alias 'validationDatasetUri')¶
+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.
+
+- Validated by:
+
+_check_field_type_mismatches
+
+
+
+
+
@@ -44796,6 +46075,12 @@ Submodules
+-
+thinking_level:
Optional[ReinforcementTuningThinkingLevel]¶
+Indicates the maximum thinking depth. Use with earlier models shall result in error. Reinforcement tuning only.
+
+
-
tuned_model_display_name:
Optional[str]¶
@@ -44820,6 +46105,12 @@ Submodules
+-
+validation_dataset_uri:
Optional[str]¶
+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.
+
+
@@ -46768,7 +48059,7 @@ Submodules },
"FunctionResponse": {
"additionalProperties": false,
- "description": "A function response.",
+ "description": "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.\n\nThis should contain the result of a `FunctionCall` made based on model\nprediction.",
"properties": {
"willContinue": {
"anyOf": [
@@ -46780,7 +48071,7 @@ Submodules }
],
"default": null,
- "description": "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.",
+ "description": "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.",
"title": "Willcontinue"
},
"scheduling": {
@@ -46793,7 +48084,7 @@ Submodules }
],
"default": null,
- "description": "Specifies how the response should be scheduled in the conversation. Only applicable to NON_BLOCKING function calls, is ignored otherwise. Defaults to WHEN_IDLE."
+ "description": "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."
},
"parts": {
"anyOf": [
@@ -46808,7 +48099,7 @@ Submodules }
],
"default": null,
- "description": "List of parts that constitute a function response. Each part may\n have a different IANA MIME type.",
+ "description": "Optional. Ordered `Parts` that constitute a function response. Parts may have different IANA MIME types.",
"title": "Parts"
},
"id": {
@@ -46857,7 +48148,7 @@ Submodules },
"FunctionResponseBlob": {
"additionalProperties": false,
- "description": "Raw media bytes for function response.\n\nText should not be sent as raw bytes, use the FunctionResponse.response\nfield.",
+ "description": "Raw media bytes for function response.\n\nText should not be sent as raw bytes, use the 'text' field.",
"properties": {
"mimeType": {
"anyOf": [
@@ -46883,7 +48174,7 @@ Submodules }
],
"default": null,
- "description": "Required. Inline media bytes.",
+ "description": "Required. Raw bytes.",
"title": "Data"
},
"displayName": {
@@ -46896,7 +48187,7 @@ Submodules }
],
"default": null,
- "description": "Optional. Display name of the blob.\n Used to provide a label or filename to distinguish blobs.",
+ "description": "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.",
"title": "Displayname"
}
},
@@ -46905,7 +48196,7 @@ Submodules },
"FunctionResponseFileData": {
"additionalProperties": false,
- "description": "URI based data for function response.",
+ "description": "URI based data for function response.\n\nThis data type is not supported in Gemini API.",
"properties": {
"fileUri": {
"anyOf": [
@@ -46943,7 +48234,7 @@ Submodules }
],
"default": null,
- "description": "Optional. Display name of the file.\n Used to provide a label or filename to distinguish files.",
+ "description": "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.",
"title": "Displayname"
}
},
@@ -46952,7 +48243,7 @@ Submodules },
"FunctionResponsePart": {
"additionalProperties": false,
- "description": "A datatype containing media that is part of a `FunctionResponse` message.\n\nA `FunctionResponsePart` consists of data which has an associated datatype. A\n`FunctionResponsePart` can only contain one of the accepted types in\n`FunctionResponsePart.data`.\n\nA `FunctionResponsePart` must have a fixed IANA MIME type identifying the\ntype and subtype of the media if the `inline_data` field is filled with raw\nbytes.",
+ "description": "A datatype containing media that is part of a `FunctionResponse` message.\n\nA `FunctionResponsePart` consists of data which has an associated datatype. A\n`FunctionResponsePart` can only contain one of the accepted types in\n`FunctionResponsePart.data`. A `FunctionResponsePart` must have a fixed IANA\nMIME type identifying the type and subtype of the media if the `inline_data`\nfield is filled with raw bytes.",
"properties": {
"inlineData": {
"anyOf": [
@@ -46964,7 +48255,7 @@ Submodules }
],
"default": null,
- "description": "Optional. Inline media bytes."
+ "description": "Inline media bytes."
},
"fileData": {
"anyOf": [
@@ -46976,14 +48267,14 @@ Submodules }
],
"default": null,
- "description": "Optional. URI based data."
+ "description": "URI based data. This field is not supported in Gemini API."
}
},
"title": "FunctionResponsePart",
"type": "object"
},
"FunctionResponseScheduling": {
- "description": "Specifies how the response should be scheduled in the conversation.",
+ "description": "Specifies how the response should be scheduled in the conversation.\n\nOnly applicable to NON_BLOCKING function calls, is ignored otherwise. Defaults\nto WHEN_IDLE.",
"enum": [
"SCHEDULING_UNSPECIFIED",
"SILENT",
@@ -49347,7 +50638,7 @@ Submodules },
"FunctionResponse": {
"additionalProperties": false,
- "description": "A function response.",
+ "description": "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.\n\nThis should contain the result of a `FunctionCall` made based on model\nprediction.",
"properties": {
"willContinue": {
"anyOf": [
@@ -49359,7 +50650,7 @@ Submodules }
],
"default": null,
- "description": "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.",
+ "description": "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.",
"title": "Willcontinue"
},
"scheduling": {
@@ -49372,7 +50663,7 @@ Submodules }
],
"default": null,
- "description": "Specifies how the response should be scheduled in the conversation. Only applicable to NON_BLOCKING function calls, is ignored otherwise. Defaults to WHEN_IDLE."
+ "description": "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."
},
"parts": {
"anyOf": [
@@ -49387,7 +50678,7 @@ Submodules }
],
"default": null,
- "description": "List of parts that constitute a function response. Each part may\n have a different IANA MIME type.",
+ "description": "Optional. Ordered `Parts` that constitute a function response. Parts may have different IANA MIME types.",
"title": "Parts"
},
"id": {
@@ -49436,7 +50727,7 @@ Submodules },
"FunctionResponseBlob": {
"additionalProperties": false,
- "description": "Raw media bytes for function response.\n\nText should not be sent as raw bytes, use the FunctionResponse.response\nfield.",
+ "description": "Raw media bytes for function response.\n\nText should not be sent as raw bytes, use the 'text' field.",
"properties": {
"mimeType": {
"anyOf": [
@@ -49462,7 +50753,7 @@ Submodules }
],
"default": null,
- "description": "Required. Inline media bytes.",
+ "description": "Required. Raw bytes.",
"title": "Data"
},
"displayName": {
@@ -49475,7 +50766,7 @@ Submodules }
],
"default": null,
- "description": "Optional. Display name of the blob.\n Used to provide a label or filename to distinguish blobs.",
+ "description": "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.",
"title": "Displayname"
}
},
@@ -49484,7 +50775,7 @@ Submodules },
"FunctionResponseFileData": {
"additionalProperties": false,
- "description": "URI based data for function response.",
+ "description": "URI based data for function response.\n\nThis data type is not supported in Gemini API.",
"properties": {
"fileUri": {
"anyOf": [
@@ -49522,7 +50813,7 @@ Submodules