| 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/automl/v1/prediction_service.proto |
| 20 | |
| 21 | package automlpb |
| 22 | |
| 23 | import ( |
| 24 | longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb" |
| 25 | context "context" |
| 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.automl.v1.PredictionService/Predict" |
| 38 | PredictionService_BatchPredict_FullMethodName = "/google.cloud.automl.v1.PredictionService/BatchPredict" |
| 39 | ) |
| 40 | |
| 41 | // PredictionServiceClient is the client API for PredictionService service. |
| 42 | // |
| 43 | // 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. |
| 44 | type PredictionServiceClient interface { |
| 45 | // Perform an online prediction. The prediction result is directly |
| 46 | // returned in the response. |
| 47 | // Available for following ML scenarios, and their expected request payloads: |
| 48 | // |
| 49 | // # AutoML Vision Classification |
| 50 | // |
| 51 | // * An image in .JPEG, .GIF or .PNG format, image_bytes up to 30MB. |
| 52 | // |
| 53 | // # AutoML Vision Object Detection |
| 54 | // |
| 55 | // * An image in .JPEG, .GIF or .PNG format, image_bytes up to 30MB. |
| 56 | // |
| 57 | // # AutoML Natural Language Classification |
| 58 | // |
| 59 | // * A TextSnippet up to 60,000 characters, UTF-8 encoded or a document in |
| 60 | // .PDF, .TIF or .TIFF format with size upto 2MB. |
| 61 | // |
| 62 | // # AutoML Natural Language Entity Extraction |
| 63 | // |
| 64 | // - A TextSnippet up to 10,000 characters, UTF-8 NFC encoded or a document |
| 65 | // in .PDF, .TIF or .TIFF format with size upto 20MB. |
| 66 | // |
| 67 | // # AutoML Natural Language Sentiment Analysis |
| 68 | // |
| 69 | // * A TextSnippet up to 60,000 characters, UTF-8 encoded or a document in |
| 70 | // .PDF, .TIF or .TIFF format with size upto 2MB. |
| 71 | // |
| 72 | // # AutoML Translation |
| 73 | // |
| 74 | // * A TextSnippet up to 25,000 characters, UTF-8 encoded. |
| 75 | // |
| 76 | // # AutoML Tables |
| 77 | // |
| 78 | // - A row with column values matching |
| 79 | // the columns of the model, up to 5MB. Not available for FORECASTING |
| 80 | // `prediction_type`. |
| 81 | Predict(ctx context.Context, in *PredictRequest, opts ...grpc.CallOption) (*PredictResponse, error) |
| 82 | // Perform a batch prediction. Unlike the online [Predict][google.cloud.automl.v1.PredictionService.Predict], batch |
| 83 | // prediction result won't be immediately available in the response. Instead, |
| 84 | // a long running operation object is returned. User can poll the operation |
| 85 | // result via [GetOperation][google.longrunning.Operations.GetOperation] |
| 86 | // method. Once the operation is done, [BatchPredictResult][google.cloud.automl.v1.BatchPredictResult] is returned in |
| 87 | // the [response][google.longrunning.Operation.response] field. |
| 88 | // Available for following ML scenarios: |
| 89 | // |
| 90 | // * AutoML Vision Classification |
| 91 | // * AutoML Vision Object Detection |
| 92 | // * AutoML Video Intelligence Classification |
| 93 | // * AutoML Video Intelligence Object Tracking * AutoML Natural Language Classification |
| 94 | // * AutoML Natural Language Entity Extraction |
| 95 | // * AutoML Natural Language Sentiment Analysis |
| 96 | // * AutoML Tables |
| 97 | BatchPredict(ctx context.Context, in *BatchPredictRequest, opts ...grpc.CallOption) (*longrunningpb.Operation, error) |
| 98 | } |
| 99 | |
| 100 | type predictionServiceClient struct { |
| 101 | cc grpc.ClientConnInterface |
| 102 | } |
| 103 | |
| 104 | func NewPredictionServiceClient(cc grpc.ClientConnInterface) PredictionServiceClient { |
| 105 | return &predictionServiceClient{cc} |
| 106 | } |
| 107 | |
| 108 | func (c *predictionServiceClient) Predict(ctx context.Context, in *PredictRequest, opts ...grpc.CallOption) (*PredictResponse, error) { |
| 109 | out := new(PredictResponse) |
| 110 | err := c.cc.Invoke(ctx, PredictionService_Predict_FullMethodName, in, out, opts...) |
| 111 | if err != nil { |
| 112 | return nil, err |
| 113 | } |
| 114 | return out, nil |
| 115 | } |
| 116 | |
| 117 | func (c *predictionServiceClient) BatchPredict(ctx context.Context, in *BatchPredictRequest, opts ...grpc.CallOption) (*longrunningpb.Operation, error) { |
| 118 | out := new(longrunningpb.Operation) |
| 119 | err := c.cc.Invoke(ctx, PredictionService_BatchPredict_FullMethodName, in, out, opts...) |
| 120 | if err != nil { |
| 121 | return nil, err |
| 122 | } |
| 123 | return out, nil |
| 124 | } |
| 125 | |
| 126 | // PredictionServiceServer is the server API for PredictionService service. |
| 127 | // All implementations should embed UnimplementedPredictionServiceServer |
| 128 | // for forward compatibility |
| 129 | type PredictionServiceServer interface { |
| 130 | // Perform an online prediction. The prediction result is directly |
| 131 | // returned in the response. |
| 132 | // Available for following ML scenarios, and their expected request payloads: |
| 133 | // |
| 134 | // # AutoML Vision Classification |
| 135 | // |
| 136 | // * An image in .JPEG, .GIF or .PNG format, image_bytes up to 30MB. |
| 137 | // |
| 138 | // # AutoML Vision Object Detection |
| 139 | // |
| 140 | // * An image in .JPEG, .GIF or .PNG format, image_bytes up to 30MB. |
| 141 | // |
| 142 | // # AutoML Natural Language Classification |
| 143 | // |
| 144 | // * A TextSnippet up to 60,000 characters, UTF-8 encoded or a document in |
| 145 | // .PDF, .TIF or .TIFF format with size upto 2MB. |
| 146 | // |
| 147 | // # AutoML Natural Language Entity Extraction |
| 148 | // |
| 149 | // - A TextSnippet up to 10,000 characters, UTF-8 NFC encoded or a document |
| 150 | // in .PDF, .TIF or .TIFF format with size upto 20MB. |
| 151 | // |
| 152 | // # AutoML Natural Language Sentiment Analysis |
| 153 | // |
| 154 | // * A TextSnippet up to 60,000 characters, UTF-8 encoded or a document in |
| 155 | // .PDF, .TIF or .TIFF format with size upto 2MB. |
| 156 | // |
| 157 | // # AutoML Translation |
| 158 | // |
| 159 | // * A TextSnippet up to 25,000 characters, UTF-8 encoded. |
| 160 | // |
| 161 | // # AutoML Tables |
| 162 | // |
| 163 | // - A row with column values matching |
| 164 | // the columns of the model, up to 5MB. Not available for FORECASTING |
| 165 | // `prediction_type`. |
| 166 | Predict(context.Context, *PredictRequest) (*PredictResponse, error) |
| 167 | // Perform a batch prediction. Unlike the online [Predict][google.cloud.automl.v1.PredictionService.Predict], batch |
| 168 | // prediction result won't be immediately available in the response. Instead, |
| 169 | // a long running operation object is returned. User can poll the operation |
| 170 | // result via [GetOperation][google.longrunning.Operations.GetOperation] |
| 171 | // method. Once the operation is done, [BatchPredictResult][google.cloud.automl.v1.BatchPredictResult] is returned in |
| 172 | // the [response][google.longrunning.Operation.response] field. |
| 173 | // Available for following ML scenarios: |
| 174 | // |
| 175 | // * AutoML Vision Classification |
| 176 | // * AutoML Vision Object Detection |
| 177 | // * AutoML Video Intelligence Classification |
| 178 | // * AutoML Video Intelligence Object Tracking * AutoML Natural Language Classification |
| 179 | // * AutoML Natural Language Entity Extraction |
| 180 | // * AutoML Natural Language Sentiment Analysis |
| 181 | // * AutoML Tables |
| 182 | BatchPredict(context.Context, *BatchPredictRequest) (*longrunningpb.Operation, error) |
| 183 | } |
| 184 | |
| 185 | // UnimplementedPredictionServiceServer should be embedded to have forward compatible implementations. |
| 186 | type UnimplementedPredictionServiceServer struct { |
| 187 | } |
| 188 | |
| 189 | func (UnimplementedPredictionServiceServer) Predict(context.Context, *PredictRequest) (*PredictResponse, error) { |
| 190 | return nil, status.Errorf(codes.Unimplemented, "method Predict not implemented") |
| 191 | } |
| 192 | func (UnimplementedPredictionServiceServer) BatchPredict(context.Context, *BatchPredictRequest) (*longrunningpb.Operation, error) { |
| 193 | return nil, status.Errorf(codes.Unimplemented, "method BatchPredict not implemented") |
| 194 | } |
| 195 | |
| 196 | // UnsafePredictionServiceServer may be embedded to opt out of forward compatibility for this service. |
| 197 | // Use of this interface is not recommended, as added methods to PredictionServiceServer will |
| 198 | // result in compilation errors. |
| 199 | type UnsafePredictionServiceServer interface { |
| 200 | mustEmbedUnimplementedPredictionServiceServer() |
| 201 | } |
| 202 | |
| 203 | func RegisterPredictionServiceServer(s grpc.ServiceRegistrar, srv PredictionServiceServer) { |
| 204 | s.RegisterService(&PredictionService_ServiceDesc, srv) |
| 205 | } |
| 206 | |
| 207 | func _PredictionService_Predict_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
| 208 | in := new(PredictRequest) |
| 209 | if err := dec(in); err != nil { |
| 210 | return nil, err |
| 211 | } |
| 212 | if interceptor == nil { |
| 213 | return srv.(PredictionServiceServer).Predict(ctx, in) |
| 214 | } |
| 215 | info := &grpc.UnaryServerInfo{ |
| 216 | Server: srv, |
| 217 | FullMethod: PredictionService_Predict_FullMethodName, |
| 218 | } |
| 219 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
| 220 | return srv.(PredictionServiceServer).Predict(ctx, req.(*PredictRequest)) |
| 221 | } |
| 222 | return interceptor(ctx, in, info, handler) |
| 223 | } |
| 224 | |
| 225 | func _PredictionService_BatchPredict_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
| 226 | in := new(BatchPredictRequest) |
| 227 | if err := dec(in); err != nil { |
| 228 | return nil, err |
| 229 | } |
| 230 | if interceptor == nil { |
| 231 | return srv.(PredictionServiceServer).BatchPredict(ctx, in) |
| 232 | } |
| 233 | info := &grpc.UnaryServerInfo{ |
| 234 | Server: srv, |
| 235 | FullMethod: PredictionService_BatchPredict_FullMethodName, |
| 236 | } |
| 237 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
| 238 | return srv.(PredictionServiceServer).BatchPredict(ctx, req.(*BatchPredictRequest)) |
| 239 | } |
| 240 | return interceptor(ctx, in, info, handler) |
| 241 | } |
| 242 | |
| 243 | // PredictionService_ServiceDesc is the grpc.ServiceDesc for PredictionService service. |
| 244 | // It's only intended for direct use with grpc.RegisterService, |
| 245 | // and not to be introspected or modified (even as a copy) |
| 246 | var PredictionService_ServiceDesc = grpc.ServiceDesc{ |
| 247 | ServiceName: "google.cloud.automl.v1.PredictionService", |
| 248 | HandlerType: (*PredictionServiceServer)(nil), |
| 249 | Methods: []grpc.MethodDesc{ |
| 250 | { |
| 251 | MethodName: "Predict", |
| 252 | Handler: _PredictionService_Predict_Handler, |
| 253 | }, |
| 254 | { |
| 255 | MethodName: "BatchPredict", |
| 256 | Handler: _PredictionService_BatchPredict_Handler, |
| 257 | }, |
| 258 | }, |
| 259 | Streams: []grpc.StreamDesc{}, |
| 260 | Metadata: "google/cloud/automl/v1/prediction_service.proto", |
| 261 | } |