Skip to content

Commit

Permalink
Updating Readme
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulKinlan committed Mar 27, 2023
1 parent 5093f8c commit 27cb810
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@

A simple IDB vector store.

```
<script type="module">
import { create, insert, query } from "./script.js";
```JavaScript
<script type="module">
import { create, insert, query } from "../index.js";

const path = { vectorPath: "embedding" };

await insert({ embedding: [1, 2, 3], "text": "ASDASINDASDASZd" }, "embedding");
await insert({ embedding: [2, 3, 4], "text": "GTFSDGRG" }, "embedding");
await insert({ embedding: [73, -213, 3], "text": "hYTRTERFR" }, "embedding");
await insert({ embedding: [1, 2, 3], "text": "ASDASINDASDASZd" }, path);
await insert({ embedding: [2, 3, 4], "text": "GTFSDGRG" }, path);
await insert({ embedding: [73, -213, 3], "text": "hYTRTERFR" }, path);

console.log(await query([1, 2, 3], "embedding", 20));
console.log(await query([1, 2, 3], { vectorPath: "embedding", limit: 20 } ));
</script>
```
```

0 comments on commit 27cb810

Please sign in to comment.