Skip to content

Commit

Permalink
fixed qdrant filename typo and removed info procs from docs
Browse files Browse the repository at this point in the history
  • Loading branch information
vga91 committed May 27, 2024
1 parent d075a24 commit fb04bf8
Show file tree
Hide file tree
Showing 11 changed files with 1 addition and 97 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ note that the list and the signature procedures are consistent with the others,
| apoc.vectordb.chroma.queryAndUpdate(hostOrKey, collection, vector, filter, limit, $config) |
Retrieve closest vectors from the defined `vector`, `limit` of results, in the collection with the name specified in the 2nd parameter, and optionally creates/updates neo4j entities.
The default endpoint is `<hostOrKey param>/api/v1/collections/<collection param>/query`.
| apoc.vectordb.chroma.info(keyConfig) | Given the `keyConfig` returns the current configuration, created with the `apoc.vectordb.configure('CHROMA', keyConfig, ...)`
|===

where the 1st parameter can be a key defined by the apoc config `apoc.chroma.<key>.host=myHost`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Besides the above config, the `apoc.vectordb.<type>.get` and the `apoc.vectordb.

See the following pages for more details on specific vector db procedures

- xref:./qdrand.adoc[Qdrant]
- xref:./qdrant.adoc[Qdrant]
- xref:./chroma.adoc[ChromaDB]
- xref:./weaviate.adoc[Weaviate]

Expand Down Expand Up @@ -106,32 +106,3 @@ CALL apoc.vectordb.qdrant.query($host, 'test_collection', [0.2, 0.1, 0.9, 0.7],
})
----

We can get the current configuration by executing the following procedure:

[source,cypher]
----
CALL apoc.vectordb.qdrant.info('qdrant-config-test')
----

.Example results
[opts="header"]
|===
| value
| {endpoint: '',
headers: {Authorization: 'Bearer <apiKey>'},
mapping: {embeddingKey: "vect", nodeLabel: "Test", entityKey: "myId", metadataKey: "foo"}
}
|===


which, in case of configuration key not found, just returns the baseUrl, for example:
[source,cypher]
----
CALL apoc.vectordb.qdrant.info('qdrant-config-test')
----
.Example results
[opts="header"]
|===
| value
| {endpoint: 'http://qdrant-config-test:6333'}
|===
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ note that the list and the signature procedures are consistent with the others,
| apoc.vectordb.qdrant.queryAndUpdate(hostOrKey, collection, vector, filter, limit, $config) |
Retrieve closest vectors from the defined `vector`, `limit` of results, in the collection with the name specified in the 2nd parameter, and optionally creates/updates neo4j entities.
The default endpoint is `<hostOrKey param>/collections/<collection param>/points/search`.
| apoc.vectordb.qdrant.info(keyConfig) | Given the `keyConfig` returns the current configuration, created with the `apoc.vectordb.configure('QDRANT', keyConfig, ...)`
|===

where the 1st parameter can be a key defined by the apoc config `apoc.qdrant.<key>.host=myHost`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ note that the list and the signature procedures are consistent with the others,
Retrieve closest vectors from the defined `vector`, `limit` of results, in the collection with the name specified in the 2nd parameter, and optionally creates/updates neo4j entities.
Note that, besides the common config parameters, this procedure requires a `field: [listOfProperty]` config, to define which properties are to be retrieved from GraphQL running under-the-hood.
The default endpoint is `<hostOrKey param>/graphql`.
| apoc.vectordb.weaviate.info(keyConfig) | Given the `keyConfig` returns the current configuration, created with the `apoc.vectordb.configure('WEAVIATE', keyConfig, ...)`
|===

where the 1st parameter can be a key defined by the apoc config `apoc.weaviate.<key>.host=myHost`.
Expand Down
19 changes: 0 additions & 19 deletions extended-it/src/test/java/apoc/vectordb/ChromaDbTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -416,24 +416,5 @@ public void queryVectorsWithSystemDbStorage() {
});

assertNodesCreated(db);

// -- info procedure
testCall(db, "CALL apoc.vectordb.chroma.info($keyConfig)",
Util.map("keyConfig", keyConfig),
r -> {
Map value = (Map) r.get("value");
assertNull(value.get("headers"));
assertEquals(baseUrl, value.get("baseUrl"));
assertEquals(mapping, value.get("mapping"));
});
}

@Test
public void emptyInfoProcedure() {
testCall(db, "CALL apoc.vectordb.chroma.info('baseUrl')",
r -> {
Map value = (Map) r.get("value");
assertEquals("http://baseUrl:8000", value.get("baseUrl"));
});
}
}
10 changes: 0 additions & 10 deletions extended-it/src/test/java/apoc/vectordb/QdrantTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -455,16 +455,6 @@ public void queryVectorsWithSystemDbStorage() {
});

assertNodesCreated(db);

// -- info procedure
testCall(db, "CALL apoc.vectordb.qdrant.info($keyConfig)",
Util.map("keyConfig", keyConfig),
r -> {
Map value = (Map) r.get("value");
assertEquals(Util.map("Authorization", "Bearer " + ADMIN_KEY), value.get("headers"));
assertEquals(baseUrl, value.get("baseUrl"));
assertEquals(mapping, value.get("mapping"));
});
}

@Test
Expand Down
10 changes: 0 additions & 10 deletions extended-it/src/test/java/apoc/vectordb/WeaviateTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -485,16 +485,6 @@ public void queryVectorsWithSystemDbStorage() {
});

assertNodesCreated(db);

// -- info procedure
testCall(db, "CALL apoc.vectordb.weaviate.info($keyConfig)",
map("keyConfig", keyConfig),
r -> {
Map value = (Map) r.get("value");
assertEquals(map("Authorization", "Bearer jane-secret-key"), value.get("headers"));
assertEquals(baseUrl, value.get("baseUrl"));
assertEquals(mapping, value.get("mapping"));
});
}

@Test
Expand Down
6 changes: 0 additions & 6 deletions extended/src/main/java/apoc/vectordb/ChromaDb.java
Original file line number Diff line number Diff line change
Expand Up @@ -189,12 +189,6 @@ private Stream<EmbeddingResult> queryCommon(String hostOrKey, String collection,
v -> listOfListsToMap((Map) v).stream());
}

@Procedure(value = "apoc.vectordb.chroma.info", mode = Mode.WRITE)
@Description("apoc.vectordb.chroma.info(keyConfig) - Given the `keyConfig` returns the current configuration, created with the `apoc.vectordb.configure('CHROMA', keyConfig, ...)`")
public Stream<MapResult> info(@Name("keyConfig") String keyConfig) throws Exception {
return getInfoProcCommon(keyConfig, DB_HANDLER);
}

private Map<String, Object> getVectorDbInfo(String hostOrKey, String collection, Map<String, Object> configuration, String templateUrl) {
return getCommonVectorDbInfo(hostOrKey, collection, configuration, templateUrl, DB_HANDLER);
}
Expand Down
6 changes: 0 additions & 6 deletions extended/src/main/java/apoc/vectordb/Qdrant.java
Original file line number Diff line number Diff line change
Expand Up @@ -189,12 +189,6 @@ private Stream<EmbeddingResult> queryCommon(String hostOrKey, String collection,
return getEmbeddingResultStream(apiConfig, procedureCallContext, urlAccessChecker, tx);
}

@Procedure(value = "apoc.vectordb.qdrant.info", mode = Mode.WRITE)
@Description("apoc.vectordb.qdrant.info(keyConfig) - Given the `keyConfig` returns the current configuration, created with the `apoc.vectordb.configure('QDRANT', keyConfig, ...)`")
public Stream<MapResult> info(@Name("keyConfig") String keyConfig) throws Exception {
return getInfoProcCommon(keyConfig, DB_HANDLER);
}

private Map<String, Object> getVectorDbInfo(
String hostOrKey, String collection, Map<String, Object> configuration, String templateUrl) {
return getCommonVectorDbInfo(hostOrKey, collection, configuration, templateUrl, DB_HANDLER);
Expand Down
7 changes: 0 additions & 7 deletions extended/src/main/java/apoc/vectordb/VectorDbUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,6 @@ public static Map<String, Object> getCommonVectorDbInfo(

return config;
}

public static Stream<MapResult> getInfoProcCommon(String hostOrKey, VectorDbHandler handler) {
Map<String, Object> info = getCommonVectorDbInfo(hostOrKey, "", Map.of(), "%s", handler);
// endpoint is equivalent to baseUrl config
info.remove("endpoint");
return Stream.of(new MapResult(info));
}

private static String getUrl(String hostOrKey, VectorDbHandler handler, Map<String, Object> props) {
if (props.isEmpty()) {
Expand Down
6 changes: 0 additions & 6 deletions extended/src/main/java/apoc/vectordb/Weaviate.java
Original file line number Diff line number Diff line change
Expand Up @@ -243,12 +243,6 @@ private Stream<EmbeddingResult> queryCommon(String hostOrKey, String collection,
);
}

@Procedure(value = "apoc.vectordb.weaviate.info", mode = Mode.WRITE)
@Description("apoc.vectordb.weaviate.info(keyConfig) - Given the `keyConfig` returns the current configuration, created with the `apoc.vectordb.configure('WEAVIATE', keyConfig, ...)`")
public Stream<MapResult> info(@Name("keyConfig") String keyConfig) throws Exception {
return getInfoProcCommon(keyConfig, DB_HANDLER);
}


private Map<String, Object> getVectorDbInfo(String hostOrKey, String collection, Map<String, Object> configuration, String templateUrl) {
return getCommonVectorDbInfo(hostOrKey, collection, configuration, templateUrl, DB_HANDLER);
Expand Down

0 comments on commit fb04bf8

Please sign in to comment.