Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add model and contents fields to ComputeTokensRequest v1 #5517

Merged
merged 8 commits into from
Jul 9, 2024
2 changes: 2 additions & 0 deletions packages/google-cloud-aiplatform/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/
| Deployment_resource_pool_service.get_deployment_resource_pool | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/deployment_resource_pool_service.get_deployment_resource_pool.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-aiplatform/samples/generated/v1/deployment_resource_pool_service.get_deployment_resource_pool.js,packages/google-cloud-aiplatform/samples/README.md) |
| Deployment_resource_pool_service.list_deployment_resource_pools | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/deployment_resource_pool_service.list_deployment_resource_pools.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-aiplatform/samples/generated/v1/deployment_resource_pool_service.list_deployment_resource_pools.js,packages/google-cloud-aiplatform/samples/README.md) |
| Deployment_resource_pool_service.query_deployed_models | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/deployment_resource_pool_service.query_deployed_models.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-aiplatform/samples/generated/v1/deployment_resource_pool_service.query_deployed_models.js,packages/google-cloud-aiplatform/samples/README.md) |
| Deployment_resource_pool_service.update_deployment_resource_pool | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/deployment_resource_pool_service.update_deployment_resource_pool.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-aiplatform/samples/generated/v1/deployment_resource_pool_service.update_deployment_resource_pool.js,packages/google-cloud-aiplatform/samples/README.md) |
| Endpoint_service.create_endpoint | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/endpoint_service.create_endpoint.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-aiplatform/samples/generated/v1/endpoint_service.create_endpoint.js,packages/google-cloud-aiplatform/samples/README.md) |
| Endpoint_service.delete_endpoint | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/endpoint_service.delete_endpoint.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-aiplatform/samples/generated/v1/endpoint_service.delete_endpoint.js,packages/google-cloud-aiplatform/samples/README.md) |
| Endpoint_service.deploy_model | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/endpoint_service.deploy_model.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-aiplatform/samples/generated/v1/endpoint_service.deploy_model.js,packages/google-cloud-aiplatform/samples/README.md) |
Expand Down Expand Up @@ -417,6 +418,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/
| Deployment_resource_pool_service.get_deployment_resource_pool | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/deployment_resource_pool_service.get_deployment_resource_pool.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-aiplatform/samples/generated/v1beta1/deployment_resource_pool_service.get_deployment_resource_pool.js,packages/google-cloud-aiplatform/samples/README.md) |
| Deployment_resource_pool_service.list_deployment_resource_pools | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/deployment_resource_pool_service.list_deployment_resource_pools.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-aiplatform/samples/generated/v1beta1/deployment_resource_pool_service.list_deployment_resource_pools.js,packages/google-cloud-aiplatform/samples/README.md) |
| Deployment_resource_pool_service.query_deployed_models | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/deployment_resource_pool_service.query_deployed_models.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-aiplatform/samples/generated/v1beta1/deployment_resource_pool_service.query_deployed_models.js,packages/google-cloud-aiplatform/samples/README.md) |
| Deployment_resource_pool_service.update_deployment_resource_pool | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/deployment_resource_pool_service.update_deployment_resource_pool.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-aiplatform/samples/generated/v1beta1/deployment_resource_pool_service.update_deployment_resource_pool.js,packages/google-cloud-aiplatform/samples/README.md) |
| Endpoint_service.create_endpoint | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/endpoint_service.create_endpoint.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-aiplatform/samples/generated/v1beta1/endpoint_service.create_endpoint.js,packages/google-cloud-aiplatform/samples/README.md) |
| Endpoint_service.delete_endpoint | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/endpoint_service.delete_endpoint.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-aiplatform/samples/generated/v1beta1/endpoint_service.delete_endpoint.js,packages/google-cloud-aiplatform/samples/README.md) |
| Endpoint_service.deploy_model | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/endpoint_service.deploy_model.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-aiplatform/samples/generated/v1beta1/endpoint_service.deploy_model.js,packages/google-cloud-aiplatform/samples/README.md) |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import "google/cloud/aiplatform/v1/endpoint.proto";
import "google/cloud/aiplatform/v1/operation.proto";
import "google/longrunning/operations.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/field_mask.proto";

option csharp_namespace = "Google.Cloud.AIPlatform.V1";
option go_package = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb";
Expand Down Expand Up @@ -74,6 +75,21 @@ service DeploymentResourcePoolService {
option (google.api.method_signature) = "parent";
}

// Update a DeploymentResourcePool.
rpc UpdateDeploymentResourcePool(UpdateDeploymentResourcePoolRequest)
returns (google.longrunning.Operation) {
option (google.api.http) = {
patch: "/v1/{deployment_resource_pool.name=projects/*/locations/*/deploymentResourcePools/*}"
body: "deployment_resource_pool"
};
option (google.api.method_signature) =
"deployment_resource_pool,update_mask";
option (google.longrunning.operation_info) = {
response_type: "DeploymentResourcePool"
metadata_type: "UpdateDeploymentResourcePoolOperationMetadata"
};
}

