From 295d0abbbc884f41c6ffa7e6d6575a8b79aac817 Mon Sep 17 00:00:00 2001 From: clarifai-prod <clarifai-prod@users.noreply.github.com> Date: Mon, 8 Apr 2024 13:09:57 +0000 Subject: [PATCH] GRPC clients version 10.3.0 --- VERSION | 2 +- src/Clarifai/Api/AppDuplicationFilters.php | 8 +- src/Clarifai/Api/AutoscaleConfig.php | 252 ++++++++++++++ src/Clarifai/Api/BuildInfo.php | 133 ++++++++ src/Clarifai/Api/CloudRegion.php | 129 ++++++++ src/Clarifai/Api/CloudRegion/Cloud.php | 75 +++++ src/Clarifai/Api/CloudRegion_Cloud.php | 16 + src/Clarifai/Api/ComputeInfo.php | 218 +++++++++++++ src/Clarifai/Api/Deployment.php | 307 ++++++++++++++++++ .../Api/Deployment/SchedulingChoice.php | 111 +++++++ .../Api/Deployment_SchedulingChoice.php | 16 + src/Clarifai/Api/EvalTestSetEntry.php | 94 +++++- src/Clarifai/Api/GetResourcePriceRequest.php | 157 --------- src/Clarifai/Api/GetResourcePriceResponse.php | 102 ------ src/Clarifai/Api/ListScopesRequest.php | 8 +- src/Clarifai/Api/ModelVersion.php | 88 +++++ src/Clarifai/Api/Nodepool.php | 292 +++++++++++++++++ src/Clarifai/Api/Nodepool/CapacityType.php | 60 ++++ src/Clarifai/Api/Nodepool_CapacityType.php | 16 + src/Clarifai/Api/PostModelOutputsRequest.php | 44 +++ .../Api/PutTaskAssignmentsRequest.php | 92 +++++- .../Api/PutTaskAssignmentsRequestAction.php | 55 ++++ src/Clarifai/Api/ReviewApproveConfig.php | 85 +++++ src/Clarifai/Api/ReviewRejectConfig.php | 85 +++++ .../Api/ReviewRequestChangesConfig.php | 85 +++++ src/Clarifai/Api/Runner.php | 233 ++++++++++++- src/Clarifai/Api/RunnerSelector.php | 183 +++++++++++ src/Clarifai/Api/Status/StatusCode.php | 12 + src/Clarifai/Api/V2Client.php | 60 +++- src/Clarifai/Auth/Scope/S.php | 16 +- .../Proto/Clarifai/Api/Resources.php | Bin 41150 -> 43072 bytes .../Proto/Clarifai/Api/Service.php | Bin 100895 -> 101202 bytes .../Proto/Clarifai/Api/Status/StatusCode.php | Bin 11888 -> 11955 bytes .../Proto/Clarifai/Auth/Scope/Scope.php | Bin 3805 -> 3871 bytes 34 files changed, 2728 insertions(+), 306 deletions(-) create mode 100644 src/Clarifai/Api/AutoscaleConfig.php create mode 100644 src/Clarifai/Api/BuildInfo.php create mode 100644 src/Clarifai/Api/CloudRegion.php create mode 100644 src/Clarifai/Api/CloudRegion/Cloud.php create mode 100644 src/Clarifai/Api/CloudRegion_Cloud.php create mode 100644 src/Clarifai/Api/ComputeInfo.php create mode 100644 src/Clarifai/Api/Deployment.php create mode 100644 src/Clarifai/Api/Deployment/SchedulingChoice.php create mode 100644 src/Clarifai/Api/Deployment_SchedulingChoice.php delete mode 100644 src/Clarifai/Api/GetResourcePriceRequest.php delete mode 100644 src/Clarifai/Api/GetResourcePriceResponse.php create mode 100644 src/Clarifai/Api/Nodepool.php create mode 100644 src/Clarifai/Api/Nodepool/CapacityType.php create mode 100644 src/Clarifai/Api/Nodepool_CapacityType.php create mode 100644 src/Clarifai/Api/ReviewApproveConfig.php create mode 100644 src/Clarifai/Api/ReviewRejectConfig.php create mode 100644 src/Clarifai/Api/ReviewRequestChangesConfig.php create mode 100644 src/Clarifai/Api/RunnerSelector.php diff --git a/VERSION b/VERSION index 26ee5b0..0719d81 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -10.2.1 +10.3.0 diff --git a/src/Clarifai/Api/AppDuplicationFilters.php b/src/Clarifai/Api/AppDuplicationFilters.php index f07ed6a..9a34107 100644 --- a/src/Clarifai/Api/AppDuplicationFilters.php +++ b/src/Clarifai/Api/AppDuplicationFilters.php @@ -41,7 +41,7 @@ class AppDuplicationFilters extends \Google\Protobuf\Internal\Message */ protected $copy_models = false; /** - * Copy workflows. Requires that copy_models and copy_concepts are also set. + * Copy workflows. * * Generated from protobuf field <code>bool copy_workflows = 5;</code> */ @@ -69,7 +69,7 @@ class AppDuplicationFilters extends \Google\Protobuf\Internal\Message * @type bool $copy_models * Copy models. Requires that copy_concepts is also set. * @type bool $copy_workflows - * Copy workflows. Requires that copy_models and copy_concepts are also set. + * Copy workflows. * @type bool $copy_installed_module_versions * Copy installed module versions. * } @@ -186,7 +186,7 @@ public function setCopyModels($var) } /** - * Copy workflows. Requires that copy_models and copy_concepts are also set. + * Copy workflows. * * Generated from protobuf field <code>bool copy_workflows = 5;</code> * @return bool @@ -197,7 +197,7 @@ public function getCopyWorkflows() } /** - * Copy workflows. Requires that copy_models and copy_concepts are also set. + * Copy workflows. * * Generated from protobuf field <code>bool copy_workflows = 5;</code> * @param bool $var diff --git a/src/Clarifai/Api/AutoscaleConfig.php b/src/Clarifai/Api/AutoscaleConfig.php new file mode 100644 index 0000000..5fccd7f --- /dev/null +++ b/src/Clarifai/Api/AutoscaleConfig.php @@ -0,0 +1,252 @@ +<?php +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: proto/clarifai/api/resources.proto + +namespace Clarifai\Api; + +use Google\Protobuf\Internal\GPBType; +use Google\Protobuf\Internal\RepeatedField; +use Google\Protobuf\Internal\GPBUtil; + +/** + * It might be better to do this as runner autoscaling so that resources + * of a model are very simply what that model needs at minimum. + * Note that resources for things like modes inside runners are not + * related to how many replicas of those runners are needed to handle traffic. + * + * Generated from protobuf message <code>clarifai.api.AutoscaleConfig</code> + */ +class AutoscaleConfig extends \Google\Protobuf\Internal\Message +{ + /** + * The minimum number of replicas for the runner to have. + * Defaults to 0 which means autoscaling can scale down to zero. + * If you want a replica always up then set to >= 1. + * + * Generated from protobuf field <code>uint32 min_replicas = 1;</code> + */ + protected $min_replicas = 0; + /** + * The maximium number of replicas to scale up the runner to. + * + * Generated from protobuf field <code>uint32 max_replicas = 2;</code> + */ + protected $max_replicas = 0; + /** + * The number of seconds of traffic history to consider when autoscaling. + * + * Generated from protobuf field <code>uint32 traffic_history_seconds = 3;</code> + */ + protected $traffic_history_seconds = 0; + /** + * The time to wait before scaling down after the last request. + * + * Generated from protobuf field <code>uint32 scale_down_delay_seconds = 4;</code> + */ + protected $scale_down_delay_seconds = 0; + /** + * The time to wait between scaling up replicas without burst traffic. + * + * Generated from protobuf field <code>uint32 scale_up_delay_seconds = 5;</code> + */ + protected $scale_up_delay_seconds = 0; + /** + * Depending on your plan you may be able to enable packing of resources into a single node + * for more compute and cost efficiency. + * + * Generated from protobuf field <code>bool enable_packing = 6;</code> + */ + protected $enable_packing = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $min_replicas + * The minimum number of replicas for the runner to have. + * Defaults to 0 which means autoscaling can scale down to zero. + * If you want a replica always up then set to >= 1. + * @type int $max_replicas + * The maximium number of replicas to scale up the runner to. + * @type int $traffic_history_seconds + * The number of seconds of traffic history to consider when autoscaling. + * @type int $scale_down_delay_seconds + * The time to wait before scaling down after the last request. + * @type int $scale_up_delay_seconds + * The time to wait between scaling up replicas without burst traffic. + * @type bool $enable_packing + * Depending on your plan you may be able to enable packing of resources into a single node + * for more compute and cost efficiency. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Proto\Clarifai\Api\Resources::initOnce(); + parent::__construct($data); + } + + /** + * The minimum number of replicas for the runner to have. + * Defaults to 0 which means autoscaling can scale down to zero. + * If you want a replica always up then set to >= 1. + * + * Generated from protobuf field <code>uint32 min_replicas = 1;</code> + * @return int + */ + public function getMinReplicas() + { + return $this->min_replicas; + } + + /** + * The minimum number of replicas for the runner to have. + * Defaults to 0 which means autoscaling can scale down to zero. + * If you want a replica always up then set to >= 1. + * + * Generated from protobuf field <code>uint32 min_replicas = 1;</code> + * @param int $var + * @return $this + */ + public function setMinReplicas($var) + { + GPBUtil::checkUint32($var); + $this->min_replicas = $var; + + return $this; + } + + /** + * The maximium number of replicas to scale up the runner to. + * + * Generated from protobuf field <code>uint32 max_replicas = 2;</code> + * @return int + */ + public function getMaxReplicas() + { + return $this->max_replicas; + } + + /** + * The maximium number of replicas to scale up the runner to. + * + * Generated from protobuf field <code>uint32 max_replicas = 2;</code> + * @param int $var + * @return $this + */ + public function setMaxReplicas($var) + { + GPBUtil::checkUint32($var); + $this->max_replicas = $var; + + return $this; + } + + /** + * The number of seconds of traffic history to consider when autoscaling. + * + * Generated from protobuf field <code>uint32 traffic_history_seconds = 3;</code> + * @return int + */ + public function getTrafficHistorySeconds() + { + return $this->traffic_history_seconds; + } + + /** + * The number of seconds of traffic history to consider when autoscaling. + * + * Generated from protobuf field <code>uint32 traffic_history_seconds = 3;</code> + * @param int $var + * @return $this + */ + public function setTrafficHistorySeconds($var) + { + GPBUtil::checkUint32($var); + $this->traffic_history_seconds = $var; + + return $this; + } + + /** + * The time to wait before scaling down after the last request. + * + * Generated from protobuf field <code>uint32 scale_down_delay_seconds = 4;</code> + * @return int + */ + public function getScaleDownDelaySeconds() + { + return $this->scale_down_delay_seconds; + } + + /** + * The time to wait before scaling down after the last request. + * + * Generated from protobuf field <code>uint32 scale_down_delay_seconds = 4;</code> + * @param int $var + * @return $this + */ + public function setScaleDownDelaySeconds($var) + { + GPBUtil::checkUint32($var); + $this->scale_down_delay_seconds = $var; + + return $this; + } + + /** + * The time to wait between scaling up replicas without burst traffic. + * + * Generated from protobuf field <code>uint32 scale_up_delay_seconds = 5;</code> + * @return int + */ + public function getScaleUpDelaySeconds() + { + return $this->scale_up_delay_seconds; + } + + /** + * The time to wait between scaling up replicas without burst traffic. + * + * Generated from protobuf field <code>uint32 scale_up_delay_seconds = 5;</code> + * @param int $var + * @return $this + */ + public function setScaleUpDelaySeconds($var) + { + GPBUtil::checkUint32($var); + $this->scale_up_delay_seconds = $var; + + return $this; + } + + /** + * Depending on your plan you may be able to enable packing of resources into a single node + * for more compute and cost efficiency. + * + * Generated from protobuf field <code>bool enable_packing = 6;</code> + * @return bool + */ + public function getEnablePacking() + { + return $this->enable_packing; + } + + /** + * Depending on your plan you may be able to enable packing of resources into a single node + * for more compute and cost efficiency. + * + * Generated from protobuf field <code>bool enable_packing = 6;</code> + * @param bool $var + * @return $this + */ + public function setEnablePacking($var) + { + GPBUtil::checkBool($var); + $this->enable_packing = $var; + + return $this; + } + +} + diff --git a/src/Clarifai/Api/BuildInfo.php b/src/Clarifai/Api/BuildInfo.php new file mode 100644 index 0000000..d78568f --- /dev/null +++ b/src/Clarifai/Api/BuildInfo.php @@ -0,0 +1,133 @@ +<?php +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: proto/clarifai/api/resources.proto + +namespace Clarifai\Api; + +use Google\Protobuf\Internal\GPBType; +use Google\Protobuf\Internal\RepeatedField; +use Google\Protobuf\Internal\GPBUtil; + +/** + * Generated from protobuf message <code>clarifai.api.BuildInfo</code> + */ +class BuildInfo extends \Google\Protobuf\Internal\Message +{ + /** + * Docker image name + * + * Generated from protobuf field <code>string docker_image_name = 1;</code> + */ + protected $docker_image_name = ''; + /** + * Docker image tag + * + * Generated from protobuf field <code>string docker_image_tag = 2;</code> + */ + protected $docker_image_tag = ''; + /** + * Docker image digest + * + * Generated from protobuf field <code>string docker_image_digest = 3;</code> + */ + protected $docker_image_digest = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $docker_image_name + * Docker image name + * @type string $docker_image_tag + * Docker image tag + * @type string $docker_image_digest + * Docker image digest + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Proto\Clarifai\Api\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Docker image name + * + * Generated from protobuf field <code>string docker_image_name = 1;</code> + * @return string + */ + public function getDockerImageName() + { + return $this->docker_image_name; + } + + /** + * Docker image name + * + * Generated from protobuf field <code>string docker_image_name = 1;</code> + * @param string $var + * @return $this + */ + public function setDockerImageName($var) + { + GPBUtil::checkString($var, True); + $this->docker_image_name = $var; + + return $this; + } + + /** + * Docker image tag + * + * Generated from protobuf field <code>string docker_image_tag = 2;</code> + * @return string + */ + public function getDockerImageTag() + { + return $this->docker_image_tag; + } + + /** + * Docker image tag + * + * Generated from protobuf field <code>string docker_image_tag = 2;</code> + * @param string $var + * @return $this + */ + public function setDockerImageTag($var) + { + GPBUtil::checkString($var, True); + $this->docker_image_tag = $var; + + return $this; + } + + /** + * Docker image digest + * + * Generated from protobuf field <code>string docker_image_digest = 3;</code> + * @return string + */ + public function getDockerImageDigest() + { + return $this->docker_image_digest; + } + + /** + * Docker image digest + * + * Generated from protobuf field <code>string docker_image_digest = 3;</code> + * @param string $var + * @return $this + */ + public function setDockerImageDigest($var) + { + GPBUtil::checkString($var, True); + $this->docker_image_digest = $var; + + return $this; + } + +} + diff --git a/src/Clarifai/Api/CloudRegion.php b/src/Clarifai/Api/CloudRegion.php new file mode 100644 index 0000000..85293e1 --- /dev/null +++ b/src/Clarifai/Api/CloudRegion.php @@ -0,0 +1,129 @@ +<?php +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: proto/clarifai/api/resources.proto + +namespace Clarifai\Api; + +use Google\Protobuf\Internal\GPBType; +use Google\Protobuf\Internal\RepeatedField; +use Google\Protobuf\Internal\GPBUtil; + +/** + * We define a cloud region here to be used in Nodepools and by the cloud agent. + * There will be one cloud agent per CloudRegion. + * This allows us to define CloudRegions that are VPCs within one physical cloud and have that + * managed by one cloud agent which can list all nodepools for that VPC to deploy them and + * orchestrate work within them. + * + * Generated from protobuf message <code>clarifai.api.CloudRegion</code> + */ +class CloudRegion extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field <code>string id = 1;</code> + */ + protected $id = ''; + /** + * Generated from protobuf field <code>.clarifai.api.CloudRegion.Cloud cloud = 3;</code> + */ + protected $cloud = 0; + /** + * The region. The naming here depends on the cloud choice above and will be validated + * against which clouds+regions that Clarifai currently supports. + * + * Generated from protobuf field <code>string region = 4;</code> + */ + protected $region = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $id + * @type int $cloud + * @type string $region + * The region. The naming here depends on the cloud choice above and will be validated + * against which clouds+regions that Clarifai currently supports. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Proto\Clarifai\Api\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field <code>string id = 1;</code> + * @return string + */ + public function getId() + { + return $this->id; + } + + /** + * Generated from protobuf field <code>string id = 1;</code> + * @param string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkString($var, True); + $this->id = $var; + + return $this; + } + + /** + * Generated from protobuf field <code>.clarifai.api.CloudRegion.Cloud cloud = 3;</code> + * @return int + */ + public function getCloud() + { + return $this->cloud; + } + + /** + * Generated from protobuf field <code>.clarifai.api.CloudRegion.Cloud cloud = 3;</code> + * @param int $var + * @return $this + */ + public function setCloud($var) + { + GPBUtil::checkEnum($var, \Clarifai\Api\CloudRegion\Cloud::class); + $this->cloud = $var; + + return $this; + } + + /** + * The region. The naming here depends on the cloud choice above and will be validated + * against which clouds+regions that Clarifai currently supports. + * + * Generated from protobuf field <code>string region = 4;</code> + * @return string + */ + public function getRegion() + { + return $this->region; + } + + /** + * The region. The naming here depends on the cloud choice above and will be validated + * against which clouds+regions that Clarifai currently supports. + * + * Generated from protobuf field <code>string region = 4;</code> + * @param string $var + * @return $this + */ + public function setRegion($var) + { + GPBUtil::checkString($var, True); + $this->region = $var; + + return $this; + } + +} + diff --git a/src/Clarifai/Api/CloudRegion/Cloud.php b/src/Clarifai/Api/CloudRegion/Cloud.php new file mode 100644 index 0000000..1ec4004 --- /dev/null +++ b/src/Clarifai/Api/CloudRegion/Cloud.php @@ -0,0 +1,75 @@ +<?php +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: proto/clarifai/api/resources.proto + +namespace Clarifai\Api\CloudRegion; + +use UnexpectedValueException; + +/** + * Protobuf type <code>clarifai.api.CloudRegion.Cloud</code> + */ +class Cloud +{ + /** + * Generated from protobuf enum <code>UNKOWN_CLOUD = 0;</code> + */ + const UNKOWN_CLOUD = 0; + /** + * Run on a user's own infrastructure. This has restrictions on who can access resources + * that are being run by SELF_HOSTED runners. Only those who are part of the user/org where they + * exist can leverage them. + * + * Generated from protobuf enum <code>SELF_HOSTED = 1;</code> + */ + const SELF_HOSTED = 1; + /** + * Generated from protobuf enum <code>AWS = 2;</code> + */ + const AWS = 2; + /** + * Generated from protobuf enum <code>GCP = 3;</code> + */ + const GCP = 3; + /** + * Generated from protobuf enum <code>AZURE = 4;</code> + */ + const AZURE = 4; + /** + * Generated from protobuf enum <code>LAMBDA = 5;</code> + */ + const LAMBDA = 5; + + private static $valueToName = [ + self::UNKOWN_CLOUD => 'UNKOWN_CLOUD', + self::SELF_HOSTED => 'SELF_HOSTED', + self::AWS => 'AWS', + self::GCP => 'GCP', + self::AZURE => 'AZURE', + self::LAMBDA => 'LAMBDA', + ]; + + 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); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Cloud::class, \Clarifai\Api\CloudRegion_Cloud::class); + diff --git a/src/Clarifai/Api/CloudRegion_Cloud.php b/src/Clarifai/Api/CloudRegion_Cloud.php new file mode 100644 index 0000000..3d09cf0 --- /dev/null +++ b/src/Clarifai/Api/CloudRegion_Cloud.php @@ -0,0 +1,16 @@ +<?php +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: proto/clarifai/api/resources.proto + +namespace Clarifai\Api; + +if (false) { + /** + * This class is deprecated. Use Clarifai\Api\CloudRegion\Cloud instead. + * @deprecated + */ + class CloudRegion_Cloud {} +} +class_exists(CloudRegion\Cloud::class); +@trigger_error('Clarifai\Api\CloudRegion_Cloud is deprecated and will be removed in the next major release. Use Clarifai\Api\CloudRegion\Cloud instead', E_USER_DEPRECATED); + diff --git a/src/Clarifai/Api/ComputeInfo.php b/src/Clarifai/Api/ComputeInfo.php new file mode 100644 index 0000000..ca0044c --- /dev/null +++ b/src/Clarifai/Api/ComputeInfo.php @@ -0,0 +1,218 @@ +<?php +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: proto/clarifai/api/resources.proto + +namespace Clarifai\Api; + +use Google\Protobuf\Internal\GPBType; +use Google\Protobuf\Internal\RepeatedField; +use Google\Protobuf\Internal\GPBUtil; + +/** + * These are the resource needs of a given API object such as a model. + * This is what they require as a minimum to run and will be used upon scheduling + * as the request and limit for the k8s pod. If we want to separate limits and requests in the + * future we can allow setting a limits ComputeInfo and a requests ComputeInfo. + * + * Generated from protobuf message <code>clarifai.api.ComputeInfo</code> + */ +class ComputeInfo extends \Google\Protobuf\Internal\Message +{ + /** + * Number of CPUs. + * + * Generated from protobuf field <code>uint32 num_cpus = 1;</code> + */ + protected $num_cpus = 0; + /** + * Amount of CPU memory to use as a minimum. + * + * Generated from protobuf field <code>string cpu_memory = 2;</code> + */ + protected $cpu_memory = ''; + /** + * Number of accelerators (typically GPUs, TPUs, etc. not CPUs) for this resource. + * + * Generated from protobuf field <code>uint32 num_accelerators = 3;</code> + */ + protected $num_accelerators = 0; + /** + * Amount of accelerator/GPU memory to use as a minimum. + * This is defined per accelerator. + * This follows the format used by kubernetes like 1Ki, 2Mi, 3Gi, 4Ti. + * + * Generated from protobuf field <code>string accelerator_memory = 4;</code> + */ + protected $accelerator_memory = ''; + /** + * Or should it be removed completely and use the nodepool accelerator type itself. + * These are the supported accelerators that the model can run on. + * + * Generated from protobuf field <code>repeated string accelerator_type = 5;</code> + */ + private $accelerator_type; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $num_cpus + * Number of CPUs. + * @type string $cpu_memory + * Amount of CPU memory to use as a minimum. + * @type int $num_accelerators + * Number of accelerators (typically GPUs, TPUs, etc. not CPUs) for this resource. + * @type string $accelerator_memory + * Amount of accelerator/GPU memory to use as a minimum. + * This is defined per accelerator. + * This follows the format used by kubernetes like 1Ki, 2Mi, 3Gi, 4Ti. + * @type array<string>|\Google\Protobuf\Internal\RepeatedField $accelerator_type + * Or should it be removed completely and use the nodepool accelerator type itself. + * These are the supported accelerators that the model can run on. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Proto\Clarifai\Api\Resources::initOnce(); + parent::__construct($data); + } + + /** + * Number of CPUs. + * + * Generated from protobuf field <code>uint32 num_cpus = 1;</code> + * @return int + */ + public function getNumCpus() + { + return $this->num_cpus; + } + + /** + * Number of CPUs. + * + * Generated from protobuf field <code>uint32 num_cpus = 1;</code> + * @param int $var + * @return $this + */ + public function setNumCpus($var) + { + GPBUtil::checkUint32($var); + $this->num_cpus = $var; + + return $this; + } + + /** + * Amount of CPU memory to use as a minimum. + * + * Generated from protobuf field <code>string cpu_memory = 2;</code> + * @return string + */ + public function getCpuMemory() + { + return $this->cpu_memory; + } + + /** + * Amount of CPU memory to use as a minimum. + * + * Generated from protobuf field <code>string cpu_memory = 2;</code> + * @param string $var + * @return $this + */ + public function setCpuMemory($var) + { + GPBUtil::checkString($var, True); + $this->cpu_memory = $var; + + return $this; + } + + /** + * Number of accelerators (typically GPUs, TPUs, etc. not CPUs) for this resource. + * + * Generated from protobuf field <code>uint32 num_accelerators = 3;</code> + * @return int + */ + public function getNumAccelerators() + { + return $this->num_accelerators; + } + + /** + * Number of accelerators (typically GPUs, TPUs, etc. not CPUs) for this resource. + * + * Generated from protobuf field <code>uint32 num_accelerators = 3;</code> + * @param int $var + * @return $this + */ + public function setNumAccelerators($var) + { + GPBUtil::checkUint32($var); + $this->num_accelerators = $var; + + return $this; + } + + /** + * Amount of accelerator/GPU memory to use as a minimum. + * This is defined per accelerator. + * This follows the format used by kubernetes like 1Ki, 2Mi, 3Gi, 4Ti. + * + * Generated from protobuf field <code>string accelerator_memory = 4;</code> + * @return string + */ + public function getAcceleratorMemory() + { + return $this->accelerator_memory; + } + + /** + * Amount of accelerator/GPU memory to use as a minimum. + * This is defined per accelerator. + * This follows the format used by kubernetes like 1Ki, 2Mi, 3Gi, 4Ti. + * + * Generated from protobuf field <code>string accelerator_memory = 4;</code> + * @param string $var + * @return $this + */ + public function setAcceleratorMemory($var) + { + GPBUtil::checkString($var, True); + $this->accelerator_memory = $var; + + return $this; + } + + /** + * Or should it be removed completely and use the nodepool accelerator type itself. + * These are the supported accelerators that the model can run on. + * + * Generated from protobuf field <code>repeated string accelerator_type = 5;</code> + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAcceleratorType() + { + return $this->accelerator_type; + } + + /** + * Or should it be removed completely and use the nodepool accelerator type itself. + * These are the supported accelerators that the model can run on. + * + * Generated from protobuf field <code>repeated string accelerator_type = 5;</code> + * @param array<string>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAcceleratorType($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->accelerator_type = $arr; + + return $this; + } + +} + diff --git a/src/Clarifai/Api/Deployment.php b/src/Clarifai/Api/Deployment.php new file mode 100644 index 0000000..5726758 --- /dev/null +++ b/src/Clarifai/Api/Deployment.php @@ -0,0 +1,307 @@ +<?php +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: proto/clarifai/api/resources.proto + +namespace Clarifai\Api; + +use Google\Protobuf\Internal\GPBType; +use Google\Protobuf\Internal\RepeatedField; +use Google\Protobuf\Internal\GPBUtil; + +/** + * A deployment allows you to configure how runners for a particular type of resource will + * scale up and down. These are unique per user_id, nodepool and model so for differnet nodepools + * you can scale differently. + * + * Generated from protobuf message <code>clarifai.api.Deployment</code> + */ +class Deployment extends \Google\Protobuf\Internal\Message +{ + /** + * An id for this configured deployment. + * + * Generated from protobuf field <code>string id = 1;</code> + */ + protected $id = ''; + /** + * The user who owns the deployment. These live in the user/org account. + * + * Generated from protobuf field <code>string user_id = 2;</code> + */ + protected $user_id = ''; + /** + * How to autoscale the object. + * + * Generated from protobuf field <code>.clarifai.api.AutoscaleConfig autoscale_config = 3;</code> + */ + protected $autoscale_config = null; + /** + * You can configure different autoscaling per nodepool(s). + * These nodepools have to be also owned by the same user_id/org as this deployment. + * If there is more than one nodepool we use the model's ComputeInfo to match + * with what the nodepool provides to decide which one can handle it combined with the + * NodepoolRank below. Note: even within a single nodepool if it is heterogeneous then + * we need a way to rank scheduling choices when we don't know how to decide (like a model + * supports + * + * Generated from protobuf field <code>repeated .clarifai.api.Nodepool nodepools = 4;</code> + */ + private $nodepools; + /** + * Generated from protobuf field <code>.clarifai.api.Deployment.SchedulingChoice scheduling_choice = 7;</code> + */ + protected $scheduling_choice = 0; + protected $object; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $id + * An id for this configured deployment. + * @type string $user_id + * The user who owns the deployment. These live in the user/org account. + * @type \Clarifai\Api\AutoscaleConfig $autoscale_config + * How to autoscale the object. + * @type array<\Clarifai\Api\Nodepool>|\Google\Protobuf\Internal\RepeatedField $nodepools + * You can configure different autoscaling per nodepool(s). + * These nodepools have to be also owned by the same user_id/org as this deployment. + * If there is more than one nodepool we use the model's ComputeInfo to match + * with what the nodepool provides to decide which one can handle it combined with the + * NodepoolRank below. Note: even within a single nodepool if it is heterogeneous then + * we need a way to rank scheduling choices when we don't know how to decide (like a model + * supports + * @type \Clarifai\Api\Model $model + * Model + * @type \Clarifai\Api\Workflow $workflow + * Workflow + * @type int $scheduling_choice + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Proto\Clarifai\Api\Resources::initOnce(); + parent::__construct($data); + } + + /** + * An id for this configured deployment. + * + * Generated from protobuf field <code>string id = 1;</code> + * @return string + */ + public function getId() + { + return $this->id; + } + + /** + * An id for this configured deployment. + * + * Generated from protobuf field <code>string id = 1;</code> + * @param string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkString($var, True); + $this->id = $var; + + return $this; + } + + /** + * The user who owns the deployment. These live in the user/org account. + * + * Generated from protobuf field <code>string user_id = 2;</code> + * @return string + */ + public function getUserId() + { + return $this->user_id; + } + + /** + * The user who owns the deployment. These live in the user/org account. + * + * Generated from protobuf field <code>string user_id = 2;</code> + * @param string $var + * @return $this + */ + public function setUserId($var) + { + GPBUtil::checkString($var, True); + $this->user_id = $var; + + return $this; + } + + /** + * How to autoscale the object. + * + * Generated from protobuf field <code>.clarifai.api.AutoscaleConfig autoscale_config = 3;</code> + * @return \Clarifai\Api\AutoscaleConfig|null + */ + public function getAutoscaleConfig() + { + return $this->autoscale_config; + } + + public function hasAutoscaleConfig() + { + return isset($this->autoscale_config); + } + + public function clearAutoscaleConfig() + { + unset($this->autoscale_config); + } + + /** + * How to autoscale the object. + * + * Generated from protobuf field <code>.clarifai.api.AutoscaleConfig autoscale_config = 3;</code> + * @param \Clarifai\Api\AutoscaleConfig $var + * @return $this + */ + public function setAutoscaleConfig($var) + { + GPBUtil::checkMessage($var, \Clarifai\Api\AutoscaleConfig::class); + $this->autoscale_config = $var; + + return $this; + } + + /** + * You can configure different autoscaling per nodepool(s). + * These nodepools have to be also owned by the same user_id/org as this deployment. + * If there is more than one nodepool we use the model's ComputeInfo to match + * with what the nodepool provides to decide which one can handle it combined with the + * NodepoolRank below. Note: even within a single nodepool if it is heterogeneous then + * we need a way to rank scheduling choices when we don't know how to decide (like a model + * supports + * + * Generated from protobuf field <code>repeated .clarifai.api.Nodepool nodepools = 4;</code> + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getNodepools() + { + return $this->nodepools; + } + + /** + * You can configure different autoscaling per nodepool(s). + * These nodepools have to be also owned by the same user_id/org as this deployment. + * If there is more than one nodepool we use the model's ComputeInfo to match + * with what the nodepool provides to decide which one can handle it combined with the + * NodepoolRank below. Note: even within a single nodepool if it is heterogeneous then + * we need a way to rank scheduling choices when we don't know how to decide (like a model + * supports + * + * Generated from protobuf field <code>repeated .clarifai.api.Nodepool nodepools = 4;</code> + * @param array<\Clarifai\Api\Nodepool>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setNodepools($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Clarifai\Api\Nodepool::class); + $this->nodepools = $arr; + + return $this; + } + + /** + * Model + * + * Generated from protobuf field <code>.clarifai.api.Model model = 5;</code> + * @return \Clarifai\Api\Model|null + */ + public function getModel() + { + return $this->readOneof(5); + } + + public function hasModel() + { + return $this->hasOneof(5); + } + + /** + * Model + * + * Generated from protobuf field <code>.clarifai.api.Model model = 5;</code> + * @param \Clarifai\Api\Model $var + * @return $this + */ + public function setModel($var) + { + GPBUtil::checkMessage($var, \Clarifai\Api\Model::class); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * Workflow + * + * Generated from protobuf field <code>.clarifai.api.Workflow workflow = 6;</code> + * @return \Clarifai\Api\Workflow|null + */ + public function getWorkflow() + { + return $this->readOneof(6); + } + + public function hasWorkflow() + { + return $this->hasOneof(6); + } + + /** + * Workflow + * + * Generated from protobuf field <code>.clarifai.api.Workflow workflow = 6;</code> + * @param \Clarifai\Api\Workflow $var + * @return $this + */ + public function setWorkflow($var) + { + GPBUtil::checkMessage($var, \Clarifai\Api\Workflow::class); + $this->writeOneof(6, $var); + + return $this; + } + + /** + * Generated from protobuf field <code>.clarifai.api.Deployment.SchedulingChoice scheduling_choice = 7;</code> + * @return int + */ + public function getSchedulingChoice() + { + return $this->scheduling_choice; + } + + /** + * Generated from protobuf field <code>.clarifai.api.Deployment.SchedulingChoice scheduling_choice = 7;</code> + * @param int $var + * @return $this + */ + public function setSchedulingChoice($var) + { + GPBUtil::checkEnum($var, \Clarifai\Api\Deployment\SchedulingChoice::class); + $this->scheduling_choice = $var; + + return $this; + } + + /** + * @return string + */ + public function getObject() + { + return $this->whichOneof("object"); + } + +} + diff --git a/src/Clarifai/Api/Deployment/SchedulingChoice.php b/src/Clarifai/Api/Deployment/SchedulingChoice.php new file mode 100644 index 0000000..4553ce6 --- /dev/null +++ b/src/Clarifai/Api/Deployment/SchedulingChoice.php @@ -0,0 +1,111 @@ +<?php +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: proto/clarifai/api/resources.proto + +namespace Clarifai\Api\Deployment; + +use UnexpectedValueException; + +/** + * In some scenarios it may not be obvous how we should schedule a resource to underlying nodes + * within the nodepool(s) above. The SchedulerChoice allows us to specify how to decide which + * nodepool to use when there are multiple nodepools and how to decide which type of node + * within a nodepool if there are multiple types. + * If here are multiple nondepools then a decision on which to use comes into play + * if it is not specified in the prediction request. + * Even with a single nodepool a choice may come up such as when a resource that needs scheduling + * has not specified the accelerator types it supports and the nodepool has multiple types. + * + * Protobuf type <code>clarifai.api.Deployment.SchedulingChoice</code> + */ +class SchedulingChoice +{ + /** + * Generated from protobuf enum <code>UNKNOWN_SCHEDULING_CHOICE = 0;</code> + */ + const UNKNOWN_SCHEDULING_CHOICE = 0; + /** + * fail if there is any ambiguity. + * + * Generated from protobuf enum <code>FAIL = 1;</code> + */ + const FAIL = 1; + /** + * randomly pick amongst the nodepools/nodes to assign. + * + * Generated from protobuf enum <code>RANDOM = 2;</code> + */ + const RANDOM = 2; + /** + * choose the compute that is cheaper + * + * Generated from protobuf enum <code>PRICE = 3;</code> + */ + const PRICE = 3; + /** + * schedule to the fastest known iption. + * + * Generated from protobuf enum <code>PERFORMANCE = 4;</code> + */ + const PERFORMANCE = 4; + /** + * optimize based on network latency. + * + * Generated from protobuf enum <code>NETWORK = 5;</code> + */ + const NETWORK = 5; + /** + * send to the least used nodepool based on it's capacity. + * + * Generated from protobuf enum <code>UTILIZATION = 6;</code> + */ + const UTILIZATION = 6; + /** + * choose spot instances over on-demand + * + * Generated from protobuf enum <code>PREFER_SPOT = 7;</code> + */ + const PREFER_SPOT = 7; + /** + * choose on-demand instances over spot. + * + * Generated from protobuf enum <code>PREFER_ONDEMAND = 8;</code> + */ + const PREFER_ONDEMAND = 8; + + private static $valueToName = [ + self::UNKNOWN_SCHEDULING_CHOICE => 'UNKNOWN_SCHEDULING_CHOICE', + self::FAIL => 'FAIL', + self::RANDOM => 'RANDOM', + self::PRICE => 'PRICE', + self::PERFORMANCE => 'PERFORMANCE', + self::NETWORK => 'NETWORK', + self::UTILIZATION => 'UTILIZATION', + self::PREFER_SPOT => 'PREFER_SPOT', + self::PREFER_ONDEMAND => 'PREFER_ONDEMAND', + ]; + + 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); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(SchedulingChoice::class, \Clarifai\Api\Deployment_SchedulingChoice::class); + diff --git a/src/Clarifai/Api/Deployment_SchedulingChoice.php b/src/Clarifai/Api/Deployment_SchedulingChoice.php new file mode 100644 index 0000000..fe9936b --- /dev/null +++ b/src/Clarifai/Api/Deployment_SchedulingChoice.php @@ -0,0 +1,16 @@ +<?php +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: proto/clarifai/api/resources.proto + +namespace Clarifai\Api; + +if (false) { + /** + * This class is deprecated. Use Clarifai\Api\Deployment\SchedulingChoice instead. + * @deprecated + */ + class Deployment_SchedulingChoice {} +} +class_exists(Deployment\SchedulingChoice::class); +@trigger_error('Clarifai\Api\Deployment_SchedulingChoice is deprecated and will be removed in the next major release. Use Clarifai\Api\Deployment\SchedulingChoice instead', E_USER_DEPRECATED); + diff --git a/src/Clarifai/Api/EvalTestSetEntry.php b/src/Clarifai/Api/EvalTestSetEntry.php index 88b3032..120caaa 100644 --- a/src/Clarifai/Api/EvalTestSetEntry.php +++ b/src/Clarifai/Api/EvalTestSetEntry.php @@ -36,9 +36,20 @@ class EvalTestSetEntry extends \Google\Protobuf\Internal\Message * Each annotation only contains one region * And the concepts is in ground_truth_concepts instead of this annotation * - * Generated from protobuf field <code>.clarifai.api.Annotation annotation = 5;</code> + * Generated from protobuf field <code>.clarifai.api.Annotation annotation = 5 [deprecated = true];</code> + * @deprecated */ protected $annotation = null; + /** + * For region based models, region and associated concepts are stored together. + * + * Generated from protobuf field <code>.clarifai.api.Annotation predicted_annotation = 7;</code> + */ + protected $predicted_annotation = null; + /** + * Generated from protobuf field <code>.clarifai.api.Annotation ground_truth_annotation = 8;</code> + */ + protected $ground_truth_annotation = null; /** * Constructor. @@ -55,6 +66,9 @@ class EvalTestSetEntry extends \Google\Protobuf\Internal\Message * Only region-based/frame-based app contains this annotation * Each annotation only contains one region * And the concepts is in ground_truth_concepts instead of this annotation + * @type \Clarifai\Api\Annotation $predicted_annotation + * For region based models, region and associated concepts are stored together. + * @type \Clarifai\Api\Annotation $ground_truth_annotation * } */ public function __construct($data = NULL) { @@ -151,21 +165,25 @@ public function setGroundTruthConcepts($var) * Each annotation only contains one region * And the concepts is in ground_truth_concepts instead of this annotation * - * Generated from protobuf field <code>.clarifai.api.Annotation annotation = 5;</code> + * Generated from protobuf field <code>.clarifai.api.Annotation annotation = 5 [deprecated = true];</code> * @return \Clarifai\Api\Annotation|null + * @deprecated */ public function getAnnotation() { + @trigger_error('annotation is deprecated.', E_USER_DEPRECATED); return $this->annotation; } public function hasAnnotation() { + @trigger_error('annotation is deprecated.', E_USER_DEPRECATED); return isset($this->annotation); } public function clearAnnotation() { + @trigger_error('annotation is deprecated.', E_USER_DEPRECATED); unset($this->annotation); } @@ -174,17 +192,87 @@ public function clearAnnotation() * Each annotation only contains one region * And the concepts is in ground_truth_concepts instead of this annotation * - * Generated from protobuf field <code>.clarifai.api.Annotation annotation = 5;</code> + * Generated from protobuf field <code>.clarifai.api.Annotation annotation = 5 [deprecated = true];</code> * @param \Clarifai\Api\Annotation $var * @return $this + * @deprecated */ public function setAnnotation($var) { + @trigger_error('annotation is deprecated.', E_USER_DEPRECATED); GPBUtil::checkMessage($var, \Clarifai\Api\Annotation::class); $this->annotation = $var; return $this; } + /** + * For region based models, region and associated concepts are stored together. + * + * Generated from protobuf field <code>.clarifai.api.Annotation predicted_annotation = 7;</code> + * @return \Clarifai\Api\Annotation|null + */ + public function getPredictedAnnotation() + { + return $this->predicted_annotation; + } + + public function hasPredictedAnnotation() + { + return isset($this->predicted_annotation); + } + + public function clearPredictedAnnotation() + { + unset($this->predicted_annotation); + } + + /** + * For region based models, region and associated concepts are stored together. + * + * Generated from protobuf field <code>.clarifai.api.Annotation predicted_annotation = 7;</code> + * @param \Clarifai\Api\Annotation $var + * @return $this + */ + public function setPredictedAnnotation($var) + { + GPBUtil::checkMessage($var, \Clarifai\Api\Annotation::class); + $this->predicted_annotation = $var; + + return $this; + } + + /** + * Generated from protobuf field <code>.clarifai.api.Annotation ground_truth_annotation = 8;</code> + * @return \Clarifai\Api\Annotation|null + */ + public function getGroundTruthAnnotation() + { + return $this->ground_truth_annotation; + } + + public function hasGroundTruthAnnotation() + { + return isset($this->ground_truth_annotation); + } + + public function clearGroundTruthAnnotation() + { + unset($this->ground_truth_annotation); + } + + /** + * Generated from protobuf field <code>.clarifai.api.Annotation ground_truth_annotation = 8;</code> + * @param \Clarifai\Api\Annotation $var + * @return $this + */ + public function setGroundTruthAnnotation($var) + { + GPBUtil::checkMessage($var, \Clarifai\Api\Annotation::class); + $this->ground_truth_annotation = $var; + + return $this; + } + } diff --git a/src/Clarifai/Api/GetResourcePriceRequest.php b/src/Clarifai/Api/GetResourcePriceRequest.php deleted file mode 100644 index cc0e4a6..0000000 --- a/src/Clarifai/Api/GetResourcePriceRequest.php +++ /dev/null @@ -1,157 +0,0 @@ -<?php -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: proto/clarifai/api/service.proto - -namespace Clarifai\Api; - -use Google\Protobuf\Internal\GPBType; -use Google\Protobuf\Internal\RepeatedField; -use Google\Protobuf\Internal\GPBUtil; - -/** - * Get Resource Price - new billing - * - * Generated from protobuf message <code>clarifai.api.GetResourcePriceRequest</code> - */ -class GetResourcePriceRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Generated from protobuf field <code>.clarifai.api.UserAppIDSet user_app_id = 1;</code> - */ - protected $user_app_id = null; - protected $resource; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Clarifai\Api\UserAppIDSet $user_app_id - * @type \Clarifai\Api\Model $model - * ########## Supported fields ########## - * - id - * - model_version.id - * @type \Clarifai\Api\Workflow $workflow - * ########## Supported fields ########## - * - id - * - version.id - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Proto\Clarifai\Api\Service::initOnce(); - parent::__construct($data); - } - - /** - * Generated from protobuf field <code>.clarifai.api.UserAppIDSet user_app_id = 1;</code> - * @return \Clarifai\Api\UserAppIDSet|null - */ - public function getUserAppId() - { - return $this->user_app_id; - } - - public function hasUserAppId() - { - return isset($this->user_app_id); - } - - public function clearUserAppId() - { - unset($this->user_app_id); - } - - /** - * Generated from protobuf field <code>.clarifai.api.UserAppIDSet user_app_id = 1;</code> - * @param \Clarifai\Api\UserAppIDSet $var - * @return $this - */ - public function setUserAppId($var) - { - GPBUtil::checkMessage($var, \Clarifai\Api\UserAppIDSet::class); - $this->user_app_id = $var; - - return $this; - } - - /** - * ########## Supported fields ########## - * - id - * - model_version.id - * - * Generated from protobuf field <code>.clarifai.api.Model model = 2;</code> - * @return \Clarifai\Api\Model|null - */ - public function getModel() - { - return $this->readOneof(2); - } - - public function hasModel() - { - return $this->hasOneof(2); - } - - /** - * ########## Supported fields ########## - * - id - * - model_version.id - * - * Generated from protobuf field <code>.clarifai.api.Model model = 2;</code> - * @param \Clarifai\Api\Model $var - * @return $this - */ - public function setModel($var) - { - GPBUtil::checkMessage($var, \Clarifai\Api\Model::class); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * ########## Supported fields ########## - * - id - * - version.id - * - * Generated from protobuf field <code>.clarifai.api.Workflow workflow = 3;</code> - * @return \Clarifai\Api\Workflow|null - */ - public function getWorkflow() - { - return $this->readOneof(3); - } - - public function hasWorkflow() - { - return $this->hasOneof(3); - } - - /** - * ########## Supported fields ########## - * - id - * - version.id - * - * Generated from protobuf field <code>.clarifai.api.Workflow workflow = 3;</code> - * @param \Clarifai\Api\Workflow $var - * @return $this - */ - public function setWorkflow($var) - { - GPBUtil::checkMessage($var, \Clarifai\Api\Workflow::class); - $this->writeOneof(3, $var); - - return $this; - } - - /** - * @return string - */ - public function getResource() - { - return $this->whichOneof("resource"); - } - -} - diff --git a/src/Clarifai/Api/GetResourcePriceResponse.php b/src/Clarifai/Api/GetResourcePriceResponse.php deleted file mode 100644 index d1b0115..0000000 --- a/src/Clarifai/Api/GetResourcePriceResponse.php +++ /dev/null @@ -1,102 +0,0 @@ -<?php -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: proto/clarifai/api/service.proto - -namespace Clarifai\Api; - -use Google\Protobuf\Internal\GPBType; -use Google\Protobuf\Internal\RepeatedField; -use Google\Protobuf\Internal\GPBUtil; - -/** - * Generated from protobuf message <code>clarifai.api.GetResourcePriceResponse</code> - */ -class GetResourcePriceResponse extends \Google\Protobuf\Internal\Message -{ - /** - * Generated from protobuf field <code>.clarifai.api.status.Status status = 1;</code> - */ - protected $status = null; - /** - * Price is in millicents, i.e. $1/100000 - * - * Generated from protobuf field <code>int64 price = 2 [(.clarifai.api.utils.cl_show_if_empty) = true];</code> - */ - protected $price = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Clarifai\Api\Status\Status $status - * @type int|string $price - * Price is in millicents, i.e. $1/100000 - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Proto\Clarifai\Api\Service::initOnce(); - parent::__construct($data); - } - - /** - * Generated from protobuf field <code>.clarifai.api.status.Status status = 1;</code> - * @return \Clarifai\Api\Status\Status|null - */ - public function getStatus() - { - return $this->status; - } - - public function hasStatus() - { - return isset($this->status); - } - - public function clearStatus() - { - unset($this->status); - } - - /** - * Generated from protobuf field <code>.clarifai.api.status.Status status = 1;</code> - * @param \Clarifai\Api\Status\Status $var - * @return $this - */ - public function setStatus($var) - { - GPBUtil::checkMessage($var, \Clarifai\Api\Status\Status::class); - $this->status = $var; - - return $this; - } - - /** - * Price is in millicents, i.e. $1/100000 - * - * Generated from protobuf field <code>int64 price = 2 [(.clarifai.api.utils.cl_show_if_empty) = true];</code> - * @return int|string - */ - public function getPrice() - { - return $this->price; - } - - /** - * Price is in millicents, i.e. $1/100000 - * - * Generated from protobuf field <code>int64 price = 2 [(.clarifai.api.utils.cl_show_if_empty) = true];</code> - * @param int|string $var - * @return $this - */ - public function setPrice($var) - { - GPBUtil::checkInt64($var); - $this->price = $var; - - return $this; - } - -} - diff --git a/src/Clarifai/Api/ListScopesRequest.php b/src/Clarifai/Api/ListScopesRequest.php index b898caf..a2a7608 100644 --- a/src/Clarifai/Api/ListScopesRequest.php +++ b/src/Clarifai/Api/ListScopesRequest.php @@ -17,7 +17,7 @@ class ListScopesRequest extends \Google\Protobuf\Internal\Message { /** * If "personal_access_token" include scopes and endpoints available to personal access tokens. - * If "api_key" include scopes and endpoints available to app-specific keys. (default) + * If "app_specific_key" include scopes and endpoints available to app-specific keys. (default) * * Generated from protobuf field <code>string key_type = 1;</code> */ @@ -37,7 +37,7 @@ class ListScopesRequest extends \Google\Protobuf\Internal\Message * * @type string $key_type * If "personal_access_token" include scopes and endpoints available to personal access tokens. - * If "api_key" include scopes and endpoints available to app-specific keys. (default) + * If "app_specific_key" include scopes and endpoints available to app-specific keys. (default) * @type \Clarifai\Api\UserAppIDSet $user_app_id * For all user specific information we include user_app_id to get the user_id in a consistent way * } @@ -49,7 +49,7 @@ public function __construct($data = NULL) { /** * If "personal_access_token" include scopes and endpoints available to personal access tokens. - * If "api_key" include scopes and endpoints available to app-specific keys. (default) + * If "app_specific_key" include scopes and endpoints available to app-specific keys. (default) * * Generated from protobuf field <code>string key_type = 1;</code> * @return string @@ -61,7 +61,7 @@ public function getKeyType() /** * If "personal_access_token" include scopes and endpoints available to personal access tokens. - * If "api_key" include scopes and endpoints available to app-specific keys. (default) + * If "app_specific_key" include scopes and endpoints available to app-specific keys. (default) * * Generated from protobuf field <code>string key_type = 1;</code> * @param string $var diff --git a/src/Clarifai/Api/ModelVersion.php b/src/Clarifai/Api/ModelVersion.php index 86245ab..d640e8f 100644 --- a/src/Clarifai/Api/ModelVersion.php +++ b/src/Clarifai/Api/ModelVersion.php @@ -131,6 +131,18 @@ class ModelVersion extends \Google\Protobuf\Internal\Message * Generated from protobuf field <code>string train_log = 23;</code> */ protected $train_log = ''; + /** + * The minimum required compute resource for this model for inference. + * + * Generated from protobuf field <code>.clarifai.api.ComputeInfo inference_compute_info = 24;</code> + */ + protected $inference_compute_info = null; + /** + * Build information for the model version + * + * Generated from protobuf field <code>.clarifai.api.BuildInfo build_info = 25;</code> + */ + protected $build_info = null; /** * Constructor. @@ -179,6 +191,10 @@ class ModelVersion extends \Google\Protobuf\Internal\Message * Configuration used to import model from third-party toolkits * @type string $train_log * Contains the training logs if available + * @type \Clarifai\Api\ComputeInfo $inference_compute_info + * The minimum required compute resource for this model for inference. + * @type \Clarifai\Api\BuildInfo $build_info + * Build information for the model version * } */ public function __construct($data = NULL) { @@ -818,5 +834,77 @@ public function setTrainLog($var) return $this; } + /** + * The minimum required compute resource for this model for inference. + * + * Generated from protobuf field <code>.clarifai.api.ComputeInfo inference_compute_info = 24;</code> + * @return \Clarifai\Api\ComputeInfo|null + */ + public function getInferenceComputeInfo() + { + return $this->inference_compute_info; + } + + public function hasInferenceComputeInfo() + { + return isset($this->inference_compute_info); + } + + public function clearInferenceComputeInfo() + { + unset($this->inference_compute_info); + } + + /** + * The minimum required compute resource for this model for inference. + * + * Generated from protobuf field <code>.clarifai.api.ComputeInfo inference_compute_info = 24;</code> + * @param \Clarifai\Api\ComputeInfo $var + * @return $this + */ + public function setInferenceComputeInfo($var) + { + GPBUtil::checkMessage($var, \Clarifai\Api\ComputeInfo::class); + $this->inference_compute_info = $var; + + return $this; + } + + /** + * Build information for the model version + * + * Generated from protobuf field <code>.clarifai.api.BuildInfo build_info = 25;</code> + * @return \Clarifai\Api\BuildInfo|null + */ + public function getBuildInfo() + { + return $this->build_info; + } + + public function hasBuildInfo() + { + return isset($this->build_info); + } + + public function clearBuildInfo() + { + unset($this->build_info); + } + + /** + * Build information for the model version + * + * Generated from protobuf field <code>.clarifai.api.BuildInfo build_info = 25;</code> + * @param \Clarifai\Api\BuildInfo $var + * @return $this + */ + public function setBuildInfo($var) + { + GPBUtil::checkMessage($var, \Clarifai\Api\BuildInfo::class); + $this->build_info = $var; + + return $this; + } + } diff --git a/src/Clarifai/Api/Nodepool.php b/src/Clarifai/Api/Nodepool.php new file mode 100644 index 0000000..ec3da28 --- /dev/null +++ b/src/Clarifai/Api/Nodepool.php @@ -0,0 +1,292 @@ +<?php +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: proto/clarifai/api/resources.proto + +namespace Clarifai\Api; + +use Google\Protobuf\Internal\GPBType; +use Google\Protobuf\Internal\RepeatedField; +use Google\Protobuf\Internal\GPBUtil; + +/** + * A nodepool is a set of nodes dedicated for a given user's compute needs. + * This compute will typically be consumed by runners and in the future other objects + * like UI modules may be assigned to node pools. + * + * Generated from protobuf message <code>clarifai.api.Nodepool</code> + */ +class Nodepool extends \Google\Protobuf\Internal\Message +{ + /** + * The user defined ID of the nodepool. + * + * Generated from protobuf field <code>string id = 1;</code> + */ + protected $id = ''; + /** + * The user/org that this nodepool belongs to. + * + * Generated from protobuf field <code>string user_id = 2;</code> + */ + protected $user_id = ''; + /** + * Which cloud region this nodepool is within. + * + * Generated from protobuf field <code>.clarifai.api.CloudRegion cloud_region = 3;</code> + */ + protected $cloud_region = null; + /** + * Generated from protobuf field <code>repeated .clarifai.api.Nodepool.CapacityType capacity_types = 4;</code> + */ + private $capacity_types; + /** + *//////////////////////////////////// + * The instance types that will be available in this pool of nodes. + * Clarifai offers multiple different choices that combine cpu cores, memory and accelerator. + * + * Generated from protobuf field <code>repeated string instance_types = 8;</code> + */ + private $instance_types; + /** + * Minimum number of instances in this nodepool. This allows the nodeool to scale down to this + * amount. A nodepool needs a minimum of 1 instance. + * + * Generated from protobuf field <code>uint32 min_instances = 9;</code> + */ + protected $min_instances = 0; + /** + * An upper limit on the number of instances in this nodepool. This allows the nodepool to scale + * up to this amount. + * + * Generated from protobuf field <code>uint32 max_instances = 10;</code> + */ + protected $max_instances = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $id + * The user defined ID of the nodepool. + * @type string $user_id + * The user/org that this nodepool belongs to. + * @type \Clarifai\Api\CloudRegion $cloud_region + * Which cloud region this nodepool is within. + * @type array<int>|\Google\Protobuf\Internal\RepeatedField $capacity_types + * @type array<string>|\Google\Protobuf\Internal\RepeatedField $instance_types + * //////////////////////////////////// + * The instance types that will be available in this pool of nodes. + * Clarifai offers multiple different choices that combine cpu cores, memory and accelerator. + * @type int $min_instances + * Minimum number of instances in this nodepool. This allows the nodeool to scale down to this + * amount. A nodepool needs a minimum of 1 instance. + * @type int $max_instances + * An upper limit on the number of instances in this nodepool. This allows the nodepool to scale + * up to this amount. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Proto\Clarifai\Api\Resources::initOnce(); + parent::__construct($data); + } + + /** + * The user defined ID of the nodepool. + * + * Generated from protobuf field <code>string id = 1;</code> + * @return string + */ + public function getId() + { + return $this->id; + } + + /** + * The user defined ID of the nodepool. + * + * Generated from protobuf field <code>string id = 1;</code> + * @param string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkString($var, True); + $this->id = $var; + + return $this; + } + + /** + * The user/org that this nodepool belongs to. + * + * Generated from protobuf field <code>string user_id = 2;</code> + * @return string + */ + public function getUserId() + { + return $this->user_id; + } + + /** + * The user/org that this nodepool belongs to. + * + * Generated from protobuf field <code>string user_id = 2;</code> + * @param string $var + * @return $this + */ + public function setUserId($var) + { + GPBUtil::checkString($var, True); + $this->user_id = $var; + + return $this; + } + + /** + * Which cloud region this nodepool is within. + * + * Generated from protobuf field <code>.clarifai.api.CloudRegion cloud_region = 3;</code> + * @return \Clarifai\Api\CloudRegion|null + */ + public function getCloudRegion() + { + return $this->cloud_region; + } + + public function hasCloudRegion() + { + return isset($this->cloud_region); + } + + public function clearCloudRegion() + { + unset($this->cloud_region); + } + + /** + * Which cloud region this nodepool is within. + * + * Generated from protobuf field <code>.clarifai.api.CloudRegion cloud_region = 3;</code> + * @param \Clarifai\Api\CloudRegion $var + * @return $this + */ + public function setCloudRegion($var) + { + GPBUtil::checkMessage($var, \Clarifai\Api\CloudRegion::class); + $this->cloud_region = $var; + + return $this; + } + + /** + * Generated from protobuf field <code>repeated .clarifai.api.Nodepool.CapacityType capacity_types = 4;</code> + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getCapacityTypes() + { + return $this->capacity_types; + } + + /** + * Generated from protobuf field <code>repeated .clarifai.api.Nodepool.CapacityType capacity_types = 4;</code> + * @param array<int>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setCapacityTypes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Clarifai\Api\Nodepool\CapacityType::class); + $this->capacity_types = $arr; + + return $this; + } + + /** + *//////////////////////////////////// + * The instance types that will be available in this pool of nodes. + * Clarifai offers multiple different choices that combine cpu cores, memory and accelerator. + * + * Generated from protobuf field <code>repeated string instance_types = 8;</code> + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getInstanceTypes() + { + return $this->instance_types; + } + + /** + *//////////////////////////////////// + * The instance types that will be available in this pool of nodes. + * Clarifai offers multiple different choices that combine cpu cores, memory and accelerator. + * + * Generated from protobuf field <code>repeated string instance_types = 8;</code> + * @param array<string>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setInstanceTypes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->instance_types = $arr; + + return $this; + } + + /** + * Minimum number of instances in this nodepool. This allows the nodeool to scale down to this + * amount. A nodepool needs a minimum of 1 instance. + * + * Generated from protobuf field <code>uint32 min_instances = 9;</code> + * @return int + */ + public function getMinInstances() + { + return $this->min_instances; + } + + /** + * Minimum number of instances in this nodepool. This allows the nodeool to scale down to this + * amount. A nodepool needs a minimum of 1 instance. + * + * Generated from protobuf field <code>uint32 min_instances = 9;</code> + * @param int $var + * @return $this + */ + public function setMinInstances($var) + { + GPBUtil::checkUint32($var); + $this->min_instances = $var; + + return $this; + } + + /** + * An upper limit on the number of instances in this nodepool. This allows the nodepool to scale + * up to this amount. + * + * Generated from protobuf field <code>uint32 max_instances = 10;</code> + * @return int + */ + public function getMaxInstances() + { + return $this->max_instances; + } + + /** + * An upper limit on the number of instances in this nodepool. This allows the nodepool to scale + * up to this amount. + * + * Generated from protobuf field <code>uint32 max_instances = 10;</code> + * @param int $var + * @return $this + */ + public function setMaxInstances($var) + { + GPBUtil::checkUint32($var); + $this->max_instances = $var; + + return $this; + } + +} + diff --git a/src/Clarifai/Api/Nodepool/CapacityType.php b/src/Clarifai/Api/Nodepool/CapacityType.php new file mode 100644 index 0000000..aa715ba --- /dev/null +++ b/src/Clarifai/Api/Nodepool/CapacityType.php @@ -0,0 +1,60 @@ +<?php +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: proto/clarifai/api/resources.proto + +namespace Clarifai\Api\Nodepool; + +use UnexpectedValueException; + +/** + * Type of nodes that are ok for instances in this pool. + * If both spot and on-demand are provided then the runner will be able to run on either + * with a preference for spot until they are not available. + * + * Protobuf type <code>clarifai.api.Nodepool.CapacityType</code> + */ +class CapacityType +{ + /** + * Generated from protobuf enum <code>UKNOWN_CAPACITY_TYPE = 0;</code> + */ + const UKNOWN_CAPACITY_TYPE = 0; + /** + * Generated from protobuf enum <code>ONDEMAND_TYPE = 1;</code> + */ + const ONDEMAND_TYPE = 1; + /** + * Generated from protobuf enum <code>SPOT_TYPE = 2;</code> + */ + const SPOT_TYPE = 2; + + private static $valueToName = [ + self::UKNOWN_CAPACITY_TYPE => 'UKNOWN_CAPACITY_TYPE', + self::ONDEMAND_TYPE => 'ONDEMAND_TYPE', + self::SPOT_TYPE => 'SPOT_TYPE', + ]; + + 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); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(CapacityType::class, \Clarifai\Api\Nodepool_CapacityType::class); + diff --git a/src/Clarifai/Api/Nodepool_CapacityType.php b/src/Clarifai/Api/Nodepool_CapacityType.php new file mode 100644 index 0000000..32ab8fc --- /dev/null +++ b/src/Clarifai/Api/Nodepool_CapacityType.php @@ -0,0 +1,16 @@ +<?php +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: proto/clarifai/api/resources.proto + +namespace Clarifai\Api; + +if (false) { + /** + * This class is deprecated. Use Clarifai\Api\Nodepool\CapacityType instead. + * @deprecated + */ + class Nodepool_CapacityType {} +} +class_exists(Nodepool\CapacityType::class); +@trigger_error('Clarifai\Api\Nodepool_CapacityType is deprecated and will be removed in the next major release. Use Clarifai\Api\Nodepool\CapacityType instead', E_USER_DEPRECATED); + diff --git a/src/Clarifai/Api/PostModelOutputsRequest.php b/src/Clarifai/Api/PostModelOutputsRequest.php index ba49571..f5be99b 100644 --- a/src/Clarifai/Api/PostModelOutputsRequest.php +++ b/src/Clarifai/Api/PostModelOutputsRequest.php @@ -41,6 +41,12 @@ class PostModelOutputsRequest extends \Google\Protobuf\Internal\Message * Generated from protobuf field <code>.clarifai.api.Model model = 5;</code> */ protected $model = null; + /** + * Allow filtering of prediction requests down to specific Nodepools, Deploymetns or Runners + * + * Generated from protobuf field <code>.clarifai.api.RunnerSelector runner_selector = 6;</code> + */ + protected $runner_selector = null; /** * Constructor. @@ -55,6 +61,8 @@ class PostModelOutputsRequest extends \Google\Protobuf\Internal\Message * @type \Clarifai\Api\Model $model * This allows you to specify config options for the model such as * the language which appear's in the model's output_info. + * @type \Clarifai\Api\RunnerSelector $runner_selector + * Allow filtering of prediction requests down to specific Nodepools, Deploymetns or Runners * } */ public function __construct($data = NULL) { @@ -198,5 +206,41 @@ public function setModel($var) return $this; } + /** + * Allow filtering of prediction requests down to specific Nodepools, Deploymetns or Runners + * + * Generated from protobuf field <code>.clarifai.api.RunnerSelector runner_selector = 6;</code> + * @return \Clarifai\Api\RunnerSelector|null + */ + public function getRunnerSelector() + { + return $this->runner_selector; + } + + public function hasRunnerSelector() + { + return isset($this->runner_selector); + } + + public function clearRunnerSelector() + { + unset($this->runner_selector); + } + + /** + * Allow filtering of prediction requests down to specific Nodepools, Deploymetns or Runners + * + * Generated from protobuf field <code>.clarifai.api.RunnerSelector runner_selector = 6;</code> + * @param \Clarifai\Api\RunnerSelector $var + * @return $this + */ + public function setRunnerSelector($var) + { + GPBUtil::checkMessage($var, \Clarifai\Api\RunnerSelector::class); + $this->runner_selector = $var; + + return $this; + } + } diff --git a/src/Clarifai/Api/PutTaskAssignmentsRequest.php b/src/Clarifai/Api/PutTaskAssignmentsRequest.php index 88494a6..13f2d14 100644 --- a/src/Clarifai/Api/PutTaskAssignmentsRequest.php +++ b/src/Clarifai/Api/PutTaskAssignmentsRequest.php @@ -27,7 +27,7 @@ class PutTaskAssignmentsRequest extends \Google\Protobuf\Internal\Message * Deprecated: use action and action_config instead. * Supported for backwards compatibility: setting this field is equivalent with * * action = LABEL_SUBMIT - * * label_submit_config = [{"task_assignments": {"input": {"id": <input-id>}}}] + * * label_submit_config = [{"task_assignments": {{"id": "<task-assignment-id-for-input-id>"}}] * * Generated from protobuf field <code>string input_id = 3;</code> */ @@ -52,10 +52,13 @@ class PutTaskAssignmentsRequest extends \Google\Protobuf\Internal\Message * Deprecated: use action and action_config instead. * Supported for backwards compatibility: setting this field is equivalent with * * action = LABEL_SUBMIT - * * label_submit_config = [{"task_assignments": {"input": {"id": <input-id>}}}] + * * label_submit_config = [{"task_assignments": {{"id": "<task-assignment-id-for-input-id>"}}] * @type int $action * Action to perform on selected task. * @type \Clarifai\Api\LabelSubmitConfig $label_submit_config + * @type \Clarifai\Api\ReviewApproveConfig $review_approve_config + * @type \Clarifai\Api\ReviewRequestChangesConfig $review_request_changes_config + * @type \Clarifai\Api\ReviewRejectConfig $review_reject_config * } */ public function __construct($data = NULL) { @@ -121,7 +124,7 @@ public function setTaskId($var) * Deprecated: use action and action_config instead. * Supported for backwards compatibility: setting this field is equivalent with * * action = LABEL_SUBMIT - * * label_submit_config = [{"task_assignments": {"input": {"id": <input-id>}}}] + * * label_submit_config = [{"task_assignments": {{"id": "<task-assignment-id-for-input-id>"}}] * * Generated from protobuf field <code>string input_id = 3;</code> * @return string @@ -135,7 +138,7 @@ public function getInputId() * Deprecated: use action and action_config instead. * Supported for backwards compatibility: setting this field is equivalent with * * action = LABEL_SUBMIT - * * label_submit_config = [{"task_assignments": {"input": {"id": <input-id>}}}] + * * label_submit_config = [{"task_assignments": {{"id": "<task-assignment-id-for-input-id>"}}] * * Generated from protobuf field <code>string input_id = 3;</code> * @param string $var @@ -202,6 +205,87 @@ public function setLabelSubmitConfig($var) return $this; } + /** + * Generated from protobuf field <code>.clarifai.api.ReviewApproveConfig review_approve_config = 7;</code> + * @return \Clarifai\Api\ReviewApproveConfig|null + */ + public function getReviewApproveConfig() + { + return $this->readOneof(7); + } + + public function hasReviewApproveConfig() + { + return $this->hasOneof(7); + } + + /** + * Generated from protobuf field <code>.clarifai.api.ReviewApproveConfig review_approve_config = 7;</code> + * @param \Clarifai\Api\ReviewApproveConfig $var + * @return $this + */ + public function setReviewApproveConfig($var) + { + GPBUtil::checkMessage($var, \Clarifai\Api\ReviewApproveConfig::class); + $this->writeOneof(7, $var); + + return $this; + } + + /** + * Generated from protobuf field <code>.clarifai.api.ReviewRequestChangesConfig review_request_changes_config = 8;</code> + * @return \Clarifai\Api\ReviewRequestChangesConfig|null + */ + public function getReviewRequestChangesConfig() + { + return $this->readOneof(8); + } + + public function hasReviewRequestChangesConfig() + { + return $this->hasOneof(8); + } + + /** + * Generated from protobuf field <code>.clarifai.api.ReviewRequestChangesConfig review_request_changes_config = 8;</code> + * @param \Clarifai\Api\ReviewRequestChangesConfig $var + * @return $this + */ + public function setReviewRequestChangesConfig($var) + { + GPBUtil::checkMessage($var, \Clarifai\Api\ReviewRequestChangesConfig::class); + $this->writeOneof(8, $var); + + return $this; + } + + /** + * Generated from protobuf field <code>.clarifai.api.ReviewRejectConfig review_reject_config = 9;</code> + * @return \Clarifai\Api\ReviewRejectConfig|null + */ + public function getReviewRejectConfig() + { + return $this->readOneof(9); + } + + public function hasReviewRejectConfig() + { + return $this->hasOneof(9); + } + + /** + * Generated from protobuf field <code>.clarifai.api.ReviewRejectConfig review_reject_config = 9;</code> + * @param \Clarifai\Api\ReviewRejectConfig $var + * @return $this + */ + public function setReviewRejectConfig($var) + { + GPBUtil::checkMessage($var, \Clarifai\Api\ReviewRejectConfig::class); + $this->writeOneof(9, $var); + + return $this; + } + /** * @return string */ diff --git a/src/Clarifai/Api/PutTaskAssignmentsRequestAction.php b/src/Clarifai/Api/PutTaskAssignmentsRequestAction.php index b22e2ed..1862ed1 100644 --- a/src/Clarifai/Api/PutTaskAssignmentsRequestAction.php +++ b/src/Clarifai/Api/PutTaskAssignmentsRequestAction.php @@ -16,25 +16,79 @@ class PutTaskAssignmentsRequestAction */ const PUT_TASK_ASSIGNMENTS_REQUEST_ACTION_NOT_SET = 0; /** + * Create a list of task assignments for labeler => 10 inputs are assigned to the labeler. + * This is a fully sync action. + * If task assignments already exist, then return existing task assignments. + * * Generated from protobuf enum <code>LABEL_START = 1;</code> */ const LABEL_START = 1; /** + * Submit task assignments => mark task assignment work as completed. + * This is a partially sync action. + * Sync: task assignments are updated as follows: + * * when review_strategy is NONE, then task assignment status is updated to SUCCESS. + * * when review strategy is CONSENSUS, then task assignment status is updated to AWAITING_CONSENSUS_REVIEW. + * * when review strategy is MANUAL, then task assignment status is updated to AWAITING_REVIEW. + * If task assignments are already submitted, then no update is performed on them. + * Async: annotations added for the same input as the task assignment are updated as follows: + * * when review_strategy is NONE, then annotation status is updated to SUCCESS. + * * when review strategy is CONSENSUS, then annotation status is updated to SUCCESS (if it reaches consensus) or AWAITING_REVIEW (if it does not reach consensus). + * * when review strategy is MANUAL, then annotation status is updated to AWAITING_REVIEW. + * * Generated from protobuf enum <code>LABEL_SUBMIT = 2;</code> */ const LABEL_SUBMIT = 2; /** + * Return a list of task assignments for reviewer to review => 10 inputs are assigned to the reviewer. + * This is a fully sync action. + * NOT idempotent: + * In the current implementation, we don't actually store the reviewer in the task assignment, + * as the task assignment still stays assigned to the labeler. + * Therefore, multiple calls to this endpoint may result in different set of task assignments to review. + * For now, this action is practically not idempotent. + * In the future, we could however store the reviewer in the task assignment and + * return existing task assignments already assigned to the reviewer => this will make this action idempotent. + * * Generated from protobuf enum <code>REVIEW_START = 10;</code> */ const REVIEW_START = 10; /** + * Approve task assignments. + * There are two types of configurations: + * * Batch approve: approve a list of task assignment IDs; + * * Bulk approve: approve all task assignments from a list of workers. + * This is a partially sync action. + * Sync: task assignments are updated to SUCCESS + * Async: annotations added for the same input as the task assignment are updated to SUCCESS + * * Generated from protobuf enum <code>REVIEW_APPROVE = 11;</code> */ const REVIEW_APPROVE = 11; /** + * Request changes for task assignments. + * There are two types of configurations: + * * Batch request changes: request changes for a list of task assignment IDs; + * * Bulk request changes: request changes for all task assignments from a list of workers. + * This is a partially sync action. + * Sync: task assignments are updated to PENDING + * Async: annotations added for the same input as the task assignment are updated to PENDING + * * Generated from protobuf enum <code>REVIEW_REQUEST_CHANGES = 12;</code> */ const REVIEW_REQUEST_CHANGES = 12; + /** + * Reject task assignments. + * There are two types of configurations: + * * Batch reject: reject a list of task assignment IDs; + * * Bulk reject: reject all task assignments from a list of workers. + * This is a partially sync action. + * Sync: task assignments are updated to REVIEW_DENIED + * Async: annotations added for the same input as the task assignment are updated to REVIEW_DENIED + * + * Generated from protobuf enum <code>REVIEW_REJECT = 13;</code> + */ + const REVIEW_REJECT = 13; private static $valueToName = [ self::PUT_TASK_ASSIGNMENTS_REQUEST_ACTION_NOT_SET => 'PUT_TASK_ASSIGNMENTS_REQUEST_ACTION_NOT_SET', @@ -43,6 +97,7 @@ class PutTaskAssignmentsRequestAction self::REVIEW_START => 'REVIEW_START', self::REVIEW_APPROVE => 'REVIEW_APPROVE', self::REVIEW_REQUEST_CHANGES => 'REVIEW_REQUEST_CHANGES', + self::REVIEW_REJECT => 'REVIEW_REJECT', ]; public static function name($value) diff --git a/src/Clarifai/Api/ReviewApproveConfig.php b/src/Clarifai/Api/ReviewApproveConfig.php new file mode 100644 index 0000000..3a70dc0 --- /dev/null +++ b/src/Clarifai/Api/ReviewApproveConfig.php @@ -0,0 +1,85 @@ +<?php +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: proto/clarifai/api/service.proto + +namespace Clarifai\Api; + +use Google\Protobuf\Internal\GPBType; +use Google\Protobuf\Internal\RepeatedField; +use Google\Protobuf\Internal\GPBUtil; + +/** + * Generated from protobuf message <code>clarifai.api.ReviewApproveConfig</code> + */ +class ReviewApproveConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field <code>repeated .clarifai.api.TaskAssignment task_assignments = 1;</code> + */ + private $task_assignments; + /** + * Generated from protobuf field <code>repeated .clarifai.api.Worker workers = 2;</code> + */ + private $workers; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Clarifai\Api\TaskAssignment>|\Google\Protobuf\Internal\RepeatedField $task_assignments + * @type array<\Clarifai\Api\Worker>|\Google\Protobuf\Internal\RepeatedField $workers + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Proto\Clarifai\Api\Service::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field <code>repeated .clarifai.api.TaskAssignment task_assignments = 1;</code> + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTaskAssignments() + { + return $this->task_assignments; + } + + /** + * Generated from protobuf field <code>repeated .clarifai.api.TaskAssignment task_assignments = 1;</code> + * @param array<\Clarifai\Api\TaskAssignment>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTaskAssignments($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Clarifai\Api\TaskAssignment::class); + $this->task_assignments = $arr; + + return $this; + } + + /** + * Generated from protobuf field <code>repeated .clarifai.api.Worker workers = 2;</code> + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getWorkers() + { + return $this->workers; + } + + /** + * Generated from protobuf field <code>repeated .clarifai.api.Worker workers = 2;</code> + * @param array<\Clarifai\Api\Worker>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setWorkers($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Clarifai\Api\Worker::class); + $this->workers = $arr; + + return $this; + } + +} + diff --git a/src/Clarifai/Api/ReviewRejectConfig.php b/src/Clarifai/Api/ReviewRejectConfig.php new file mode 100644 index 0000000..15ed6cb --- /dev/null +++ b/src/Clarifai/Api/ReviewRejectConfig.php @@ -0,0 +1,85 @@ +<?php +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: proto/clarifai/api/service.proto + +namespace Clarifai\Api; + +use Google\Protobuf\Internal\GPBType; +use Google\Protobuf\Internal\RepeatedField; +use Google\Protobuf\Internal\GPBUtil; + +/** + * Generated from protobuf message <code>clarifai.api.ReviewRejectConfig</code> + */ +class ReviewRejectConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field <code>repeated .clarifai.api.TaskAssignment task_assignments = 1;</code> + */ + private $task_assignments; + /** + * Generated from protobuf field <code>repeated .clarifai.api.Worker workers = 2;</code> + */ + private $workers; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Clarifai\Api\TaskAssignment>|\Google\Protobuf\Internal\RepeatedField $task_assignments + * @type array<\Clarifai\Api\Worker>|\Google\Protobuf\Internal\RepeatedField $workers + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Proto\Clarifai\Api\Service::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field <code>repeated .clarifai.api.TaskAssignment task_assignments = 1;</code> + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTaskAssignments() + { + return $this->task_assignments; + } + + /** + * Generated from protobuf field <code>repeated .clarifai.api.TaskAssignment task_assignments = 1;</code> + * @param array<\Clarifai\Api\TaskAssignment>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTaskAssignments($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Clarifai\Api\TaskAssignment::class); + $this->task_assignments = $arr; + + return $this; + } + + /** + * Generated from protobuf field <code>repeated .clarifai.api.Worker workers = 2;</code> + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getWorkers() + { + return $this->workers; + } + + /** + * Generated from protobuf field <code>repeated .clarifai.api.Worker workers = 2;</code> + * @param array<\Clarifai\Api\Worker>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setWorkers($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Clarifai\Api\Worker::class); + $this->workers = $arr; + + return $this; + } + +} + diff --git a/src/Clarifai/Api/ReviewRequestChangesConfig.php b/src/Clarifai/Api/ReviewRequestChangesConfig.php new file mode 100644 index 0000000..7388046 --- /dev/null +++ b/src/Clarifai/Api/ReviewRequestChangesConfig.php @@ -0,0 +1,85 @@ +<?php +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: proto/clarifai/api/service.proto + +namespace Clarifai\Api; + +use Google\Protobuf\Internal\GPBType; +use Google\Protobuf\Internal\RepeatedField; +use Google\Protobuf\Internal\GPBUtil; + +/** + * Generated from protobuf message <code>clarifai.api.ReviewRequestChangesConfig</code> + */ +class ReviewRequestChangesConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field <code>repeated .clarifai.api.TaskAssignment task_assignments = 1;</code> + */ + private $task_assignments; + /** + * Generated from protobuf field <code>repeated .clarifai.api.Worker workers = 2;</code> + */ + private $workers; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Clarifai\Api\TaskAssignment>|\Google\Protobuf\Internal\RepeatedField $task_assignments + * @type array<\Clarifai\Api\Worker>|\Google\Protobuf\Internal\RepeatedField $workers + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Proto\Clarifai\Api\Service::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field <code>repeated .clarifai.api.TaskAssignment task_assignments = 1;</code> + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTaskAssignments() + { + return $this->task_assignments; + } + + /** + * Generated from protobuf field <code>repeated .clarifai.api.TaskAssignment task_assignments = 1;</code> + * @param array<\Clarifai\Api\TaskAssignment>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTaskAssignments($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Clarifai\Api\TaskAssignment::class); + $this->task_assignments = $arr; + + return $this; + } + + /** + * Generated from protobuf field <code>repeated .clarifai.api.Worker workers = 2;</code> + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getWorkers() + { + return $this->workers; + } + + /** + * Generated from protobuf field <code>repeated .clarifai.api.Worker workers = 2;</code> + * @param array<\Clarifai\Api\Worker>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setWorkers($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Clarifai\Api\Worker::class); + $this->workers = $arr; + + return $this; + } + +} + diff --git a/src/Clarifai/Api/Runner.php b/src/Clarifai/Api/Runner.php index caafa7d..481b6d9 100644 --- a/src/Clarifai/Api/Runner.php +++ b/src/Clarifai/Api/Runner.php @@ -9,7 +9,8 @@ use Google\Protobuf\Internal\GPBUtil; /** - * An app module that a user created in our app module marketplace. + * A worker for compute within a nodepool of instances. + * This asks the API for work * * Generated from protobuf message <code>clarifai.api.Runner</code> */ @@ -17,6 +18,7 @@ class Runner extends \Google\Protobuf\Internal\Message { /** * A unique ID for this app module. + * This is a UUID since runners can be automatically orchestrated. * * Generated from protobuf field <code>string id = 1;</code> */ @@ -48,17 +50,40 @@ class Runner extends \Google\Protobuf\Internal\Message */ protected $metadata = null; /** - * The creator of the app module. + * The owner of the runner. Runners belong to a user/org account. * * Generated from protobuf field <code>string user_id = 6;</code> */ protected $user_id = ''; /** - * Labels to match. + * Labels to match in order to find work. * - * Generated from protobuf field <code>repeated string labels = 7;</code> + * Generated from protobuf field <code>repeated string labels = 7 [deprecated = true];</code> + * @deprecated */ private $labels; + /** + * Runners are defined within nodepools so this field needs the id and user_id of the nodepool + * to be provided when creating a Runner. + * This nodepool must be accessible to you or an org you are part of. + * + * Generated from protobuf field <code>.clarifai.api.Nodepool nodepool = 12;</code> + */ + protected $nodepool = null; + /** + *////////////////////////// + * Need resources on the runner so we can schedule this Runner into the Nodepool. + * If this runner is being orchestrated for a model then the orchestrator will set this to the + * model resource requirements. If a workflow then it'll compute those requirements and set + * populate this resource field. + * Having this on the underlying object like Model and Workflow allows us to represent the minimum + * requirements on those object, which may be less than what the Runner allocates (as a safety + * margin for the runner to for sure run the resource). + * + * Generated from protobuf field <code>.clarifai.api.ComputeInfo compute_info = 13;</code> + */ + protected $compute_info = null; + protected $object; /** * Constructor. @@ -68,6 +93,7 @@ class Runner extends \Google\Protobuf\Internal\Message * * @type string $id * A unique ID for this app module. + * This is a UUID since runners can be automatically orchestrated. * @type string $description * A short description for this app module to be used in grids of modules. * @type \Google\Protobuf\Timestamp $created_at @@ -79,9 +105,26 @@ class Runner extends \Google\Protobuf\Internal\Message * https://github.com/google/protobuf/blob/master/src/google/protobuf/struct.proto * This is an optional arg. * @type string $user_id - * The creator of the app module. + * The owner of the runner. Runners belong to a user/org account. * @type array<string>|\Google\Protobuf\Internal\RepeatedField $labels - * Labels to match. + * Labels to match in order to find work. + * @type \Clarifai\Api\Model $model + * Model: match work to only a specific model. + * @type \Clarifai\Api\Workflow $workflow + * Workflow: match work to only a specific workflow. + * @type \Clarifai\Api\Nodepool $nodepool + * Runners are defined within nodepools so this field needs the id and user_id of the nodepool + * to be provided when creating a Runner. + * This nodepool must be accessible to you or an org you are part of. + * @type \Clarifai\Api\ComputeInfo $compute_info + * ////////////////////////// + * Need resources on the runner so we can schedule this Runner into the Nodepool. + * If this runner is being orchestrated for a model then the orchestrator will set this to the + * model resource requirements. If a workflow then it'll compute those requirements and set + * populate this resource field. + * Having this on the underlying object like Model and Workflow allows us to represent the minimum + * requirements on those object, which may be less than what the Runner allocates (as a safety + * margin for the runner to for sure run the resource). * } */ public function __construct($data = NULL) { @@ -91,6 +134,7 @@ public function __construct($data = NULL) { /** * A unique ID for this app module. + * This is a UUID since runners can be automatically orchestrated. * * Generated from protobuf field <code>string id = 1;</code> * @return string @@ -102,6 +146,7 @@ public function getId() /** * A unique ID for this app module. + * This is a UUID since runners can be automatically orchestrated. * * Generated from protobuf field <code>string id = 1;</code> * @param string $var @@ -254,7 +299,7 @@ public function setMetadata($var) } /** - * The creator of the app module. + * The owner of the runner. Runners belong to a user/org account. * * Generated from protobuf field <code>string user_id = 6;</code> * @return string @@ -265,7 +310,7 @@ public function getUserId() } /** - * The creator of the app module. + * The owner of the runner. Runners belong to a user/org account. * * Generated from protobuf field <code>string user_id = 6;</code> * @param string $var @@ -280,30 +325,194 @@ public function setUserId($var) } /** - * Labels to match. + * Labels to match in order to find work. * - * Generated from protobuf field <code>repeated string labels = 7;</code> + * Generated from protobuf field <code>repeated string labels = 7 [deprecated = true];</code> * @return \Google\Protobuf\Internal\RepeatedField + * @deprecated */ public function getLabels() { + @trigger_error('labels is deprecated.', E_USER_DEPRECATED); return $this->labels; } /** - * Labels to match. + * Labels to match in order to find work. * - * Generated from protobuf field <code>repeated string labels = 7;</code> + * Generated from protobuf field <code>repeated string labels = 7 [deprecated = true];</code> * @param array<string>|\Google\Protobuf\Internal\RepeatedField $var * @return $this + * @deprecated */ public function setLabels($var) { + @trigger_error('labels is deprecated.', E_USER_DEPRECATED); $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); $this->labels = $arr; return $this; } + /** + * Model: match work to only a specific model. + * + * Generated from protobuf field <code>.clarifai.api.Model model = 9;</code> + * @return \Clarifai\Api\Model|null + */ + public function getModel() + { + return $this->readOneof(9); + } + + public function hasModel() + { + return $this->hasOneof(9); + } + + /** + * Model: match work to only a specific model. + * + * Generated from protobuf field <code>.clarifai.api.Model model = 9;</code> + * @param \Clarifai\Api\Model $var + * @return $this + */ + public function setModel($var) + { + GPBUtil::checkMessage($var, \Clarifai\Api\Model::class); + $this->writeOneof(9, $var); + + return $this; + } + + /** + * Workflow: match work to only a specific workflow. + * + * Generated from protobuf field <code>.clarifai.api.Workflow workflow = 10;</code> + * @return \Clarifai\Api\Workflow|null + */ + public function getWorkflow() + { + return $this->readOneof(10); + } + + public function hasWorkflow() + { + return $this->hasOneof(10); + } + + /** + * Workflow: match work to only a specific workflow. + * + * Generated from protobuf field <code>.clarifai.api.Workflow workflow = 10;</code> + * @param \Clarifai\Api\Workflow $var + * @return $this + */ + public function setWorkflow($var) + { + GPBUtil::checkMessage($var, \Clarifai\Api\Workflow::class); + $this->writeOneof(10, $var); + + return $this; + } + + /** + * Runners are defined within nodepools so this field needs the id and user_id of the nodepool + * to be provided when creating a Runner. + * This nodepool must be accessible to you or an org you are part of. + * + * Generated from protobuf field <code>.clarifai.api.Nodepool nodepool = 12;</code> + * @return \Clarifai\Api\Nodepool|null + */ + public function getNodepool() + { + return $this->nodepool; + } + + public function hasNodepool() + { + return isset($this->nodepool); + } + + public function clearNodepool() + { + unset($this->nodepool); + } + + /** + * Runners are defined within nodepools so this field needs the id and user_id of the nodepool + * to be provided when creating a Runner. + * This nodepool must be accessible to you or an org you are part of. + * + * Generated from protobuf field <code>.clarifai.api.Nodepool nodepool = 12;</code> + * @param \Clarifai\Api\Nodepool $var + * @return $this + */ + public function setNodepool($var) + { + GPBUtil::checkMessage($var, \Clarifai\Api\Nodepool::class); + $this->nodepool = $var; + + return $this; + } + + /** + *////////////////////////// + * Need resources on the runner so we can schedule this Runner into the Nodepool. + * If this runner is being orchestrated for a model then the orchestrator will set this to the + * model resource requirements. If a workflow then it'll compute those requirements and set + * populate this resource field. + * Having this on the underlying object like Model and Workflow allows us to represent the minimum + * requirements on those object, which may be less than what the Runner allocates (as a safety + * margin for the runner to for sure run the resource). + * + * Generated from protobuf field <code>.clarifai.api.ComputeInfo compute_info = 13;</code> + * @return \Clarifai\Api\ComputeInfo|null + */ + public function getComputeInfo() + { + return $this->compute_info; + } + + public function hasComputeInfo() + { + return isset($this->compute_info); + } + + public function clearComputeInfo() + { + unset($this->compute_info); + } + + /** + *////////////////////////// + * Need resources on the runner so we can schedule this Runner into the Nodepool. + * If this runner is being orchestrated for a model then the orchestrator will set this to the + * model resource requirements. If a workflow then it'll compute those requirements and set + * populate this resource field. + * Having this on the underlying object like Model and Workflow allows us to represent the minimum + * requirements on those object, which may be less than what the Runner allocates (as a safety + * margin for the runner to for sure run the resource). + * + * Generated from protobuf field <code>.clarifai.api.ComputeInfo compute_info = 13;</code> + * @param \Clarifai\Api\ComputeInfo $var + * @return $this + */ + public function setComputeInfo($var) + { + GPBUtil::checkMessage($var, \Clarifai\Api\ComputeInfo::class); + $this->compute_info = $var; + + return $this; + } + + /** + * @return string + */ + public function getObject() + { + return $this->whichOneof("object"); + } + } diff --git a/src/Clarifai/Api/RunnerSelector.php b/src/Clarifai/Api/RunnerSelector.php new file mode 100644 index 0000000..c0bf714 --- /dev/null +++ b/src/Clarifai/Api/RunnerSelector.php @@ -0,0 +1,183 @@ +<?php +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: proto/clarifai/api/resources.proto + +namespace Clarifai\Api; + +use Google\Protobuf\Internal\GPBType; +use Google\Protobuf\Internal\RepeatedField; +use Google\Protobuf\Internal\GPBUtil; + +/** + *//////////////////////////////////////// + * Don't need RunnerSelector if we're opening up endpoints for deployments. + * //////////////////////////////////////// + * The RunnerSelector is an optional field we can provide during runtime + * of model/workflow predictions to specify which particular runner we want to process the work. + * This can optionally be used to select a particular nodepool and then within that nodepool + * a particular runner. + * + * Generated from protobuf message <code>clarifai.api.RunnerSelector</code> + */ +class RunnerSelector extends \Google\Protobuf\Internal\Message +{ + /** + * A particular nodepool for the resource to be run within. This request the id and user_id of + * the nodepool to be specified. Runners will be scaled according to a deployment for the given + * resource to be run. There should not be more than one deployment in this nodepool for the + * particular resource to run. If no deployments then default autoscaling will be used. + * + * Generated from protobuf field <code>.clarifai.api.Nodepool nodepool = 1;</code> + */ + protected $nodepool = null; + /** + * Optionally a partcular runner within the nodepool. + * + * Generated from protobuf field <code>.clarifai.api.Runner runner = 2;</code> + */ + protected $runner = null; + /** + * Optionally a partcular deployment within the nodepool. + * + * Generated from protobuf field <code>.clarifai.api.Deployment deployment = 3;</code> + */ + protected $deployment = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Clarifai\Api\Nodepool $nodepool + * A particular nodepool for the resource to be run within. This request the id and user_id of + * the nodepool to be specified. Runners will be scaled according to a deployment for the given + * resource to be run. There should not be more than one deployment in this nodepool for the + * particular resource to run. If no deployments then default autoscaling will be used. + * @type \Clarifai\Api\Runner $runner + * Optionally a partcular runner within the nodepool. + * @type \Clarifai\Api\Deployment $deployment + * Optionally a partcular deployment within the nodepool. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Proto\Clarifai\Api\Resources::initOnce(); + parent::__construct($data); + } + + /** + * A particular nodepool for the resource to be run within. This request the id and user_id of + * the nodepool to be specified. Runners will be scaled according to a deployment for the given + * resource to be run. There should not be more than one deployment in this nodepool for the + * particular resource to run. If no deployments then default autoscaling will be used. + * + * Generated from protobuf field <code>.clarifai.api.Nodepool nodepool = 1;</code> + * @return \Clarifai\Api\Nodepool|null + */ + public function getNodepool() + { + return $this->nodepool; + } + + public function hasNodepool() + { + return isset($this->nodepool); + } + + public function clearNodepool() + { + unset($this->nodepool); + } + + /** + * A particular nodepool for the resource to be run within. This request the id and user_id of + * the nodepool to be specified. Runners will be scaled according to a deployment for the given + * resource to be run. There should not be more than one deployment in this nodepool for the + * particular resource to run. If no deployments then default autoscaling will be used. + * + * Generated from protobuf field <code>.clarifai.api.Nodepool nodepool = 1;</code> + * @param \Clarifai\Api\Nodepool $var + * @return $this + */ + public function setNodepool($var) + { + GPBUtil::checkMessage($var, \Clarifai\Api\Nodepool::class); + $this->nodepool = $var; + + return $this; + } + + /** + * Optionally a partcular runner within the nodepool. + * + * Generated from protobuf field <code>.clarifai.api.Runner runner = 2;</code> + * @return \Clarifai\Api\Runner|null + */ + public function getRunner() + { + return $this->runner; + } + + public function hasRunner() + { + return isset($this->runner); + } + + public function clearRunner() + { + unset($this->runner); + } + + /** + * Optionally a partcular runner within the nodepool. + * + * Generated from protobuf field <code>.clarifai.api.Runner runner = 2;</code> + * @param \Clarifai\Api\Runner $var + * @return $this + */ + public function setRunner($var) + { + GPBUtil::checkMessage($var, \Clarifai\Api\Runner::class); + $this->runner = $var; + + return $this; + } + + /** + * Optionally a partcular deployment within the nodepool. + * + * Generated from protobuf field <code>.clarifai.api.Deployment deployment = 3;</code> + * @return \Clarifai\Api\Deployment|null + */ + public function getDeployment() + { + return $this->deployment; + } + + public function hasDeployment() + { + return isset($this->deployment); + } + + public function clearDeployment() + { + unset($this->deployment); + } + + /** + * Optionally a partcular deployment within the nodepool. + * + * Generated from protobuf field <code>.clarifai.api.Deployment deployment = 3;</code> + * @param \Clarifai\Api\Deployment $var + * @return $this + */ + public function setDeployment($var) + { + GPBUtil::checkMessage($var, \Clarifai\Api\Deployment::class); + $this->deployment = $var; + + return $this; + } + +} + diff --git a/src/Clarifai/Api/Status/StatusCode.php b/src/Clarifai/Api/Status/StatusCode.php index d04726d..50d6b92 100644 --- a/src/Clarifai/Api/Status/StatusCode.php +++ b/src/Clarifai/Api/Status/StatusCode.php @@ -1331,6 +1331,12 @@ class StatusCode * Generated from protobuf enum <code>TASK_MISSING = 54102;</code> */ const TASK_MISSING = 54102; + /** + * Not allowed to perform a task-related action. + * + * Generated from protobuf enum <code>TASK_PERMISSION_DENIED = 54103;</code> + */ + const TASK_PERMISSION_DENIED = 54103; /** * Generated from protobuf enum <code>TASK_ASSIGNMENT_SUCCESS = 54200;</code> */ @@ -1347,6 +1353,10 @@ class StatusCode * Generated from protobuf enum <code>TASK_ASSIGNMENT_AWAITING_CONSENSUS_REVIEW = 54203;</code> */ const TASK_ASSIGNMENT_AWAITING_CONSENSUS_REVIEW = 54203; + /** + * Generated from protobuf enum <code>TASK_ASSIGNMENT_REVIEW_DENIED = 54204;</code> + */ + const TASK_ASSIGNMENT_REVIEW_DENIED = 54204; /** * Label Order Related Status Code 55xxx * @@ -1972,10 +1982,12 @@ class StatusCode self::TASK_CONFLICT => 'TASK_CONFLICT', self::TASK_NOT_IMPLEMENTED => 'TASK_NOT_IMPLEMENTED', self::TASK_MISSING => 'TASK_MISSING', + self::TASK_PERMISSION_DENIED => 'TASK_PERMISSION_DENIED', self::TASK_ASSIGNMENT_SUCCESS => 'TASK_ASSIGNMENT_SUCCESS', self::TASK_ASSIGNMENT_PENDING => 'TASK_ASSIGNMENT_PENDING', self::TASK_ASSIGNMENT_AWAITING_REVIEW => 'TASK_ASSIGNMENT_AWAITING_REVIEW', self::TASK_ASSIGNMENT_AWAITING_CONSENSUS_REVIEW => 'TASK_ASSIGNMENT_AWAITING_CONSENSUS_REVIEW', + self::TASK_ASSIGNMENT_REVIEW_DENIED => 'TASK_ASSIGNMENT_REVIEW_DENIED', self::LABEL_ORDER_PENDING => 'LABEL_ORDER_PENDING', self::LABEL_ORDER_IN_PROGRESS => 'LABEL_ORDER_IN_PROGRESS', self::LABEL_ORDER_SUCCESS => 'LABEL_ORDER_SUCCESS', diff --git a/src/Clarifai/Api/V2Client.php b/src/Clarifai/Api/V2Client.php index 0d26d7a..32bd870 100644 --- a/src/Clarifai/Api/V2Client.php +++ b/src/Clarifai/Api/V2Client.php @@ -643,6 +643,22 @@ public function PostModelOutputs(\Clarifai\Api\PostModelOutputsRequest $argument } /** + * // TODO(zeiler): will need to + * // Single request but streaming resopnses. + * rpc GeneratePostModelOutputs (PostModelOutputsRequest) returns (stream MultiOutputResponse) { + * option (google.api.http) = { + * post: "/v2/users/{user_app_id.user_id}/apps/{user_app_id.app_id}/models/{model_id}/versions/{version_id}/outputs" + * body: "*" + * }; + * option (clarifai.auth.util.cl_auth_type) = KeyAuth; + * option (clarifai.auth.util.cl_depending_scopes) = Apps_Get; + * option (clarifai.auth.util.cl_depending_scopes) = Concepts_Get; + * option (clarifai.auth.util.cl_depending_scopes) = Models_Get; + * option (clarifai.auth.util.cl_depending_scopes) = Predict; + * option (clarifai.auth.util.cl_depending_scopes) = Nodepools_Get; + * option (clarifai.auth.util.cl_depending_scopes) = Deployments_Get; + * } + * * List all the datasets. * @param \Clarifai\Api\ListDatasetsRequest $argument input argument * @param array $metadata metadata @@ -1203,6 +1219,23 @@ public function ListModelVersions(\Clarifai\Api\ListModelVersionsRequest $argume } /** + * TODO(zeiler): in future we can add endpoints like this for listing runners for a specific model + * List all the runners currently handling work for the given model. + * By default this lists the runners available in your account as well as all the orgs you have + * access to. + * Could have RunnerSelector to break it down by Nodepool or Deployment. + * Addition filters on the request can select specific user/org to list from or nodepool. + * rpc ListModelVersionRunners (ListModelVersionRunnersRequest) returns (MultiRunnerResponse) { + * option (google.api.http) = { + * get: "/v2/users/{user_app_id.user_id}/apps/{user_app_id.app_id}/models/{model_id}/versions/{version_id}/runners" + * }; + * option (clarifai.auth.util.cl_auth_type) = KeyAuth; + * option (clarifai.auth.util.cl_depending_scopes) = Apps_Get; + * option (clarifai.auth.util.cl_depending_scopes) = Concepts_Get; + * option (clarifai.auth.util.cl_depending_scopes) = Models_Get; + * option (clarifai.auth.util.cl_depending_scopes) = Runners_Get; + * } + * * @param \Clarifai\Api\PostWorkflowVersionsUnPublishRequest $argument input argument * @param array $metadata metadata * @param array $options call options @@ -2290,20 +2323,6 @@ public function GetStatusCode(\Clarifai\Api\GetStatusCodeRequest $argument, $metadata, $options); } - /** - * @param \Clarifai\Api\GetResourcePriceRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetResourcePrice(\Clarifai\Api\GetResourcePriceRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/clarifai.api.V2/GetResourcePrice', - $argument, - ['\Clarifai\Api\GetResourcePriceResponse', 'decode'], - $metadata, $options); - } - /** * owner list users who the app is shared with * @param \Clarifai\Api\ListCollaboratorsRequest $argument input argument @@ -3096,7 +3115,9 @@ public function ListNextTaskAssignments(\Clarifai\Api\ListNextTaskAssignmentsReq } /** - * PutTaskAssignments evaluates all the annotations by labeler (authenticated user) for given task (task_id) and input (input_id). + * PutTaskAssignments performs an action for the task assignments in given task. + * All the actions are theoretically idempotent, but practically, in the current implementation, + * the REVIEW_START action is not idempotent. See PutTaskAssignmentsRequestAction for more details. * @param \Clarifai\Api\PutTaskAssignmentsRequest $argument input argument * @param array $metadata metadata * @param array $options call options @@ -3318,7 +3339,8 @@ public function PostInputsUploads(\Clarifai\Api\PostInputsUploadsRequest $argume } /** - * Get a specific runner from an app. + * Get a specific runner. + * TODO(zeiler): runner_id is a UUID so can list globally as well. * @param \Clarifai\Api\GetRunnerRequest $argument input argument * @param array $metadata metadata * @param array $options call options @@ -3333,7 +3355,7 @@ public function GetRunner(\Clarifai\Api\GetRunnerRequest $argument, } /** - * List all the runners in community, by user or by app. + * List all the runners for the user. * @param \Clarifai\Api\ListRunnersRequest $argument input argument * @param array $metadata metadata * @param array $options call options @@ -3348,7 +3370,7 @@ public function ListRunners(\Clarifai\Api\ListRunnersRequest $argument, } /** - * Add a runners to an app. + * Add a runners to a user. * @param \Clarifai\Api\PostRunnersRequest $argument input argument * @param array $metadata metadata * @param array $options call options @@ -3379,6 +3401,7 @@ public function DeleteRunners(\Clarifai\Api\DeleteRunnersRequest $argument, /** * List items for the remote runner to work on. + * since the runner_id is a UUID we can access it directly too. * @param \Clarifai\Api\ListRunnerItemsRequest $argument input argument * @param array $metadata metadata * @param array $options call options @@ -3394,6 +3417,7 @@ public function ListRunnerItems(\Clarifai\Api\ListRunnerItemsRequest $argument, /** * Post back outputs from remote runners + * since the runner_id is a UUID we can access it directly too. * @param \Clarifai\Api\PostRunnerItemOutputsRequest $argument input argument * @param array $metadata metadata * @param array $options call options diff --git a/src/Clarifai/Auth/Scope/S.php b/src/Clarifai/Auth/Scope/S.php index f0ca1cb..d148606 100644 --- a/src/Clarifai/Auth/Scope/S.php +++ b/src/Clarifai/Auth/Scope/S.php @@ -149,6 +149,18 @@ class S * Generated from protobuf enum <code>Models_Sync = 27 [(.clarifai.auth.scope.clarifai_depending_scopes) = Models_Get];</code> */ const Models_Sync = 27; + /** + * To get model version export + * + * Generated from protobuf enum <code>ModelExports_Get = 142 [(.clarifai.auth.scope.clarfai_exposed) = true];</code> + */ + const ModelExports_Get = 142; + /** + * To create model version export + * + * Generated from protobuf enum <code>ModelExports_Add = 143 [(.clarifai.auth.scope.clarfai_exposed) = true, (.clarifai.auth.scope.clarifai_depending_scopes) = ModelExports_Get];</code> + */ + const ModelExports_Add = 143; /** * Write to the workflows DB table. * @@ -518,7 +530,7 @@ class S */ const Uploads_Delete = 130; /** - * To read allo control over remote runners + * To control remote runners * * Generated from protobuf enum <code>Runners_Get = 131 [(.clarifai.auth.scope.clarfai_exposed) = true];</code> */ @@ -559,6 +571,8 @@ class S self::Models_Delete => 'Models_Delete', self::Models_Train => 'Models_Train', self::Models_Sync => 'Models_Sync', + self::ModelExports_Get => 'ModelExports_Get', + self::ModelExports_Add => 'ModelExports_Add', self::Workflows_Add => 'Workflows_Add', self::Workflows_Get => 'Workflows_Get', self::Workflows_Patch => 'Workflows_Patch', diff --git a/src/GPBMetadata/Proto/Clarifai/Api/Resources.php b/src/GPBMetadata/Proto/Clarifai/Api/Resources.php index f9de4978e6fed2d664ddf0a876c3e0857114d467..31463fe5e0ec3d398c987c535014c77a709d564c 100644 GIT binary patch delta 1766 zcmZuxO>Y}j6zz<^uVZ`i;wF<6(qJkz6_r7j098npCgVxt#_?GGP}E51X)^Qd3>nW@ z^P!TJRk2}(gk}Nkx<Kj<waSJSqAOUTE?7|3`~ZFe@6Fhb9kH?e&b{x=z2}~De|gRS z`i6h`SAzfg_shQ%4<7RWq%Uvo{mZ|D9>BV34~R=_onYM=jRT)xia4Se?wph-att*n zf<6E^4NS|3<C{C&Zoalr)h*362bx*c#%6Vo#aZ&>WHu)N{YAoB<#Wi*185Ug4M#sG zE;dKnkYHOI5s{;h<&X%%Qpnft3`IT)-Ga5HkYNsq=Zgszyj)dYr};O0_~+qs?xQeh z-rwHiMGk!e<*`c)Q}>C1HQRQ4%{Lue%!IGrE8mso03~5#=sJOIVBZb=v&Gyj%f0-r z`Eir~HWB{u{cqa{(w25gEKkhrBzAMrm+nAn<QT*fbKx^}GaO|~9E8uGmBnMnJs()k z(}Npm7qT|Z89R<8uCU-%YkEW<!pai$1xCHPK>c18($47@ME5H%c*xE#0`R6WC9edT zz+<c$Q_9$@mJ=A*B}3YFxP7udkr~j5&ge5J>e^V-P5%P>7h~dyN!n1c_WtrnXCJG| z)8rn_Me9&BZO_-3Y~ssV#s<0xg^_7fg~TyW%+U!IB3SzplPeq;UU>{FOV5f>?jN?) z;}({swj?)tPjK%^TM=%cRVb*fx^g77>M_Kj0_3`FwHF`x%1<2RqyEBI8*7s)q@wO4 zi4<$Mmz!GPp&I>1MM%dyQ5LACDqTp$0RdL}t;49KrrNL5Qc95TD$RX-pmuvoUEoj# z64G&3;Mt!?a$88C+yqk6Nx!2ANd%B?N=JKjNk~<`Vl^&UN}!?$Mpz#QUNpu6qUrR6 zM`Yx<7t={nU$87q*NH`3&39ZcYO8>@04<=iTeO2oY^TK_8<Ut~Q>y&TK}iaH$I~^7 z$c{ZQho}rIY;rCcTc)nf%3&xS+#F?YETG%4;k(*kVCwkH^k_X7*dw}Q8?(B0CLl(S zW5aoBV`>fUDuoeTK-;h$X9VMG@l+J23M005Y7tB|dT!c7F-`Go<!u6>PK$IdM#T0h zUH@x=Tk+cX6a;P7CtYu>Q85v|w9Cr%_U}Q?p87F1LcX@XteKe+(A@2*x!cps(31tX z*J0Ju&xjFNv~sMUIi^nN!r-XC?kzui)l0QIzad8#Dla$?u7l`Z*rbAtOwyGPlzP9} zXg$L6fjVi(%qdw&?n{j()g@J4hx$c5qSDMks@-7;38vq+(%Dx#)JzmeqC8|;O7B?h z911BG?e`kZ#);Hxs4XEKrFWElrGuH<gbZ4PQac7_juf(NL*1ROsBbtZb^_ZbZkOs+ vr}9`@ejMZK;R2g!H%gAgp0Aac>4_gg_W|hcoDQ9ikZ$D#6<q%K!&c@$L`MDw delta 100 zcmV-q0Gt27&;q`}0<hQv0*1M>+5<U03H${L3{7ujWo(mRg%q<eLe&BcN(2ZA5DH2J z2oewzv)Dz!1_IdulbcMS0W6a|O)RtDO)E?S)&Y|Yn#T_g3I=RpVr6V|7zZE&C<(JB Gp&AGC`yg)s diff --git a/src/GPBMetadata/Proto/Clarifai/Api/Service.php b/src/GPBMetadata/Proto/Clarifai/Api/Service.php index 883ae648840072f441bdac37803de003d7db667d..59cdd32f1d95e9b2ede794b5dd4dd6514ce09144 100644 GIT binary patch delta 751 zcmbO~h3(QbwhcZkOb1#v`?2g6+AJ*bNSX1&<Zsry%!N$3_=`&O@=}Z9i&Jw_lS}f8 zB-j)fHMosr^pbNDi!##^GxZV+GWCMMih`kPHgB-W%w)R3JXw0#J82;&F43aYvdq-- z_{4&OqWrSd_~iV&w9Iq~_Q`_lMe2jVa*hxwXRwS1gHRxsEL2lbYGG+=aY=k~Mq*xi zYB5YR2iO@JXwCqe6$H`Y4AB5L(t%3^Ze$kFFA$TI(j_>-Mk!!73aE0@@(h6zE@2dh zPS#v*$0el7#a^CYl$}~MIdF}*TsWAiRLvy?QHtsgEILG?I*Pf3U^;--P1aa$k7hJC zRAC1rm-O^|WsK63PZ{WK-nyJ$faMe;m;7YeWs;L0Zl5D2B*?`Z<QnGb8Xh0y>gDPj zBEW03ea7a79dc?+oh*|V+>7O2#oToH$z-N}W~I!jjf_6i7qBpLOy9uA$TvCb{-Nlo zbfqNyG9&%c;?$yI{c5zh*Gow)$jPtFP0cIO1F4A5OsUmJh~d|;S?<9lF~;YUKYmMR zYG9oHuAI?n@|^E3o1cE)E6TWi`eI(ja>o7BrTG|lOs`jGWaa8(oG>Rwy`NEN!}QyH zjHQgbrU&vf?wsDB&d9>l$GDwKfboJN<AUk84H-Q+Bfx%g6SADlxYJS~ic^Rk<OyJM Vn*lU}X?vCtW18spSssk7jsRyr4#@xj delta 486 zcmcaKjcxuEwhcZkOr1@e{aAJjiL7Ac5_eB62}&)_FD*(=4JgV?PMzGyX33~B`K-H= zkOza178gf(eo=N>PJX!rvjXGf{8}kx4+bYLE{-CoCZ(7dE(r`nKKhwS2y?L(fJ~HN zQef0zc4BGRD#56v$0ag7!IM#Bvx4|(WyYP8-&pP1eAhZNlkGnvmt;Wc^oM1P;*<X@ zbef!HC^UKd()!8#%i~!(7`ddU3sx{nPnMR|+pN5jUw~~pBbPi(`G=+Klf!mSWj1P> zxtVd7oEp;t=E;f=V!018HC=u(nQ0l5Qs#6)KE}k!7rwJk{`g?eX0b;{#28;szWpPe zsfBU6VkM)~<hGwKtP|$MsIzW9^>eQ%%SI+HvFRK68O5eA<Y$ay+&N8vaR)aaNCCgl zY9=nx$?Jner{5P~jAh(9y+DXDXZiy{M)v6&1R347{}E)opvX9N`dMQ}4-Q|j3#^5v zCzvuiZ_hSiOcE74%*Z8x9$-SMlRy5DWQD{);Z^a;|9^0cgL%NnDag+&PE|?(8|5YB bG1>5t6(214<H12Z{h%VF==QUojIE9Uqb9Cd diff --git a/src/GPBMetadata/Proto/Clarifai/Api/Status/StatusCode.php b/src/GPBMetadata/Proto/Clarifai/Api/Status/StatusCode.php index eb547f14dd1368362ea61ffbeff2656176f21de3..297fd1695ed5366a5d03651581b5e0e026d59954 100644 GIT binary patch delta 98 zcmewmvpIIdBSw~%NG|P(-rAD|nZy{+ZPsAgt0*nQB^Kfs>>VHA8szI49PH`u7w_Wg s=jrMqaDDP4<(W##T(V$!N1&X$pRcQ5NPLiMn5SzvOxd2z6)HbC0V>-cu>b%7 delta 35 rcmdlS`ypn-BSw~k5nS36y|pI`GKn#EZ`NSit2miiW!mO_DqlGP_l6BG diff --git a/src/GPBMetadata/Proto/Clarifai/Auth/Scope/Scope.php b/src/GPBMetadata/Proto/Clarifai/Auth/Scope/Scope.php index 0404acb23098782c87ea797c891f2698e76ff3ea..0ef77838036f9dcf6e04d9c84b84f29dd4a714c4 100644 GIT binary patch delta 97 zcmcaBJ6~?Ybw-wJ5?rd23-}}_e_`xl+9S5PiHU>BUcfg$B{j#jq9DJhq&VI^wM3wg lQHtfm>=<=MAq6f}S;v$Vfqq6QPO$6`pprhu&Fw5<TmWB>Amac4 delta 26 icmbO)cUN}9bw<YNlW#DtVEQY%xrvE`Y4aJDU@icbw+bNu