-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchunks.proto
46 lines (40 loc) · 1.47 KB
/
chunks.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
syntax = "proto3";
package redactive.grpc.v1;
import "google/protobuf/struct.proto";
message SourceReference {
// Source system of the document e.g. confluence, slack, local_file_system
string system = 1;
// Version of the source system e.g. 1.0.0
string system_version = 2;
// Connection id to the source system e.g. confluence space id, slack channel id, local file hostname
string connection_id = 3;
// Document id in the source system e.g. confluence page id, slack message id, local file path
string document_id = 4;
// Document version in the source system e.g. confluence page version, slack message version, local file version hash
string document_version = 5;
}
message ChunkReference {
// Chunking version e.g. 1.0.0
string chunking_version = 1;
// chunk id is unique within the document, but not globally unique, it's actually the index of the chunk in the document
string chunk_id = 2;
// SHA256 hash of the chunk body
string chunk_hash = 3;
}
// A chunk is a part of a document
message RelevantChunk {
message Relevance {
// Simiarlity score of the chunk
float similarity_score = 1;
}
// Source reference of the document
SourceReference source = 1;
// Chunk reference of the chunk
ChunkReference chunk = 2;
// Relevance of the chunk
Relevance relevance = 3;
// Chunk body
string chunk_body = 4;
// Document metadata
google.protobuf.Struct document_metadata = 5;
}