examples + fmt

This commit is contained in:
Alex Garcia 2024-07-31 12:55:20 -07:00
parent 356f75cca7
commit dd972f6ffe
16 changed files with 1064 additions and 25 deletions

View file

@ -23,7 +23,7 @@ const query = [0.3, 0.3, 0.3, 0.3];
db.exec("CREATE VIRTUAL TABLE vec_items USING vec0(embedding float[4])");
const insertStmt = db.prepare(
"INSERT INTO vec_items(rowid, embedding) VALUES (?, ?)"
"INSERT INTO vec_items(rowid, embedding) VALUES (?, ?)",
);
const insertVectors = db.transaction((items) => {
@ -44,7 +44,7 @@ const rows = db
WHERE embedding MATCH ?
ORDER BY distance
LIMIT 5
`
`,
)
.all([new Uint8Array(new Float32Array(query).buffer)]);