@memberjunction/ai-vectors-qdrant 6.2.0-edge.0 → 6.2.0-edge.1
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/config.d.ts
CHANGED
|
@@ -2,9 +2,13 @@
|
|
|
2
2
|
* Qdrant connection URL. Defaults to localhost:6333 if not set.
|
|
3
3
|
* For Qdrant Cloud, use the full cluster URL (e.g., https://xyz.us-east-1-0.aws.cloud.qdrant.io:6333).
|
|
4
4
|
*/
|
|
5
|
+
export declare const QdrantUrl: string;
|
|
6
|
+
/** @deprecated Use {@link QdrantUrl}. */
|
|
5
7
|
export declare const qdrantUrl: string;
|
|
6
8
|
/**
|
|
7
9
|
* Qdrant API key. Required for Qdrant Cloud; optional for local instances.
|
|
8
10
|
*/
|
|
9
|
-
export declare const
|
|
11
|
+
export declare const QdrantApiKey: string | undefined;
|
|
12
|
+
/** @deprecated Use {@link QdrantApiKey}. */
|
|
13
|
+
export declare const qdrantApiKey: string;
|
|
10
14
|
//# sourceMappingURL=config.d.ts.map
|
package/dist/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,eAAO,MAAM,SAAS,EAAE,MAA0D,CAAC;AAEnF;;GAEG;AACH,eAAO,MAAM,YAAY,EAAE,MAAM,GAAG,SAAsC,CAAC"}
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,eAAO,MAAM,SAAS,EAAE,MAA0D,CAAC;AAEnF,yCAAyC;AACzC,eAAO,MAAM,SAAS,QAAY,CAAC;AAEnC;;GAEG;AACH,eAAO,MAAM,YAAY,EAAE,MAAM,GAAG,SAAsC,CAAC;AAE3E,4CAA4C;AAC5C,eAAO,MAAM,YAAY,QAAe,CAAC"}
|
package/dist/config.js
CHANGED
|
@@ -4,9 +4,13 @@ dotenv.config({ quiet: true });
|
|
|
4
4
|
* Qdrant connection URL. Defaults to localhost:6333 if not set.
|
|
5
5
|
* For Qdrant Cloud, use the full cluster URL (e.g., https://xyz.us-east-1-0.aws.cloud.qdrant.io:6333).
|
|
6
6
|
*/
|
|
7
|
-
export const
|
|
7
|
+
export const QdrantUrl = process.env.QDRANT_URL || 'http://localhost:6333';
|
|
8
|
+
/** @deprecated Use {@link QdrantUrl}. */
|
|
9
|
+
export const qdrantUrl = QdrantUrl;
|
|
8
10
|
/**
|
|
9
11
|
* Qdrant API key. Required for Qdrant Cloud; optional for local instances.
|
|
10
12
|
*/
|
|
11
|
-
export const
|
|
13
|
+
export const QdrantApiKey = process.env.QDRANT_API_KEY;
|
|
14
|
+
/** @deprecated Use {@link QdrantApiKey}. */
|
|
15
|
+
export const qdrantApiKey = QdrantApiKey;
|
|
12
16
|
//# sourceMappingURL=config.js.map
|
package/dist/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,MAAM,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAE/B;;;GAGG;AACH,MAAM,CAAC,MAAM,SAAS,GAAW,OAAO,CAAC,GAAG,CAAC,UAAU,IAAI,uBAAuB,CAAC;AAEnF;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,GAAuB,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,MAAM,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAE/B;;;GAGG;AACH,MAAM,CAAC,MAAM,SAAS,GAAW,OAAO,CAAC,GAAG,CAAC,UAAU,IAAI,uBAAuB,CAAC;AAEnF,yCAAyC;AACzC,MAAM,CAAC,MAAM,SAAS,GAAG,SAAS,CAAC;AAEnC;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,GAAuB,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC;AAE3E,4CAA4C;AAC5C,MAAM,CAAC,MAAM,YAAY,GAAG,YAAY,CAAC"}
|
|
@@ -233,11 +233,11 @@ export declare class QdrantDatabase extends VectorDBBase {
|
|
|
233
233
|
/**
|
|
234
234
|
* Convert MetadataFilterConditions to Qdrant's native filter syntax.
|
|
235
235
|
*/
|
|
236
|
-
private
|
|
236
|
+
private conditionsToQdrantFilter;
|
|
237
237
|
/**
|
|
238
238
|
* Extract collection name from query params. Checks for 'id' field first (used as collection name
|
|
239
239
|
* when vector is also provided), otherwise returns undefined.
|
|
240
240
|
*/
|
|
241
|
-
private
|
|
241
|
+
private extractCollectionName;
|
|
242
242
|
}
|
|
243
243
|
//# sourceMappingURL=QdrantDatabase.d.ts.map
|
|
@@ -11,7 +11,7 @@ import { QdrantClient } from '@qdrant/js-client-rest';
|
|
|
11
11
|
import { RegisterClass } from '@memberjunction/global';
|
|
12
12
|
import { VectorDBBase, VectorMetadataFilter, } from '@memberjunction/ai-vectordb';
|
|
13
13
|
import { LogError } from '@memberjunction/core';
|
|
14
|
-
import {
|
|
14
|
+
import { QdrantUrl } from '../config.js';
|
|
15
15
|
/**
|
|
16
16
|
* Maps MJ's metric enum values to Qdrant distance types.
|
|
17
17
|
*/
|
|
@@ -70,7 +70,7 @@ let QdrantDatabase = class QdrantDatabase extends VectorDBBase {
|
|
|
70
70
|
constructor(apiKey) {
|
|
71
71
|
super(apiKey);
|
|
72
72
|
this._client = new QdrantClient({
|
|
73
|
-
url:
|
|
73
|
+
url: QdrantUrl,
|
|
74
74
|
apiKey: apiKey || undefined,
|
|
75
75
|
});
|
|
76
76
|
}
|
|
@@ -97,7 +97,7 @@ let QdrantDatabase = class QdrantDatabase extends VectorDBBase {
|
|
|
97
97
|
name: c.name,
|
|
98
98
|
dimension: 0, // Not available from list endpoint
|
|
99
99
|
metric: 'cosine',
|
|
100
|
-
host:
|
|
100
|
+
host: QdrantUrl,
|
|
101
101
|
}));
|
|
102
102
|
return { indexes };
|
|
103
103
|
}
|
|
@@ -131,7 +131,7 @@ let QdrantDatabase = class QdrantDatabase extends VectorDBBase {
|
|
|
131
131
|
name: params.id,
|
|
132
132
|
dimension,
|
|
133
133
|
metric,
|
|
134
|
-
host:
|
|
134
|
+
host: QdrantUrl,
|
|
135
135
|
};
|
|
136
136
|
return this.wrapSuccessResponse(description);
|
|
137
137
|
}
|
|
@@ -232,7 +232,7 @@ let QdrantDatabase = class QdrantDatabase extends VectorDBBase {
|
|
|
232
232
|
// signature added in @memberjunction/ai-vectordb v5.30+.
|
|
233
233
|
async QueryIndex(params, _contextUser) {
|
|
234
234
|
try {
|
|
235
|
-
const collectionName = this.
|
|
235
|
+
const collectionName = this.extractCollectionName(params);
|
|
236
236
|
if (!collectionName) {
|
|
237
237
|
return this.wrapFailureResponse('Collection name (id) is required for QueryIndex');
|
|
238
238
|
}
|
|
@@ -573,12 +573,12 @@ let QdrantDatabase = class QdrantDatabase extends VectorDBBase {
|
|
|
573
573
|
if (conditions.length === 0) {
|
|
574
574
|
return undefined;
|
|
575
575
|
}
|
|
576
|
-
return this.
|
|
576
|
+
return this.conditionsToQdrantFilter(conditions);
|
|
577
577
|
}
|
|
578
578
|
/**
|
|
579
579
|
* Convert MetadataFilterConditions to Qdrant's native filter syntax.
|
|
580
580
|
*/
|
|
581
|
-
|
|
581
|
+
conditionsToQdrantFilter(conditions) {
|
|
582
582
|
const must = [];
|
|
583
583
|
for (const condition of conditions) {
|
|
584
584
|
switch (condition.Operator) {
|
|
@@ -616,7 +616,7 @@ let QdrantDatabase = class QdrantDatabase extends VectorDBBase {
|
|
|
616
616
|
* Extract collection name from query params. Checks for 'id' field first (used as collection name
|
|
617
617
|
* when vector is also provided), otherwise returns undefined.
|
|
618
618
|
*/
|
|
619
|
-
|
|
619
|
+
extractCollectionName(params) {
|
|
620
620
|
if ('id' in params && typeof params.id === 'string') {
|
|
621
621
|
// When both vector and id are present, id is the collection name
|
|
622
622
|
if ('vector' in params && params.vector) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@memberjunction/ai-vectors-qdrant",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "6.2.0-edge.
|
|
4
|
+
"version": "6.2.0-edge.1",
|
|
5
5
|
"description": "MemberJunction: Qdrant Implementation for AI Vector Database",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
@@ -11,9 +11,9 @@
|
|
|
11
11
|
"author": "MemberJunction.com",
|
|
12
12
|
"license": "BUSL-1.1",
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@memberjunction/core": "6.2.0-edge.
|
|
15
|
-
"@memberjunction/global": "6.2.0-edge.
|
|
16
|
-
"@memberjunction/ai-vectordb": "6.2.0-edge.
|
|
14
|
+
"@memberjunction/core": "6.2.0-edge.1",
|
|
15
|
+
"@memberjunction/global": "6.2.0-edge.1",
|
|
16
|
+
"@memberjunction/ai-vectordb": "6.2.0-edge.1",
|
|
17
17
|
"@qdrant/js-client-rest": "^1.13.0",
|
|
18
18
|
"dotenv": "^17.2.4"
|
|
19
19
|
},
|