Skip to content

Commit 807a13b

Browse files
committed
[hotfix] Fix argument name mismatch in PythonVectorStore. (#635)
(cherry picked from commit 13d543e)
1 parent f36f85b commit 807a13b

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

api/src/main/java/org/apache/flink/agents/api/vectorstores/python/PythonVectorStore.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public List<String> add(
8080
kwargs.put("documents", pythonDocuments);
8181

8282
if (collection != null) {
83-
kwargs.put("collection", collection);
83+
kwargs.put("collection_name", collection);
8484
}
8585

8686
return (List<String>) adapter.callMethod(vectorStore, "add", kwargs);
@@ -109,7 +109,7 @@ public List<Document> get(
109109
kwargs.put("ids", ids);
110110
}
111111
if (collection != null) {
112-
kwargs.put("collection", collection);
112+
kwargs.put("collection_name", collection);
113113
}
114114

115115
Object pythonDocuments = adapter.callMethod(vectorStore, "get", kwargs);
@@ -126,7 +126,7 @@ public void delete(
126126
kwargs.put("ids", ids);
127127
}
128128
if (collection != null) {
129-
kwargs.put("collection", collection);
129+
kwargs.put("collection_name", collection);
130130
}
131131
adapter.callMethod(vectorStore, "delete", kwargs);
132132
}

api/src/test/java/org/apache/flink/agents/api/vectorstores/python/PythonCollectionManageableVectorStoreTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ void testAddDocuments() throws Exception {
261261
argThat(
262262
kwargs -> {
263263
assertThat(kwargs).containsKey("documents");
264-
assertThat(kwargs).containsKey("collection");
264+
assertThat(kwargs).containsKey("collection_name");
265265
assertThat(kwargs).containsKey("batch_size");
266266
return true;
267267
}));
@@ -294,7 +294,7 @@ void testGetDocuments() throws Exception {
294294
argThat(
295295
kwargs -> {
296296
assertThat(kwargs).containsKey("ids");
297-
assertThat(kwargs).containsKey("collection");
297+
assertThat(kwargs).containsKey("collection_name");
298298
return true;
299299
}));
300300
}
@@ -317,7 +317,7 @@ void testDeleteDocuments() throws Exception {
317317
argThat(
318318
kwargs -> {
319319
assertThat(kwargs).containsKey("ids");
320-
assertThat(kwargs).containsKey("collection");
320+
assertThat(kwargs).containsKey("collection_name");
321321
return true;
322322
}));
323323
}

0 commit comments

Comments
 (0)