From fc33366874f10567d9ec032a6b926fcee5966f74 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 20 Sep 2024 13:02:04 -0400 Subject: [PATCH] feat: A new field `response_logprbs` is added to message `.google.cloud.aiplatform.v1.GenerationConfig` (#7680) * feat: Add CIVIC_INTEGRITY category to SafetySettings for prediction service PiperOrigin-RevId: 676040723 Source-Link: https://github.com/googleapis/googleapis/commit/cf775e213aa691494c6aa823d20620cb6e0c1c75 Source-Link: https://github.com/googleapis/googleapis-gen/commit/17d42e26cdcb90bb14b4efbf4761d7739b6b306b Copy-Tag: eyJwIjoiQWlQbGF0Zm9ybS8uT3dsQm90LnlhbWwiLCJoIjoiMTdkNDJlMjZjZGNiOTBiYjE0YjRlZmJmNDc2MWQ3NzM5YjZiMzA2YiJ9 * feat: A new field `any_of` is added to message `.google.cloud.aiplatform.v1.Schema` PiperOrigin-RevId: 676462752 Source-Link: https://github.com/googleapis/googleapis/commit/bd0c988bca62e31c2866bc3dc9fd9d60ad581110 Source-Link: https://github.com/googleapis/googleapis-gen/commit/3ac8004545589c69b4b0aee51efae42ec5b0f22d Copy-Tag: eyJwIjoiQWlQbGF0Zm9ybS8uT3dsQm90LnlhbWwiLCJoIjoiM2FjODAwNDU0NTU4OWM2OWI0YjBhZWU1MWVmYWU0MmVjNWIwZjIyZCJ9 * feat: A new field `response_logprbs` is added to message `.google.cloud.aiplatform.v1.GenerationConfig` feat: A new field `logprbs` is added to message `.google.cloud.aiplatform.v1.GenerationConfig` feat: A new field `logprobs_result` is added to message `.google.cloud.aiplatform.v1.Candidate` feat: A new field `model_version` is added to message `.google.cloud.aiplatform.v1.GenerateContentResponse` PiperOrigin-RevId: 676556181 Source-Link: https://github.com/googleapis/googleapis/commit/07b069bfb0f49d0e95097ac1811c99fc7ad6d3f4 Source-Link: https://github.com/googleapis/googleapis-gen/commit/919c46929d2eb6427116895ae4926fd8636c7d2d Copy-Tag: eyJwIjoiQWlQbGF0Zm9ybS8uT3dsQm90LnlhbWwiLCJoIjoiOTE5YzQ2OTI5ZDJlYjY0MjcxMTY4OTVhZTQ5MjZmZDg2MzZjN2QyZCJ9 --- AiPlatform/metadata/V1/Content.php | Bin 6413 -> 7024 bytes AiPlatform/metadata/V1/Openapi.php | Bin 1845 -> 1902 bytes AiPlatform/metadata/V1/PredictionService.php | Bin 9687 -> 9715 bytes AiPlatform/src/V1/Candidate.php | 44 +++++ AiPlatform/src/V1/GenerateContentResponse.php | 34 ++++ AiPlatform/src/V1/GenerationConfig.php | 88 ++++++++++ AiPlatform/src/V1/HarmCategory.php | 7 + AiPlatform/src/V1/LogprobsResult.php | 105 +++++++++++ .../src/V1/LogprobsResult/Candidate.php | 166 ++++++++++++++++++ .../src/V1/LogprobsResult/TopCandidates.php | 68 +++++++ AiPlatform/src/V1/Schema.php | 38 ++++ .../V1/Client/PredictionServiceClientTest.php | 8 + 12 files changed, 558 insertions(+) create mode 100644 AiPlatform/src/V1/LogprobsResult.php create mode 100644 AiPlatform/src/V1/LogprobsResult/Candidate.php create mode 100644 AiPlatform/src/V1/LogprobsResult/TopCandidates.php diff --git a/AiPlatform/metadata/V1/Content.php b/AiPlatform/metadata/V1/Content.php index 8f5c13f8aa3169a6030f628e1bcb515d5c9fdb6a..6b5b5ae57d095b4e200c96856151147b3da3c4c9 100644 GIT binary patch delta 602 zcmeA*`e3$!mzimX!DfEu`OHiQxh8L5J87@XC0LYNT#%nvoEo2#pI%UupHwU%q`;`b z;l%vFkxIODG=04kvCdPMC$8jktSQ8UIY)FVHRJ!Nm`=3Z$ttr$mAaXd}0g z*5r+xGJHNzCkBC~HoFMwGwJj*bD@a~1#t0|N83FZCw}Jow delta 101 zcmV-r0Gj{sHjOf{4FdwTE3*#+p92Ej36rn}$&729y5>7Xb&87YJto z2$O#ZUI7WS-UychvzQBt1p%^?BN2VmkS~A diff --git a/AiPlatform/metadata/V1/Openapi.php b/AiPlatform/metadata/V1/Openapi.php index 4fc3613d492b52249d45c258ef295c3918470cc9..b913e864fe5ac46b999eb723571cba06bf806b84 100644 GIT binary patch delta 51 zcmdnW_l|EvAQQ`FPA-j!-Wro@nXH*Mux;MOw1A0E$efEUF|RT{KTU#Lfq8Ndv-ajF H*4vB#o{kSw delta 32 ocmaFIx0P>0AQQ_hPA-j!-Wro@nXH+zWY*h^0JJ^}BLDyZ diff --git a/AiPlatform/metadata/V1/PredictionService.php b/AiPlatform/metadata/V1/PredictionService.php index 00707b13081911f2a98274fa780d5230af49c5f2..7356318f583a3a5c7e5d4abe55b350f00d45395f 100644 GIT binary patch delta 65 zcmcca{n>j%5DUvCCobd3j;zuX(U60szgN6iEO8 delta 42 ycmezDecgLQ5DUvTCobd3j;zuX(double avg_logprobs = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ protected $avg_logprobs = 0.0; + /** + * Output only. Log-likelihood scores for the response tokens and top tokens + * + * Generated from protobuf field .google.cloud.aiplatform.v1.LogprobsResult logprobs_result = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $logprobs_result = null; /** * Output only. The reason why the model stopped generating tokens. * If empty, the model has not stopped generating the tokens. @@ -87,6 +93,8 @@ class Candidate extends \Google\Protobuf\Internal\Message * Output only. Confidence score of the candidate. * @type float $avg_logprobs * Output only. Average log probability score of the candidate. + * @type \Google\Cloud\AIPlatform\V1\LogprobsResult $logprobs_result + * Output only. Log-likelihood scores for the response tokens and top tokens * @type int $finish_reason * Output only. The reason why the model stopped generating tokens. * If empty, the model has not stopped generating the tokens. @@ -221,6 +229,42 @@ public function setAvgLogprobs($var) return $this; } + /** + * Output only. Log-likelihood scores for the response tokens and top tokens + * + * Generated from protobuf field .google.cloud.aiplatform.v1.LogprobsResult logprobs_result = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\AIPlatform\V1\LogprobsResult|null + */ + public function getLogprobsResult() + { + return $this->logprobs_result; + } + + public function hasLogprobsResult() + { + return isset($this->logprobs_result); + } + + public function clearLogprobsResult() + { + unset($this->logprobs_result); + } + + /** + * Output only. Log-likelihood scores for the response tokens and top tokens + * + * Generated from protobuf field .google.cloud.aiplatform.v1.LogprobsResult logprobs_result = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\AIPlatform\V1\LogprobsResult $var + * @return $this + */ + public function setLogprobsResult($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AIPlatform\V1\LogprobsResult::class); + $this->logprobs_result = $var; + + return $this; + } + /** * Output only. The reason why the model stopped generating tokens. * If empty, the model has not stopped generating the tokens. diff --git a/AiPlatform/src/V1/GenerateContentResponse.php b/AiPlatform/src/V1/GenerateContentResponse.php index b694b187304a..c51989167c51 100644 --- a/AiPlatform/src/V1/GenerateContentResponse.php +++ b/AiPlatform/src/V1/GenerateContentResponse.php @@ -21,6 +21,12 @@ class GenerateContentResponse extends \Google\Protobuf\Internal\Message * Generated from protobuf field repeated .google.cloud.aiplatform.v1.Candidate candidates = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ private $candidates; + /** + * Output only. The model version used to generate the response. + * + * Generated from protobuf field string model_version = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $model_version = ''; /** * Output only. Content filter results for a prompt sent in the request. * Note: Sent only in the first stream chunk. @@ -44,6 +50,8 @@ class GenerateContentResponse extends \Google\Protobuf\Internal\Message * * @type array<\Google\Cloud\AIPlatform\V1\Candidate>|\Google\Protobuf\Internal\RepeatedField $candidates * Output only. Generated candidates. + * @type string $model_version + * Output only. The model version used to generate the response. * @type \Google\Cloud\AIPlatform\V1\GenerateContentResponse\PromptFeedback $prompt_feedback * Output only. Content filter results for a prompt sent in the request. * Note: Sent only in the first stream chunk. @@ -83,6 +91,32 @@ public function setCandidates($var) return $this; } + /** + * Output only. The model version used to generate the response. + * + * Generated from protobuf field string model_version = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getModelVersion() + { + return $this->model_version; + } + + /** + * Output only. The model version used to generate the response. + * + * Generated from protobuf field string model_version = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setModelVersion($var) + { + GPBUtil::checkString($var, True); + $this->model_version = $var; + + return $this; + } + /** * Output only. Content filter results for a prompt sent in the request. * Note: Sent only in the first stream chunk. diff --git a/AiPlatform/src/V1/GenerationConfig.php b/AiPlatform/src/V1/GenerationConfig.php index dc7419481c60..edcaf047a54d 100644 --- a/AiPlatform/src/V1/GenerationConfig.php +++ b/AiPlatform/src/V1/GenerationConfig.php @@ -51,6 +51,18 @@ class GenerationConfig extends \Google\Protobuf\Internal\Message * Generated from protobuf field repeated string stop_sequences = 6 [(.google.api.field_behavior) = OPTIONAL]; */ private $stop_sequences; + /** + * Optional. If true, export the logprobs results in response. + * + * Generated from protobuf field optional bool response_logprobs = 18 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $response_logprobs = null; + /** + * Optional. Logit probabilities. + * + * Generated from protobuf field optional int32 logprobs = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $logprobs = null; /** * Optional. Positive penalties. * @@ -118,6 +130,10 @@ class GenerationConfig extends \Google\Protobuf\Internal\Message * Optional. The maximum number of output tokens to generate per message. * @type array|\Google\Protobuf\Internal\RepeatedField $stop_sequences * Optional. Stop sequences. + * @type bool $response_logprobs + * Optional. If true, export the logprobs results in response. + * @type int $logprobs + * Optional. Logit probabilities. * @type float $presence_penalty * Optional. Positive penalties. * @type float $frequency_penalty @@ -355,6 +371,78 @@ public function setStopSequences($var) return $this; } + /** + * Optional. If true, export the logprobs results in response. + * + * Generated from protobuf field optional bool response_logprobs = 18 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getResponseLogprobs() + { + return isset($this->response_logprobs) ? $this->response_logprobs : false; + } + + public function hasResponseLogprobs() + { + return isset($this->response_logprobs); + } + + public function clearResponseLogprobs() + { + unset($this->response_logprobs); + } + + /** + * Optional. If true, export the logprobs results in response. + * + * Generated from protobuf field optional bool response_logprobs = 18 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setResponseLogprobs($var) + { + GPBUtil::checkBool($var); + $this->response_logprobs = $var; + + return $this; + } + + /** + * Optional. Logit probabilities. + * + * Generated from protobuf field optional int32 logprobs = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getLogprobs() + { + return isset($this->logprobs) ? $this->logprobs : 0; + } + + public function hasLogprobs() + { + return isset($this->logprobs); + } + + public function clearLogprobs() + { + unset($this->logprobs); + } + + /** + * Optional. Logit probabilities. + * + * Generated from protobuf field optional int32 logprobs = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setLogprobs($var) + { + GPBUtil::checkInt32($var); + $this->logprobs = $var; + + return $this; + } + /** * Optional. Positive penalties. * diff --git a/AiPlatform/src/V1/HarmCategory.php b/AiPlatform/src/V1/HarmCategory.php index 26d10e848ab9..3d0b26112191 100644 --- a/AiPlatform/src/V1/HarmCategory.php +++ b/AiPlatform/src/V1/HarmCategory.php @@ -43,6 +43,12 @@ class HarmCategory * Generated from protobuf enum HARM_CATEGORY_SEXUALLY_EXPLICIT = 4; */ const HARM_CATEGORY_SEXUALLY_EXPLICIT = 4; + /** + * The harm category is civic integrity. + * + * Generated from protobuf enum HARM_CATEGORY_CIVIC_INTEGRITY = 5; + */ + const HARM_CATEGORY_CIVIC_INTEGRITY = 5; private static $valueToName = [ self::HARM_CATEGORY_UNSPECIFIED => 'HARM_CATEGORY_UNSPECIFIED', @@ -50,6 +56,7 @@ class HarmCategory self::HARM_CATEGORY_DANGEROUS_CONTENT => 'HARM_CATEGORY_DANGEROUS_CONTENT', self::HARM_CATEGORY_HARASSMENT => 'HARM_CATEGORY_HARASSMENT', self::HARM_CATEGORY_SEXUALLY_EXPLICIT => 'HARM_CATEGORY_SEXUALLY_EXPLICIT', + self::HARM_CATEGORY_CIVIC_INTEGRITY => 'HARM_CATEGORY_CIVIC_INTEGRITY', ]; public static function name($value) diff --git a/AiPlatform/src/V1/LogprobsResult.php b/AiPlatform/src/V1/LogprobsResult.php new file mode 100644 index 000000000000..67a50884f9e2 --- /dev/null +++ b/AiPlatform/src/V1/LogprobsResult.php @@ -0,0 +1,105 @@ +google.cloud.aiplatform.v1.LogprobsResult + */ +class LogprobsResult extends \Google\Protobuf\Internal\Message +{ + /** + * Length = total number of decoding steps. + * + * Generated from protobuf field repeated .google.cloud.aiplatform.v1.LogprobsResult.TopCandidates top_candidates = 1; + */ + private $top_candidates; + /** + * Length = total number of decoding steps. + * The chosen candidates may or may not be in top_candidates. + * + * Generated from protobuf field repeated .google.cloud.aiplatform.v1.LogprobsResult.Candidate chosen_candidates = 2; + */ + private $chosen_candidates; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\AIPlatform\V1\LogprobsResult\TopCandidates>|\Google\Protobuf\Internal\RepeatedField $top_candidates + * Length = total number of decoding steps. + * @type array<\Google\Cloud\AIPlatform\V1\LogprobsResult\Candidate>|\Google\Protobuf\Internal\RepeatedField $chosen_candidates + * Length = total number of decoding steps. + * The chosen candidates may or may not be in top_candidates. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Aiplatform\V1\Content::initOnce(); + parent::__construct($data); + } + + /** + * Length = total number of decoding steps. + * + * Generated from protobuf field repeated .google.cloud.aiplatform.v1.LogprobsResult.TopCandidates top_candidates = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTopCandidates() + { + return $this->top_candidates; + } + + /** + * Length = total number of decoding steps. + * + * Generated from protobuf field repeated .google.cloud.aiplatform.v1.LogprobsResult.TopCandidates top_candidates = 1; + * @param array<\Google\Cloud\AIPlatform\V1\LogprobsResult\TopCandidates>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTopCandidates($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AIPlatform\V1\LogprobsResult\TopCandidates::class); + $this->top_candidates = $arr; + + return $this; + } + + /** + * Length = total number of decoding steps. + * The chosen candidates may or may not be in top_candidates. + * + * Generated from protobuf field repeated .google.cloud.aiplatform.v1.LogprobsResult.Candidate chosen_candidates = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getChosenCandidates() + { + return $this->chosen_candidates; + } + + /** + * Length = total number of decoding steps. + * The chosen candidates may or may not be in top_candidates. + * + * Generated from protobuf field repeated .google.cloud.aiplatform.v1.LogprobsResult.Candidate chosen_candidates = 2; + * @param array<\Google\Cloud\AIPlatform\V1\LogprobsResult\Candidate>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setChosenCandidates($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AIPlatform\V1\LogprobsResult\Candidate::class); + $this->chosen_candidates = $arr; + + return $this; + } + +} + diff --git a/AiPlatform/src/V1/LogprobsResult/Candidate.php b/AiPlatform/src/V1/LogprobsResult/Candidate.php new file mode 100644 index 000000000000..aacd45c39de2 --- /dev/null +++ b/AiPlatform/src/V1/LogprobsResult/Candidate.php @@ -0,0 +1,166 @@ +google.cloud.aiplatform.v1.LogprobsResult.Candidate + */ +class Candidate extends \Google\Protobuf\Internal\Message +{ + /** + * The candidate’s token string value. + * + * Generated from protobuf field optional string token = 1; + */ + protected $token = null; + /** + * The candidate’s token id value. + * + * Generated from protobuf field optional int32 token_id = 3; + */ + protected $token_id = null; + /** + * The candidate's log probability. + * + * Generated from protobuf field optional float log_probability = 2; + */ + protected $log_probability = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $token + * The candidate’s token string value. + * @type int $token_id + * The candidate’s token id value. + * @type float $log_probability + * The candidate's log probability. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Aiplatform\V1\Content::initOnce(); + parent::__construct($data); + } + + /** + * The candidate’s token string value. + * + * Generated from protobuf field optional string token = 1; + * @return string + */ + public function getToken() + { + return isset($this->token) ? $this->token : ''; + } + + public function hasToken() + { + return isset($this->token); + } + + public function clearToken() + { + unset($this->token); + } + + /** + * The candidate’s token string value. + * + * Generated from protobuf field optional string token = 1; + * @param string $var + * @return $this + */ + public function setToken($var) + { + GPBUtil::checkString($var, True); + $this->token = $var; + + return $this; + } + + /** + * The candidate’s token id value. + * + * Generated from protobuf field optional int32 token_id = 3; + * @return int + */ + public function getTokenId() + { + return isset($this->token_id) ? $this->token_id : 0; + } + + public function hasTokenId() + { + return isset($this->token_id); + } + + public function clearTokenId() + { + unset($this->token_id); + } + + /** + * The candidate’s token id value. + * + * Generated from protobuf field optional int32 token_id = 3; + * @param int $var + * @return $this + */ + public function setTokenId($var) + { + GPBUtil::checkInt32($var); + $this->token_id = $var; + + return $this; + } + + /** + * The candidate's log probability. + * + * Generated from protobuf field optional float log_probability = 2; + * @return float + */ + public function getLogProbability() + { + return isset($this->log_probability) ? $this->log_probability : 0.0; + } + + public function hasLogProbability() + { + return isset($this->log_probability); + } + + public function clearLogProbability() + { + unset($this->log_probability); + } + + /** + * The candidate's log probability. + * + * Generated from protobuf field optional float log_probability = 2; + * @param float $var + * @return $this + */ + public function setLogProbability($var) + { + GPBUtil::checkFloat($var); + $this->log_probability = $var; + + return $this; + } + +} + + diff --git a/AiPlatform/src/V1/LogprobsResult/TopCandidates.php b/AiPlatform/src/V1/LogprobsResult/TopCandidates.php new file mode 100644 index 000000000000..dba1c1d2958e --- /dev/null +++ b/AiPlatform/src/V1/LogprobsResult/TopCandidates.php @@ -0,0 +1,68 @@ +google.cloud.aiplatform.v1.LogprobsResult.TopCandidates + */ +class TopCandidates extends \Google\Protobuf\Internal\Message +{ + /** + * Sorted by log probability in descending order. + * + * Generated from protobuf field repeated .google.cloud.aiplatform.v1.LogprobsResult.Candidate candidates = 1; + */ + private $candidates; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\AIPlatform\V1\LogprobsResult\Candidate>|\Google\Protobuf\Internal\RepeatedField $candidates + * Sorted by log probability in descending order. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Aiplatform\V1\Content::initOnce(); + parent::__construct($data); + } + + /** + * Sorted by log probability in descending order. + * + * Generated from protobuf field repeated .google.cloud.aiplatform.v1.LogprobsResult.Candidate candidates = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getCandidates() + { + return $this->candidates; + } + + /** + * Sorted by log probability in descending order. + * + * Generated from protobuf field repeated .google.cloud.aiplatform.v1.LogprobsResult.Candidate candidates = 1; + * @param array<\Google\Cloud\AIPlatform\V1\LogprobsResult\Candidate>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setCandidates($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AIPlatform\V1\LogprobsResult\Candidate::class); + $this->candidates = $arr; + + return $this; + } + +} + + diff --git a/AiPlatform/src/V1/Schema.php b/AiPlatform/src/V1/Schema.php index 5d5b26401dd6..2bdb1b7f96c6 100644 --- a/AiPlatform/src/V1/Schema.php +++ b/AiPlatform/src/V1/Schema.php @@ -158,6 +158,13 @@ class Schema extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.protobuf.Value example = 4 [(.google.api.field_behavior) = OPTIONAL]; */ protected $example = null; + /** + * Optional. The value should be validated against any (one or more) of the + * subschemas in the list. + * + * Generated from protobuf field repeated .google.cloud.aiplatform.v1.Schema any_of = 11 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $any_of; /** * Constructor. @@ -221,6 +228,9 @@ class Schema extends \Google\Protobuf\Internal\Message * @type \Google\Protobuf\Value $example * Optional. Example of the object. Will only populated when the object is the * root. + * @type array<\Google\Cloud\AIPlatform\V1\Schema>|\Google\Protobuf\Internal\RepeatedField $any_of + * Optional. The value should be validated against any (one or more) of the + * subschemas in the list. * } */ public function __construct($data = NULL) { @@ -832,5 +842,33 @@ public function setExample($var) return $this; } + /** + * Optional. The value should be validated against any (one or more) of the + * subschemas in the list. + * + * Generated from protobuf field repeated .google.cloud.aiplatform.v1.Schema any_of = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAnyOf() + { + return $this->any_of; + } + + /** + * Optional. The value should be validated against any (one or more) of the + * subschemas in the list. + * + * Generated from protobuf field repeated .google.cloud.aiplatform.v1.Schema any_of = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\AIPlatform\V1\Schema>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAnyOf($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AIPlatform\V1\Schema::class); + $this->any_of = $arr; + + return $this; + } + } diff --git a/AiPlatform/tests/Unit/V1/Client/PredictionServiceClientTest.php b/AiPlatform/tests/Unit/V1/Client/PredictionServiceClientTest.php index 037cb7db22d2..328e0c73d175 100644 --- a/AiPlatform/tests/Unit/V1/Client/PredictionServiceClientTest.php +++ b/AiPlatform/tests/Unit/V1/Client/PredictionServiceClientTest.php @@ -298,7 +298,9 @@ public function generateContentTest() ]); $this->assertTrue($transport->isExhausted()); // Mock response + $modelVersion = 'modelVersion-1669102142'; $expectedResponse = new GenerateContentResponse(); + $expectedResponse->setModelVersion($modelVersion); $transport->addResponse($expectedResponse); // Mock request $model = 'model104069929'; @@ -776,11 +778,17 @@ public function streamGenerateContentTest() ]); $this->assertTrue($transport->isExhausted()); // Mock response + $modelVersion = 'modelVersion-1669102142'; $expectedResponse = new GenerateContentResponse(); + $expectedResponse->setModelVersion($modelVersion); $transport->addResponse($expectedResponse); + $modelVersion2 = 'modelVersion2-1984354059'; $expectedResponse2 = new GenerateContentResponse(); + $expectedResponse2->setModelVersion($modelVersion2); $transport->addResponse($expectedResponse2); + $modelVersion3 = 'modelVersion3-1984354058'; $expectedResponse3 = new GenerateContentResponse(); + $expectedResponse3->setModelVersion($modelVersion3); $transport->addResponse($expectedResponse3); // Mock request $model = 'model104069929';