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_garden_service.proto and publisher_model.proto to BUILD.bazel #4225

Merged
merged 7 commits into from
May 3, 2023
1 change: 1 addition & 0 deletions packages/google-cloud-aiplatform/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/
| Metadata_service.update_execution | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.update_execution.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/metadata_service.update_execution.js,samples/README.md) |
| Migration_service.batch_migrate_resources | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/migration_service.batch_migrate_resources.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/migration_service.batch_migrate_resources.js,samples/README.md) |
| Migration_service.search_migratable_resources | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/migration_service.search_migratable_resources.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/migration_service.search_migratable_resources.js,samples/README.md) |
| Model_garden_service.get_publisher_model | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_garden_service.get_publisher_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/model_garden_service.get_publisher_model.js,samples/README.md) |
| Model_service.batch_import_evaluated_annotations | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_service.batch_import_evaluated_annotations.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/model_service.batch_import_evaluated_annotations.js,samples/README.md) |
| Model_service.batch_import_model_evaluation_slices | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_service.batch_import_model_evaluation_slices.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/model_service.batch_import_model_evaluation_slices.js,samples/README.md) |
| Model_service.copy_model | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_service.copy_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/model_service.copy_model.js,samples/README.md) |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,14 @@ message Model {
string metadata_artifact = 44 [(google.api.field_behavior) = OUTPUT_ONLY];
}

// Contains information about the Large Model.
message LargeModelReference {
// Required. The unique name of the large Foundation or pre-built model. Like
// "chat-panda", "text-panda". Or model name with version ID, like
// "chat-panda-001", "text-panda-005", etc.
string name = 1 [(google.api.field_behavior) = REQUIRED];
}

// Contains the schemata used in Model's predictions and explanations via
// [PredictionService.Predict][google.cloud.aiplatform.v1beta1.PredictionService.Predict],
// [PredictionService.Explain][google.cloud.aiplatform.v1beta1.PredictionService.Explain]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
// Copyright 2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

syntax = "proto3";

package google.cloud.aiplatform.v1beta1;

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/v1beta1/publisher_model.proto";

option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1";
option go_package = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb";
option java_multiple_files = true;
option java_outer_classname = "ModelGardenServiceProto";
option java_package = "com.google.cloud.aiplatform.v1beta1";
option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1";
option ruby_package = "Google::Cloud::AIPlatform::V1beta1";

// The interface of Model Garden Service.
service ModelGardenService {
option (google.api.default_host) = "aiplatform.googleapis.com";
option (google.api.oauth_scopes) =
"https://www.googleapis.com/auth/cloud-platform";

// Gets a Model Garden publisher model.
rpc GetPublisherModel(GetPublisherModelRequest) returns (PublisherModel) {
option (google.api.http) = {
get: "/v1beta1/{name=publishers/*/models/*}"
};
option (google.api.method_signature) = "name";
}
}

// View enumeration of PublisherModel.
enum PublisherModelView {
// The default / unset value. The API will default to the BASIC view.
PUBLISHER_MODEL_VIEW_UNSPECIFIED = 0;

// Include basic metadata about the publisher model, but not the full
// contents.
PUBLISHER_MODEL_VIEW_BASIC = 1;

// Include everything.
PUBLISHER_MODEL_VIEW_FULL = 2;

// Include: VersionId, ModelVersionExternalName, and SupportedActions.
PUBLISHER_MODEL_VERSION_VIEW_BASIC = 3;
}

// Request message for
// [ModelGardenService.GetPublisherModel][google.cloud.aiplatform.v1beta1.ModelGardenService.GetPublisherModel]
message GetPublisherModelRequest {
// Required. The name of the PublisherModel resource.
// Format:
// `publishers/{publisher}/models/{publisher_model}`
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "aiplatform.googleapis.com/PublisherModel"
}
];

// Optional. The IETF BCP-47 language code representing the language in which
// the publisher model's text information should be written in (see go/bcp47).
string language_code = 2 [(google.api.field_behavior) = OPTIONAL];

// Optional. PublisherModel view specifying which fields to read.
PublisherModelView view = 3 [(google.api.field_behavior) = OPTIONAL];
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,214 @@
// Copyright 2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

syntax = "proto3";

package google.cloud.aiplatform.v1beta1;

import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/cloud/aiplatform/v1beta1/machine_resources.proto";
import "google/cloud/aiplatform/v1beta1/model.proto";

option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1";
option go_package = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb";
option java_multiple_files = true;
option java_outer_classname = "PublisherModelProto";
option java_package = "com.google.cloud.aiplatform.v1beta1";
option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1";
option ruby_package = "Google::Cloud::AIPlatform::V1beta1";

