Skip to content

Commit

Permalink
feat: update Nodejs generator to send API versions in headers for GAP…
Browse files Browse the repository at this point in the history
…ICs (#5343)

* feat: Added the v1beta1 version of the GenAI Tuning Service

PiperOrigin-RevId: 632610890

Source-Link: googleapis/googleapis@e5eef0f

Source-Link: googleapis/googleapis-gen@39bd6f8
Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWFpcGxhdGZvcm0vLk93bEJvdC55YW1sIiwiaCI6IjM5YmQ2ZjhkYmMzZmQ2NDk4MmI1NTlhNDM5MjZlNjcxMGNjN2IzMjgifQ==

* feat: update Nodejs generator to send API versions in headers for GAPICs

PiperOrigin-RevId: 634109303

Source-Link: googleapis/googleapis@998ade8

Source-Link: googleapis/googleapis-gen@000ca6f
Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWFpcGxhdGZvcm0vLk93bEJvdC55YW1sIiwiaCI6IjAwMGNhNmYwMDgwMWY2NWI4NDdlNjAyOWNiMDUxMTE0MDRkZjIxZWMifQ==

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: sofisl <[email protected]>
Co-authored-by: Sofia Leon <[email protected]>
  • Loading branch information
4 people authored May 20, 2024
1 parent 8eb07ac commit d129760
Show file tree
Hide file tree
Showing 123 changed files with 23,077 additions and 18 deletions.
4 changes: 4 additions & 0 deletions packages/google-cloud-aiplatform/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,10 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/
| Featurestore_service.update_entity_type | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_service.update_entity_type.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/featurestore_service.update_entity_type.js,packages/google-cloud-aiplatform/samples/README.md) |
| Featurestore_service.update_feature | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_service.update_feature.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/featurestore_service.update_feature.js,packages/google-cloud-aiplatform/samples/README.md) |
| Featurestore_service.update_featurestore | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_service.update_featurestore.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/featurestore_service.update_featurestore.js,packages/google-cloud-aiplatform/samples/README.md) |
| Gen_ai_tuning_service.cancel_tuning_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/gen_ai_tuning_service.cancel_tuning_job.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/gen_ai_tuning_service.cancel_tuning_job.js,packages/google-cloud-aiplatform/samples/README.md) |
| Gen_ai_tuning_service.create_tuning_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/gen_ai_tuning_service.create_tuning_job.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/gen_ai_tuning_service.create_tuning_job.js,packages/google-cloud-aiplatform/samples/README.md) |
| Gen_ai_tuning_service.get_tuning_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/gen_ai_tuning_service.get_tuning_job.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/gen_ai_tuning_service.get_tuning_job.js,packages/google-cloud-aiplatform/samples/README.md) |
| Gen_ai_tuning_service.list_tuning_jobs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/gen_ai_tuning_service.list_tuning_jobs.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/gen_ai_tuning_service.list_tuning_jobs.js,packages/google-cloud-aiplatform/samples/README.md) |
| Index_endpoint_service.create_index_endpoint | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/index_endpoint_service.create_index_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/index_endpoint_service.create_index_endpoint.js,packages/google-cloud-aiplatform/samples/README.md) |
| Index_endpoint_service.delete_index_endpoint | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/index_endpoint_service.delete_index_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/index_endpoint_service.delete_index_endpoint.js,packages/google-cloud-aiplatform/samples/README.md) |
| Index_endpoint_service.deploy_index | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/index_endpoint_service.deploy_index.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/index_endpoint_service.deploy_index.js,packages/google-cloud-aiplatform/samples/README.md) |
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
// Copyright 2024 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/tuning_job.proto";
import "google/protobuf/empty.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 = "GenAiTuningServiceProto";
option java_package = "com.google.cloud.aiplatform.v1beta1";
option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1";
option ruby_package = "Google::Cloud::AIPlatform::V1beta1";

