-
Notifications
You must be signed in to change notification settings - Fork 160
/
modelresponse.proto
94 lines (81 loc) · 2.56 KB
/
modelresponse.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
// Copyright 2015 gRPC authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
syntax = "proto3";
/*option java_multiple_files = true;
option java_package = "io.grpc.examples.helloworld";
option java_outer_classname = "HelloWorldProto";
option objc_class_prefix = "HLW";*/
package modelresponse;
service ModelResponse {
rpc GeneratorReply (MultiStringRequest) returns (MultiStringReply) {}
rpc ClassificationReply (SingleStringRequest) returns (SingleStringReply) {}
rpc QuestionAndAnswerReply(QARequest) returns (SingleStringReply) {}
rpc FillMaskReply(SingleStringRequest) returns (SingleStringReply) {}
rpc TokenClassificationReply(SingleStringRequest) returns (SingleStringReply) {}
rpc ConversationalReply(ConversationRequest) returns (ConversationReply) {}
rpc Txt2ImgReply(MultiStringRequest) returns (ImageReply) {}
}
message Value {
oneof oneof_values {
string svalue = 1;
int64 ivalue = 2;
float fvalue = 3;
bool bvalue = 4;
}
}
message SingleStringRequest {
string request = 1;
map<string,Value> query_kwargs = 2;
}
message MultiStringRequest {
repeated string request = 1;
map<string,Value> query_kwargs = 2;
}
message SingleStringReply {
string response = 1;
float time_taken = 2;
float model_time_taken = 3;
}
message MultiStringReply {
repeated string response = 1;
float time_taken = 2;
float model_time_taken = 3;
}
message QARequest {
string question = 1;
string context = 2;
map<string,Value> query_kwargs = 3;
}
message ConversationRequest {
string text = 1;
optional int64 conversation_id = 2;
repeated string past_user_inputs = 3;
repeated string generated_responses = 4;
map<string,Value> query_kwargs = 5;
}
message ConversationReply {
int64 conversation_id = 1;
repeated string past_user_inputs = 2;
repeated string generated_responses = 3;
float time_taken = 4;
float model_time_taken = 5;
}
message ImageReply {
repeated bytes images = 1;
repeated bool nsfw_content_detected = 2;
string mode = 3;
int64 size_w = 4;
int64 size_h = 5;
float time_taken = 6;
}