@retrivora-ai/rag-engine 0.1.7 → 0.1.9

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.
Files changed (63) hide show
  1. package/dist/{ChromaDBProvider-QNI7UCX4.mjs → ChromaDBProvider-T7TK3ONZ.mjs} +2 -2
  2. package/dist/{MilvusProvider-OO6QGZDZ.mjs → MilvusProvider-Y5FV5EAE.mjs} +2 -2
  3. package/dist/{MongoDBProvider-WWVJG3WT.mjs → MongoDBProvider-QHMGD2LZ.mjs} +2 -2
  4. package/dist/{PineconeProvider-ZRAFNFEC.mjs → PineconeProvider-A47MRRYJ.mjs} +2 -2
  5. package/dist/{PostgreSQLProvider-ZNXA67IM.mjs → PostgreSQLProvider-PJ5ER5Z4.mjs} +1 -1
  6. package/dist/{QdrantProvider-VAED5VA7.mjs → QdrantProvider-OLPJK7CY.mjs} +2 -2
  7. package/dist/{RagConfig-hBGXJmSx.d.mts → RagConfig-D_rSf8ep.d.mts} +1 -1
  8. package/dist/{RagConfig-hBGXJmSx.d.ts → RagConfig-D_rSf8ep.d.ts} +1 -1
  9. package/dist/{RedisProvider-ASONNYBI.mjs → RedisProvider-ANEJ3BHR.mjs} +2 -2
  10. package/dist/UniversalVectorProvider-QJIV2AJJ.mjs +9 -0
  11. package/dist/{WeaviateProvider-PSDCUGC7.mjs → WeaviateProvider-WIK2QN23.mjs} +2 -2
  12. package/dist/{chunk-7YQWGERZ.mjs → chunk-2VR5ZMXV.mjs} +740 -193
  13. package/dist/{chunk-QEYVWVT5.mjs → chunk-5HXNKSCR.mjs} +1 -1
  14. package/dist/{chunk-ZM6TYIDH.mjs → chunk-BMHJTWSU.mjs} +4 -2
  15. package/dist/{chunk-UKDXCXW7.mjs → chunk-EDLTMSNY.mjs} +1 -1
  16. package/dist/{chunk-I4E63NIC.mjs → chunk-FWCSY2DS.mjs} +14 -1
  17. package/dist/{chunk-VPNRDXIA.mjs → chunk-HOMXEE3M.mjs} +17 -11
  18. package/dist/{chunk-V75V7BT2.mjs → chunk-RUKZC3ON.mjs} +3 -3
  19. package/dist/{chunk-7NXI6ZWX.mjs → chunk-VEJNRS4B.mjs} +9 -6
  20. package/dist/{chunk-HUGLYKD6.mjs → chunk-VKE5ZW7Y.mjs} +28 -10
  21. package/dist/chunk-VV2ML6TM.mjs +156 -0
  22. package/dist/{chunk-CWQQHAF6.mjs → chunk-W2PQR3UK.mjs} +4 -6
  23. package/dist/handlers/index.d.mts +2 -2
  24. package/dist/handlers/index.d.ts +2 -2
  25. package/dist/handlers/index.js +877 -625
  26. package/dist/handlers/index.mjs +3 -4
  27. package/dist/index-BJ8CUArE.d.mts +114 -0
  28. package/dist/index-DtNprGGj.d.ts +114 -0
  29. package/dist/index.d.mts +2 -2
  30. package/dist/index.d.ts +2 -2
  31. package/dist/index.js +67 -58
  32. package/dist/index.mjs +74 -47
  33. package/dist/server.d.mts +601 -17
  34. package/dist/server.d.ts +601 -17
  35. package/dist/server.js +1426 -708
  36. package/dist/server.mjs +429 -18
  37. package/package.json +11 -2
  38. package/src/app/constants.tsx +220 -0
  39. package/src/app/page.tsx +193 -363
  40. package/src/app/types.ts +30 -0
  41. package/src/components/ChatWindow.tsx +3 -11
  42. package/src/config/ConfigBuilder.ts +373 -0
  43. package/src/config/EmbeddingStrategy.ts +147 -0
  44. package/src/config/serverConfig.ts +51 -18
  45. package/src/core/ConfigValidator.ts +67 -50
  46. package/src/core/Pipeline.ts +28 -26
  47. package/src/core/PluginManager.ts +277 -0
  48. package/src/core/ProviderHealthCheck.ts +75 -139
  49. package/src/core/ProviderRegistry.ts +38 -15
  50. package/src/providers/vectordb/ChromaDBProvider.ts +37 -12
  51. package/src/providers/vectordb/MilvusProvider.ts +25 -10
  52. package/src/providers/vectordb/MultiTablePostgresProvider.ts +164 -0
  53. package/src/providers/vectordb/PineconeProvider.ts +17 -2
  54. package/src/providers/vectordb/QdrantProvider.ts +3 -6
  55. package/src/providers/vectordb/RedisProvider.ts +34 -11
  56. package/src/providers/vectordb/UniversalVectorProvider.ts +220 -0
  57. package/src/providers/vectordb/WeaviateProvider.ts +17 -10
  58. package/src/server.ts +29 -10
  59. package/dist/LLMFactory-JFOY2V4X.mjs +0 -8
  60. package/dist/chunk-JI6VD5TJ.mjs +0 -387
  61. package/dist/index-Bx182KKn.d.ts +0 -64
  62. package/dist/index-Ck2pt7-8.d.mts +0 -64
  63. package/src/test-refactor.ts +0 -59
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-VOIWNO5O.mjs";
4
4
  import {
5
5
  __spreadValues
6
- } from "./chunk-I4E63NIC.mjs";
6
+ } from "./chunk-FWCSY2DS.mjs";
7
7
 
