Skip to content

Commit bfc679e

Browse files
Jesse SJesse Schumacher
andauthored
Vec 229 aerospike 1.0 (#2)
* feat: Update aerospike-vector-search client to 1.0.0 * fix: Remove unsupported options from ini_options * rename metadatas to labels --------- Co-authored-by: Jesse Schumacher <[email protected]>
1 parent df78608 commit bfc679e

File tree

7 files changed

+26
-26
lines changed

7 files changed

+26
-26
lines changed

docs/docs/integrations/vectorstores/aerospike.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
},
5252
"outputs": [],
5353
"source": [
54-
"!pip install --upgrade --quiet aerospike-vector-search==0.6.1 langchain-community sentence-transformers langchain"
54+
"!pip install --upgrade --quiet aerospike-vector-search==1.0.0 langchain-community sentence-transformers langchain"
5555
]
5656
},
5757
{
@@ -401,7 +401,7 @@
401401
" vector_field=VECTOR_KEY,\n",
402402
" vector_distance_metric=MODEL_DISTANCE_CALC,\n",
403403
" dimensions=MODEL_DIM,\n",
404-
" index_meta_data={\n",
404+
" index_labels={\n",
405405
" \"model\": \"miniLM-L6-v2\",\n",
406406
" \"date\": \"05/04/2024\",\n",
407407
" \"dim\": str(MODEL_DIM),\n",

libs/community/langchain_community/vectorstores/aerospike.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ def convert_distance_strategy(
155155
def add_texts(
156156
self,
157157
texts: Iterable[str],
158-
metadatas: Optional[List[dict]] = None,
158+
labels: Optional[List[dict[str, str]]] = None,
159159
ids: Optional[List[str]] = None,
160160
set_name: Optional[str] = None,
161161
embedding_chunk_size: int = 1000,
@@ -168,7 +168,7 @@ def add_texts(
168168
169169
Args:
170170
texts: Iterable of strings to add to the vectorstore.
171-
metadatas: Optional list of metadatas associated with the texts.
171+
labels: Optional list of labels associated with the texts.
172172
ids: Optional list of ids to associate with the texts.
173173
set_name: Optional aerospike set name to add the texts to.
174174
batch_size: Batch size to use when adding the texts to the vectorstore.
@@ -197,24 +197,24 @@ def add_texts(
197197
ids = ids or [str(uuid.uuid4()) for _ in texts]
198198

199199
# We need to shallow copy so that we can add the vector and text keys
200-
if metadatas:
201-
metadatas = [m.copy() for m in metadatas]
200+
if labels:
201+
labels = [m.copy() for m in labels]
202202
else:
203-
metadatas = metadatas or [{} for _ in texts]
203+
labels = labels or [{} for _ in texts]
204204

205205
for i in range(0, len(texts), embedding_chunk_size):
206206
chunk_texts = texts[i : i + embedding_chunk_size]
207207
chunk_ids = ids[i : i + embedding_chunk_size]
208-
chunk_metadatas = metadatas[i : i + embedding_chunk_size]
208+
chunk_labels = labels[i : i + embedding_chunk_size]
209209
embeddings = self._embed_documents(chunk_texts)
210210

211211
for metadata, embedding, text in zip(
212-
chunk_metadatas, embeddings, chunk_texts
212+
chunk_labels, embeddings, chunk_texts
213213
):
214214
metadata[self._vector_key] = embedding
215215
metadata[self._text_key] = text
216216

217-
for id, metadata in zip(chunk_ids, chunk_metadatas):
217+
for id, metadata in zip(chunk_ids, chunk_labels):
218218
metadata[self._id_key] = id
219219
self._client.upsert(
220220
namespace=self._namespace,
@@ -545,7 +545,7 @@ def from_texts(
545545
cls,
546546
texts: List[str],
547547
embedding: Embeddings,
548-
metadatas: Optional[List[dict]] = None,
548+
labels: Optional[List[dict]] = None,
549549
client: Client = None,
550550
namespace: str = "test",
551551
index_name: Optional[str] = None,
@@ -589,7 +589,7 @@ def from_texts(
589589

590590
aerospike.add_texts(
591591
texts,
592-
metadatas=metadatas,
592+
labels=labels,
593593
ids=ids,
594594
index_name=index_name,
595595
embedding_chunk_size=embeddings_chunk_size,

libs/community/pyproject.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,8 @@ select = [ "E", "F", "I", "T201",]
5454
omit = [ "tests/*",]
5555

5656
[tool.pytest.ini_options]
57-
addopts = "--strict-markers --strict-config --durations=5 --snapshot-warn-unused -vv"
57+
addopts = "--strict-markers --strict-config --durations=5 -vv"
5858
markers = [ "requires: mark tests as requiring a specific library", "scheduled: mark tests to run in scheduled testing", "compile: mark placeholder test used to compile integration tests without running them",]
59-
asyncio_mode = "auto"
6059

6160
[tool.poetry.group.test]
6261
optional = true
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
features.conf
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,11 @@ cluster:
66
# The Proximus service listening ports, TLS and network interface.
77
service:
88
ports:
9-
5002: {}
10-
# Uncomment for local debugging
11-
advertised-listeners:
12-
default:
13-
address: 127.0.0.1
14-
port: 5002
9+
5002:
10+
advertised-listeners:
11+
default:
12+
address: 127.0.0.1
13+
port: 5002
1514

1615
# Management API listening ports, TLS and network interface.
1716
manage:
@@ -24,13 +23,14 @@ interconnect:
2423
5001: {}
2524

2625
# Target Aerospike cluster
27-
aerospike:
26+
storage:
2827
seeds:
2928
- aerospike:
3029
port: 3000
3130

3231
# The logging properties.
3332
logging:
3433
enable-console-logging: true
34+
file: "/etc/aerospike-vector-search/avs.log"
3535
levels:
36-
metrics-ticker: off
36+
metrics-ticker: info

libs/community/tests/integration_tests/vectorstores/docker-compose/aerospike/aerospike.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ namespace test {
5151
}
5252
}
5353

54-
namespace proximus-meta {
54+
namespace avs-meta {
5555
replication-factor 1
5656
nsup-period 100
5757

libs/community/tests/integration_tests/vectorstores/docker-compose/aerospike/docker-compose.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ services:
1010
command:
1111
- "--config-file"
1212
- "/opt/aerospike/etc/aerospike/aerospike.conf"
13-
proximus:
14-
image: aerospike/aerospike-proximus:0.4.0
13+
avs:
14+
image: aerospike/aerospike-vector-search:0.9.0
1515
ports:
1616
- "5002:5002"
1717
networks:
1818
- aerospike-test
1919
volumes:
20-
- .:/etc/aerospike-proximus
20+
- .:/etc/aerospike-vector-search
2121

2222
networks:
2323
aerospike-test: {}

0 commit comments

Comments
 (0)