File size: 1,129 Bytes
eea5056
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
syntax = "proto3";  // 使用Protobuf版本3

package runtime.aot.machine_learning.parents.gpt;

service GPTInferenceService {
    rpc Predict (Request) returns (Response);
    rpc PredictWithStream (Request) returns (stream Response);
}

// Global
message Message {
  uint64 role = 1;  // 值 0 为 system,1 为普通,回复中只有 1
  string message = 2;
}

// Requests
message Request {
  string models = 1; // 模型名称
  repeated Message messages = 2; // 消息列表
  double temperature = 3;  // 采样温度
  double top_p = 4;  // 核心采样
}

// Response
message Response {
  uint64 response_code = 2; // 返回状态码,200,439 等,204 为终止
  optional Body body = 4;
}

message Body{
  string id = 1; // eg.chatcmpl-ANcM3OsoLf6AXJpO76pDoW7Ry68oc
  string object = 2; // eg. chat.completion
  uint64 time = 3; // UNIX时间戳
  MessageWarpper message_warpper = 4;
  Unknown unknown = 5;
}

message MessageWarpper {
  int64 arg1 = 1; // 也许是常量1
  Message message = 2; // 回应的消息 wt u need
}

message Unknown {
  // 都不知道
  int64 arg1 = 1;
  int64 arg2 = 2;
  int64 arg3 = 3;
}