Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,22 @@ jobs:
- name: build
run: docker build -t ember:ci .

go-client:
name: go client
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.22'
cache-dependency-path: clients/ember-go/go.sum
- name: build
working-directory: clients/ember-go
run: go build ./...
- name: test
working-directory: clients/ember-go
run: go test ./...

security:
name: security
runs-on: ubuntu-latest
Expand Down
8 changes: 6 additions & 2 deletions clients/ember-py/ember/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,12 +289,14 @@ def vadd(
"euclidean": ember_pb2.VECTOR_METRIC_EUCLIDEAN,
"ip": ember_pb2.VECTOR_METRIC_INNER_PRODUCT,
}
if metric not in metric_map:
raise ValueError(f"unknown metric {metric!r}; expected one of: cosine, euclidean, ip")
resp = self._stub.VAdd(
ember_pb2.VAddRequest(
key=key,
element=element,
vector=vector,
metric=metric_map.get(metric, ember_pb2.VECTOR_METRIC_COSINE),
metric=metric_map[metric],
connectivity=m,
ef_construction=ef,
),
Expand All @@ -320,6 +322,8 @@ def vadd_batch(
"euclidean": ember_pb2.VECTOR_METRIC_EUCLIDEAN,
"ip": ember_pb2.VECTOR_METRIC_INNER_PRODUCT,
}
if metric not in metric_map:
raise ValueError(f"unknown metric {metric!r}; expected one of: cosine, euclidean, ip")
batch_entries = [
ember_pb2.VAddBatchEntry(element=elem, vector=vec)
for elem, vec in entries
Expand All @@ -328,7 +332,7 @@ def vadd_batch(
ember_pb2.VAddBatchRequest(
key=key,
entries=batch_entries,
metric=metric_map.get(metric, ember_pb2.VECTOR_METRIC_COSINE),
metric=metric_map[metric],
connectivity=m,
ef_construction=ef,
),
Expand Down
Loading