// A Model Garden Publisher Model.
message PublisherModel {
option (google.api.resource) = {
type: "aiplatform.googleapis.com/PublisherModel"
pattern: "publishers/{publisher}/models/{model}"
};

// Reference to a resource.
message ResourceReference {
oneof reference {
// The URI of the resource.
string uri = 1;

// The resource name of the GCP resource.
string resource_name = 2;
}
}

// A named piece of documentation.
message Documentation {
// Required. E.g., OVERVIEW, USE CASES, DOCUMENTATION, SDK & SAMPLES, JAVA,
// NODE.JS, etc..
string title = 1 [(google.api.field_behavior) = REQUIRED];

// Required. Content of this piece of document (in Markdown format).
string content = 2 [(google.api.field_behavior) = REQUIRED];
}

// Actions could take on this Publisher Model.
message CallToAction {
// The regional resource name or the URI. Key is region, e.g.,
// us-central1, europe-west2, global, etc..
message RegionalResourceReferences {
// Required.
map<string, ResourceReference> references = 1
[(google.api.field_behavior) = REQUIRED];

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

// Rest API docs.
message ViewRestApi {
// Required.
repeated Documentation documentations = 1
[(google.api.field_behavior) = REQUIRED];

// Required. The title of the view rest API.
string title = 2 [(google.api.field_behavior) = REQUIRED];
}

// Model metadata that is needed for UploadModel or
// DeployModel/CreateEndpoint requests.
message Deploy {
// The prediction (for example, the machine) resources that the
// DeployedModel uses.
oneof prediction_resources {
// A description of resources that are dedicated to the DeployedModel,
// and that need a higher degree of manual configuration.
DedicatedResources dedicated_resources = 5;

// A description of resources that to large degree are decided by Vertex
// AI, and require only a modest additional configuration.
AutomaticResources automatic_resources = 6;

// The resource name of the shared DeploymentResourcePool to deploy on.
// Format:
// `projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}`
string shared_resources = 7;
}

// Optional. Default model display name.
string model_display_name = 1 [(google.api.field_behavior) = OPTIONAL];

// Optional. Large model reference. When this is set, model_artifact_spec
// is not needed.
LargeModelReference large_model_reference = 2
[(google.api.field_behavior) = OPTIONAL];

// Optional. The specification of the container that is to be used when
// deploying this Model in Vertex AI. Not present for Large Models.
ModelContainerSpec container_spec = 3
[(google.api.field_behavior) = OPTIONAL];

// Optional. The path to the directory containing the Model artifact and
// any of its supporting files.
string artifact_uri = 4 [(google.api.field_behavior) = OPTIONAL];

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

// Optional. To view Rest API docs.
ViewRestApi view_rest_api = 1 [(google.api.field_behavior) = OPTIONAL];

// Optional. Open notebook of the PublisherModel.
RegionalResourceReferences open_notebook = 2
[(google.api.field_behavior) = OPTIONAL];

// Optional. Create application using the PublisherModel.
RegionalResourceReferences create_application = 3
[(google.api.field_behavior) = OPTIONAL];

// Optional. Open fine-tuning pipeline of the PublisherModel.
RegionalResourceReferences open_fine_tuning_pipeline = 4
[(google.api.field_behavior) = OPTIONAL];

// Optional. Open prompt-tuning pipeline of the PublisherModel.
RegionalResourceReferences open_prompt_tuning_pipeline = 5
[(google.api.field_behavior) = OPTIONAL];

// Optional. Open Genie / Playground.
RegionalResourceReferences open_genie = 6
[(google.api.field_behavior) = OPTIONAL];

// Optional. Deploy the PublisherModel to Vertex Endpoint.
Deploy deploy = 7 [(google.api.field_behavior) = OPTIONAL];

// Optional. Open in Generation AI Studio.
RegionalResourceReferences open_generation_ai_studio = 8
[(google.api.field_behavior) = OPTIONAL];
}

// An enum representing the open source category of a PublisherModel.
enum OpenSourceCategory {
// The open source category is unspecified, which should not be used.
OPEN_SOURCE_CATEGORY_UNSPECIFIED = 0;

// Used to indicate the PublisherModel is not open sourced.
PROPRIETARY = 1;

// Used to indicate the PublisherModel is a Google-owned open source model
// w/ Google checkpoint.
GOOGLE_OWNED_OSS_WITH_GOOGLE_CHECKPOINT = 2;

// Used to indicate the PublisherModel is a 3p-owned open source model w/
// Google checkpoint.
THIRD_PARTY_OWNED_OSS_WITH_GOOGLE_CHECKPOINT = 3;

// Used to indicate the PublisherModel is a Google-owned pure open source
// model.
GOOGLE_OWNED_OSS = 4;

// Used to indicate the PublisherModel is a 3p-owned pure open source model.
THIRD_PARTY_OWNED_OSS = 5;
}

// Output only. The resource name of the PublisherModel.
string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];

// Output only. Immutable. The version ID of the PublisherModel.
// A new version is committed when a new model version is uploaded under an
// existing model id. It is an auto-incrementing decimal number in string
// representation.
string version_id = 2 [
(google.api.field_behavior) = IMMUTABLE,
(google.api.field_behavior) = OUTPUT_ONLY
];

// Required. Indicates the open source category of the publisher model.
OpenSourceCategory open_source_category = 7
[(google.api.field_behavior) = REQUIRED];

// Optional. Supported call-to-action options.
CallToAction supported_actions = 19 [(google.api.field_behavior) = OPTIONAL];

// Optional. Additional information about the model's Frameworks.
repeated string frameworks = 23 [(google.api.field_behavior) = OPTIONAL];

// Optional. Output only. Immutable. Used to indicate this model has a
// publisher model and provide the template of the publisher model resource
// name.
string publisher_model_template = 30 [
(google.api.field_behavior) = IMMUTABLE,
(google.api.field_behavior) = OUTPUT_ONLY
];

// Optional. The schemata that describes formats of the PublisherModel's
// predictions and explanations as given and returned via
// [PredictionService.Predict][google.cloud.aiplatform.v1beta1.PredictionService.Predict].
PredictSchemata predict_schemata = 31
[(google.api.field_behavior) = OPTIONAL];
}
Loading