From 5edf09f0206267d8d4a07c8d405dd802f41520e6 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 18 Sep 2024 17:12:43 -0400 Subject: [PATCH] feat: A new field `generation_config` is added to message `.google.cloud.aiplatform.v1.CountTokensRequest` (#7676) * feat: A new field `property_ordering` is added to message `.google.cloud.aiplatform.v1.Schema` PiperOrigin-RevId: 675187467 Source-Link: https://github.com/googleapis/googleapis/commit/38d33ad1da5ece4874e4b7b7921df7299835b253 Source-Link: https://github.com/googleapis/googleapis-gen/commit/95e20a9547e1cbcb0a2ce443f62d05bc001a79bb Copy-Tag: eyJwIjoiQWlQbGF0Zm9ybS8uT3dsQm90LnlhbWwiLCJoIjoiOTVlMjBhOTU0N2UxY2JjYjBhMmNlNDQzZjYyZDA1YmMwMDFhNzliYiJ9 * feat: A new field `generation_config` is added to message `.google.cloud.aiplatform.v1.CountTokensRequest` feat: A new field `labels` is added to message `.google.cloud.aiplatform.v1.GenerateContentRequest` PiperOrigin-RevId: 675839175 Source-Link: https://github.com/googleapis/googleapis/commit/49d2887d428ca722e89b4009f4b629e53fe6f8ec Source-Link: https://github.com/googleapis/googleapis-gen/commit/e6a2931c45ceeea921e245904eef1075c9e44180 Copy-Tag: eyJwIjoiQWlQbGF0Zm9ybS8uT3dsQm90LnlhbWwiLCJoIjoiZTZhMjkzMWM0NWNlZWVhOTIxZTI0NTkwNGVlZjEwNzVjOWU0NDE4MCJ9 --- AiPlatform/metadata/V1/Openapi.php | Bin 1813 -> 1845 bytes AiPlatform/metadata/V1/PredictionService.php | Bin 9450 -> 9687 bytes AiPlatform/src/V1/CountTokensRequest.php | 48 ++++++++++++++++ AiPlatform/src/V1/GenerateContentRequest.php | 54 ++++++++++++++++++ .../GenerateContentResponse/UsageMetadata.php | 7 +++ AiPlatform/src/V1/Schema.php | 46 ++++++++++++++- 6 files changed, 153 insertions(+), 2 deletions(-) diff --git a/AiPlatform/metadata/V1/Openapi.php b/AiPlatform/metadata/V1/Openapi.php index 2511c27b0bc69339241643f69d2ce3f8cfd1ffb8..4fc3613d492b52249d45c258ef295c3918470cc9 100644 GIT binary patch delta 58 zcmbQrx0P>0AQQ_hPA-j!-Wro@nXDPVZ{Eq&&nP9wC0J0DUyxc9Ll#*JMnU^jh Oslcqkx!H;3G7|tNFA{D5 delta 31 ncmdnWHNhomg1Yr?&b_GTaZX=z^ zAH`%Q$1AW;J}1n_;=$O#IC;IGgqV{Emr#6qYF=tlVo7FxUVL(XURq}QGh<`heCDKG;~vV)o=C|FpUT3n*%1D15nD=Dg+>>xZxPfC}I8%a!v on~OO+wNio+=nPIFUM|+M#GKMp2__KNipc`#3dzl1gue*@08)B9xc~qF delta 83 zcmV-Z0IdJlOX^9mQUnCaKngRHK?NI;W*D=H1kwuv>H@P}5K{pcLKO-VUvqhLbY*Q{ pX>N0La&=>LX>V?mFcMJ&*#im|ldmEcvzrnW0h0t2mb1we4iURc8{Gf^ diff --git a/AiPlatform/src/V1/CountTokensRequest.php b/AiPlatform/src/V1/CountTokensRequest.php index 799caf4c9d7..036ec2dcc97 100644 --- a/AiPlatform/src/V1/CountTokensRequest.php +++ b/AiPlatform/src/V1/CountTokensRequest.php @@ -62,6 +62,13 @@ class CountTokensRequest extends \Google\Protobuf\Internal\Message * Generated from protobuf field repeated .google.cloud.aiplatform.v1.Tool tools = 6 [(.google.api.field_behavior) = OPTIONAL]; */ private $tools; + /** + * Optional. Generation config that the model will use to generate the + * response. + * + * Generated from protobuf field optional .google.cloud.aiplatform.v1.GenerationConfig generation_config = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $generation_config = null; /** * @param string $endpoint Required. The name of the Endpoint requested to perform token counting. @@ -111,6 +118,9 @@ public static function build(string $endpoint, array $instances): self * A `Tool` is a piece of code that enables the system to interact with * external systems to perform an action, or set of actions, outside of * knowledge and scope of the model. + * @type \Google\Cloud\AIPlatform\V1\GenerationConfig $generation_config + * Optional. Generation config that the model will use to generate the + * response. * } */ public function __construct($data = NULL) { @@ -306,5 +316,43 @@ public function setTools($var) return $this; } + /** + * Optional. Generation config that the model will use to generate the + * response. + * + * Generated from protobuf field optional .google.cloud.aiplatform.v1.GenerationConfig generation_config = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\AIPlatform\V1\GenerationConfig|null + */ + public function getGenerationConfig() + { + return $this->generation_config; + } + + public function hasGenerationConfig() + { + return isset($this->generation_config); + } + + public function clearGenerationConfig() + { + unset($this->generation_config); + } + + /** + * Optional. Generation config that the model will use to generate the + * response. + * + * Generated from protobuf field optional .google.cloud.aiplatform.v1.GenerationConfig generation_config = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\AIPlatform\V1\GenerationConfig $var + * @return $this + */ + public function setGenerationConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\AIPlatform\V1\GenerationConfig::class); + $this->generation_config = $var; + + return $this; + } + } diff --git a/AiPlatform/src/V1/GenerateContentRequest.php b/AiPlatform/src/V1/GenerateContentRequest.php index 57abea8b41b..ce79495ca96 100644 --- a/AiPlatform/src/V1/GenerateContentRequest.php +++ b/AiPlatform/src/V1/GenerateContentRequest.php @@ -60,6 +60,17 @@ class GenerateContentRequest extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.cloud.aiplatform.v1.ToolConfig tool_config = 7 [(.google.api.field_behavior) = OPTIONAL]; */ protected $tool_config = null; + /** + * Optional. The labels with user-defined metadata for the request. It is used + * for billing and reporting only. + * Label keys and values can be no longer than 63 characters + * (Unicode codepoints) and can only contain lowercase letters, numeric + * characters, underscores, and dashes. International characters are allowed. + * Label values are optional. Label keys must start with a letter. + * + * Generated from protobuf field map labels = 10 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $labels; /** * Optional. Per request settings for blocking unsafe content. * Enforced on GenerateContentResponse.candidates. @@ -131,6 +142,13 @@ public static function build(string $model, array $contents): self * @type \Google\Cloud\AIPlatform\V1\ToolConfig $tool_config * Optional. Tool config. This config is shared for all tools provided in the * request. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Optional. The labels with user-defined metadata for the request. It is used + * for billing and reporting only. + * Label keys and values can be no longer than 63 characters + * (Unicode codepoints) and can only contain lowercase letters, numeric + * characters, underscores, and dashes. International characters are allowed. + * Label values are optional. Label keys must start with a letter. * @type array<\Google\Cloud\AIPlatform\V1\SafetySetting>|\Google\Protobuf\Internal\RepeatedField $safety_settings * Optional. Per request settings for blocking unsafe content. * Enforced on GenerateContentResponse.candidates. @@ -323,6 +341,42 @@ public function setToolConfig($var) return $this; } + /** + * Optional. The labels with user-defined metadata for the request. It is used + * for billing and reporting only. + * Label keys and values can be no longer than 63 characters + * (Unicode codepoints) and can only contain lowercase letters, numeric + * characters, underscores, and dashes. International characters are allowed. + * Label values are optional. Label keys must start with a letter. + * + * Generated from protobuf field map labels = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Optional. The labels with user-defined metadata for the request. It is used + * for billing and reporting only. + * Label keys and values can be no longer than 63 characters + * (Unicode codepoints) and can only contain lowercase letters, numeric + * characters, underscores, and dashes. International characters are allowed. + * Label values are optional. Label keys must start with a letter. + * + * Generated from protobuf field map labels = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + /** * Optional. Per request settings for blocking unsafe content. * Enforced on GenerateContentResponse.candidates. diff --git a/AiPlatform/src/V1/GenerateContentResponse/UsageMetadata.php b/AiPlatform/src/V1/GenerateContentResponse/UsageMetadata.php index 2fe733e6891..7d02df0bc04 100644 --- a/AiPlatform/src/V1/GenerateContentResponse/UsageMetadata.php +++ b/AiPlatform/src/V1/GenerateContentResponse/UsageMetadata.php @@ -30,6 +30,8 @@ class UsageMetadata extends \Google\Protobuf\Internal\Message */ protected $candidates_token_count = 0; /** + * Total token count for prompt and response candidates. + * * Generated from protobuf field int32 total_token_count = 3; */ protected $total_token_count = 0; @@ -47,6 +49,7 @@ class UsageMetadata extends \Google\Protobuf\Internal\Message * @type int $candidates_token_count * Number of tokens in the response(s). * @type int $total_token_count + * Total token count for prompt and response candidates. * } */ public function __construct($data = NULL) { @@ -111,6 +114,8 @@ public function setCandidatesTokenCount($var) } /** + * Total token count for prompt and response candidates. + * * Generated from protobuf field int32 total_token_count = 3; * @return int */ @@ -120,6 +125,8 @@ public function getTotalTokenCount() } /** + * Total token count for prompt and response candidates. + * * Generated from protobuf field int32 total_token_count = 3; * @param int $var * @return $this diff --git a/AiPlatform/src/V1/Schema.php b/AiPlatform/src/V1/Schema.php index 86a814c3aea..5d5b26401dd 100644 --- a/AiPlatform/src/V1/Schema.php +++ b/AiPlatform/src/V1/Schema.php @@ -11,8 +11,8 @@ /** * Schema is used to define the format of input/output data. Represents a select * subset of an [OpenAPI 3.0 schema - * object](https://spec.openapis.org/oas/v3.0.3#schema). More fields may be - * added in the future as needed. + * object](https://spec.openapis.org/oas/v3.0.3#schema-object). More fields may + * be added in the future as needed. * * Generated from protobuf message google.cloud.aiplatform.v1.Schema */ @@ -92,6 +92,14 @@ class Schema extends \Google\Protobuf\Internal\Message * Generated from protobuf field map properties = 3 [(.google.api.field_behavior) = OPTIONAL]; */ private $properties; + /** + * Optional. The order of the properties. + * Not a standard field in open api spec. Only used to support the order of + * the properties. + * + * Generated from protobuf field repeated string property_ordering = 25 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $property_ordering; /** * Optional. Required properties of Type.OBJECT. * @@ -187,6 +195,10 @@ class Schema extends \Google\Protobuf\Internal\Message * @type array|\Google\Protobuf\Internal\MapField $properties * Optional. SCHEMA FIELDS FOR TYPE OBJECT * Properties of Type.OBJECT. + * @type array|\Google\Protobuf\Internal\RepeatedField $property_ordering + * Optional. The order of the properties. + * Not a standard field in open api spec. Only used to support the order of + * the properties. * @type array|\Google\Protobuf\Internal\RepeatedField $required * Optional. Required properties of Type.OBJECT. * @type int|string $min_properties @@ -538,6 +550,36 @@ public function setProperties($var) return $this; } + /** + * Optional. The order of the properties. + * Not a standard field in open api spec. Only used to support the order of + * the properties. + * + * Generated from protobuf field repeated string property_ordering = 25 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPropertyOrdering() + { + return $this->property_ordering; + } + + /** + * Optional. The order of the properties. + * Not a standard field in open api spec. Only used to support the order of + * the properties. + * + * Generated from protobuf field repeated string property_ordering = 25 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPropertyOrdering($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->property_ordering = $arr; + + return $this; + } + /** * Optional. Required properties of Type.OBJECT. *