// A service for creating and managing GenAI Tuning Jobs.
service GenAiTuningService {
option (google.api.default_host) = "aiplatform.googleapis.com";
option (google.api.oauth_scopes) =
"https://www.googleapis.com/auth/cloud-platform";

// Creates a TuningJob. A created TuningJob right away will be attempted to
// be run.
rpc CreateTuningJob(CreateTuningJobRequest) returns (TuningJob) {
option (google.api.http) = {
post: "/v1beta1/{parent=projects/*/locations/*}/tuningJobs"
body: "tuning_job"
};
option (google.api.method_signature) = "parent,tuning_job";
}

// Gets a TuningJob.
rpc GetTuningJob(GetTuningJobRequest) returns (TuningJob) {
option (google.api.http) = {
get: "/v1beta1/{name=projects/*/locations/*/tuningJobs/*}"
};
option (google.api.method_signature) = "name";
}

// Lists TuningJobs in a Location.
rpc ListTuningJobs(ListTuningJobsRequest) returns (ListTuningJobsResponse) {
option (google.api.http) = {
get: "/v1beta1/{parent=projects/*/locations/*}/tuningJobs"
};
option (google.api.method_signature) = "parent";
}

// Cancels a TuningJob.
// Starts asynchronous cancellation on the TuningJob. The server makes a best
// effort to cancel the job, but success is not guaranteed. Clients can use
// [GenAiTuningService.GetTuningJob][google.cloud.aiplatform.v1beta1.GenAiTuningService.GetTuningJob]
// or other methods to check whether the cancellation succeeded or whether the
// job completed despite cancellation. On successful cancellation, the
// TuningJob is not deleted; instead it becomes a job with a
// [TuningJob.error][google.cloud.aiplatform.v1beta1.TuningJob.error] value
// with a [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding
// to `Code.CANCELLED`, and
// [TuningJob.state][google.cloud.aiplatform.v1beta1.TuningJob.state] is set
// to `CANCELLED`.
rpc CancelTuningJob(CancelTuningJobRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
post: "/v1beta1/{name=projects/*/locations/*/tuningJobs/*}:cancel"
body: "*"
};
option (google.api.method_signature) = "name";
}
}

// Request message for
// [GenAiTuningService.CreateTuningJob][google.cloud.aiplatform.v1beta1.GenAiTuningService.CreateTuningJob].
message CreateTuningJobRequest {
// Required. The resource name of the Location to create the TuningJob in.
// Format: `projects/{project}/locations/{location}`
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "locations.googleapis.com/Location"
}
];

// Required. The TuningJob to create.
TuningJob tuning_job = 2 [(google.api.field_behavior) = REQUIRED];
}

// Request message for
// [GenAiTuningService.GetTuningJob][google.cloud.aiplatform.v1beta1.GenAiTuningService.GetTuningJob].
message GetTuningJobRequest {
// Required. The name of the TuningJob resource. Format:
// `projects/{project}/locations/{location}/tuningJobs/{tuning_job}`
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "aiplatform.googleapis.com/TuningJob"
}
];
}

// Request message for
// [GenAiTuningService.ListTuningJobs][google.cloud.aiplatform.v1beta1.GenAiTuningService.ListTuningJobs].
message ListTuningJobsRequest {
// Required. The resource name of the Location to list the TuningJobs from.
// Format: `projects/{project}/locations/{location}`
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "locations.googleapis.com/Location"
}
];

// Optional. The standard list filter.
string filter = 2 [(google.api.field_behavior) = OPTIONAL];

// Optional. The standard list page size.
int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL];

// Optional. The standard list page token.
// Typically obtained via [ListTuningJob.next_page_token][] of the
// previous GenAiTuningService.ListTuningJob][] call.
string page_token = 4 [(google.api.field_behavior) = OPTIONAL];
}

// Response message for
// [GenAiTuningService.ListTuningJobs][google.cloud.aiplatform.v1beta1.GenAiTuningService.ListTuningJobs]
message ListTuningJobsResponse {
// List of TuningJobs in the requested page.
repeated TuningJob tuning_jobs = 1;

// A token to retrieve the next page of results.
// Pass to
// [ListTuningJobsRequest.page_token][google.cloud.aiplatform.v1beta1.ListTuningJobsRequest.page_token]
// to obtain that page.
string next_page_token = 2;
}

// Request message for
// [GenAiTuningService.CancelTuningJob][google.cloud.aiplatform.v1beta1.GenAiTuningService.CancelTuningJob].
message CancelTuningJobRequest {
// Required. The name of the TuningJob to cancel. Format:
// `projects/{project}/locations/{location}/tuningJobs/{tuning_job}`
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "aiplatform.googleapis.com/TuningJob"
}
];
}
Loading

0 comments on commit d129760

Please sign in to comment.