-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathfeature.proto
98 lines (78 loc) · 1.61 KB
/
feature.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
95
96
97
98
syntax = "proto3";
option go_package = "github.com/crumbjp/faissdb/server/feature";
package feature;
service Feature {
rpc Status (StatusRequest) returns (StatusReply) {}
rpc Set (SetRequest) returns (SetReply) {}
rpc Del (DelRequest) returns (DelReply) {}
rpc Search (SearchRequest) returns (SearchReply) {}
rpc Train (TrainRequest) returns (TrainReply) {}
rpc Dropall (DropallRequest) returns (DropallReply) {}
rpc DbStats (DbStatsRequest) returns (DbStatsReply) {}
}
message StatusRequest {
}
message StatusReply {
int32 id = 1;
int32 status = 2;
int32 role = 3;
}
message Data {
string key = 1;
repeated double v = 2;
string sparsev = 3;
repeated string collections = 4;
}
message SetRequest {
repeated Data data = 1;
}
message SetReply {
int32 nstored = 1;
int32 nerror = 2;
}
message DelRequest {
repeated string key = 1;
}
message DelReply {
}
message SearchRequest {
int32 n = 1;
repeated double v = 2;
string sparsev = 3;
string collection = 4;
}
message SearchReply {
repeated double distances = 1;
repeated string keys = 2;
}
message TrainRequest {
double proportion = 1;
bool force = 2;
}
message TrainReply {
}
message DropallRequest {
}
message DropallReply {
}
message DbStatsRequest {
}
message DbData {
string collection = 1;
int32 ntotal = 2;
}
message FaissConfig {
string description = 1;
string metric = 2;
int32 nprobe = 3;
int32 dimension = 4;
int32 syncinterval = 5;
}
message DbStatsReply {
bool istrained = 1;
FaissConfig faissconfig = 2;
string lastsynced = 3;
string lastkey = 4;
int32 status = 5;
repeated DbData dbs = 6;
}