-
Notifications
You must be signed in to change notification settings - Fork 5
/
faiss.proto
75 lines (60 loc) · 1.48 KB
/
faiss.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
syntax = "proto3";
package faiss_index;
// Service Definition
service Server {
rpc Add (AddRequest) returns (SimpleResponse) {}
rpc Remove (IdRequest) returns (SimpleResponse) {}
rpc Search (SearchRequest) returns (SearchResponse) {}
rpc SearchByEmbedding (SearchByEmbeddingRequest) returns (SearchResponse) {}
rpc GetEmbedding (GetEmbeddingRequest) returns (EmbeddingResponse) {}
rpc Restore (RestoreRequest) returns (SimpleResponse) {}
rpc Reset (EmptyRequest) returns (SimpleResponse) {}
rpc Import (ImportRequest) returns (SimpleResponse) {}
rpc Total (EmptyRequest) returns (TotalResponse) {}
}
// Message Definition
message AddRequest {
int64 id = 1;
repeated float embedding = 2;
string key = 3;
}
message IdRequest {
int64 id = 1;
}
message SearchRequest {
int64 id = 1;
int32 count = 2;
string key = 3;
}
message SearchByEmbeddingRequest {
repeated float embedding = 1;
int32 count = 2;
}
message GetEmbeddingRequest {
int64 id = 1;
string key = 2;
}
message RestoreRequest {
string save_path = 1;
}
message ImportRequest {
string embs_path = 1;
string ids_path = 2;
string keys_path = 3;
}
message EmptyRequest {
}
message SimpleResponse {
string message = 1;
}
message SearchResponse {
repeated int64 ids = 1;
repeated float scores = 2;
repeated string keys = 3;
}
message EmbeddingResponse {
repeated float embedding = 1;
}
message TotalResponse {
int64 count = 1;
}