Starting April 29, 2025, Gemini 1.5 Pro and Gemini 1.5 Flash models are not available in projects that have no prior usage of these models, including new projects. For details, see Model versions and lifecycle.
Perform an online explanation.
If
deployed_model_id
is specified, the corresponding DeployModel must have
explanation_spec
populated. If
deployed_model_id
is not specified, all DeployedModels must have
explanation_spec
populated.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-03 UTC."],[],[],null,["# Class PredictionServiceGrpc.PredictionServiceFutureStub (1.32.0)\n\n public static final class PredictionServiceGrpc.PredictionServiceFutureStub extends AbstractFutureStub\u003cPredictionServiceGrpc.PredictionServiceFutureStub\u003e\n\nA stub to allow clients to do ListenableFuture-style rpc calls to service PredictionService.\n\nA service for online predictions and explanations. \n\nInheritance\n-----------\n\n[java.lang.Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \\\u003e io.grpc.stub.AbstractStub \\\u003e io.grpc.stub.AbstractFutureStub \\\u003e PredictionServiceGrpc.PredictionServiceFutureStub \n\nInherited Members\n-----------------\n\nio.grpc.stub.AbstractFutureStub.\\\u003cT\\\u003enewStub(io.grpc.stub.AbstractStub.StubFactory\\\u003cT\\\u003e,io.grpc.Channel) \nio.grpc.stub.AbstractFutureStub.\\\u003cT\\\u003enewStub(io.grpc.stub.AbstractStub.StubFactory\\\u003cT\\\u003e,io.grpc.Channel,io.grpc.CallOptions) \nio.grpc.stub.AbstractStub.\\\u003cT\\\u003ewithOption(io.grpc.CallOptions.Key\\\u003cT\\\u003e,T) \nio.grpc.stub.AbstractStub.build(io.grpc.Channel,io.grpc.CallOptions) \nio.grpc.stub.AbstractStub.getCallOptions() \nio.grpc.stub.AbstractStub.getChannel() \nio.grpc.stub.AbstractStub.withCallCredentials(io.grpc.CallCredentials) \nio.grpc.stub.AbstractStub.withChannel(io.grpc.Channel) \nio.grpc.stub.AbstractStub.withCompression(java.lang.String) \nio.grpc.stub.AbstractStub.withDeadline(io.grpc.Deadline) \nio.grpc.stub.AbstractStub.withDeadlineAfter(java.time.Duration) \nio.grpc.stub.AbstractStub.withDeadlineAfter(long,java.util.concurrent.TimeUnit) \nio.grpc.stub.AbstractStub.withExecutor(java.util.concurrent.Executor) \nio.grpc.stub.AbstractStub.withInterceptors(io.grpc.ClientInterceptor...) \nio.grpc.stub.AbstractStub.withMaxInboundMessageSize(int) \nio.grpc.stub.AbstractStub.withMaxOutboundMessageSize(int) \nio.grpc.stub.AbstractStub.withOnReadyThreshold(int) \nio.grpc.stub.AbstractStub.withWaitForReady() \n[Object.clone()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone--) \n[Object.equals(Object)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-) \n[Object.finalize()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--) \n[Object.getClass()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--) \n[Object.hashCode()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--) \n[Object.notify()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--) \n[Object.notifyAll()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--) \n[Object.toString()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--) \n[Object.wait()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--) \n[Object.wait(long)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-) \n[Object.wait(long,int)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-)\n\nMethods\n-------\n\n### build(Channel channel, CallOptions callOptions)\n\n protected PredictionServiceGrpc.PredictionServiceFutureStub build(Channel channel, CallOptions callOptions)\n\n**Overrides** \nio.grpc.stub.AbstractStub.build(io.grpc.Channel,io.grpc.CallOptions)\n\n### directPredict(DirectPredictRequest request)\n\n public ListenableFuture\u003cDirectPredictResponse\u003e directPredict(DirectPredictRequest request)\n\nPerform an unary online prediction request to a gRPC model server for\nVertex first-party products and frameworks.\n\n### directRawPredict(DirectRawPredictRequest request)\n\n public ListenableFuture\u003cDirectRawPredictResponse\u003e directRawPredict(DirectRawPredictRequest request)\n\nPerform an unary online prediction request to a gRPC model server for\ncustom containers.\n\n### explain(ExplainRequest request)\n\n public ListenableFuture\u003cExplainResponse\u003e explain(ExplainRequest request)\n\nPerform an online explanation.\nIf\ndeployed_model_id\nis specified, the corresponding DeployModel must have\nexplanation_spec\npopulated. If\ndeployed_model_id\nis not specified, all DeployedModels must have\nexplanation_spec\npopulated.\n\n### generateContent(GenerateContentRequest request)\n\n public ListenableFuture\u003cGenerateContentResponse\u003e generateContent(GenerateContentRequest request)\n\nGenerate content with multimodal inputs.\n\n### predict(PredictRequest request)\n\n public ListenableFuture\u003cPredictResponse\u003e predict(PredictRequest request)\n\nPerform an online prediction.\n\n### rawPredict(RawPredictRequest request)\n\n public ListenableFuture\u003cHttpBody\u003e rawPredict(RawPredictRequest request)\n\nPerform an online prediction with an arbitrary HTTP payload.\nThe response includes the following HTTP headers:\n\n- `X-Vertex-AI-Endpoint-Id`: ID of the Endpoint that served this prediction.\n- `X-Vertex-AI-Deployed-Model-Id`: ID of the Endpoint's DeployedModel that served this prediction."]]