hyperspace-sdk-ts 3.0.7 → 3.0.8
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/client.d.ts +2 -2
- package/dist/client.js +4 -4
- package/package.json +1 -1
package/dist/client.d.ts
CHANGED
|
@@ -71,12 +71,12 @@ export declare class HyperspaceClient {
|
|
|
71
71
|
deleteCollection(name: string): Promise<boolean>;
|
|
72
72
|
listCollections(): Promise<string[]>;
|
|
73
73
|
delete(id: number, collection?: string): Promise<boolean>;
|
|
74
|
-
insert(
|
|
74
|
+
insert(vector: number[] | Float32Array | Float64Array, id: number, meta?: {
|
|
75
75
|
[key: string]: string;
|
|
76
76
|
}, collection?: string, durability?: DurabilityLevel, typedMetadata?: {
|
|
77
77
|
[key: string]: TypedMetadataValue;
|
|
78
78
|
}): Promise<boolean>;
|
|
79
|
-
insertText(
|
|
79
|
+
insertText(text: string, id: number, meta?: {
|
|
80
80
|
[key: string]: string;
|
|
81
81
|
}, collection?: string, durability?: DurabilityLevel): Promise<boolean>;
|
|
82
82
|
vectorize(text: string, metric?: string): Promise<number[]>;
|
package/dist/client.js
CHANGED
|
@@ -290,11 +290,11 @@ class HyperspaceClient {
|
|
|
290
290
|
});
|
|
291
291
|
});
|
|
292
292
|
}
|
|
293
|
-
insert(
|
|
293
|
+
insert(vector, id, meta, collection = '', durability = hyperspace_pb_1.DurabilityLevel.DEFAULT_LEVEL, typedMetadata) {
|
|
294
294
|
return new Promise((resolve, reject) => {
|
|
295
295
|
const req = new hyperspace_pb_1.InsertRequest();
|
|
296
|
-
req.setId(id);
|
|
297
296
|
req.setVectorList(HyperspaceClient.toVectorList(vector));
|
|
297
|
+
req.setId(id);
|
|
298
298
|
if (meta) {
|
|
299
299
|
const map = req.getMetadataMap();
|
|
300
300
|
for (const k in meta)
|
|
@@ -316,11 +316,11 @@ class HyperspaceClient {
|
|
|
316
316
|
});
|
|
317
317
|
});
|
|
318
318
|
}
|
|
319
|
-
insertText(
|
|
319
|
+
insertText(text, id, meta, collection = '', durability = hyperspace_pb_1.DurabilityLevel.DEFAULT_LEVEL) {
|
|
320
320
|
return new Promise((resolve, reject) => {
|
|
321
321
|
const req = new hyperspace_pb_1.InsertTextRequest();
|
|
322
|
-
req.setId(id);
|
|
323
322
|
req.setText(text);
|
|
323
|
+
req.setId(id);
|
|
324
324
|
if (meta) {
|
|
325
325
|
const map = req.getMetadataMap();
|
|
326
326
|
for (const k in meta)
|