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