Skip to content

Commit

Permalink
Merge pull request #65 from getzep/version-bump
Browse files Browse the repository at this point in the history
chore: Bump version + Remove embedding search from documents example
  • Loading branch information
paul-paliychuk authored Apr 29, 2024
2 parents 22e5338 + 53b7962 commit 6bf1f45
Showing 1 changed file with 1 addition and 22 deletions.
23 changes: 1 addition & 22 deletions examples/documents/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,26 +184,6 @@ async function main() {
);
printResults(mmrSearchResults);

// Search by embedding
const interestingDocument = searchResults[0];
console.log(
`Searching for documents similar to:\n${interestingDocument.content}\n`,
);
if (!interestingDocument.embedding) {
throw new Error("No embedding found for document");
}
const vectorToSearch = new Float32Array(interestingDocument.embedding);
const embeddingSearchResults = await collection.search(
{
embedding: vectorToSearch,
},
3,
);
console.log(
`Found ${embeddingSearchResults.length} documents matching embedding`,
);
printResults(embeddingSearchResults);

// Search for documents using both text and metadata
const metadataQuery = {
where: { jsonpath: '$[*] ? (@.bar == "qux")' },
Expand All @@ -230,10 +210,9 @@ async function main() {
},
3,
);
console.log("Returned array length:", embeddingSearchResults.length);

// Delete a document
const documentToDelete = embeddingSearchResults[0].uuid;
const documentToDelete = searchResults[0].uuid;
if (!documentToDelete) {
throw new Error("No document to delete");
}
Expand Down

0 comments on commit 6bf1f45

Please sign in to comment.