Skip to content

Commit 63261a6

Browse files
committed
chore: switch lancedb to use existsOk
1 parent 9ec30f4 commit 63261a6

35 files changed

Lines changed: 400 additions & 515 deletions

File tree

core/embedjs-interfaces/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"name": "@llm-tools/embedjs-interfaces",
3-
"version": "0.1.20",
3+
"version": "0.1.21",
44
"description": "Interfaces for extending the embedjs ecosystem",
55
"dependencies": {
6-
"@langchain/core": "^0.3.18",
6+
"@langchain/core": "^0.3.19",
77
"debug": "^4.3.7",
88
"md5": "^2.3.0",
99
"uuid": "^11.0.3"

core/embedjs-utils/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"name": "@llm-tools/embedjs-utils",
3-
"version": "0.1.20",
3+
"version": "0.1.21",
44
"description": "Useful util functions when extending the embedjs ecosystem",
55
"dependencies": {
6-
"@llm-tools/embedjs-interfaces": "0.1.20"
6+
"@llm-tools/embedjs-interfaces": "0.1.21"
77
},
88
"type": "module",
99
"main": "./src/index.js",

core/embedjs/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
22
"type": "module",
33
"name": "@llm-tools/embedjs",
4-
"version": "0.1.20",
4+
"version": "0.1.21",
55
"description": "A NodeJS RAG framework to easily work with LLMs and custom datasets",
66
"dependencies": {
77
"@langchain/textsplitters": "^0.1.0",
8-
"@llm-tools/embedjs-interfaces": "0.1.20",
9-
"@llm-tools/embedjs-utils": "0.1.20",
8+
"@llm-tools/embedjs-interfaces": "0.1.21",
9+
"@llm-tools/embedjs-utils": "0.1.21",
1010
"debug": "^4.3.7",
1111
"langchain": "^0.3.6",
1212
"md5": "^2.3.0",
@@ -16,7 +16,7 @@
1616
"devDependencies": {
1717
"@types/debug": "^4.1.12",
1818
"@types/md5": "^2.3.5",
19-
"@types/node": "^22.9.1"
19+
"@types/node": "^22.10.0"
2020
},
2121
"main": "./src/index.js",
2222
"license": "Apache-2.0",

databases/embedjs-astra/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"name": "@llm-tools/embedjs-astradb",
3-
"version": "0.1.20",
3+
"version": "0.1.21",
44
"description": "Add AstraDB support to embedjs",
55
"dependencies": {
66
"@datastax/astra-db-ts": "^1.5.0",
7-
"@llm-tools/embedjs-interfaces": "0.1.20",
7+
"@llm-tools/embedjs-interfaces": "0.1.21",
88
"debug": "^4.3.7"
99
},
1010
"type": "module",

databases/embedjs-cosmos/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"name": "@llm-tools/embedjs-cosmos",
3-
"version": "0.1.20",
3+
"version": "0.1.21",
44
"description": "Add CosmosDB support to embedjs",
55
"dependencies": {
66
"@azure/cosmos": "^4.2.0",
7-
"@llm-tools/embedjs-interfaces": "0.1.20",
7+
"@llm-tools/embedjs-interfaces": "0.1.21",
88
"debug": "^4.3.7"
99
},
1010
"type": "module",

databases/embedjs-hnswlib/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"name": "@llm-tools/embedjs-hnswlib",
3-
"version": "0.1.20",
3+
"version": "0.1.21",
44
"description": "Add HNSWLib support to embedjs",
55
"dependencies": {
6-
"@llm-tools/embedjs-interfaces": "0.1.20",
6+
"@llm-tools/embedjs-interfaces": "0.1.21",
77
"debug": "^4.3.7",
88
"hnswlib-node": "^3.0.0"
99
},

databases/embedjs-lancedb/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"name": "@llm-tools/embedjs-lancedb",
3-
"version": "0.1.20",
3+
"version": "0.1.21",
44
"description": "Add LanceDb support to embedjs",
55
"dependencies": {
66
"@lancedb/lancedb": "^0.13.0",
7-
"@llm-tools/embedjs-interfaces": "0.1.20",
7+
"@llm-tools/embedjs-interfaces": "0.1.21",
88
"compute-cosine-similarity": "^1.1.0",
99
"debug": "^4.3.7"
1010
},

databases/embedjs-lancedb/src/lance-db.ts

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,14 @@ export class LanceDb implements BaseVectorDatabase {
2525
}
2626

2727
const dir = await (this.isTemp ? fs.mkdtemp(this.path) : this.path);
28-
this.debug(`Connecting to path - ${dir}`);
28+
this.debug(`Connecting to database at path - ${dir}`);
2929
const client = await connect(dir);
3030

31-
const list = await client.tableNames();
32-
this.debug(`Table names found - [${list.join(',')}]`);
33-
if (list.indexOf(LanceDb.STATIC_DB_NAME) > -1) this.table = await client.openTable(LanceDb.STATIC_DB_NAME);
34-
else {
35-
//TODO: You can add a proper schema instead of a sample record now but it requires another package apache-arrow; another install on downstream as well
36-
this.table = await client.createTable(LanceDb.STATIC_DB_NAME, [
31+
this.debug('Trying to connect to table');
32+
this.table = await client.createTable(
33+
LanceDb.STATIC_DB_NAME,
34+
[
35+
//TODO: You can add a proper schema instead of a sample record now but it requires another package apache-arrow; another install on downstream as well
3736
{
3837
id: 'md5',
3938
pageContent: 'sample',
@@ -42,8 +41,10 @@ export class LanceDb implements BaseVectorDatabase {
4241
vectorString: 'sample',
4342
metadata: 'sample',
4443
},
45-
]);
46-
}
44+
],
45+
{ existOk: true },
46+
);
47+
this.debug('Connected to table');
4748
}
4849

4950
async insertChunks(chunks: InsertChunkData[]): Promise<number> {

databases/embedjs-libsql/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"name": "@llm-tools/embedjs-libsql",
3-
"version": "0.1.20",
3+
"version": "0.1.21",
44
"description": "Add LibSQL support to embedjs",
55
"dependencies": {
66
"@libsql/client": "^0.14.0",
7-
"@llm-tools/embedjs-interfaces": "0.1.20",
7+
"@llm-tools/embedjs-interfaces": "0.1.21",
88
"debug": "^4.3.7"
99
},
1010
"type": "module",

databases/embedjs-lmdb/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"name": "@llm-tools/embedjs-lmdb",
3-
"version": "0.1.20",
3+
"version": "0.1.21",
44
"description": "Add LMDB support to embedjs",
55
"dependencies": {
6-
"@llm-tools/embedjs-interfaces": "0.1.20",
6+
"@llm-tools/embedjs-interfaces": "0.1.21",
77
"debug": "^4.3.7",
88
"lmdb": "^3.1.6"
99
},

0 commit comments

Comments
 (0)