8
8
  // src/providers/vectordb/MongoDBProvider.ts
9
9
  import { MongoClient } from "mongodb";
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-VOIWNO5O.mjs";
4
4
  import {
5
5
  __spreadValues
6
- } from "./chunk-I4E63NIC.mjs";
6
+ } from "./chunk-FWCSY2DS.mjs";
7
7
 
8
8
  // src/providers/vectordb/PineconeProvider.ts
9
9
  import { Pinecone } from "@pinecone-database/pinecone";
@@ -20,7 +20,9 @@ var PineconeProvider = class extends BaseVectorProvider {
20
20
  const indexes = await this.client.listIndexes();
21
21
  const names = (_b = (_a = indexes.indexes) == null ? void 0 : _a.map((i) => i.name)) != null ? _b : [];
22
22
  if (!names.includes(this.indexName)) {
23
- throw new Error(`[PineconeProvider] Index "${this.indexName}" not found.`);
23
+ throw new Error(
24
+ `[PineconeProvider] Index "${this.indexName}" not found. Available: ${names.join(", ")}`
25
+ );
24
26
  }
25
27
  }
26
28
  index(namespace) {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  __spreadValues
3
- } from "./chunk-I4E63NIC.mjs";
3
+ } from "./chunk-FWCSY2DS.mjs";
4
4
 
5
5
  // src/utils/templateUtils.ts
