1// Copyright 2023 Google LLC 2// 3// Licensed under the Apache License, Version 2.0 (the "License"); 4// you may not use this file except in compliance with the License. 5// You may obtain a copy of the License at 6// 7// http://www.apache.org/licenses/LICENSE-2.0 8// 9// Unless required by applicable law or agreed to in writing, software 10// distributed under the License is distributed on an "AS IS" BASIS, 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12// See the License for the specific language governing permissions and 13// limitations under the License. 14 15syntax = "proto3"; 16 17package google.cloud.aiplatform.v1beta1; 18 19import "google/api/annotations.proto"; 20import "google/api/client.proto"; 21import "google/api/field_behavior.proto"; 22import "google/api/resource.proto"; 23import "google/cloud/aiplatform/v1beta1/publisher_model.proto"; 24 25option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; 26option go_package = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; 27option java_multiple_files = true; 28option java_outer_classname = "ModelGardenServiceProto"; 29option java_package = "com.google.cloud.aiplatform.v1beta1"; 30option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; 31option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; 32 33// The interface of Model Garden Service. 34service ModelGardenService { 35 option (google.api.default_host) = "aiplatform.googleapis.com"; 36 option (google.api.oauth_scopes) = 37 "https://www.googleapis.com/auth/cloud-platform"; 38 39 // Gets a Model Garden publisher model. 40 rpc GetPublisherModel(GetPublisherModelRequest) returns (PublisherModel) { 41 option (google.api.http) = { 42 get: "/v1beta1/{name=publishers/*/models/*}" 43 }; 44 option (google.api.method_signature) = "name"; 45 } 46 47 // Lists publisher models in Model Garden. 48 rpc ListPublisherModels(ListPublisherModelsRequest) 49 returns (ListPublisherModelsResponse) { 50 option (google.api.http) = { 51 get: "/v1beta1/{parent=publishers/*}/models" 52 }; 53 option (google.api.method_signature) = "parent"; 54 } 55} 56 57// View enumeration of PublisherModel. 58enum PublisherModelView { 59 // The default / unset value. The API will default to the BASIC view. 60 PUBLISHER_MODEL_VIEW_UNSPECIFIED = 0; 61 62 // Include basic metadata about the publisher model, but not the full 63 // contents. 64 PUBLISHER_MODEL_VIEW_BASIC = 1; 65 66 // Include everything. 67 PUBLISHER_MODEL_VIEW_FULL = 2; 68 69 // Include: VersionId, ModelVersionExternalName, and SupportedActions. 70 PUBLISHER_MODEL_VERSION_VIEW_BASIC = 3; 71} 72 73// Request message for 74// [ModelGardenService.GetPublisherModel][google.cloud.aiplatform.v1beta1.ModelGardenService.GetPublisherModel] 75message GetPublisherModelRequest { 76 // Required. The name of the PublisherModel resource. 77 // Format: 78 // `publishers/{publisher}/models/{publisher_model}` 79 string name = 1 [ 80 (google.api.field_behavior) = REQUIRED, 81 (google.api.resource_reference) = { 82 type: "aiplatform.googleapis.com/PublisherModel" 83 } 84 ]; 85 86 // Optional. The IETF BCP-47 language code representing the language in which 87 // the publisher model's text information should be written in (see go/bcp47). 88 string language_code = 2 [(google.api.field_behavior) = OPTIONAL]; 89 90 // Optional. PublisherModel view specifying which fields to read. 91 PublisherModelView view = 3 [(google.api.field_behavior) = OPTIONAL]; 92} 93 94// Request message for 95// [ModelGardenService.ListPublisherModels][google.cloud.aiplatform.v1beta1.ModelGardenService.ListPublisherModels]. 96message ListPublisherModelsRequest { 97 // Required. The name of the Publisher from which to list the PublisherModels. 98 // Format: `publishers/{publisher}` 99 string parent = 1 [(google.api.field_behavior) = REQUIRED]; 100 101 // Optional. The standard list filter. 102 string filter = 2 [(google.api.field_behavior) = OPTIONAL]; 103 104 // Optional. The standard list page size. 105 int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; 106 107 // Optional. The standard list page token. 108 // Typically obtained via 109 // [ListPublisherModelsResponse.next_page_token][google.cloud.aiplatform.v1beta1.ListPublisherModelsResponse.next_page_token] 110 // of the previous 111 // [ModelGardenService.ListPublisherModels][google.cloud.aiplatform.v1beta1.ModelGardenService.ListPublisherModels] 112 // call. 113 string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; 114 115 // Optional. PublisherModel view specifying which fields to read. 116 PublisherModelView view = 5 [(google.api.field_behavior) = OPTIONAL]; 117 118 // Optional. A comma-separated list of fields to order by, sorted in ascending 119 // order. Use "desc" after a field name for descending. 120 string order_by = 6 [(google.api.field_behavior) = OPTIONAL]; 121 122 // Optional. The IETF BCP-47 language code representing the language in which 123 // the publisher models' text information should be written in (see go/bcp47). 124 // If not set, by default English (en). 125 string language_code = 7 [(google.api.field_behavior) = OPTIONAL]; 126} 127 128// Response message for 129// [ModelGardenService.ListPublisherModels][google.cloud.aiplatform.v1beta1.ModelGardenService.ListPublisherModels]. 130message ListPublisherModelsResponse { 131 // List of PublisherModels in the requested page. 132 repeated PublisherModel publisher_models = 1; 133 134 // A token to retrieve next page of results. 135 // Pass to [ListPublisherModels.page_token][] to obtain that page. 136 string next_page_token = 2; 137} 138