Send feedback
  
   
 
  
    
      Class PredictionServiceGrpc.PredictionServiceBlockingV2Stub (3.79.0) 
  
  
  
   
  
    
  
  
    
    
    
    
    
  Version latestkeyboard_arrow_down  
  
 
    
    
    
    
      
  
  
  
    
public   static   final   class  PredictionServiceGrpc . PredictionServiceBlockingV2Stub   extends   AbstractBlockingStub<PredictionServiceGrpc . PredictionServiceBlockingV2Stub > 
  A stub to allow clients to do synchronous rpc calls to service PredictionService.
 A service for online predictions and explanations.
    Inheritance 
    java.lang.Object  >  
    io.grpc.stub.AbstractStub  >  
    io.grpc.stub.AbstractBlockingStub  >  
    PredictionServiceGrpc.PredictionServiceBlockingV2Stub 
   
  
    Inherited Members 
    
      io.grpc.stub.AbstractBlockingStub.<T>newStub(io.grpc.stub.AbstractStub.StubFactory<T>,io.grpc.Channel) 
    
    
      io.grpc.stub.AbstractBlockingStub.<T>newStub(io.grpc.stub.AbstractStub.StubFactory<T>,io.grpc.Channel,io.grpc.CallOptions) 
    
    
      io.grpc.stub.AbstractStub.<T>withOption(io.grpc.CallOptions.Key<T>,T) 
    
    
      io.grpc.stub.AbstractStub.build(io.grpc.Channel,io.grpc.CallOptions) 
    
    
      io.grpc.stub.AbstractStub.getCallOptions() 
    
    
      io.grpc.stub.AbstractStub.getChannel() 
    
    
      io.grpc.stub.AbstractStub.withCallCredentials(io.grpc.CallCredentials) 
    
    
      io.grpc.stub.AbstractStub.withChannel(io.grpc.Channel) 
    
    
      io.grpc.stub.AbstractStub.withCompression(java.lang.String) 
    
    
      io.grpc.stub.AbstractStub.withDeadline(io.grpc.Deadline) 
    
    
      io.grpc.stub.AbstractStub.withDeadlineAfter(java.time.Duration) 
    
    
      io.grpc.stub.AbstractStub.withDeadlineAfter(long,java.util.concurrent.TimeUnit) 
    
    
      io.grpc.stub.AbstractStub.withExecutor(java.util.concurrent.Executor) 
    
    
      io.grpc.stub.AbstractStub.withInterceptors(io.grpc.ClientInterceptor...) 
    
    
      io.grpc.stub.AbstractStub.withMaxInboundMessageSize(int) 
    
    
      io.grpc.stub.AbstractStub.withMaxOutboundMessageSize(int) 
    
    
      io.grpc.stub.AbstractStub.withOnReadyThreshold(int) 
    
    
      io.grpc.stub.AbstractStub.withWaitForReady() 
    
    
    
    
    
    
    
    
    
    
    
    
   
  Methods
   
  
    
protected   PredictionServiceGrpc . PredictionServiceBlockingV2Stub   build ( Channel   channel ,   CallOptions   callOptions )  
  
    
      
        Parameters  
      
        Name Description  
      
        channelio.grpc.Channel  
      
        callOptionsio.grpc.CallOptions  
     
  
  
  Overrides 
  io.grpc.stub.AbstractStub.build(io.grpc.Channel,io.grpc.CallOptions) 
  
    
public   BlockingClientCall <? , HttpBody >  chatCompletions ( ChatCompletionsRequest   request )  
   Exposes an OpenAI-compatible endpoint for chat completions.
    
      
        Returns  
      
        Type Description  
      
        io.grpc.stub.BlockingClientCall <? ,com.google.api.HttpBody > 
     
  
  
    
public   CountTokensResponse   countTokens ( CountTokensRequest   request )  
   Perform a token counting.
    
public   DirectPredictResponse   directPredict ( DirectPredictRequest   request )  
   Perform an unary online prediction request to a gRPC model server for
 Vertex first-party products and frameworks.
    
public   DirectRawPredictResponse   directRawPredict ( DirectRawPredictRequest   request )  
   Perform an unary online prediction request to a gRPC model server for
 custom containers.
    
public   ExplainResponse   explain ( ExplainRequest   request )  
   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.
generateContent(GenerateContentRequest request) 
  
    
public   GenerateContentResponse   generateContent ( GenerateContentRequest   request )  
   Generate content with multimodal inputs.
    
public   PredictResponse   predict ( PredictRequest   request )  
   Perform an online prediction.
    
public   HttpBody   rawPredict ( RawPredictRequest   request )  
   Perform an online prediction with an arbitrary HTTP payload.
 The response includes the following HTTP headers:
X-Vertex-AI-Endpoint-Id: ID of the
Endpoint  that served this
prediction.X-Vertex-AI-Deployed-Model-Id: ID of the Endpoint's
DeployedModel  that served
this prediction. 
    
      
        Returns  
      
        Type Description  
      
        com.google.api.HttpBody  
     
  
  
    
public   BlockingClientCall <? , StreamingPredictResponse >  serverStreamingPredict ( StreamingPredictRequest   request )  
   Perform a server-side streaming online prediction request for Vertex
 LLM streaming.
    
public   BlockingClientCall<StreamDirectPredictRequest , StreamDirectPredictResponse >  streamDirectPredict ()  
   Perform a streaming online prediction request to a gRPC model server for
 Vertex first-party products and frameworks.
    
public   BlockingClientCall<StreamDirectRawPredictRequest , StreamDirectRawPredictResponse >  streamDirectRawPredict ()  
   Perform a streaming online prediction request to a gRPC model server for
 custom containers.
streamGenerateContent(GenerateContentRequest request) 
  
    
public   BlockingClientCall <? , GenerateContentResponse >  streamGenerateContent ( GenerateContentRequest   request )  
   Generate content with multimodal inputs with streaming support.
    
public   BlockingClientCall <? , HttpBody >  streamRawPredict ( StreamRawPredictRequest   request )  
   Perform a streaming online prediction with an arbitrary HTTP payload.
    
      
        Returns  
      
        Type Description  
      
        io.grpc.stub.BlockingClientCall <? ,com.google.api.HttpBody > 
     
  
  
    
public   BlockingClientCall<StreamingPredictRequest , StreamingPredictResponse >  streamingPredict ()  
   Perform a streaming online prediction request for Vertex first-party
 products and frameworks.
    
public   BlockingClientCall<StreamingRawPredictRequest , StreamingRawPredictResponse >  streamingRawPredict ()  
   Perform a streaming online prediction request through gRPC.
 
     
    
  
  
  
     
  
    
    
      
       
         
  
  
    
    Send feedback
  
   
 
       
    
    
  
  
 
  Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License , and code samples are licensed under the Apache 2.0 License . For details, see the Google Developers Site Policies . Java is a registered trademark of Oracle and/or its affiliates.
  Last updated 2025-10-29 UTC.
 
 
  
  
    
    
    
      
  
  
    Need to tell us more?
  
   
 
     
  
  
    
      [[["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-10-29 UTC."],[],[]]