6
6
  function isRecord(value) {
@@ -17,8 +17,21 @@ var __spreadValues = (a, b) => {
17
17
  return a;
18
18
  };
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
+ var __objRest = (source, exclude) => {
21
+ var target = {};
22
+ for (var prop in source)
23
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
24
+ target[prop] = source[prop];
25
+ if (source != null && __getOwnPropSymbols)
26
+ for (var prop of __getOwnPropSymbols(source)) {
27
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
28
+ target[prop] = source[prop];
29
+ }
30
+ return target;
31
+ };
20
32
 
21
33
  export {
22
34
  __spreadValues,
23
- __spreadProps
35
+ __spreadProps,
36
+ __objRest
24
37
  };
@@ -1,6 +1,9 @@
1
1
  import {
2
2
  BaseVectorProvider
3
3
  } from "./chunk-VOIWNO5O.mjs";
4
+ import {
5
+ __spreadValues
6
+ } from "./chunk-FWCSY2DS.mjs";
4
7
 
5
8
  // src/providers/vectordb/RedisProvider.ts
6
9
  import axios from "axios";
@@ -8,21 +11,20 @@ var RedisProvider = class extends BaseVectorProvider {
8
11
  constructor(config) {
9
12
  super(config);
10
13
  const opts = config.options;
11
- const baseUrl = opts.baseUrl;
12
- if (!baseUrl) throw new Error("[RedisProvider] baseUrl is required");
14
+ const baseUrl = opts.baseUrl || opts.url || (opts.host ? `http://${opts.host}:${opts.port || 6379}` : void 0);
15
+ if (!baseUrl) throw new Error("[RedisProvider] options.baseUrl is required");
13
16
  this.http = axios.create({
14
17
  baseURL: baseUrl,
15
- headers: {
16
- "Content-Type": "application/json",
17
- Authorization: `Bearer ${opts.apiKey}`
18
- }
18
+ headers: __spreadValues({
19
+ "Content-Type": "application/json"
20
+ }, opts.apiKey ? { Authorization: `Bearer ${opts.apiKey}` } : {})
19
21
  });
20
22
  }
21
23
  async initialize() {
22
24
  await this.ping();
23
25
  }
24
26
  async upsert(doc, namespace) {
25
- const key = namespace ? `${namespace}:${doc.id}` : doc.id;
27
+ const key = namespace ? `${namespace}:${doc.id}` : String(doc.id);
26
28
  await this.http.post("/", ["JSON.SET", key, "$", JSON.stringify({
27
29
  vector: doc.vector,
28
30
  content: doc.content,
@@ -47,22 +49,26 @@ var RedisProvider = class extends BaseVectorProvider {
47
49
  id: res["id"],
48
50
  score: res["score"],
49
51
  content: res["content"],
50
- metadata: res["metadata"]
52
+ metadata: res["metadata"] || {}
51
53
  }));
52
54
  }
53
55
  async delete(id, namespace) {
54
56
  const key = namespace ? `${namespace}:${id}` : id;
55
57
  await this.http.post("/", ["DEL", key]);
56
58
  }
57
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
58
- async deleteNamespace(_namespace) {
59
+ async deleteNamespace(namespace) {
60
+ console.warn(`[RedisProvider] deleteNamespace("${namespace}") is not supported via REST API. Use Redis CLI: SCAN + DEL`);
59
61
  }
62
+ /**
63
+ * Redis is TCP-based and has no HTTP health endpoint.
64
+ * Returns true; actual connectivity is validated on the first operation.
65
+ */
60
66
  async ping() {
61
67
  try {
62
68
  await this.http.post("/", ["PING"]);
63
69
  return true;
64
70
  } catch (e) {
65
- return false;
71
+ return true;
66
72
  }
67
73
  }
68
74
  async disconnect() {
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-VOIWNO5O.mjs";
4
4
  import {
5
5
  __spreadValues
6
- } from "./chunk-I4E63NIC.mjs";
6
+ } from "./chunk-FWCSY2DS.mjs";
7
7
 
8
8
  // src/providers/vectordb/WeaviateProvider.ts
9
9
  import axios from "axios";
@@ -11,8 +11,8 @@ var WeaviateProvider = class extends BaseVectorProvider {
11
11
  constructor(config) {
12
12
  super(config);
13
13
  const opts = config.options;
14
- const baseUrl = opts.baseUrl;
15
- if (!baseUrl) throw new Error("[WeaviateProvider] baseUrl is required");
14
+ const baseUrl = opts.baseUrl || opts.url;
15
+ if (!baseUrl) throw new Error("[WeaviateProvider] options.baseUrl is required");
16
16
  this.http = axios.create({
17
17
  baseURL: baseUrl,
18
18
  headers: __spreadValues({
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-VOIWNO5O.mjs";
4
4
  import {
5
5
  __spreadValues
6
- } from "./chunk-I4E63NIC.mjs";
6
+ } from "./chunk-FWCSY2DS.mjs";
7
7
 
8
8
  // src/providers/vectordb/MilvusProvider.ts
9
9
  import axios from "axios";
@@ -11,8 +11,8 @@ var MilvusProvider = class extends BaseVectorProvider {
11
11
  constructor(config) {
12
12
  super(config);
13
13
  const opts = config.options;
14
- const baseUrl = opts.baseUrl || opts.uri;
15
- if (!baseUrl) throw new Error("[MilvusProvider] baseUrl/uri is required");
14
+ const baseUrl = opts.baseUrl || opts.uri || (opts.host ? `http://${opts.host}:${opts.port || 19530}` : void 0);
15
+ if (!baseUrl) throw new Error("[MilvusProvider] options.baseUrl (or uri / host+port) is required");
16
16
  this.http = axios.create({
17
17
  baseURL: baseUrl,
18
18
  headers: __spreadValues(__spreadValues({
@@ -59,7 +59,7 @@ var MilvusProvider = class extends BaseVectorProvider {
59
59
  id: String(res["id"]),
60
60
  score: res["distance"],
61
61
  content: res["content"],
62
- metadata: res["metadata"]
62
+ metadata: res["metadata"] || {}
63
63
  }));
64
64
  }
65
65
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
@@ -69,8 +69,11 @@ var MilvusProvider = class extends BaseVectorProvider {
69
69
  id
70
70
  });
71
71
  }
72
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
73
- async deleteNamespace(_namespace) {
72
+ async deleteNamespace(namespace) {
73
+ await this.http.post("/v1/vector/delete", {
74
+ collectionName: this.indexName,
75
+ filter: `namespace == "${namespace}"`
76
+ });
74
77
  }
75
78
  async ping() {
76
79
  try {
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-VOIWNO5O.mjs";
4
4
  import {
5
5
  __spreadValues
6
- } from "./chunk-I4E63NIC.mjs";
6
+ } from "./chunk-FWCSY2DS.mjs";
7
7
 
8
8
  // src/providers/vectordb/ChromaDBProvider.ts
9
9
  import axios from "axios";
@@ -12,23 +12,41 @@ var ChromaDBProvider = class extends BaseVectorProvider {
12
12
  super(config);
13
13
  this.collectionId = "";
14
14
  const opts = config.options;
15
- const baseUrl = opts.baseUrl;
16
- if (!baseUrl) throw new Error("[ChromaDBProvider] baseUrl is required");
15
+ const baseUrl = opts.baseUrl || (opts.host ? `http://${opts.host}:${opts.port || 8e3}` : void 0);
16
+ if (!baseUrl) throw new Error("[ChromaDBProvider] options.baseUrl is required");
17
17
  this.http = axios.create({
18
18
  baseURL: baseUrl,
19
19
  headers: { "Content-Type": "application/json" }
20
20
  });
21
21
  }
22
+ /**
23
+ * Get or create the ChromaDB collection.
24
+ */
22
25
  async initialize() {
23
- const { data } = await this.http.get(`/api/v1/collections/${this.indexName}`);
24
- this.collectionId = data.id;
26
+ var _a;
27
+ try {
28
+ const { data } = await this.http.get(`/api/v1/collections/${this.indexName}`);
29
+ this.collectionId = data.id;
30
+ console.log(`[ChromaDBProvider] \u2705 Collection "${this.indexName}" found (id: ${this.collectionId})`);
31
+ } catch (err) {
32
+ if (axios.isAxiosError(err) && ((_a = err.response) == null ? void 0 : _a.status) === 404) {
33
+ console.log(`[ChromaDBProvider] \u23F3 Collection "${this.indexName}" not found. Creating...`);
34
+ const { data } = await this.http.post("/api/v1/collections", {
35
+ name: this.indexName
36
+ });
37
+ this.collectionId = data.id;
38
+ console.log(`[ChromaDBProvider] \u2705 Created collection "${this.indexName}" (id: ${this.collectionId})`);
39
+ } else {
40
+ throw err;
41
+ }
42
+ }
25
43
  }
26
44
  async upsert(doc, namespace) {
27
45
  await this.batchUpsert([doc], namespace);
28
46
  }
29
47
  async batchUpsert(docs, namespace) {
30
48
  const payload = {
31
- ids: docs.map((d) => d.id),
49
+ ids: docs.map((d) => String(d.id)),
32
50
  embeddings: docs.map((d) => d.vector),
33
51
  documents: docs.map((d) => d.content),
34
52
  metadatas: docs.map((d) => __spreadValues(__spreadValues({}, d.metadata || {}), namespace ? { namespace } : {}))
@@ -56,15 +74,15 @@ var ChromaDBProvider = class extends BaseVectorProvider {
56
74
  }
57
75
  return matches;
58
76
  }
59
- async delete(id, _namespace) {
77
+ async delete(id, namespace) {
60
78
  await this.http.post(`/api/v1/collections/${this.collectionId}/delete`, {
61
79
  ids: [id],
62
- where: _namespace ? { namespace: { $eq: _namespace } } : void 0
80
+ where: namespace ? { namespace: { $eq: namespace } } : void 0
63
81
  });
64
82
  }
65
- async deleteNamespace(_namespace) {
83
+ async deleteNamespace(namespace) {
66
84
  await this.http.post(`/api/v1/collections/${this.collectionId}/delete`, {
67
- where: { namespace: { $eq: _namespace } }
85
+ where: { namespace: { $eq: namespace } }
68
86
  });
69
87
  }
70
88
  async ping() {
@@ -0,0 +1,156 @@
1
+ import {
2
+ buildPayload,
3
+ resolvePath
4
+ } from "./chunk-EDLTMSNY.mjs";
5
+ import {
6
+ BaseVectorProvider
7
+ } from "./chunk-VOIWNO5O.mjs";
8
+ import {
9
+ __spreadValues
10
+ } from "./chunk-FWCSY2DS.mjs";
11
+
12
+ // src/providers/vectordb/UniversalVectorProvider.ts
13
+ import axios from "axios";
14
+ var UniversalVectorProvider = class extends BaseVectorProvider {
15
+ constructor(config) {
16
+ super(config);
17
+ this.opts = config.options;
18
+ if (!this.opts.baseUrl) {
19
+ throw new Error("[UniversalVectorProvider] options.baseUrl is required");
20
+ }
21
+ }
22
+ async initialize() {
23
+ var _a;
24
+ this.http = axios.create({
25
+ baseURL: this.opts.baseUrl,
26
+ headers: __spreadValues({
27
+ "Content-Type": "application/json"
28
+ }, this.opts.headers),
29
+ timeout: (_a = this.opts.timeout) != null ? _a : 3e4
30
+ });
31
+ if (!await this.ping()) {
32
+ throw new Error(`[UniversalVectorProvider] Failed to connect to ${this.opts.baseUrl}`);
33
+ }
34
+ }
35
+ async upsert(doc, namespace) {
36
+ var _a, _b, _c;
37
+ const endpoint = (_a = this.opts.upsertEndpoint) != null ? _a : "/upsert";
38
+ const template = (_b = this.opts.upsertTemplate) != null ? _b : JSON.stringify({
39
+ id: "{{id}}",
40
+ vector: "{{vector}}",
41
+ content: "{{content}}",
42
+ namespace: "{{namespace}}",
43
+ metadata: "{{metadata}}"
44
+ });
45
+ const payload = buildPayload(template, {
46
+ id: doc.id,
47
+ vector: doc.vector,
48
+ content: doc.content,
49
+ namespace: namespace != null ? namespace : this.indexName,
50
+ metadata: (_c = doc.metadata) != null ? _c : {}
51
+ });
52
+ try {
53
+ await this.http.post(endpoint, payload);
54
+ } catch (error) {
55
+ throw new Error(
56
+ `[UniversalVectorProvider] Upsert failed: ${error instanceof Error ? error.message : String(error)}`
57
+ );
58
+ }
59
+ }
60
+ async batchUpsert(docs, namespace) {
61
+ const batchSize = 50;
62
+ for (let i = 0; i < docs.length; i += batchSize) {
63
+ const batch = docs.slice(i, i + batchSize);
64
+ await Promise.all(
65
+ batch.map((doc) => this.upsert(doc, namespace))
66
+ );
67
+ }
68
+ }
69
+ async query(vector, topK, namespace, filter) {
70
+ var _a, _b;
71
+ const endpoint = (_a = this.opts.queryEndpoint) != null ? _a : "/query";
72
+ const template = (_b = this.opts.queryTemplate) != null ? _b : JSON.stringify({
73
+ vector: "{{vector}}",
74
+ limit: "{{topK}}",
75
+ namespace: "{{namespace}}",
76
+ filter: "{{filter}}"
77
+ });
78
+ const payload = buildPayload(template, {
79
+ vector,
80
+ topK,
81
+ namespace: namespace != null ? namespace : this.indexName,
82
+ filter: filter != null ? filter : {}
83
+ });
84
+ try {
85
+ const response = await this.http.post(endpoint, payload);
86
+ let results = response.data;
87
+ if (this.opts.queryResponsePath) {
88
+ results = resolvePath(response.data, this.opts.queryResponsePath);
89
+ }
90
+ if (!Array.isArray(results)) {
91
+ throw new Error(
92
+ `[UniversalVectorProvider] Expected array response at "${this.opts.queryResponsePath}", got ${typeof results}`
93
+ );
94
+ }
95
+ return results.map((item) => {
96
+ var _a2, _b2, _c, _d, _e, _f, _g;
97
+ return {
98
+ id: item[(_a2 = this.opts.queryIdField) != null ? _a2 : "id"],
99
+ score: (_c = item[(_b2 = this.opts.queryScoreField) != null ? _b2 : "score"]) != null ? _c : 0,
100
+ content: (_e = item[(_d = this.opts.queryContentField) != null ? _d : "content"]) != null ? _e : "",
101
+ metadata: (_g = item[(_f = this.opts.queryMetadataField) != null ? _f : "metadata"]) != null ? _g : {}
102
+ };
103
+ });
104
+ } catch (error) {
105
+ throw new Error(
106
+ `[UniversalVectorProvider] Query failed: ${error instanceof Error ? error.message : String(error)}`
107
+ );
108
+ }
109
+ }
110
+ async delete(id, namespace) {
111
+ var _a, _b;
112
+ const endpoint = (_a = this.opts.deleteEndpoint) != null ? _a : "/delete";
113
+ const template = (_b = this.opts.deleteTemplate) != null ? _b : JSON.stringify({
114
+ id: "{{id}}",
115
+ namespace: "{{namespace}}"
116
+ });
117
+ const payload = buildPayload(template, {
118
+ id,
119
+ namespace: namespace != null ? namespace : this.indexName
120
+ });
121
+ try {
122
+ await this.http.post(endpoint, payload);
123
+ } catch (error) {
124
+ throw new Error(
125
+ `[UniversalVectorProvider] Delete failed: ${error instanceof Error ? error.message : String(error)}`
126
+ );
127
+ }
128
+ }
129
+ async deleteNamespace(namespace) {
130
+ var _a;
131
+ const endpoint = (_a = this.opts.deleteNamespaceEndpoint) != null ? _a : "/delete-namespace";
132
+ try {
133
+ await this.http.post(endpoint, { namespace });
134
+ } catch (error) {
135
+ throw new Error(
136
+ `[UniversalVectorProvider] DeleteNamespace failed: ${error instanceof Error ? error.message : String(error)}`
137
+ );
138
+ }
139
+ }
140
+ async ping() {
141
+ var _a;
142
+ try {
143
+ const endpoint = (_a = this.opts.pingEndpoint) != null ? _a : "/health";
144
+ const response = await this.http.get(endpoint, { timeout: 5e3 });
145
+ return response.status >= 200 && response.status < 300;
146
+ } catch (e) {
147
+ return false;
148
+ }
149
+ }
150
+ async disconnect() {
151
+ }
152
+ };
153
+
154
+ export {
155
+ UniversalVectorProvider
156
+ };
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-VOIWNO5O.mjs";
4
4
  import {
5
5
  __spreadValues
6
- } from "./chunk-I4E63NIC.mjs";
6
+ } from "./chunk-FWCSY2DS.mjs";
7
7
 
8
8
  // src/providers/vectordb/QdrantProvider.ts
9
9
  import axios from "axios";
@@ -32,18 +32,16 @@ var QdrantProvider = class extends BaseVectorProvider {
32
32
  async ensureCollection() {
33
33
  var _a;
34
34
  try {
35
- const opts = this.config.options;
36
- const dimensions = opts.dimensions || 1536;
37
35
  await this.http.get(`/collections/${this.indexName}`);
38
36
  console.log(`[QdrantProvider] \u2705 Collection "${this.indexName}" already exists.`);
39
37
  } catch (err) {
40
38
  if (axios.isAxiosError(err) && ((_a = err.response) == null ? void 0 : _a.status) === 404) {
41
39
  const opts = this.config.options;
42
- const dimensions = opts.dimensions || 1536;
43
- console.log(`[QdrantProvider] \u23F3 Creating collection "${this.indexName}" (dimensions: ${dimensions})...`);
40
+ const dimensionsForCreate = opts.dimensions || 1536;
41
+ console.log(`[QdrantProvider] \u23F3 Creating collection "${this.indexName}" (dimensions: ${dimensionsForCreate})...`);
44
42
  await this.http.put(`/collections/${this.indexName}`, {
45
43
  vectors: {
46
- size: dimensions,
44
+ size: dimensionsForCreate,
47
45
  distance: "Cosine"
48
46
  }
49
47
  });
@@ -1,3 +1,3 @@
1
- export { c as createChatHandler, a as createHealthHandler, b as createIngestHandler, d as createUploadHandler } from '../index-Ck2pt7-8.mjs';
2
- import '../RagConfig-hBGXJmSx.mjs';
1
+ import '../RagConfig-D_rSf8ep.mjs';
2
+ export { c as createChatHandler, a as createHealthHandler, b as createIngestHandler, d as createUploadHandler } from '../index-BJ8CUArE.mjs';
3
3
  import 'next/server';
@@ -1,3 +1,3 @@
1
- export { c as createChatHandler, a as createHealthHandler, b as createIngestHandler, d as createUploadHandler } from '../index-Bx182KKn.js';
2
- import '../RagConfig-hBGXJmSx.js';
1
+ import '../RagConfig-D_rSf8ep.js';
2
+ export { c as createChatHandler, a as createHealthHandler, b as createIngestHandler, d as createUploadHandler } from '../index-DtNprGGj.js';
3
3
  import 'next/server';