@vectorstores/chroma 0.1.2 → 0.1.4
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.
- package/dist/index.cjs +19 -5
- package/dist/index.d.cts +6 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.edge-light.d.ts +6 -0
- package/dist/index.edge-light.js +19 -5
- package/dist/index.js +19 -5
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -41,13 +41,17 @@ class ChromaVectorStore extends core.BaseVectorStore {
|
|
|
41
41
|
await collection.add(dataToInsert);
|
|
42
42
|
return nodes.map((node)=>node.id_);
|
|
43
43
|
}
|
|
44
|
-
|
|
44
|
+
/**
|
|
45
|
+
* Deletes all nodes from the collection that belong to the given document.
|
|
46
|
+
* @param refDocId Reference document ID - all nodes with this ref_doc_id will be deleted.
|
|
47
|
+
* @param deleteOptions Optional delete parameters for Chroma.
|
|
48
|
+
*/ async delete(refDocId, deleteOptions) {
|
|
45
49
|
const collection = await this.getCollection();
|
|
46
50
|
await collection.delete({
|
|
47
|
-
|
|
48
|
-
refDocId
|
|
49
|
-
|
|
50
|
-
|
|
51
|
+
where: {
|
|
52
|
+
ref_doc_id: refDocId,
|
|
53
|
+
...deleteOptions?.where
|
|
54
|
+
},
|
|
51
55
|
whereDocument: deleteOptions?.whereDocument
|
|
52
56
|
});
|
|
53
57
|
}
|
|
@@ -147,6 +151,16 @@ class ChromaVectorStore extends core.BaseVectorStore {
|
|
|
147
151
|
};
|
|
148
152
|
return vectorStoreQueryResult;
|
|
149
153
|
}
|
|
154
|
+
async exists(refDocId) {
|
|
155
|
+
const collection = await this.getCollection();
|
|
156
|
+
const result = await collection.get({
|
|
157
|
+
where: {
|
|
158
|
+
ref_doc_id: refDocId
|
|
159
|
+
},
|
|
160
|
+
limit: 1
|
|
161
|
+
});
|
|
162
|
+
return result.ids.length > 0;
|
|
163
|
+
}
|
|
150
164
|
}
|
|
151
165
|
|
|
152
166
|
exports.ChromaVectorStore = ChromaVectorStore;
|
package/dist/index.d.cts
CHANGED
|
@@ -25,11 +25,17 @@ declare class ChromaVectorStore extends BaseVectorStore {
|
|
|
25
25
|
getCollection(): Promise<Collection>;
|
|
26
26
|
private getDataToInsert;
|
|
27
27
|
add(nodes: BaseNode[]): Promise<string[]>;
|
|
28
|
+
/**
|
|
29
|
+
* Deletes all nodes from the collection that belong to the given document.
|
|
30
|
+
* @param refDocId Reference document ID - all nodes with this ref_doc_id will be deleted.
|
|
31
|
+
* @param deleteOptions Optional delete parameters for Chroma.
|
|
32
|
+
*/
|
|
28
33
|
delete(refDocId: string, deleteOptions?: ChromaDeleteOptions): Promise<void>;
|
|
29
34
|
private transformChromaFilterCondition;
|
|
30
35
|
private transformChromaFilterOperator;
|
|
31
36
|
private toChromaFilter;
|
|
32
37
|
query(query: VectorStoreQuery, options?: ChromaQueryOptions): Promise<VectorStoreQueryResult>;
|
|
38
|
+
exists(refDocId: string): Promise<boolean>;
|
|
33
39
|
}
|
|
34
40
|
|
|
35
41
|
export { ChromaVectorStore };
|
package/dist/index.d.ts
CHANGED
|
@@ -25,11 +25,17 @@ declare class ChromaVectorStore extends BaseVectorStore {
|
|
|
25
25
|
getCollection(): Promise<Collection>;
|
|
26
26
|
private getDataToInsert;
|
|
27
27
|
add(nodes: BaseNode[]): Promise<string[]>;
|
|
28
|
+
/**
|
|
29
|
+
* Deletes all nodes from the collection that belong to the given document.
|
|
30
|
+
* @param refDocId Reference document ID - all nodes with this ref_doc_id will be deleted.
|
|
31
|
+
* @param deleteOptions Optional delete parameters for Chroma.
|
|
32
|
+
*/
|
|
28
33
|
delete(refDocId: string, deleteOptions?: ChromaDeleteOptions): Promise<void>;
|
|
29
34
|
private transformChromaFilterCondition;
|
|
30
35
|
private transformChromaFilterOperator;
|
|
31
36
|
private toChromaFilter;
|
|
32
37
|
query(query: VectorStoreQuery, options?: ChromaQueryOptions): Promise<VectorStoreQueryResult>;
|
|
38
|
+
exists(refDocId: string): Promise<boolean>;
|
|
33
39
|
}
|
|
34
40
|
|
|
35
41
|
export { ChromaVectorStore };
|
|
@@ -25,11 +25,17 @@ declare class ChromaVectorStore extends BaseVectorStore {
|
|
|
25
25
|
getCollection(): Promise<Collection>;
|
|
26
26
|
private getDataToInsert;
|
|
27
27
|
add(nodes: BaseNode[]): Promise<string[]>;
|
|
28
|
+
/**
|
|
29
|
+
* Deletes all nodes from the collection that belong to the given document.
|
|
30
|
+
* @param refDocId Reference document ID - all nodes with this ref_doc_id will be deleted.
|
|
31
|
+
* @param deleteOptions Optional delete parameters for Chroma.
|
|
32
|
+
*/
|
|
28
33
|
delete(refDocId: string, deleteOptions?: ChromaDeleteOptions): Promise<void>;
|
|
29
34
|
private transformChromaFilterCondition;
|
|
30
35
|
private transformChromaFilterOperator;
|
|
31
36
|
private toChromaFilter;
|
|
32
37
|
query(query: VectorStoreQuery, options?: ChromaQueryOptions): Promise<VectorStoreQueryResult>;
|
|
38
|
+
exists(refDocId: string): Promise<boolean>;
|
|
33
39
|
}
|
|
34
40
|
|
|
35
41
|
export { ChromaVectorStore };
|
package/dist/index.edge-light.js
CHANGED
|
@@ -39,13 +39,17 @@ class ChromaVectorStore extends BaseVectorStore {
|
|
|
39
39
|
await collection.add(dataToInsert);
|
|
40
40
|
return nodes.map((node)=>node.id_);
|
|
41
41
|
}
|
|
42
|
-
|
|
42
|
+
/**
|
|
43
|
+
* Deletes all nodes from the collection that belong to the given document.
|
|
44
|
+
* @param refDocId Reference document ID - all nodes with this ref_doc_id will be deleted.
|
|
45
|
+
* @param deleteOptions Optional delete parameters for Chroma.
|
|
46
|
+
*/ async delete(refDocId, deleteOptions) {
|
|
43
47
|
const collection = await this.getCollection();
|
|
44
48
|
await collection.delete({
|
|
45
|
-
|
|
46
|
-
refDocId
|
|
47
|
-
|
|
48
|
-
|
|
49
|
+
where: {
|
|
50
|
+
ref_doc_id: refDocId,
|
|
51
|
+
...deleteOptions?.where
|
|
52
|
+
},
|
|
49
53
|
whereDocument: deleteOptions?.whereDocument
|
|
50
54
|
});
|
|
51
55
|
}
|
|
@@ -145,6 +149,16 @@ class ChromaVectorStore extends BaseVectorStore {
|
|
|
145
149
|
};
|
|
146
150
|
return vectorStoreQueryResult;
|
|
147
151
|
}
|
|
152
|
+
async exists(refDocId) {
|
|
153
|
+
const collection = await this.getCollection();
|
|
154
|
+
const result = await collection.get({
|
|
155
|
+
where: {
|
|
156
|
+
ref_doc_id: refDocId
|
|
157
|
+
},
|
|
158
|
+
limit: 1
|
|
159
|
+
});
|
|
160
|
+
return result.ids.length > 0;
|
|
161
|
+
}
|
|
148
162
|
}
|
|
149
163
|
|
|
150
164
|
export { ChromaVectorStore };
|
package/dist/index.js
CHANGED
|
@@ -39,13 +39,17 @@ class ChromaVectorStore extends BaseVectorStore {
|
|
|
39
39
|
await collection.add(dataToInsert);
|
|
40
40
|
return nodes.map((node)=>node.id_);
|
|
41
41
|
}
|
|
42
|
-
|
|
42
|
+
/**
|
|
43
|
+
* Deletes all nodes from the collection that belong to the given document.
|
|
44
|
+
* @param refDocId Reference document ID - all nodes with this ref_doc_id will be deleted.
|
|
45
|
+
* @param deleteOptions Optional delete parameters for Chroma.
|
|
46
|
+
*/ async delete(refDocId, deleteOptions) {
|
|
43
47
|
const collection = await this.getCollection();
|
|
44
48
|
await collection.delete({
|
|
45
|
-
|
|
46
|
-
refDocId
|
|
47
|
-
|
|
48
|
-
|
|
49
|
+
where: {
|
|
50
|
+
ref_doc_id: refDocId,
|
|
51
|
+
...deleteOptions?.where
|
|
52
|
+
},
|
|
49
53
|
whereDocument: deleteOptions?.whereDocument
|
|
50
54
|
});
|
|
51
55
|
}
|
|
@@ -145,6 +149,16 @@ class ChromaVectorStore extends BaseVectorStore {
|
|
|
145
149
|
};
|
|
146
150
|
return vectorStoreQueryResult;
|
|
147
151
|
}
|
|
152
|
+
async exists(refDocId) {
|
|
153
|
+
const collection = await this.getCollection();
|
|
154
|
+
const result = await collection.get({
|
|
155
|
+
where: {
|
|
156
|
+
ref_doc_id: refDocId
|
|
157
|
+
},
|
|
158
|
+
limit: 1
|
|
159
|
+
});
|
|
160
|
+
return result.ids.length > 0;
|
|
161
|
+
}
|
|
148
162
|
}
|
|
149
163
|
|
|
150
164
|
export { ChromaVectorStore };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vectorstores/chroma",
|
|
3
3
|
"description": "Chroma Storage for vectorstores",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.4",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
7
7
|
"module": "./dist/index.js",
|
|
@@ -34,11 +34,11 @@
|
|
|
34
34
|
"directory": "packages/providers/storage/chroma"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@vectorstores/
|
|
38
|
-
"@vectorstores/
|
|
37
|
+
"@vectorstores/env": "0.1.0",
|
|
38
|
+
"@vectorstores/core": "0.1.4"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
|
-
"@vectorstores/core": "0.1.
|
|
41
|
+
"@vectorstores/core": "0.1.4",
|
|
42
42
|
"@vectorstores/env": "0.1.0"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|