// Delete a DeploymentResourcePool.
rpc DeleteDeploymentResourcePool(DeleteDeploymentResourcePoolRequest)
returns (google.longrunning.Operation) {
Expand Down Expand Up @@ -175,6 +191,22 @@ message ListDeploymentResourcePoolsResponse {
string next_page_token = 2;
}

// Request message for UpdateDeploymentResourcePool method.
message UpdateDeploymentResourcePoolRequest {
// Required. The DeploymentResourcePool to update.
//
// The DeploymentResourcePool's `name` field is used to identify the
// DeploymentResourcePool to update.
// Format:
// `projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}`
DeploymentResourcePool deployment_resource_pool = 1
[(google.api.field_behavior) = REQUIRED];

// Required. The list of fields to update.
google.protobuf.FieldMask update_mask = 2
[(google.api.field_behavior) = REQUIRED];
}

// Runtime operation information for UpdateDeploymentResourcePool method.
message UpdateDeploymentResourcePoolOperationMetadata {
// The operation generic information.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package google.cloud.aiplatform.v1;
import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/cloud/aiplatform/v1/encryption_spec.proto";
import "google/cloud/aiplatform/v1/service_networking.proto";
import "google/protobuf/timestamp.proto";

option csharp_namespace = "Google.Cloud.AIPlatform.V1";
Expand Down Expand Up @@ -72,6 +73,19 @@ message FeatureOnlineStore {
// this FeatureOnlineStore
string public_endpoint_domain_name = 2
[(google.api.field_behavior) = OUTPUT_ONLY];

// Optional. Private service connect config. The private service connection
// is available only for Optimized storage type, not for embedding
// management now. If
// [PrivateServiceConnectConfig.enable_private_service_connect][google.cloud.aiplatform.v1.PrivateServiceConnectConfig.enable_private_service_connect]
// set to true, customers will use private service connection to send
// request. Otherwise, the connection will set to public endpoint.
PrivateServiceConnectConfig private_service_connect_config = 3
[(google.api.field_behavior) = OPTIONAL];

// Output only. The name of the service attachment resource. Populated if
// private service connect is enabled and after FeatureViewSync is created.
string service_attachment = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
}

// Possible states a featureOnlineStore can have.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import "google/api/annotations.proto";
import "google/api/client.proto";
import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/cloud/aiplatform/v1/content.proto";
import "google/cloud/aiplatform/v1/prediction_service.proto";
import "google/protobuf/struct.proto";

Expand Down Expand Up @@ -75,11 +76,19 @@ message ComputeTokensRequest {
}
];

// Required. The instances that are the input to token computing API call.
// Optional. The instances that are the input to token computing API call.
// Schema is identical to the prediction schema of the text model, even for
// the non-text models, like chat models, or Codey models.
repeated google.protobuf.Value instances = 2
[(google.api.field_behavior) = REQUIRED];
[(google.api.field_behavior) = OPTIONAL];

// Optional. The name of the publisher model requested to serve the
// prediction. Format:
// projects/{project}/locations/{location}/publishers/*/models/*
string model = 3 [(google.api.field_behavior) = OPTIONAL];

// Optional. Input content.
repeated Content contents = 4 [(google.api.field_behavior) = OPTIONAL];
}

// Tokens info with a list of tokens and the corresponding list of token ids.
Expand All @@ -89,6 +98,9 @@ message TokensInfo {

// A list of token ids from the input.
repeated int64 token_ids = 2;

// Optional. Optional fields for the role from the corresponding Content.
string role = 3 [(google.api.field_behavior) = OPTIONAL];
}

// Response message for ComputeTokens RPC call.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,12 @@ message Model {
// only supports specifing the Model Garden models and Genie models.
BaseModelSource base_model_source = 50
[(google.api.field_behavior) = OPTIONAL];

// Output only. Reserved for future use.
bool satisfies_pzs = 51 [(google.api.field_behavior) = OUTPUT_ONLY];

// Output only. Reserved for future use.
bool satisfies_pzi = 52 [(google.api.field_behavior) = OUTPUT_ONLY];
}

