1 // Code generated by protoc-gen-go. DO NOT EDIT.
2 // source: google/cloud/ml/v1beta1/prediction_service.proto
6 import proto "github.com/golang/protobuf/proto"
9 import _ "google.golang.org/genproto/googleapis/api/annotations"
10 import google_api3 "google.golang.org/genproto/googleapis/api/httpbody"
13 context "golang.org/x/net/context"
14 grpc "google.golang.org/grpc"
17 // Reference imports to suppress errors if they are not otherwise used.
22 // Request for predictions to be issued against a trained model.
24 // The body of the request is a single JSON object with a single top-level
29 // <dd>A JSON array containing values representing the instances to use for
33 // The structure of each element of the instances list is determined by your
34 // model's input definition. Instances can include named inputs or can contain
35 // only unlabeled values.
37 // Not all data includes named inputs. Some instances will be simple
38 // JSON values (boolean, number, or string). However, instances are often lists
39 // of simple values, or complex nested lists. Here are some examples of request
42 // CSV data with each row encoded as a string value:
44 // {"instances": ["1.0,true,\\"x\\"", "-2.0,false,\\"y\\""]}
48 // {"instances": ["the quick brown fox", "la bruja le dio"]}
50 // Sentences encoded as lists of words (vectors of strings):
54 // ["the","quick","brown"],
55 // ["la","bruja","le"],
60 // Floating point scalar values:
62 // {"instances": [0.0, 1.1, 2.2]}
64 // Vectors of integers:
74 // Tensors (in this case, two-dimensional tensors):
86 // Images can be represented different ways. In this encoding scheme the first
87 // two dimensions represent the rows and columns of the image, and the third
88 // contains lists (vectors) of the R, G, and B values for each pixel.
109 // JSON strings must be encoded as UTF-8. To send binary data, you must
110 // base64-encode the data and mark it as binary. To mark a JSON string
111 // as binary, replace it with a JSON object with a single attribute named `b64`:
112 // <pre>{"b64": "..."} </pre>
115 // Two Serialized tf.Examples (fake data, for illustrative purposes only):
117 // {"instances": [{"b64": "X5ad6u"}, {"b64": "IA9j4nx"}]}
119 // Two JPEG image byte strings (fake data, for illustrative purposes only):
121 // {"instances": [{"b64": "ASa8asdf"}, {"b64": "JLK7ljk3"}]}
123 // If your data includes named references, format each instance as a JSON object
124 // with the named references as the keys:
126 // JSON input data to be preprocessed:
143 // Some models have an underlying TensorFlow graph that accepts multiple input
144 // tensors. In this case, you should use the names of JSON name/value pairs to
145 // identify the input tensors, as shown in the following exmaples:
147 // For a graph with input tensor aliases "tag" (string) and "image"
148 // (base64-encoded string):
154 // "image": {"b64": "ASa8asdf"}
158 // "image": {"b64": "JLK7ljk3"}
163 // For a graph with input tensor aliases "tag" (string) and "image"
164 // (3-dimensional array of 8-bit ints):
204 // If the call is successful, the response body will contain one prediction
205 // entry per instance in the request body. If prediction fails for any
206 // instance, the response body will contain no predictions and will contian
207 // a single error entry instead.
208 type PredictRequest struct {
209 // Required. The resource name of a model or a version.
211 // Authorization: requires `Viewer` role on the parent project.
212 Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
214 // Required. The prediction request body.
215 HttpBody *google_api3.HttpBody `protobuf:"bytes,2,opt,name=http_body,json=httpBody" json:"http_body,omitempty"`
218 func (m *PredictRequest) Reset() { *m = PredictRequest{} }
219 func (m *PredictRequest) String() string { return proto.CompactTextString(m) }
220 func (*PredictRequest) ProtoMessage() {}
221 func (*PredictRequest) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{0} }
223 func (m *PredictRequest) GetName() string {
230 func (m *PredictRequest) GetHttpBody() *google_api3.HttpBody {
238 proto.RegisterType((*PredictRequest)(nil), "google.cloud.ml.v1beta1.PredictRequest")
241 // Reference imports to suppress errors if they are not otherwise used.
242 var _ context.Context
243 var _ grpc.ClientConn
245 // This is a compile-time assertion to ensure that this generated file
246 // is compatible with the grpc package it is being compiled against.
247 const _ = grpc.SupportPackageIsVersion4
249 // Client API for OnlinePredictionService service
251 type OnlinePredictionServiceClient interface {
252 // Performs prediction on the data in the request.
254 // **** REMOVE FROM GENERATED DOCUMENTATION
255 Predict(ctx context.Context, in *PredictRequest, opts ...grpc.CallOption) (*google_api3.HttpBody, error)
258 type onlinePredictionServiceClient struct {
262 func NewOnlinePredictionServiceClient(cc *grpc.ClientConn) OnlinePredictionServiceClient {
263 return &onlinePredictionServiceClient{cc}
266 func (c *onlinePredictionServiceClient) Predict(ctx context.Context, in *PredictRequest, opts ...grpc.CallOption) (*google_api3.HttpBody, error) {
267 out := new(google_api3.HttpBody)
268 err := grpc.Invoke(ctx, "/google.cloud.ml.v1beta1.OnlinePredictionService/Predict", in, out, c.cc, opts...)
275 // Server API for OnlinePredictionService service
277 type OnlinePredictionServiceServer interface {
278 // Performs prediction on the data in the request.
280 // **** REMOVE FROM GENERATED DOCUMENTATION
281 Predict(context.Context, *PredictRequest) (*google_api3.HttpBody, error)
284 func RegisterOnlinePredictionServiceServer(s *grpc.Server, srv OnlinePredictionServiceServer) {
285 s.RegisterService(&_OnlinePredictionService_serviceDesc, srv)
288 func _OnlinePredictionService_Predict_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
289 in := new(PredictRequest)
290 if err := dec(in); err != nil {
293 if interceptor == nil {
294 return srv.(OnlinePredictionServiceServer).Predict(ctx, in)
296 info := &grpc.UnaryServerInfo{
298 FullMethod: "/google.cloud.ml.v1beta1.OnlinePredictionService/Predict",
300 handler := func(ctx context.Context, req interface{}) (interface{}, error) {
301 return srv.(OnlinePredictionServiceServer).Predict(ctx, req.(*PredictRequest))
303 return interceptor(ctx, in, info, handler)
306 var _OnlinePredictionService_serviceDesc = grpc.ServiceDesc{
307 ServiceName: "google.cloud.ml.v1beta1.OnlinePredictionService",
308 HandlerType: (*OnlinePredictionServiceServer)(nil),
309 Methods: []grpc.MethodDesc{
311 MethodName: "Predict",
312 Handler: _OnlinePredictionService_Predict_Handler,
315 Streams: []grpc.StreamDesc{},
316 Metadata: "google/cloud/ml/v1beta1/prediction_service.proto",
319 func init() { proto.RegisterFile("google/cloud/ml/v1beta1/prediction_service.proto", fileDescriptor3) }
321 var fileDescriptor3 = []byte{
322 // 312 bytes of a gzipped FileDescriptorProto
323 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x91, 0x4d, 0x4a, 0x03, 0x31,
324 0x14, 0xc7, 0x49, 0x11, 0xb5, 0x11, 0x5c, 0x04, 0xb1, 0xb5, 0x08, 0x96, 0xba, 0xb0, 0x74, 0x91,
325 0xd8, 0xba, 0xb2, 0xe2, 0xa6, 0x2b, 0x77, 0x0e, 0x75, 0x21, 0xb8, 0x29, 0xe9, 0x4c, 0x48, 0x23,
326 0x99, 0xbc, 0x38, 0x93, 0x16, 0x8b, 0xb8, 0xf1, 0x0a, 0x3d, 0x9a, 0x57, 0xf0, 0x20, 0x92, 0x49,
327 0x28, 0xca, 0xe8, 0xee, 0x31, 0x6f, 0x7e, 0xef, 0xff, 0x11, 0x7c, 0x29, 0x01, 0xa4, 0x16, 0x2c,
328 0xd5, 0xb0, 0xcc, 0x58, 0xae, 0xd9, 0x6a, 0x38, 0x17, 0x8e, 0x0f, 0x99, 0x2d, 0x44, 0xa6, 0x52,
329 0xa7, 0xc0, 0xcc, 0x4a, 0x51, 0xac, 0x54, 0x2a, 0xa8, 0x2d, 0xc0, 0x01, 0x69, 0x05, 0x82, 0x56,
330 0x04, 0xcd, 0x35, 0x8d, 0x44, 0xe7, 0x34, 0x9e, 0xe2, 0x56, 0x31, 0x6e, 0x0c, 0x38, 0xee, 0xe9,
331 0x32, 0x60, 0x9d, 0x93, 0x1f, 0xdb, 0x85, 0x73, 0x76, 0x0e, 0xd9, 0x3a, 0xac, 0x7a, 0x8f, 0xf8,
332 0x30, 0x09, 0x6a, 0x53, 0xf1, 0xb2, 0x14, 0xa5, 0x23, 0x04, 0xef, 0x18, 0x9e, 0x8b, 0x36, 0xea,
333 0xa2, 0x7e, 0x73, 0x5a, 0xcd, 0x64, 0x88, 0x9b, 0x9e, 0x9b, 0x79, 0xb0, 0xdd, 0xe8, 0xa2, 0xfe,
334 0xc1, 0xe8, 0x88, 0x46, 0x2f, 0xdc, 0x2a, 0x7a, 0xe7, 0x9c, 0x9d, 0x40, 0xb6, 0x9e, 0xee, 0x2f,
335 0xe2, 0x34, 0xda, 0x20, 0xdc, 0xba, 0x37,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