smgc commited on
Commit
eea5056
·
verified ·
1 Parent(s): cf64aff

Create protos/GPTInferenceService.proto

Browse files
Files changed (1) hide show
  1. protos/GPTInferenceService.proto +48 -0
protos/GPTInferenceService.proto ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ syntax = "proto3"; // 使用Protobuf版本3
2
+
3
+ package runtime.aot.machine_learning.parents.gpt;
4
+
5
+ service GPTInferenceService {
6
+ rpc Predict (Request) returns (Response);
7
+ rpc PredictWithStream (Request) returns (stream Response);
8
+ }
9
+
10
+ // Global
11
+ message Message {
12
+ uint64 role = 1; // 值 0 为 system,1 为普通,回复中只有 1
13
+ string message = 2;
14
+ }
15
+
16
+ // Requests
17
+ message Request {
18
+ string models = 1; // 模型名称
19
+ repeated Message messages = 2; // 消息列表
20
+ double temperature = 3; // 采样温度
21
+ double top_p = 4; // 核心采样
22
+ }
23
+
24
+ // Response
25
+ message Response {
26
+ uint64 response_code = 2; // 返回状态码,200,439 等,204 为终止
27
+ optional Body body = 4;
28
+ }
29
+
30
+ message Body{
31
+ string id = 1; // eg.chatcmpl-ANcM3OsoLf6AXJpO76pDoW7Ry68oc
32
+ string object = 2; // eg. chat.completion
33
+ uint64 time = 3; // UNIX时间戳
34
+ MessageWarpper message_warpper = 4;
35
+ Unknown unknown = 5;
36
+ }
37
+
38
+ message MessageWarpper {
39
+ int64 arg1 = 1; // 也许是常量1
40
+ Message message = 2; // 回应的消息 wt u need
41
+ }
42
+
43
+ message Unknown {
44
+ // 都不知道
45
+ int64 arg1 = 1;
46
+ int64 arg2 = 2;
47
+ int64 arg3 = 3;
48
+ }