// Contains information about the Large Model.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,13 @@ message ResourcePool {
// The min/max number of replicas allowed if enabling autoscaling
message AutoscalingSpec {
// Optional. min replicas in the node pool,
// must be ≤ replica_count and < max_replica_count or will throw error
// must be ≤ replica_count and < max_replica_count or will throw error.
// For autoscaling enabled Ray-on-Vertex, we allow min_replica_count of a
// resource_pool to be 0 to match the OSS Ray
// behavior(https://docs.ray.io/en/latest/cluster/vms/user-guides/configuring-autoscaling.html#cluster-config-parameters).
// As for Persistent Resource, the min_replica_count must be > 0, we added
// a corresponding validation inside
// CreatePersistentResourceRequestValidator.java.
optional int64 min_replica_count = 1
[(google.api.field_behavior) = OPTIONAL];

Expand Down Expand Up @@ -194,7 +200,7 @@ message ResourcePool {
// this resource pool. Will replace idle_replica_count.
int64 used_replica_count = 6 [(google.api.field_behavior) = OUTPUT_ONLY];

// Optional. Optional spec to configure GKE autoscaling
// Optional. Optional spec to configure GKE or Ray-on-Vertex autoscaling
AutoscalingSpec autoscaling_spec = 7 [(google.api.field_behavior) = OPTIONAL];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,14 @@ message PublisherModel {
// Model metadata that is needed for UploadModel or
// DeployModel/CreateEndpoint requests.
message Deploy {
// Metadata information about the deployment for managing deployment
// config.
message DeployMetadata {
// Optional. Labels for the deployment. For managing deployment config
// like verifying, source of deployment config, etc.
map<string, string> labels = 1 [(google.api.field_behavior) = OPTIONAL];
}

// The prediction (for example, the machine) resources that the
// DeployedModel uses.
oneof prediction_resources {
Expand Down Expand Up @@ -154,6 +162,10 @@ message PublisherModel {
optional string deploy_task_name = 10
[(google.api.field_behavior) = OPTIONAL];

// Optional. Metadata information about this deployment config.
optional DeployMetadata deploy_metadata = 11
[(google.api.field_behavior) = OPTIONAL];

// Required. The title of the regional resource reference.
string title = 8 [(google.api.field_behavior) = REQUIRED];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,10 @@ message Tensorboard {
// TensorBoard instance to be default will mark all other TensorBoard
// instances (if any) as non default.
bool is_default = 12;

// Output only. Reserved for future use.
bool satisfies_pzs = 13 [(google.api.field_behavior) = OUTPUT_ONLY];

// Output only. Reserved for future use.
bool satisfies_pzi = 14 [(google.api.field_behavior) = OUTPUT_ONLY];
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import "google/cloud/aiplatform/v1beta1/endpoint.proto";
import "google/cloud/aiplatform/v1beta1/operation.proto";
import "google/longrunning/operations.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/field_mask.proto";

option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1";
option go_package = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb";
Expand Down Expand Up @@ -74,6 +75,21 @@ service DeploymentResourcePoolService {
option (google.api.method_signature) = "parent";
}

// Update a DeploymentResourcePool.
rpc UpdateDeploymentResourcePool(UpdateDeploymentResourcePoolRequest)
returns (google.longrunning.Operation) {
option (google.api.http) = {
patch: "/v1beta1/{deployment_resource_pool.name=projects/*/locations/*/deploymentResourcePools/*}"
body: "deployment_resource_pool"
};
option (google.api.method_signature) =
"deployment_resource_pool,update_mask";
option (google.longrunning.operation_info) = {
response_type: "DeploymentResourcePool"
metadata_type: "UpdateDeploymentResourcePoolOperationMetadata"
};
}

// Delete a DeploymentResourcePool.
rpc DeleteDeploymentResourcePool(DeleteDeploymentResourcePoolRequest)
returns (google.longrunning.Operation) {
Expand Down Expand Up @@ -175,6 +191,22 @@ message ListDeploymentResourcePoolsResponse {
string next_page_token = 2;
}

// Request message for UpdateDeploymentResourcePool method.
message UpdateDeploymentResourcePoolRequest {
// Required. The DeploymentResourcePool to update.
//
// The DeploymentResourcePool's `name` field is used to identify the
// DeploymentResourcePool to update.
// Format:
// `projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}`
DeploymentResourcePool deployment_resource_pool = 1
[(google.api.field_behavior) = REQUIRED];

// Required. The list of fields to update.
google.protobuf.FieldMask update_mask = 2
[(google.api.field_behavior) = REQUIRED];
}

// Runtime operation information for UpdateDeploymentResourcePool method.
message UpdateDeploymentResourcePoolOperationMetadata {
// The operation generic information.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,10 @@ message BleuInstance {

// Spec for bleu score metric - calculates the precision of n-grams in the
// prediction as compared to reference - returns a score ranging between 0 to 1.
message BleuSpec {}
message BleuSpec {
// Optional. Whether to use_effective_order to compute bleu score.
bool use_effective_order = 1 [(google.api.field_behavior) = OPTIONAL];
}

// Results for bleu metric.
message BleuResults {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ message RuntimeConfig {
// Code execution runtime configurations for code interpreter extension.
CodeInterpreterRuntimeConfig code_interpreter_runtime_config = 2;

// Runtime configuration for Vertext AI Search extension.
// Runtime configuration for Vertex AI Search extension.
VertexAISearchRuntimeConfig vertex_ai_search_runtime_config = 6;
}

Expand Down
Loading
Loading