Skip to content

Commit

Permalink
feat: [aiplatform] add grpc_ports to UploadModel ModelContainerSpec (#…
Browse files Browse the repository at this point in the history
…10065)

* feat: add grpc_ports to UploadModel ModelContainerSpec
feat: add DirectPredict to PredictionService
feat: add DirectRawPredict to PredictionService
feat: add StreamingPredict to PredictionService.
feat: add StreamingRawPredict to PredictionService.

PiperOrigin-RevId: 583502805

Source-Link: googleapis/googleapis@31c70c9

Source-Link: https://github.com/googleapis/googleapis-gen/commit/a041c3d8068cb99a1dcf83124d0cd63eba91a4c7
Copy-Tag: eyJwIjoiamF2YS1haXBsYXRmb3JtLy5Pd2xCb3QueWFtbCIsImgiOiJhMDQxYzNkODA2OGNiOTlhMWRjZjgzMTI0ZDBjZDYzZWJhOTFhNGM3In0=

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] authored Nov 27, 2023
1 parent 7a49d63 commit de32d7a
Show file tree
Hide file tree
Showing 34 changed files with 9,152 additions and 122 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import com.google.api.gax.paging.AbstractFixedSizeCollection;
import com.google.api.gax.paging.AbstractPage;
import com.google.api.gax.paging.AbstractPagedListResponse;
import com.google.api.gax.rpc.BidiStreamingCallable;
import com.google.api.gax.rpc.PageContext;
import com.google.api.gax.rpc.ServerStreamingCallable;
import com.google.api.gax.rpc.UnaryCallable;
Expand Down Expand Up @@ -536,6 +537,175 @@ public final UnaryCallable<RawPredictRequest, HttpBody> rawPredictCallable() {
return stub.rawPredictCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Perform an unary online prediction request for Vertex first-party products and frameworks.
*
* <p>Sample code:
*
* <pre>{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
* DirectPredictRequest request =
* DirectPredictRequest.newBuilder()
* .setEndpoint(
* EndpointName.ofProjectLocationEndpointName(
* "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
* .toString())
* .addAllInputs(new ArrayList<Tensor>())
* .setParameters(Tensor.newBuilder().build())
* .build();
* DirectPredictResponse response = predictionServiceClient.directPredict(request);
* }
* }</pre>
*
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final DirectPredictResponse directPredict(DirectPredictRequest request) {
return directPredictCallable().call(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Perform an unary online prediction request for Vertex first-party products and frameworks.
*
* <p>Sample code:
*
* <pre>{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
* DirectPredictRequest request =
* DirectPredictRequest.newBuilder()
* .setEndpoint(
* EndpointName.ofProjectLocationEndpointName(
* "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
* .toString())
* .addAllInputs(new ArrayList<Tensor>())
* .setParameters(Tensor.newBuilder().build())
* .build();
* ApiFuture<DirectPredictResponse> future =
* predictionServiceClient.directPredictCallable().futureCall(request);
* // Do something.
* DirectPredictResponse response = future.get();
* }
* }</pre>
*/
public final UnaryCallable<DirectPredictRequest, DirectPredictResponse> directPredictCallable() {
return stub.directPredictCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Perform an online prediction request through gRPC.
*
* <p>Sample code:
*
* <pre>{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
* DirectRawPredictRequest request =
* DirectRawPredictRequest.newBuilder()
* .setEndpoint(
* EndpointName.ofProjectLocationEndpointName(
* "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
* .toString())
* .setMethodName("methodName-723163380")
* .setInput(ByteString.EMPTY)
* .build();
* DirectRawPredictResponse response = predictionServiceClient.directRawPredict(request);
* }
* }</pre>
*
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final DirectRawPredictResponse directRawPredict(DirectRawPredictRequest request) {
return directRawPredictCallable().call(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Perform an online prediction request through gRPC.
*
* <p>Sample code:
*
* <pre>{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
* DirectRawPredictRequest request =
* DirectRawPredictRequest.newBuilder()
* .setEndpoint(
* EndpointName.ofProjectLocationEndpointName(
* "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
* .toString())
* .setMethodName("methodName-723163380")
* .setInput(ByteString.EMPTY)
* .build();
* ApiFuture<DirectRawPredictResponse> future =
* predictionServiceClient.directRawPredictCallable().futureCall(request);
* // Do something.
* DirectRawPredictResponse response = future.get();
* }
* }</pre>
*/
public final UnaryCallable<DirectRawPredictRequest, DirectRawPredictResponse>
directRawPredictCallable() {
return stub.directRawPredictCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Perform a streaming online prediction request for Vertex first-party products and frameworks.
*
* <p>Sample code:
*
* <pre>{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
* BidiStream<StreamingPredictRequest, StreamingPredictResponse> bidiStream =
* predictionServiceClient.streamingPredictCallable().call();
* StreamingPredictRequest request =
* StreamingPredictRequest.newBuilder()
* .setEndpoint(
* EndpointName.ofProjectLocationEndpointName(
* "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
* .toString())
* .addAllInputs(new ArrayList<Tensor>())
* .setParameters(Tensor.newBuilder().build())
* .build();
* bidiStream.send(request);
* for (StreamingPredictResponse response : bidiStream) {
* // Do something when a response is received.
* }
* }
* }</pre>
*/
public final BidiStreamingCallable<StreamingPredictRequest, StreamingPredictResponse>
streamingPredictCallable() {
return stub.streamingPredictCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Perform a server-side streaming online prediction request for Vertex LLM streaming.
Expand Down Expand Up @@ -571,6 +741,42 @@ public final UnaryCallable<RawPredictRequest, HttpBody> rawPredictCallable() {
return stub.serverStreamingPredictCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Perform a streaming online prediction request through gRPC.
*
* <p>Sample code:
*
* <pre>{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
* BidiStream<StreamingRawPredictRequest, StreamingRawPredictResponse> bidiStream =
* predictionServiceClient.streamingRawPredictCallable().call();
* StreamingRawPredictRequest request =
* StreamingRawPredictRequest.newBuilder()
* .setEndpoint(
* EndpointName.ofProjectLocationEndpointName(
* "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
* .toString())
* .setMethodName("methodName-723163380")
* .setInput(ByteString.EMPTY)
* .build();
* bidiStream.send(request);
* for (StreamingRawPredictResponse response : bidiStream) {
* // Do something when a response is received.
* }
* }
* }</pre>
*/
public final BidiStreamingCallable<StreamingRawPredictRequest, StreamingRawPredictResponse>
streamingRawPredictCallable() {
return stub.streamingRawPredictCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Perform an online explanation.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import com.google.api.gax.rpc.ClientSettings;
import com.google.api.gax.rpc.PagedCallSettings;
import com.google.api.gax.rpc.ServerStreamingCallSettings;
import com.google.api.gax.rpc.StreamingCallSettings;
import com.google.api.gax.rpc.TransportChannelProvider;
import com.google.api.gax.rpc.UnaryCallSettings;
import com.google.cloud.aiplatform.v1.stub.PredictionServiceStubSettings;
Expand Down Expand Up @@ -95,12 +96,35 @@ public UnaryCallSettings<RawPredictRequest, HttpBody> rawPredictSettings() {
return ((PredictionServiceStubSettings) getStubSettings()).rawPredictSettings();
}

/** Returns the object with the settings used for calls to directPredict. */
public UnaryCallSettings<DirectPredictRequest, DirectPredictResponse> directPredictSettings() {
return ((PredictionServiceStubSettings) getStubSettings()).directPredictSettings();
}

/** Returns the object with the settings used for calls to directRawPredict. */
public UnaryCallSettings<DirectRawPredictRequest, DirectRawPredictResponse>
directRawPredictSettings() {
return ((PredictionServiceStubSettings) getStubSettings()).directRawPredictSettings();
}

/** Returns the object with the settings used for calls to streamingPredict. */
public StreamingCallSettings<StreamingPredictRequest, StreamingPredictResponse>
streamingPredictSettings() {
return ((PredictionServiceStubSettings) getStubSettings()).streamingPredictSettings();
}

/** Returns the object with the settings used for calls to serverStreamingPredict. */
public ServerStreamingCallSettings<StreamingPredictRequest, StreamingPredictResponse>
serverStreamingPredictSettings() {
return ((PredictionServiceStubSettings) getStubSettings()).serverStreamingPredictSettings();
}

/** Returns the object with the settings used for calls to streamingRawPredict. */
public StreamingCallSettings<StreamingRawPredictRequest, StreamingRawPredictResponse>
streamingRawPredictSettings() {
return ((PredictionServiceStubSettings) getStubSettings()).streamingRawPredictSettings();
}

/** Returns the object with the settings used for calls to explain. */
public UnaryCallSettings<ExplainRequest, ExplainResponse> explainSettings() {
return ((PredictionServiceStubSettings) getStubSettings()).explainSettings();
Expand Down Expand Up @@ -240,12 +264,36 @@ public UnaryCallSettings.Builder<RawPredictRequest, HttpBody> rawPredictSettings
return getStubSettingsBuilder().rawPredictSettings();
}

/** Returns the builder for the settings used for calls to directPredict. */
public UnaryCallSettings.Builder<DirectPredictRequest, DirectPredictResponse>
directPredictSettings() {
return getStubSettingsBuilder().directPredictSettings();
}

/** Returns the builder for the settings used for calls to directRawPredict. */
public UnaryCallSettings.Builder<DirectRawPredictRequest, DirectRawPredictResponse>
directRawPredictSettings() {
return getStubSettingsBuilder().directRawPredictSettings();
}

/** Returns the builder for the settings used for calls to streamingPredict. */
public StreamingCallSettings.Builder<StreamingPredictRequest, StreamingPredictResponse>
streamingPredictSettings() {
return getStubSettingsBuilder().streamingPredictSettings();
}

/** Returns the builder for the settings used for calls to serverStreamingPredict. */
public ServerStreamingCallSettings.Builder<StreamingPredictRequest, StreamingPredictResponse>
serverStreamingPredictSettings() {
return getStubSettingsBuilder().serverStreamingPredictSettings();
}

/** Returns the builder for the settings used for calls to streamingRawPredict. */
public StreamingCallSettings.Builder<StreamingRawPredictRequest, StreamingRawPredictResponse>
streamingRawPredictSettings() {
return getStubSettingsBuilder().streamingRawPredictSettings();
}

/** Returns the builder for the settings used for calls to explain. */
public UnaryCallSettings.Builder<ExplainRequest, ExplainResponse> explainSettings() {
return getStubSettingsBuilder().explainSettings();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -991,6 +991,12 @@
"grpc": {
"libraryClient": "PredictionServiceClient",
"rpcs": {
"DirectPredict": {
"methods": ["directPredict", "directPredictCallable"]
},
"DirectRawPredict": {
"methods": ["directRawPredict", "directRawPredictCallable"]
},
"Explain": {
"methods": ["explain", "explain", "explain", "explainCallable"]
},
Expand All @@ -1015,6 +1021,12 @@
"SetIamPolicy": {
"methods": ["setIamPolicy", "setIamPolicyCallable"]
},
"StreamingPredict": {
"methods": ["streamingPredictCallable"]
},
"StreamingRawPredict": {
"methods": ["streamingRawPredictCallable"]
},
"TestIamPermissions": {
"methods": ["testIamPermissions", "testIamPermissionsCallable"]
}
Expand Down
Loading

0 comments on commit de32d7a

Please sign in to comment.