Skip to content

Commit

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

* 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: 586417186

Source-Link: googleapis/googleapis@362f61e

Source-Link: googleapis/googleapis-gen@a81e534
Copy-Tag: eyJwIjoiamF2YS1haXBsYXRmb3JtLy5Pd2xCb3QueWFtbCIsImgiOiJhODFlNTM0M2NlNmNhOWVlNGE1NDU1NDlkYzMyZWRjMjM1MDUzMGFhIn0=

* 🦉 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 30, 2023
1 parent e4f430e commit eeb5108
Show file tree
Hide file tree
Showing 34 changed files with 9,215 additions and 147 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,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 @@ -544,6 +545,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 @@ -579,6 +749,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.v1beta1.stub.PredictionServiceStubSettings;
Expand Down Expand Up @@ -96,12 +97,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 @@ -246,12 +270,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 @@ -1078,6 +1078,12 @@
"CountTokens": {
"methods": ["countTokens", "countTokens", "countTokens", "countTokensCallable"]
},
"DirectPredict": {
"methods": ["directPredict", "directPredictCallable"]
},
"DirectRawPredict": {
"methods": ["directRawPredict", "directRawPredictCallable"]
},
"Explain": {
"methods": ["explain", "explain", "explain", "explainCallable"]
},
Expand All @@ -1102,6 +1108,12 @@
"SetIamPolicy": {
"methods": ["setIamPolicy", "setIamPolicyCallable"]
},
"StreamingPredict": {
"methods": ["streamingPredictCallable"]
},
"StreamingRawPredict": {
"methods": ["streamingRawPredictCallable"]
},
"TestIamPermissions": {
"methods": ["testIamPermissions", "testIamPermissionsCallable"]
}
Expand Down
Loading

0 comments on commit eeb5108

Please sign in to comment.