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: [aiplatform] add grpc_ports to UploadModel ModelContainerSpec #10065

Merged
merged 4 commits into from
Nov 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading