Skip to content

Commit 1a6586f

Browse files
committed
Add README
1 parent fc96775 commit 1a6586f

File tree

3 files changed

+32
-4
lines changed

3 files changed

+32
-4
lines changed

crates/grpc_server/.sample.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ GRPC_SERVER_DIMENSION=3 // required
33

44
GRPC_SERVER_HOST=localhost // defaults to 127.0.0.1 aka localhost
55
GRPC_SERVER_PORT=8080 // defaults to 8080
6-
GRPC_SERVER_STORAGE_TYPE=inmemory // (inmemory/rocksdb) defaults to inmemory
6+
GRPC_SERVER_STORAGE_TYPE=inmemory // (inmemory/rocksdb) defaults to 'inmemory'
77
GRPC_SERVER_INDEX_TYPE=flat // defaults to flat
88
GRPC_SERVER_DATA_PATH=data // defaults to a temporary directory
99
GRPC_SERVER_LOGGING=true // defaults to true

crates/grpc_server/README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
### Build
2+
3+
Clone the repository and run `cargo build --bin grpc_server` to build the binary of the gRPC server crate.
4+
5+
You can than then start the gRPC server by running:
6+
7+
```bash
8+
cargo run --bin grpc_server
9+
```
10+
11+
### Configuration
12+
13+
Use the [.sample.env](.sample.env) shown below as a reference to set your environment variables in a `.env` file.
14+
15+
```bash
16+
GRPC_SERVER_ROOT_PASSWORD=123 // required
17+
GRPC_SERVER_DIMENSION=3 // required
18+
19+
GRPC_SERVER_HOST=localhost // defaults to 127.0.0.1 aka localhost
20+
GRPC_SERVER_PORT=8080 // defaults to 8080
21+
GRPC_SERVER_STORAGE_TYPE=inmemory // (inmemory/rocksdb) defaults to inmemory
22+
GRPC_SERVER_INDEX_TYPE=flat // defaults to flat
23+
GRPC_SERVER_DATA_PATH=data // defaults to a temporary directory
24+
GRPC_SERVER_LOGGING=true // defaults to true
25+
26+
```
27+
28+
29+
### Testing
30+
31+
The [vector-db.proto](proto/vector-db.proto) can be imported into any gRPC client.

crates/grpc_server/src/main.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ impl VectorDb for VectorDBService {
7171

7272
let point = point_opt.unwrap();
7373

74-
// TODO: handle payload properly once we decide to define it
7574
Ok(Response::new(Point {
7675
id: Some(PointId { id: point.id }),
7776
vector: Some(DenseVector {
@@ -89,8 +88,6 @@ impl VectorDb for VectorDBService {
8988

9089
let search_request = request.into_inner();
9190

92-
//TODO: distance function panics if different dimensions; no dimension enforcement
93-
9491
// extract request arguments
9592
let query_vect = search_request.query_vector.unwrap();
9693
let similarity = SIMILARITY_PROTOBUFF_MAP[search_request.similarity as usize];

0 commit comments

Comments
 (0)