Skip to content

Commit

Permalink
community[patch]: overriding similaritySearchWithScore in neo4j vecto…
Browse files Browse the repository at this point in the history
…r store to enable filtering (#5599)

* overriding similaritySearchWithScore

* Format

* Fix build

---------

Co-authored-by: jacoblee93 <[email protected]>
  • Loading branch information
AumeshMisra and jacoblee93 authored May 31, 2024
1 parent 6371927 commit a32586f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions libs/langchain-community/src/vectorstores/neo4j_vector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -637,6 +637,15 @@ export class Neo4jVectorStore extends VectorStore {
return results.map((result) => result[0]);
}

async similaritySearchWithScore(
query: string,
k = 4,
params: Record<string, any> = {}

Check warning on line 643 in libs/langchain-community/src/vectorstores/neo4j_vector.ts

View workflow job for this annotation

GitHub Actions / Check linting

Unexpected any. Specify a different type
): Promise<[Document, number][]> {
const embedding = await this.embeddings.embedQuery(query);
return this.similaritySearchVectorWithScore(embedding, k, query, params);
}

async similaritySearchVectorWithScore(
vector: number[],
k: number,
Expand Down

0 comments on commit a32586f

Please sign in to comment.