prediction_service.proto 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. // Copyright 2021 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. syntax = "proto3";
  15. package google.cloud.aiplatform.v1;
  16. import "google/api/annotations.proto";
  17. import "google/api/client.proto";
  18. import "google/api/field_behavior.proto";
  19. import "google/api/httpbody.proto";
  20. import "google/api/resource.proto";
  21. import "google/protobuf/struct.proto";
  22. option csharp_namespace = "Google.Cloud.AIPlatform.V1";
  23. option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform";
  24. option java_multiple_files = true;
  25. option java_outer_classname = "PredictionServiceProto";
  26. option java_package = "com.google.cloud.aiplatform.v1";
  27. option php_namespace = "Google\\Cloud\\AIPlatform\\V1";
  28. option ruby_package = "Google::Cloud::AIPlatform::V1";
  29. // A service for online predictions and explanations.
  30. service PredictionService {
  31. option (google.api.default_host) = "aiplatform.googleapis.com";
  32. option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform";
  33. // Perform an online prediction.
  34. rpc Predict(PredictRequest) returns (PredictResponse) {
  35. option (google.api.http) = {
  36. post: "/v1/{endpoint=projects/*/locations/*/endpoints/*}:predict"
  37. body: "*"
  38. };
  39. option (google.api.method_signature) = "endpoint,instances,parameters";
  40. }
  41. }
  42. // Request message for [PredictionService.Predict][google.cloud.aiplatform.v1.PredictionService.Predict].
  43. message PredictRequest {
  44. // Required. The name of the Endpoint requested to serve the prediction.
  45. // Format:
  46. // `projects/{project}/locations/{location}/endpoints/{endpoint}`
  47. string endpoint = 1 [
  48. (google.api.field_behavior) = REQUIRED,
  49. (google.api.resource_reference) = {
  50. type: "aiplatform.googleapis.com/Endpoint"
  51. }
  52. ];
  53. // Required. The instances that are the input to the prediction call.
  54. // A DeployedModel may have an upper limit on the number of instances it
  55. // supports per request, and when it is exceeded the prediction call errors
  56. // in case of AutoML Models, or, in case of customer created Models, the
  57. // behaviour is as documented by that Model.
  58. // The schema of any single instance may be specified via Endpoint's
  59. // DeployedModels' [Model's][google.cloud.aiplatform.v1.DeployedModel.model]
  60. // [PredictSchemata's][google.cloud.aiplatform.v1.Model.predict_schemata]
  61. // [instance_schema_uri][google.cloud.aiplatform.v1.PredictSchemata.instance_schema_uri].
  62. repeated google.protobuf.Value instances = 2 [(google.api.field_behavior) = REQUIRED];
  63. // The parameters that govern the prediction. The schema of the parameters may
  64. // be specified via Endpoint's DeployedModels' [Model's ][google.cloud.aiplatform.v1.DeployedModel.model]
  65. // [PredictSchemata's][google.cloud.aiplatform.v1.Model.predict_schemata]
  66. // [parameters_schema_uri][google.cloud.aiplatform.v1.PredictSchemata.parameters_schema_uri].
  67. google.protobuf.Value parameters = 3;
  68. }
  69. // Response message for [PredictionService.Predict][google.cloud.aiplatform.v1.PredictionService.Predict].
  70. message PredictResponse {
  71. // The predictions that are the output of the predictions call.
  72. // The schema of any single prediction may be specified via Endpoint's
  73. // DeployedModels' [Model's ][google.cloud.aiplatform.v1.DeployedModel.model]
  74. // [PredictSchemata's][google.cloud.aiplatform.v1.Model.predict_schemata]
  75. // [prediction_schema_uri][google.cloud.aiplatform.v1.PredictSchemata.prediction_schema_uri].
  76. repeated google.protobuf.Value predictions = 1;
  77. // ID of the Endpoint's DeployedModel that served this prediction.
  78. string deployed_model_id = 2;
  79. }