Skip to content

Commit

Permalink
fix: udpate predict method for url/base64 (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
Phelan164 committed Feb 24, 2022
1 parent 9640542 commit 9bd38a3
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions model/model.proto
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ service Model {
rpc PredictModelByUpload (stream PredictModelRequest) returns (google.protobuf.Struct) {}

// This method handle request with file in body such as url/base64 encode
rpc PredictModel (PredictModelRequest) returns (google.protobuf.Struct) {
rpc PredictModel (PredictModelImageRequest) returns (google.protobuf.Struct) {
option (google.api.http) = {
post: "/models/{name}/outputs"
post: "/models/{name}/versions/{version}/outputs"
body: "*"
};
}
Expand Down Expand Up @@ -121,6 +121,22 @@ message PredictModelRequest {
bytes content = 3 [(google.api.field_behavior) = REQUIRED];
}

message ImageRequest {
// image url
string url = 1;
// base 64 byte array of image content
string base64 = 2;
}

message PredictModelImageRequest {
// model name
string name = 1 [(google.api.field_behavior) = REQUIRED];
// model version
int32 version = 2 [(google.api.field_behavior) = REQUIRED];
// image content request
repeated ImageRequest contents = 3 [(google.api.field_behavior) = REQUIRED];
}

message ListModelRequest {}

message ListModelResponse {
Expand Down

0 comments on commit 9bd38a3

Please sign in to comment.