cloud.google.com/go/aiplatform@v1.106.0/apiv1/aiplatformpb/prediction_service_grpc.pb.go (about)

     1  // Copyright 2025 Google LLC
     2  //
     3  // Licensed under the Apache License, Version 2.0 (the "License");
     4  // you may not use this file except in compliance with the License.
     5  // You may obtain a copy of the License at
     6  //
     7  //     http://www.apache.org/licenses/LICENSE-2.0
     8  //
     9  // Unless required by applicable law or agreed to in writing, software
    10  // distributed under the License is distributed on an "AS IS" BASIS,
    11  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  // See the License for the specific language governing permissions and
    13  // limitations under the License.
    14  
    15  // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
    16  // versions:
    17  // - protoc-gen-go-grpc v1.3.0
    18  // - protoc             v4.25.7
    19  // source: google/cloud/aiplatform/v1/prediction_service.proto
    20  
    21  package aiplatformpb
    22  
    23  import (
    24  	context "context"
    25  	httpbody "google.golang.org/genproto/googleapis/api/httpbody"
    26  	grpc "google.golang.org/grpc"
    27  	codes "google.golang.org/grpc/codes"
    28  	status "google.golang.org/grpc/status"
    29  )
    30  
    31  // This is a compile-time assertion to ensure that this generated file
    32  // is compatible with the grpc package it is being compiled against.
    33  // Requires gRPC-Go v1.32.0 or later.
    34  const _ = grpc.SupportPackageIsVersion7
    35  
    36  const (
    37  	PredictionService_Predict_FullMethodName                = "/google.cloud.aiplatform.v1.PredictionService/Predict"
    38  	PredictionService_RawPredict_FullMethodName             = "/google.cloud.aiplatform.v1.PredictionService/RawPredict"
    39  	PredictionService_StreamRawPredict_FullMethodName       = "/google.cloud.aiplatform.v1.PredictionService/StreamRawPredict"
    40  	PredictionService_DirectPredict_FullMethodName          = "/google.cloud.aiplatform.v1.PredictionService/DirectPredict"
    41  	PredictionService_DirectRawPredict_FullMethodName       = "/google.cloud.aiplatform.v1.PredictionService/DirectRawPredict"
    42  	PredictionService_StreamDirectPredict_FullMethodName    = "/google.cloud.aiplatform.v1.PredictionService/StreamDirectPredict"
    43  	PredictionService_StreamDirectRawPredict_FullMethodName = "/google.cloud.aiplatform.v1.PredictionService/StreamDirectRawPredict"
    44  	PredictionService_StreamingPredict_FullMethodName       = "/google.cloud.aiplatform.v1.PredictionService/StreamingPredict"
    45  	PredictionService_ServerStreamingPredict_FullMethodName = "/google.cloud.aiplatform.v1.PredictionService/ServerStreamingPredict"
    46  	PredictionService_StreamingRawPredict_FullMethodName    = "/google.cloud.aiplatform.v1.PredictionService/StreamingRawPredict"
    47  	PredictionService_Explain_FullMethodName                = "/google.cloud.aiplatform.v1.PredictionService/Explain"
    48  	PredictionService_GenerateContent_FullMethodName        = "/google.cloud.aiplatform.v1.PredictionService/GenerateContent"
    49  	PredictionService_StreamGenerateContent_FullMethodName  = "/google.cloud.aiplatform.v1.PredictionService/StreamGenerateContent"
    50  )
    51  
    52  // PredictionServiceClient is the client API for PredictionService service.
    53  //
    54  // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
    55  type PredictionServiceClient interface {
    56  	// Perform an online prediction.
    57  	Predict(ctx context.Context, in *PredictRequest, opts ...grpc.CallOption) (*PredictResponse, error)
    58  	// Perform an online prediction with an arbitrary HTTP payload.
    59  	//
    60  	// The response includes the following HTTP headers:
    61  	//
    62  	// * `X-Vertex-AI-Endpoint-Id`: ID of the
    63  	// [Endpoint][google.cloud.aiplatform.v1.Endpoint] that served this
    64  	// prediction.
    65  	//
    66  	// * `X-Vertex-AI-Deployed-Model-Id`: ID of the Endpoint's
    67  	// [DeployedModel][google.cloud.aiplatform.v1.DeployedModel] that served this
    68  	// prediction.
    69  	RawPredict(ctx context.Context, in *RawPredictRequest, opts ...grpc.CallOption) (*httpbody.HttpBody, error)
    70  	// Perform a streaming online prediction with an arbitrary HTTP payload.
    71  	StreamRawPredict(ctx context.Context, in *StreamRawPredictRequest, opts ...grpc.CallOption) (PredictionService_StreamRawPredictClient, error)
    72  	// Perform an unary online prediction request to a gRPC model server for
    73  	// Vertex first-party products and frameworks.
    74  	DirectPredict(ctx context.Context, in *DirectPredictRequest, opts ...grpc.CallOption) (*DirectPredictResponse, error)
    75  	// Perform an unary online prediction request to a gRPC model server for
    76  	// custom containers.
    77  	DirectRawPredict(ctx context.Context, in *DirectRawPredictRequest, opts ...grpc.CallOption) (*DirectRawPredictResponse, error)
    78  	// Perform a streaming online prediction request to a gRPC model server for
    79  	// Vertex first-party products and frameworks.
    80  	StreamDirectPredict(ctx context.Context, opts ...grpc.CallOption) (PredictionService_StreamDirectPredictClient, error)
    81  	// Perform a streaming online prediction request to a gRPC model server for
    82  	// custom containers.
    83  	StreamDirectRawPredict(ctx context.Context, opts ...grpc.CallOption) (PredictionService_StreamDirectRawPredictClient, error)
    84  	// Perform a streaming online prediction request for Vertex first-party
    85  	// products and frameworks.
    86  	StreamingPredict(ctx context.Context, opts ...grpc.CallOption) (PredictionService_StreamingPredictClient, error)
    87  	// Perform a server-side streaming online prediction request for Vertex
    88  	// LLM streaming.
    89  	ServerStreamingPredict(ctx context.Context, in *StreamingPredictRequest, opts ...grpc.CallOption) (PredictionService_ServerStreamingPredictClient, error)
    90  	// Perform a streaming online prediction request through gRPC.
    91  	StreamingRawPredict(ctx context.Context, opts ...grpc.CallOption) (PredictionService_StreamingRawPredictClient, error)
    92  	// Perform an online explanation.
    93  	//
    94  	// If
    95  	// [deployed_model_id][google.cloud.aiplatform.v1.ExplainRequest.deployed_model_id]
    96  	// is specified, the corresponding DeployModel must have
    97  	// [explanation_spec][google.cloud.aiplatform.v1.DeployedModel.explanation_spec]
    98  	// populated. If
    99  	// [deployed_model_id][google.cloud.aiplatform.v1.ExplainRequest.deployed_model_id]
   100  	// is not specified, all DeployedModels must have
   101  	// [explanation_spec][google.cloud.aiplatform.v1.DeployedModel.explanation_spec]
   102  	// populated.
   103  	Explain(ctx context.Context, in *ExplainRequest, opts ...grpc.CallOption) (*ExplainResponse, error)
   104  	// Generate content with multimodal inputs.
   105  	GenerateContent(ctx context.Context, in *GenerateContentRequest, opts ...grpc.CallOption) (*GenerateContentResponse, error)
   106  	// Generate content with multimodal inputs with streaming support.
   107  	StreamGenerateContent(ctx context.Context, in *GenerateContentRequest, opts ...grpc.CallOption) (PredictionService_StreamGenerateContentClient, error)
   108  }
   109  
   110  type predictionServiceClient struct {
   111  	cc grpc.ClientConnInterface
   112  }
   113  
   114  func NewPredictionServiceClient(cc grpc.ClientConnInterface) PredictionServiceClient {
   115  	return &predictionServiceClient{cc}
   116  }
   117  
   118  func (c *predictionServiceClient) Predict(ctx context.Context, in *PredictRequest, opts ...grpc.CallOption) (*PredictResponse, error) {
   119  	out := new(PredictResponse)
   120  	err := c.cc.Invoke(ctx, PredictionService_Predict_FullMethodName, in, out, opts...)
   121  	if err != nil {
   122  		return nil, err
   123  	}
   124  	return out, nil
   125  }
   126  
   127  func (c *predictionServiceClient) RawPredict(ctx context.Context, in *RawPredictRequest, opts ...grpc.CallOption) (*httpbody.HttpBody, error) {
   128  	out := new(httpbody.HttpBody)
   129  	err := c.cc.Invoke(ctx, PredictionService_RawPredict_FullMethodName, in, out, opts...)
   130  	if err != nil {
   131  		return nil, err
   132  	}
   133  	return out, nil
   134  }
   135  
   136  func (c *predictionServiceClient) StreamRawPredict(ctx context.Context, in *StreamRawPredictRequest, opts ...grpc.CallOption) (PredictionService_StreamRawPredictClient, error) {
   137  	stream, err := c.cc.NewStream(ctx, &PredictionService_ServiceDesc.Streams[0], PredictionService_StreamRawPredict_FullMethodName, opts...)
   138  	if err != nil {
   139  		return nil, err
   140  	}
   141  	x := &predictionServiceStreamRawPredictClient{stream}
   142  	if err := x.ClientStream.SendMsg(in); err != nil {
   143  		return nil, err
   144  	}
   145  	if err := x.ClientStream.CloseSend(); err != nil {
   146  		return nil, err
   147  	}
   148  	return x, nil
   149  }
   150  
   151  type PredictionService_StreamRawPredictClient interface {
   152  	Recv() (*httpbody.HttpBody, error)
   153  	grpc.ClientStream
   154  }
   155  
   156  type predictionServiceStreamRawPredictClient struct {
   157  	grpc.ClientStream
   158  }
   159  
   160  func (x *predictionServiceStreamRawPredictClient) Recv() (*httpbody.HttpBody, error) {
   161  	m := new(httpbody.HttpBody)
   162  	if err := x.ClientStream.RecvMsg(m); err != nil {
   163  		return nil, err
   164  	}
   165  	return m, nil
   166  }
   167  
   168  func (c *predictionServiceClient) DirectPredict(ctx context.Context, in *DirectPredictRequest, opts ...grpc.CallOption) (*DirectPredictResponse, error) {
   169  	out := new(DirectPredictResponse)
   170  	err := c.cc.Invoke(ctx, PredictionService_DirectPredict_FullMethodName, in, out, opts...)
   171  	if err != nil {
   172  		return nil, err
   173  	}
   174  	return out, nil
   175  }
   176  
   177  func (c *predictionServiceClient) DirectRawPredict(ctx context.Context, in *DirectRawPredictRequest, opts ...grpc.CallOption) (*DirectRawPredictResponse, error) {
   178  	out := new(DirectRawPredictResponse)
   179  	err := c.cc.Invoke(ctx, PredictionService_DirectRawPredict_FullMethodName, in, out, opts...)
   180  	if err != nil {
   181  		return nil, err
   182  	}
   183  	return out, nil
   184  }
   185  
   186  func (c *predictionServiceClient) StreamDirectPredict(ctx context.Context, opts ...grpc.CallOption) (PredictionService_StreamDirectPredictClient, error) {
   187  	stream, err := c.cc.NewStream(ctx, &PredictionService_ServiceDesc.Streams[1], PredictionService_StreamDirectPredict_FullMethodName, opts...)
   188  	if err != nil {
   189  		return nil, err
   190  	}
   191  	x := &predictionServiceStreamDirectPredictClient{stream}
   192  	return x, nil
   193  }
   194  
   195  type PredictionService_StreamDirectPredictClient interface {
   196  	Send(*StreamDirectPredictRequest) error
   197  	Recv() (*StreamDirectPredictResponse, error)
   198  	grpc.ClientStream
   199  }
   200  
   201  type predictionServiceStreamDirectPredictClient struct {
   202  	grpc.ClientStream
   203  }
   204  
   205  func (x *predictionServiceStreamDirectPredictClient) Send(m *StreamDirectPredictRequest) error {
   206  	return x.ClientStream.SendMsg(m)
   207  }
   208  
   209  func (x *predictionServiceStreamDirectPredictClient) Recv() (*StreamDirectPredictResponse, error) {
   210  	m := new(StreamDirectPredictResponse)
   211  	if err := x.ClientStream.RecvMsg(m); err != nil {
   212  		return nil, err
   213  	}
   214  	return m, nil
   215  }
   216  
   217  func (c *predictionServiceClient) StreamDirectRawPredict(ctx context.Context, opts ...grpc.CallOption) (PredictionService_StreamDirectRawPredictClient, error) {
   218  	stream, err := c.cc.NewStream(ctx, &PredictionService_ServiceDesc.Streams[2], PredictionService_StreamDirectRawPredict_FullMethodName, opts...)
   219  	if err != nil {
   220  		return nil, err
   221  	}
   222  	x := &predictionServiceStreamDirectRawPredictClient{stream}
   223  	return x, nil
   224  }
   225  
   226  type PredictionService_StreamDirectRawPredictClient interface {
   227  	Send(*StreamDirectRawPredictRequest) error
   228  	Recv() (*StreamDirectRawPredictResponse, error)
   229  	grpc.ClientStream
   230  }
   231  
   232  type predictionServiceStreamDirectRawPredictClient struct {
   233  	grpc.ClientStream
   234  }
   235  
   236  func (x *predictionServiceStreamDirectRawPredictClient) Send(m *StreamDirectRawPredictRequest) error {
   237  	return x.ClientStream.SendMsg(m)
   238  }
   239  
   240  func (x *predictionServiceStreamDirectRawPredictClient) Recv() (*StreamDirectRawPredictResponse, error) {
   241  	m := new(StreamDirectRawPredictResponse)
   242  	if err := x.ClientStream.RecvMsg(m); err != nil {
   243  		return nil, err
   244  	}
   245  	return m, nil
   246  }
   247  
   248  func (c *predictionServiceClient) StreamingPredict(ctx context.Context, opts ...grpc.CallOption) (PredictionService_StreamingPredictClient, error) {
   249  	stream, err := c.cc.NewStream(ctx, &PredictionService_ServiceDesc.Streams[3], PredictionService_StreamingPredict_FullMethodName, opts...)
   250  	if err != nil {
   251  		return nil, err
   252  	}
   253  	x := &predictionServiceStreamingPredictClient{stream}
   254  	return x, nil
   255  }
   256  
   257  type PredictionService_StreamingPredictClient interface {
   258  	Send(*StreamingPredictRequest) error
   259  	Recv() (*StreamingPredictResponse, error)
   260  	grpc.ClientStream
   261  }
   262  
   263  type predictionServiceStreamingPredictClient struct {
   264  	grpc.ClientStream
   265  }
   266  
   267  func (x *predictionServiceStreamingPredictClient) Send(m *StreamingPredictRequest) error {
   268  	return x.ClientStream.SendMsg(m)
   269  }
   270  
   271  func (x *predictionServiceStreamingPredictClient) Recv() (*StreamingPredictResponse, error) {
   272  	m := new(StreamingPredictResponse)
   273  	if err := x.ClientStream.RecvMsg(m); err != nil {
   274  		return nil, err
   275  	}
   276  	return m, nil
   277  }
   278  
   279  func (c *predictionServiceClient) ServerStreamingPredict(ctx context.Context, in *StreamingPredictRequest, opts ...grpc.CallOption) (PredictionService_ServerStreamingPredictClient, error) {
   280  	stream, err := c.cc.NewStream(ctx, &PredictionService_ServiceDesc.Streams[4], PredictionService_ServerStreamingPredict_FullMethodName, opts...)
   281  	if err != nil {
   282  		return nil, err
   283  	}
   284  	x := &predictionServiceServerStreamingPredictClient{stream}
   285  	if err := x.ClientStream.SendMsg(in); err != nil {
   286  		return nil, err
   287  	}
   288  	if err := x.ClientStream.CloseSend(); err != nil {
   289  		return nil, err
   290  	}
   291  	return x, nil
   292  }
   293  
   294  type PredictionService_ServerStreamingPredictClient interface {
   295  	Recv() (*StreamingPredictResponse, error)
   296  	grpc.ClientStream
   297  }
   298  
   299  type predictionServiceServerStreamingPredictClient struct {
   300  	grpc.ClientStream
   301  }
   302  
   303  func (x *predictionServiceServerStreamingPredictClient) Recv() (*StreamingPredictResponse, error) {
   304  	m := new(StreamingPredictResponse)
   305  	if err := x.ClientStream.RecvMsg(m); err != nil {
   306  		return nil, err
   307  	}
   308  	return m, nil
   309  }
   310  
   311  func (c *predictionServiceClient) StreamingRawPredict(ctx context.Context, opts ...grpc.CallOption) (PredictionService_StreamingRawPredictClient, error) {
   312  	stream, err := c.cc.NewStream(ctx, &PredictionService_ServiceDesc.Streams[5], PredictionService_StreamingRawPredict_FullMethodName, opts...)
   313  	if err != nil {
   314  		return nil, err
   315  	}
   316  	x := &predictionServiceStreamingRawPredictClient{stream}
   317  	return x, nil
   318  }
   319  
   320  type PredictionService_StreamingRawPredictClient interface {
   321  	Send(*StreamingRawPredictRequest) error
   322  	Recv() (*StreamingRawPredictResponse, error)
   323  	grpc.ClientStream
   324  }
   325  
   326  type predictionServiceStreamingRawPredictClient struct {
   327  	grpc.ClientStream
   328  }
   329  
   330  func (x *predictionServiceStreamingRawPredictClient) Send(m *StreamingRawPredictRequest) error {
   331  	return x.ClientStream.SendMsg(m)
   332  }
   333  
   334  func (x *predictionServiceStreamingRawPredictClient) Recv() (*StreamingRawPredictResponse, error) {
   335  	m := new(StreamingRawPredictResponse)
   336  	if err := x.ClientStream.RecvMsg(m); err != nil {
   337  		return nil, err
   338  	}
   339  	return m, nil
   340  }
   341  
   342  func (c *predictionServiceClient) Explain(ctx context.Context, in *ExplainRequest, opts ...grpc.CallOption) (*ExplainResponse, error) {
   343  	out := new(ExplainResponse)
   344  	err := c.cc.Invoke(ctx, PredictionService_Explain_FullMethodName, in, out, opts...)
   345  	if err != nil {
   346  		return nil, err
   347  	}
   348  	return out, nil
   349  }
   350  
   351  func (c *predictionServiceClient) GenerateContent(ctx context.Context, in *GenerateContentRequest, opts ...grpc.CallOption) (*GenerateContentResponse, error) {
   352  	out := new(GenerateContentResponse)
   353  	err := c.cc.Invoke(ctx, PredictionService_GenerateContent_FullMethodName, in, out, opts...)
   354  	if err != nil {
   355  		return nil, err
   356  	}
   357  	return out, nil
   358  }
   359  
   360  func (c *predictionServiceClient) StreamGenerateContent(ctx context.Context, in *GenerateContentRequest, opts ...grpc.CallOption) (PredictionService_StreamGenerateContentClient, error) {
   361  	stream, err := c.cc.NewStream(ctx, &PredictionService_ServiceDesc.Streams[6], PredictionService_StreamGenerateContent_FullMethodName, opts...)
   362  	if err != nil {
   363  		return nil, err
   364  	}
   365  	x := &predictionServiceStreamGenerateContentClient{stream}
   366  	if err := x.ClientStream.SendMsg(in); err != nil {
   367  		return nil, err
   368  	}
   369  	if err := x.ClientStream.CloseSend(); err != nil {
   370  		return nil, err
   371  	}
   372  	return x, nil
   373  }
   374  
   375  type PredictionService_StreamGenerateContentClient interface {
   376  	Recv() (*GenerateContentResponse, error)
   377  	grpc.ClientStream
   378  }
   379  
   380  type predictionServiceStreamGenerateContentClient struct {
   381  	grpc.ClientStream
   382  }
   383  
   384  func (x *predictionServiceStreamGenerateContentClient) Recv() (*GenerateContentResponse, error) {
   385  	m := new(GenerateContentResponse)
   386  	if err := x.ClientStream.RecvMsg(m); err != nil {
   387  		return nil, err
   388  	}
   389  	return m, nil
   390  }
   391  
   392  // PredictionServiceServer is the server API for PredictionService service.
   393  // All implementations should embed UnimplementedPredictionServiceServer
   394  // for forward compatibility
   395  type PredictionServiceServer interface {
   396  	// Perform an online prediction.
   397  	Predict(context.Context, *PredictRequest) (*PredictResponse, error)
   398  	// Perform an online prediction with an arbitrary HTTP payload.
   399  	//
   400  	// The response includes the following HTTP headers:
   401  	//
   402  	// * `X-Vertex-AI-Endpoint-Id`: ID of the
   403  	// [Endpoint][google.cloud.aiplatform.v1.Endpoint] that served this
   404  	// prediction.
   405  	//
   406  	// * `X-Vertex-AI-Deployed-Model-Id`: ID of the Endpoint's
   407  	// [DeployedModel][google.cloud.aiplatform.v1.DeployedModel] that served this
   408  	// prediction.
   409  	RawPredict(context.Context, *RawPredictRequest) (*httpbody.HttpBody, error)
   410  	// Perform a streaming online prediction with an arbitrary HTTP payload.
   411  	StreamRawPredict(*StreamRawPredictRequest, PredictionService_StreamRawPredictServer) error
   412  	// Perform an unary online prediction request to a gRPC model server for
   413  	// Vertex first-party products and frameworks.
   414  	DirectPredict(context.Context, *DirectPredictRequest) (*DirectPredictResponse, error)
   415  	// Perform an unary online prediction request to a gRPC model server for
   416  	// custom containers.
   417  	DirectRawPredict(context.Context, *DirectRawPredictRequest) (*DirectRawPredictResponse, error)
   418  	// Perform a streaming online prediction request to a gRPC model server for
   419  	// Vertex first-party products and frameworks.
   420  	StreamDirectPredict(PredictionService_StreamDirectPredictServer) error
   421  	// Perform a streaming online prediction request to a gRPC model server for
   422  	// custom containers.
   423  	StreamDirectRawPredict(PredictionService_StreamDirectRawPredictServer) error
   424  	// Perform a streaming online prediction request for Vertex first-party
   425  	// products and frameworks.
   426  	StreamingPredict(PredictionService_StreamingPredictServer) error
   427  	// Perform a server-side streaming online prediction request for Vertex
   428  	// LLM streaming.
   429  	ServerStreamingPredict(*StreamingPredictRequest, PredictionService_ServerStreamingPredictServer) error
   430  	// Perform a streaming online prediction request through gRPC.
   431  	StreamingRawPredict(PredictionService_StreamingRawPredictServer) error
   432  	// Perform an online explanation.
   433  	//
   434  	// If
   435  	// [deployed_model_id][google.cloud.aiplatform.v1.ExplainRequest.deployed_model_id]
   436  	// is specified, the corresponding DeployModel must have
   437  	// [explanation_spec][google.cloud.aiplatform.v1.DeployedModel.explanation_spec]
   438  	// populated. If
   439  	// [deployed_model_id][google.cloud.aiplatform.v1.ExplainRequest.deployed_model_id]
   440  	// is not specified, all DeployedModels must have
   441  	// [explanation_spec][google.cloud.aiplatform.v1.DeployedModel.explanation_spec]
   442  	// populated.
   443  	Explain(context.Context, *ExplainRequest) (*ExplainResponse, error)
   444  	// Generate content with multimodal inputs.
   445  	GenerateContent(context.Context, *GenerateContentRequest) (*GenerateContentResponse, error)
   446  	// Generate content with multimodal inputs with streaming support.
   447  	StreamGenerateContent(*GenerateContentRequest, PredictionService_StreamGenerateContentServer) error
   448  }
   449  
   450  // UnimplementedPredictionServiceServer should be embedded to have forward compatible implementations.
   451  type UnimplementedPredictionServiceServer struct {
   452  }
   453  
   454  func (UnimplementedPredictionServiceServer) Predict(context.Context, *PredictRequest) (*PredictResponse, error) {
   455  	return nil, status.Errorf(codes.Unimplemented, "method Predict not implemented")
   456  }
   457  func (UnimplementedPredictionServiceServer) RawPredict(context.Context, *RawPredictRequest) (*httpbody.HttpBody, error) {
   458  	return nil, status.Errorf(codes.Unimplemented, "method RawPredict not implemented")
   459  }
   460  func (UnimplementedPredictionServiceServer) StreamRawPredict(*StreamRawPredictRequest, PredictionService_StreamRawPredictServer) error {
   461  	return status.Errorf(codes.Unimplemented, "method StreamRawPredict not implemented")
   462  }
   463  func (UnimplementedPredictionServiceServer) DirectPredict(context.Context, *DirectPredictRequest) (*DirectPredictResponse, error) {
   464  	return nil, status.Errorf(codes.Unimplemented, "method DirectPredict not implemented")
   465  }
   466  func (UnimplementedPredictionServiceServer) DirectRawPredict(context.Context, *DirectRawPredictRequest) (*DirectRawPredictResponse, error) {
   467  	return nil, status.Errorf(codes.Unimplemented, "method DirectRawPredict not implemented")
   468  }
   469  func (UnimplementedPredictionServiceServer) StreamDirectPredict(PredictionService_StreamDirectPredictServer) error {
   470  	return status.Errorf(codes.Unimplemented, "method StreamDirectPredict not implemented")
   471  }
   472  func (UnimplementedPredictionServiceServer) StreamDirectRawPredict(PredictionService_StreamDirectRawPredictServer) error {
   473  	return status.Errorf(codes.Unimplemented, "method StreamDirectRawPredict not implemented")
   474  }
   475  func (UnimplementedPredictionServiceServer) StreamingPredict(PredictionService_StreamingPredictServer) error {
   476  	return status.Errorf(codes.Unimplemented, "method StreamingPredict not implemented")
   477  }
   478  func (UnimplementedPredictionServiceServer) ServerStreamingPredict(*StreamingPredictRequest, PredictionService_ServerStreamingPredictServer) error {
   479  	return status.Errorf(codes.Unimplemented, "method ServerStreamingPredict not implemented")
   480  }
   481  func (UnimplementedPredictionServiceServer) StreamingRawPredict(PredictionService_StreamingRawPredictServer) error {
   482  	return status.Errorf(codes.Unimplemented, "method StreamingRawPredict not implemented")
   483  }
   484  func (UnimplementedPredictionServiceServer) Explain(context.Context, *ExplainRequest) (*ExplainResponse, error) {
   485  	return nil, status.Errorf(codes.Unimplemented, "method Explain not implemented")
   486  }
   487  func (UnimplementedPredictionServiceServer) GenerateContent(context.Context, *GenerateContentRequest) (*GenerateContentResponse, error) {
   488  	return nil, status.Errorf(codes.Unimplemented, "method GenerateContent not implemented")
   489  }
   490  func (UnimplementedPredictionServiceServer) StreamGenerateContent(*GenerateContentRequest, PredictionService_StreamGenerateContentServer) error {
   491  	return status.Errorf(codes.Unimplemented, "method StreamGenerateContent not implemented")
   492  }
   493  
   494  // UnsafePredictionServiceServer may be embedded to opt out of forward compatibility for this service.
   495  // Use of this interface is not recommended, as added methods to PredictionServiceServer will
   496  // result in compilation errors.
   497  type UnsafePredictionServiceServer interface {
   498  	mustEmbedUnimplementedPredictionServiceServer()
   499  }
   500  
   501  func RegisterPredictionServiceServer(s grpc.ServiceRegistrar, srv PredictionServiceServer) {
   502  	s.RegisterService(&PredictionService_ServiceDesc, srv)
   503  }
   504  
   505  func _PredictionService_Predict_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   506  	in := new(PredictRequest)
   507  	if err := dec(in); err != nil {
   508  		return nil, err
   509  	}
   510  	if interceptor == nil {
   511  		return srv.(PredictionServiceServer).Predict(ctx, in)
   512  	}
   513  	info := &grpc.UnaryServerInfo{
   514  		Server:     srv,
   515  		FullMethod: PredictionService_Predict_FullMethodName,
   516  	}
   517  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   518  		return srv.(PredictionServiceServer).Predict(ctx, req.(*PredictRequest))
   519  	}
   520  	return interceptor(ctx, in, info, handler)
   521  }
   522  
   523  func _PredictionService_RawPredict_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   524  	in := new(RawPredictRequest)
   525  	if err := dec(in); err != nil {
   526  		return nil, err
   527  	}
   528  	if interceptor == nil {
   529  		return srv.(PredictionServiceServer).RawPredict(ctx, in)
   530  	}
   531  	info := &grpc.UnaryServerInfo{
   532  		Server:     srv,
   533  		FullMethod: PredictionService_RawPredict_FullMethodName,
   534  	}
   535  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   536  		return srv.(PredictionServiceServer).RawPredict(ctx, req.(*RawPredictRequest))
   537  	}
   538  	return interceptor(ctx, in, info, handler)
   539  }
   540  
   541  func _PredictionService_StreamRawPredict_Handler(srv interface{}, stream grpc.ServerStream) error {
   542  	m := new(StreamRawPredictRequest)
   543  	if err := stream.RecvMsg(m); err != nil {
   544  		return err
   545  	}
   546  	return srv.(PredictionServiceServer).StreamRawPredict(m, &predictionServiceStreamRawPredictServer{stream})
   547  }
   548  
   549  type PredictionService_StreamRawPredictServer interface {
   550  	Send(*httpbody.HttpBody) error
   551  	grpc.ServerStream
   552  }
   553  
   554  type predictionServiceStreamRawPredictServer struct {
   555  	grpc.ServerStream
   556  }
   557  
   558  func (x *predictionServiceStreamRawPredictServer) Send(m *httpbody.HttpBody) error {
   559  	return x.ServerStream.SendMsg(m)
   560  }
   561  
   562  func _PredictionService_DirectPredict_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   563  	in := new(DirectPredictRequest)
   564  	if err := dec(in); err != nil {
   565  		return nil, err
   566  	}
   567  	if interceptor == nil {
   568  		return srv.(PredictionServiceServer).DirectPredict(ctx, in)
   569  	}
   570  	info := &grpc.UnaryServerInfo{
   571  		Server:     srv,
   572  		FullMethod: PredictionService_DirectPredict_FullMethodName,
   573  	}
   574  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   575  		return srv.(PredictionServiceServer).DirectPredict(ctx, req.(*DirectPredictRequest))
   576  	}
   577  	return interceptor(ctx, in, info, handler)
   578  }
   579  
   580  func _PredictionService_DirectRawPredict_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   581  	in := new(DirectRawPredictRequest)
   582  	if err := dec(in); err != nil {
   583  		return nil, err
   584  	}
   585  	if interceptor == nil {
   586  		return srv.(PredictionServiceServer).DirectRawPredict(ctx, in)
   587  	}
   588  	info := &grpc.UnaryServerInfo{
   589  		Server:     srv,
   590  		FullMethod: PredictionService_DirectRawPredict_FullMethodName,
   591  	}
   592  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   593  		return srv.(PredictionServiceServer).DirectRawPredict(ctx, req.(*DirectRawPredictRequest))
   594  	}
   595  	return interceptor(ctx, in, info, handler)
   596  }
   597  
   598  func _PredictionService_StreamDirectPredict_Handler(srv interface{}, stream grpc.ServerStream) error {
   599  	return srv.(PredictionServiceServer).StreamDirectPredict(&predictionServiceStreamDirectPredictServer{stream})
   600  }
   601  
   602  type PredictionService_StreamDirectPredictServer interface {
   603  	Send(*StreamDirectPredictResponse) error
   604  	Recv() (*StreamDirectPredictRequest, error)
   605  	grpc.ServerStream
   606  }
   607  
   608  type predictionServiceStreamDirectPredictServer struct {
   609  	grpc.ServerStream
   610  }
   611  
   612  func (x *predictionServiceStreamDirectPredictServer) Send(m *StreamDirectPredictResponse) error {
   613  	return x.ServerStream.SendMsg(m)
   614  }
   615  
   616  func (x *predictionServiceStreamDirectPredictServer) Recv() (*StreamDirectPredictRequest, error) {
   617  	m := new(StreamDirectPredictRequest)
   618  	if err := x.ServerStream.RecvMsg(m); err != nil {
   619  		return nil, err
   620  	}
   621  	return m, nil
   622  }
   623  
   624  func _PredictionService_StreamDirectRawPredict_Handler(srv interface{}, stream grpc.ServerStream) error {
   625  	return srv.(PredictionServiceServer).StreamDirectRawPredict(&predictionServiceStreamDirectRawPredictServer{stream})
   626  }
   627  
   628  type PredictionService_StreamDirectRawPredictServer interface {
   629  	Send(*StreamDirectRawPredictResponse) error
   630  	Recv() (*StreamDirectRawPredictRequest, error)
   631  	grpc.ServerStream
   632  }
   633  
   634  type predictionServiceStreamDirectRawPredictServer struct {
   635  	grpc.ServerStream
   636  }
   637  
   638  func (x *predictionServiceStreamDirectRawPredictServer) Send(m *StreamDirectRawPredictResponse) error {
   639  	return x.ServerStream.SendMsg(m)
   640  }
   641  
   642  func (x *predictionServiceStreamDirectRawPredictServer) Recv() (*StreamDirectRawPredictRequest, error) {
   643  	m := new(StreamDirectRawPredictRequest)
   644  	if err := x.ServerStream.RecvMsg(m); err != nil {
   645  		return nil, err
   646  	}
   647  	return m, nil
   648  }
   649  
   650  func _PredictionService_StreamingPredict_Handler(srv interface{}, stream grpc.ServerStream) error {
   651  	return srv.(PredictionServiceServer).StreamingPredict(&predictionServiceStreamingPredictServer{stream})
   652  }
   653  
   654  type PredictionService_StreamingPredictServer interface {
   655  	Send(*StreamingPredictResponse) error
   656  	Recv() (*StreamingPredictRequest, error)
   657  	grpc.ServerStream
   658  }
   659  
   660  type predictionServiceStreamingPredictServer struct {
   661  	grpc.ServerStream
   662  }
   663  
   664  func (x *predictionServiceStreamingPredictServer) Send(m *StreamingPredictResponse) error {
   665  	return x.ServerStream.SendMsg(m)
   666  }
   667  
   668  func (x *predictionServiceStreamingPredictServer) Recv() (*StreamingPredictRequest, error) {
   669  	m := new(StreamingPredictRequest)
   670  	if err := x.ServerStream.RecvMsg(m); err != nil {
   671  		return nil, err
   672  	}
   673  	return m, nil
   674  }
   675  
   676  func _PredictionService_ServerStreamingPredict_Handler(srv interface{}, stream grpc.ServerStream) error {
   677  	m := new(StreamingPredictRequest)
   678  	if err := stream.RecvMsg(m); err != nil {
   679  		return err
   680  	}
   681  	return srv.(PredictionServiceServer).ServerStreamingPredict(m, &predictionServiceServerStreamingPredictServer{stream})
   682  }
   683  
   684  type PredictionService_ServerStreamingPredictServer interface {
   685  	Send(*StreamingPredictResponse) error
   686  	grpc.ServerStream
   687  }
   688  
   689  type predictionServiceServerStreamingPredictServer struct {
   690  	grpc.ServerStream
   691  }
   692  
   693  func (x *predictionServiceServerStreamingPredictServer) Send(m *StreamingPredictResponse) error {
   694  	return x.ServerStream.SendMsg(m)
   695  }
   696  
   697  func _PredictionService_StreamingRawPredict_Handler(srv interface{}, stream grpc.ServerStream) error {
   698  	return srv.(PredictionServiceServer).StreamingRawPredict(&predictionServiceStreamingRawPredictServer{stream})
   699  }
   700  
   701  type PredictionService_StreamingRawPredictServer interface {
   702  	Send(*StreamingRawPredictResponse) error
   703  	Recv() (*StreamingRawPredictRequest, error)
   704  	grpc.ServerStream
   705  }
   706  
   707  type predictionServiceStreamingRawPredictServer struct {
   708  	grpc.ServerStream
   709  }
   710  
   711  func (x *predictionServiceStreamingRawPredictServer) Send(m *StreamingRawPredictResponse) error {
   712  	return x.ServerStream.SendMsg(m)
   713  }
   714  
   715  func (x *predictionServiceStreamingRawPredictServer) Recv() (*StreamingRawPredictRequest, error) {
   716  	m := new(StreamingRawPredictRequest)
   717  	if err := x.ServerStream.RecvMsg(m); err != nil {
   718  		return nil, err
   719  	}
   720  	return m, nil
   721  }
   722  
   723  func _PredictionService_Explain_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   724  	in := new(ExplainRequest)
   725  	if err := dec(in); err != nil {
   726  		return nil, err
   727  	}
   728  	if interceptor == nil {
   729  		return srv.(PredictionServiceServer).Explain(ctx, in)
   730  	}
   731  	info := &grpc.UnaryServerInfo{
   732  		Server:     srv,
   733  		FullMethod: PredictionService_Explain_FullMethodName,
   734  	}
   735  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   736  		return srv.(PredictionServiceServer).Explain(ctx, req.(*ExplainRequest))
   737  	}
   738  	return interceptor(ctx, in, info, handler)
   739  }
   740  
   741  func _PredictionService_GenerateContent_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   742  	in := new(GenerateContentRequest)
   743  	if err := dec(in); err != nil {
   744  		return nil, err
   745  	}
   746  	if interceptor == nil {
   747  		return srv.(PredictionServiceServer).GenerateContent(ctx, in)
   748  	}
   749  	info := &grpc.UnaryServerInfo{
   750  		Server:     srv,
   751  		FullMethod: PredictionService_GenerateContent_FullMethodName,
   752  	}
   753  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   754  		return srv.(PredictionServiceServer).GenerateContent(ctx, req.(*GenerateContentRequest))
   755  	}
   756  	return interceptor(ctx, in, info, handler)
   757  }
   758  
   759  func _PredictionService_StreamGenerateContent_Handler(srv interface{}, stream grpc.ServerStream) error {
   760  	m := new(GenerateContentRequest)
   761  	if err := stream.RecvMsg(m); err != nil {
   762  		return err
   763  	}
   764  	return srv.(PredictionServiceServer).StreamGenerateContent(m, &predictionServiceStreamGenerateContentServer{stream})
   765  }
   766  
   767  type PredictionService_StreamGenerateContentServer interface {
   768  	Send(*GenerateContentResponse) error
   769  	grpc.ServerStream
   770  }
   771  
   772  type predictionServiceStreamGenerateContentServer struct {
   773  	grpc.ServerStream
   774  }
   775  
   776  func (x *predictionServiceStreamGenerateContentServer) Send(m *GenerateContentResponse) error {
   777  	return x.ServerStream.SendMsg(m)
   778  }
   779  
   780  // PredictionService_ServiceDesc is the grpc.ServiceDesc for PredictionService service.
   781  // It's only intended for direct use with grpc.RegisterService,
   782  // and not to be introspected or modified (even as a copy)
   783  var PredictionService_ServiceDesc = grpc.ServiceDesc{
   784  	ServiceName: "google.cloud.aiplatform.v1.PredictionService",
   785  	HandlerType: (*PredictionServiceServer)(nil),
   786  	Methods: []grpc.MethodDesc{
   787  		{
   788  			MethodName: "Predict",
   789  			Handler:    _PredictionService_Predict_Handler,
   790  		},
   791  		{
   792  			MethodName: "RawPredict",
   793  			Handler:    _PredictionService_RawPredict_Handler,
   794  		},
   795  		{
   796  			MethodName: "DirectPredict",
   797  			Handler:    _PredictionService_DirectPredict_Handler,
   798  		},
   799  		{
   800  			MethodName: "DirectRawPredict",
   801  			Handler:    _PredictionService_DirectRawPredict_Handler,
   802  		},
   803  		{
   804  			MethodName: "Explain",
   805  			Handler:    _PredictionService_Explain_Handler,
   806  		},
   807  		{
   808  			MethodName: "GenerateContent",
   809  			Handler:    _PredictionService_GenerateContent_Handler,
   810  		},
   811  	},
   812  	Streams: []grpc.StreamDesc{
   813  		{
   814  			StreamName:    "StreamRawPredict",
   815  			Handler:       _PredictionService_StreamRawPredict_Handler,
   816  			ServerStreams: true,
   817  		},
   818  		{
   819  			StreamName:    "StreamDirectPredict",
   820  			Handler:       _PredictionService_StreamDirectPredict_Handler,
   821  			ServerStreams: true,
   822  			ClientStreams: true,
   823  		},
   824  		{
   825  			StreamName:    "StreamDirectRawPredict",
   826  			Handler:       _PredictionService_StreamDirectRawPredict_Handler,
   827  			ServerStreams: true,
   828  			ClientStreams: true,
   829  		},
   830  		{
   831  			StreamName:    "StreamingPredict",
   832  			Handler:       _PredictionService_StreamingPredict_Handler,
   833  			ServerStreams: true,
   834  			ClientStreams: true,
   835  		},
   836  		{
   837  			StreamName:    "ServerStreamingPredict",
   838  			Handler:       _PredictionService_ServerStreamingPredict_Handler,
   839  			ServerStreams: true,
   840  		},
   841  		{
   842  			StreamName:    "StreamingRawPredict",
   843  			Handler:       _PredictionService_StreamingRawPredict_Handler,
   844  			ServerStreams: true,
   845  			ClientStreams: true,
   846  		},
   847  		{
   848  			StreamName:    "StreamGenerateContent",
   849  			Handler:       _PredictionService_StreamGenerateContent_Handler,
   850  			ServerStreams: true,
   851  		},
   852  	},
   853  	Metadata: "google/cloud/aiplatform/v1/prediction_service.proto",
   854  }