@sprucelabs/chroma-data-store 2.0.25 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { CreateOptions, Database, DatabaseInternalOptions, Index, IndexWithFilter, QueryOptions } from '@sprucelabs/data-stores';
|
|
2
2
|
import { OllamaEmbeddingFunction } from '@chroma-core/ollama';
|
|
3
|
+
import { ChromaClient } from 'chromadb';
|
|
3
4
|
export default class ChromaDatabase implements Database {
|
|
4
5
|
static Class?: new (connectionString: string) => Database;
|
|
5
6
|
static EmbeddingFunction: typeof OllamaEmbeddingFunction;
|
|
6
7
|
private static embeddingFields?;
|
|
8
|
+
static ChromaClient?: typeof ChromaClient;
|
|
7
9
|
private connectionString;
|
|
8
10
|
private client;
|
|
9
11
|
private _isConnected;
|
package/build/ChromaDatabase.js
CHANGED
|
@@ -77,7 +77,13 @@ class ChromaDatabase {
|
|
|
77
77
|
return (0, data_stores_1.generateId)();
|
|
78
78
|
}
|
|
79
79
|
async connect() {
|
|
80
|
-
|
|
80
|
+
const connectionUrl = new URL(this.connectionString);
|
|
81
|
+
const args = {
|
|
82
|
+
host: connectionUrl.hostname,
|
|
83
|
+
port: parseInt(connectionUrl.port, 10),
|
|
84
|
+
ssl: false,
|
|
85
|
+
};
|
|
86
|
+
this.client = new (ChromaDatabase.ChromaClient ?? chromadb_1.ChromaClient)(args);
|
|
81
87
|
try {
|
|
82
88
|
await this.client.heartbeat();
|
|
83
89
|
}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { CreateOptions, Database, DatabaseInternalOptions, Index, IndexWithFilter, QueryOptions } from '@sprucelabs/data-stores';
|
|
2
2
|
import { OllamaEmbeddingFunction } from '@chroma-core/ollama';
|
|
3
|
+
import { ChromaClient } from 'chromadb';
|
|
3
4
|
export default class ChromaDatabase implements Database {
|
|
4
5
|
static Class?: new (connectionString: string) => Database;
|
|
5
6
|
static EmbeddingFunction: typeof OllamaEmbeddingFunction;
|
|
6
7
|
private static embeddingFields?;
|
|
8
|
+
static ChromaClient?: typeof ChromaClient;
|
|
7
9
|
private connectionString;
|
|
8
10
|
private client;
|
|
9
11
|
private _isConnected;
|
|
@@ -105,7 +105,14 @@ class ChromaDatabase {
|
|
|
105
105
|
}
|
|
106
106
|
connect() {
|
|
107
107
|
return __awaiter(this, void 0, void 0, function* () {
|
|
108
|
-
|
|
108
|
+
var _a;
|
|
109
|
+
const connectionUrl = new URL(this.connectionString);
|
|
110
|
+
const args = {
|
|
111
|
+
host: connectionUrl.hostname,
|
|
112
|
+
port: parseInt(connectionUrl.port, 10),
|
|
113
|
+
ssl: false,
|
|
114
|
+
};
|
|
115
|
+
this.client = new ((_a = ChromaDatabase.ChromaClient) !== null && _a !== void 0 ? _a : ChromaClient)(args);
|
|
109
116
|
try {
|
|
110
117
|
yield this.client.heartbeat();
|
|
111
118
|
}
|
package/package.json
CHANGED
|
@@ -7,13 +7,25 @@
|
|
|
7
7
|
"types": "./build/index.d.ts",
|
|
8
8
|
"module": "./build/esm/index.js",
|
|
9
9
|
"sideEffects": false,
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"import": {
|
|
13
|
+
"types": "./build/esm/index.d.ts",
|
|
14
|
+
"default": "./build/esm/index.js"
|
|
15
|
+
},
|
|
16
|
+
"require": {
|
|
17
|
+
"types": "./build/index.d.ts",
|
|
18
|
+
"default": "./build/index.js"
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
},
|
|
10
22
|
"keywords": [
|
|
11
23
|
"node",
|
|
12
24
|
"components",
|
|
13
25
|
"sprucebot",
|
|
14
26
|
"sprucelabs"
|
|
15
27
|
],
|
|
16
|
-
"version": "
|
|
28
|
+
"version": "3.0.0",
|
|
17
29
|
"scripts": {
|
|
18
30
|
"build.ci": "yarn run build.tsc && yarn run build.resolve-paths && yarn run lint",
|
|
19
31
|
"build.copy-files": "mkdir -p build && rsync -avzq --exclude='*.ts' ./src/ ./build/",
|
|
@@ -43,22 +55,22 @@
|
|
|
43
55
|
"generate.embeddings": "./support/generate_embeddings.sh"
|
|
44
56
|
},
|
|
45
57
|
"devDependencies": {
|
|
46
|
-
"@sprucelabs/esm-postbuild": "^
|
|
47
|
-
"@sprucelabs/jest-json-reporter": "^
|
|
48
|
-
"@sprucelabs/resolve-path-aliases": "^
|
|
49
|
-
"@sprucelabs/semantic-release": "^
|
|
50
|
-
"@sprucelabs/test": "^
|
|
51
|
-
"@sprucelabs/test-utils": "^
|
|
52
|
-
"@types/node": "^
|
|
58
|
+
"@sprucelabs/esm-postbuild": "^9.0.17",
|
|
59
|
+
"@sprucelabs/jest-json-reporter": "^10.0.24",
|
|
60
|
+
"@sprucelabs/resolve-path-aliases": "^4.0.17",
|
|
61
|
+
"@sprucelabs/semantic-release": "^6.0.0",
|
|
62
|
+
"@sprucelabs/test": "^11.1.4",
|
|
63
|
+
"@sprucelabs/test-utils": "^7.2.10",
|
|
64
|
+
"@types/node": "^25.2.3",
|
|
53
65
|
"chokidar-cli": "^3.0.0",
|
|
54
|
-
"eslint": "^
|
|
55
|
-
"eslint-config-spruce": "^11.2.
|
|
56
|
-
"jest": "^30.0
|
|
57
|
-
"jest-circus": "^30.0
|
|
58
|
-
"prettier": "^3.
|
|
66
|
+
"eslint": "^10.0.0",
|
|
67
|
+
"eslint-config-spruce": "^11.2.33",
|
|
68
|
+
"jest": "^30.2.0",
|
|
69
|
+
"jest-circus": "^30.2.0",
|
|
70
|
+
"prettier": "^3.8.1",
|
|
59
71
|
"ts-node": "^10.9.2",
|
|
60
|
-
"tsc-watch": "^7.
|
|
61
|
-
"typescript": "^5.9.
|
|
72
|
+
"tsc-watch": "^7.2.0",
|
|
73
|
+
"typescript": "^5.9.3"
|
|
62
74
|
},
|
|
63
75
|
"description": "A data store adapter for Chroma (vectordb)",
|
|
64
76
|
"skill": {
|
|
@@ -83,14 +95,14 @@
|
|
|
83
95
|
}
|
|
84
96
|
},
|
|
85
97
|
"dependencies": {
|
|
86
|
-
"@chroma-core/ollama": "^0.1.
|
|
87
|
-
"@sprucelabs/data-stores": "^
|
|
88
|
-
"@sprucelabs/error": "^
|
|
89
|
-
"@sprucelabs/schema": "^
|
|
90
|
-
"@sprucelabs/spruce-core-schemas": "^
|
|
91
|
-
"@sprucelabs/spruce-skill-utils": "^
|
|
92
|
-
"chromadb": "^3.0
|
|
98
|
+
"@chroma-core/ollama": "^0.1.8",
|
|
99
|
+
"@sprucelabs/data-stores": "^32.0.6",
|
|
100
|
+
"@sprucelabs/error": "^8.1.8",
|
|
101
|
+
"@sprucelabs/schema": "^33.2.4",
|
|
102
|
+
"@sprucelabs/spruce-core-schemas": "^42.1.10",
|
|
103
|
+
"@sprucelabs/spruce-skill-utils": "^34.0.11",
|
|
104
|
+
"chromadb": "^3.3.0",
|
|
93
105
|
"chromadb-default-embed": "^2.14.0",
|
|
94
|
-
"ollama": "^0.
|
|
106
|
+
"ollama": "^0.6.3"
|
|
95
107
|
}
|
|
96
108
|
}
|