diff --git a/AiPlatform/metadata/V1/PredictionService.php b/AiPlatform/metadata/V1/PredictionService.php index 81c925e42c34..8d5d8615b658 100644 Binary files a/AiPlatform/metadata/V1/PredictionService.php and b/AiPlatform/metadata/V1/PredictionService.php differ diff --git a/AiPlatform/src/V1/GenerateContentResponse/UsageMetadata.php b/AiPlatform/src/V1/GenerateContentResponse/UsageMetadata.php index 9f76d139b551..c58ba7c4db93 100644 --- a/AiPlatform/src/V1/GenerateContentResponse/UsageMetadata.php +++ b/AiPlatform/src/V1/GenerateContentResponse/UsageMetadata.php @@ -67,6 +67,20 @@ class UsageMetadata extends \Google\Protobuf\Internal\Message * Generated from protobuf field repeated .google.cloud.aiplatform.v1.ModalityTokenCount candidates_tokens_details = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ private $candidates_tokens_details; + /** + * Output only. A detailed breakdown by modality of the token counts from + * the results of tool executions, which are provided back to the model as + * input. + * + * Generated from protobuf field repeated .google.cloud.aiplatform.v1.ModalityTokenCount tool_use_prompt_tokens_details = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $tool_use_prompt_tokens_details; + /** + * Output only. The traffic type for this request. + * + * Generated from protobuf field .google.cloud.aiplatform.v1.GenerateContentResponse.UsageMetadata.TrafficType traffic_type = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $traffic_type = 0; /** * Constructor. @@ -94,6 +108,12 @@ class UsageMetadata extends \Google\Protobuf\Internal\Message * input. * @type array<\Google\Cloud\AIPlatform\V1\ModalityTokenCount>|\Google\Protobuf\Internal\RepeatedField $candidates_tokens_details * Output only. List of modalities that were returned in the response. + * @type array<\Google\Cloud\AIPlatform\V1\ModalityTokenCount>|\Google\Protobuf\Internal\RepeatedField $tool_use_prompt_tokens_details + * Output only. A detailed breakdown by modality of the token counts from + * the results of tool executions, which are provided back to the model as + * input. + * @type int $traffic_type + * Output only. The traffic type for this request. * } */ public function __construct($data = NULL) { @@ -317,6 +337,62 @@ public function setCandidatesTokensDetails($var) return $this; } + /** + * Output only. A detailed breakdown by modality of the token counts from + * the results of tool executions, which are provided back to the model as + * input. + * + * Generated from protobuf field repeated .google.cloud.aiplatform.v1.ModalityTokenCount tool_use_prompt_tokens_details = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getToolUsePromptTokensDetails() + { + return $this->tool_use_prompt_tokens_details; + } + + /** + * Output only. A detailed breakdown by modality of the token counts from + * the results of tool executions, which are provided back to the model as + * input. + * + * Generated from protobuf field repeated .google.cloud.aiplatform.v1.ModalityTokenCount tool_use_prompt_tokens_details = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array<\Google\Cloud\AIPlatform\V1\ModalityTokenCount>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setToolUsePromptTokensDetails($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AIPlatform\V1\ModalityTokenCount::class); + $this->tool_use_prompt_tokens_details = $arr; + + return $this; + } + + /** + * Output only. The traffic type for this request. + * + * Generated from protobuf field .google.cloud.aiplatform.v1.GenerateContentResponse.UsageMetadata.TrafficType traffic_type = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getTrafficType() + { + return $this->traffic_type; + } + + /** + * Output only. The traffic type for this request. + * + * Generated from protobuf field .google.cloud.aiplatform.v1.GenerateContentResponse.UsageMetadata.TrafficType traffic_type = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setTrafficType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\AIPlatform\V1\GenerateContentResponse\UsageMetadata\TrafficType::class); + $this->traffic_type = $var; + + return $this; + } + } diff --git a/AiPlatform/src/V1/GenerateContentResponse/UsageMetadata/TrafficType.php b/AiPlatform/src/V1/GenerateContentResponse/UsageMetadata/TrafficType.php new file mode 100644 index 000000000000..e4e90b0f281e --- /dev/null +++ b/AiPlatform/src/V1/GenerateContentResponse/UsageMetadata/TrafficType.php @@ -0,0 +1,77 @@ +google.cloud.aiplatform.v1.GenerateContentResponse.UsageMetadata.TrafficType + */ +class TrafficType +{ + /** + * Unspecified request traffic type. + * + * Generated from protobuf enum TRAFFIC_TYPE_UNSPECIFIED = 0; + */ + const TRAFFIC_TYPE_UNSPECIFIED = 0; + /** + * The request was processed using Pay-As-You-Go quota. + * + * Generated from protobuf enum ON_DEMAND = 1; + */ + const ON_DEMAND = 1; + /** + * Type for Priority Pay-As-You-Go traffic. + * + * Generated from protobuf enum ON_DEMAND_PRIORITY = 3; + */ + const ON_DEMAND_PRIORITY = 3; + /** + * Type for Flex traffic. + * + * Generated from protobuf enum ON_DEMAND_FLEX = 4; + */ + const ON_DEMAND_FLEX = 4; + /** + * Type for Provisioned Throughput traffic. + * + * Generated from protobuf enum PROVISIONED_THROUGHPUT = 2; + */ + const PROVISIONED_THROUGHPUT = 2; + + private static $valueToName = [ + self::TRAFFIC_TYPE_UNSPECIFIED => 'TRAFFIC_TYPE_UNSPECIFIED', + self::ON_DEMAND => 'ON_DEMAND', + self::ON_DEMAND_PRIORITY => 'ON_DEMAND_PRIORITY', + self::ON_DEMAND_FLEX => 'ON_DEMAND_FLEX', + self::PROVISIONED_THROUGHPUT => 'PROVISIONED_THROUGHPUT', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +