@retrivora-ai/rag-engine 1.1.3 → 1.1.5

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.
@@ -83,7 +83,7 @@ function getRagConfig(baseConfig, env = process.env) {
83
83
  return getEnvConfig(env, baseConfig);
84
84
  }
85
85
  function getEnvConfig(env = process.env, base) {
86
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V, _W, _X, _Y, _Z, __, _$, _aa, _ba, _ca, _da, _ea, _fa, _ga, _ha, _ia, _ja, _ka, _la, _ma, _na, _oa, _pa;
86
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V, _W, _X, _Y, _Z, __, _$, _aa, _ba, _ca, _da, _ea, _fa, _ga, _ha, _ia, _ja, _ka, _la, _ma, _na, _oa, _pa, _qa, _ra, _sa, _ta, _ua, _va;
87
87
  const projectId = (_c = (_b = (_a = readString(env, "RAG_PROJECT_ID")) != null ? _a : readString(env, "NEXT_PUBLIC_PROJECT_ID")) != null ? _b : base == null ? void 0 : base.projectId) != null ? _c : "__default__";
88
88
  const vectorProvider = readEnum(env, "VECTOR_DB_PROVIDER", "pinecone", VECTOR_DB_PROVIDERS);
89
89
  const llmProvider = readEnum(env, "LLM_PROVIDER", "openai", LLM_PROVIDERS);
@@ -92,34 +92,35 @@ function getEnvConfig(env = process.env, base) {
92
92
  const vectorDbOptions = {};
93
93
  if (vectorProvider === "pinecone") {
94
94
  vectorDbOptions.apiKey = (_g = (_f = readString(env, "PINECONE_API_KEY")) != null ? _f : (_e = (_d = base == null ? void 0 : base.vectorDb) == null ? void 0 : _d.options) == null ? void 0 : _e.apiKey) != null ? _g : "";
95
+ vectorDbOptions.indexName = (_l = (_i = readString(env, "PINECONE_INDEX")) != null ? _i : (_h = base == null ? void 0 : base.vectorDb) == null ? void 0 : _h.indexName) != null ? _l : (_k = (_j = base == null ? void 0 : base.vectorDb) == null ? void 0 : _j.options) == null ? void 0 : _k.indexName;
95
96
  } else if (vectorProvider === "pgvector" || vectorProvider === "postgresql") {
96
- vectorDbOptions.connectionString = (_k = (_j = readString(env, "PGVECTOR_CONNECTION_STRING")) != null ? _j : (_i = (_h = base == null ? void 0 : base.vectorDb) == null ? void 0 : _h.options) == null ? void 0 : _i.connectionString) != null ? _k : "";
97
+ vectorDbOptions.connectionString = (_p = (_o = readString(env, "PGVECTOR_CONNECTION_STRING")) != null ? _o : (_n = (_m = base == null ? void 0 : base.vectorDb) == null ? void 0 : _m.options) == null ? void 0 : _n.connectionString) != null ? _p : "";
97
98
  vectorDbOptions.dimensions = embeddingDimensions;
98
99
  } else if (vectorProvider === "mongodb") {
99
- vectorDbOptions.uri = (_o = (_n = readString(env, "MONGODB_URI")) != null ? _n : (_m = (_l = base == null ? void 0 : base.vectorDb) == null ? void 0 : _l.options) == null ? void 0 : _m.uri) != null ? _o : "";
100
- vectorDbOptions.database = (_s = (_r = readString(env, "MONGODB_DB")) != null ? _r : (_q = (_p = base == null ? void 0 : base.vectorDb) == null ? void 0 : _p.options) == null ? void 0 : _q.database) != null ? _s : "";
101
- vectorDbOptions.collection = (_w = (_v = readString(env, "MONGODB_COLLECTION")) != null ? _v : (_u = (_t = base == null ? void 0 : base.vectorDb) == null ? void 0 : _t.options) == null ? void 0 : _u.collection) != null ? _w : "";
102
- vectorDbOptions.indexName = (_C = (_B = (_y = readString(env, "MONGODB_INDEX_NAME")) != null ? _y : (_x = base == null ? void 0 : base.vectorDb) == null ? void 0 : _x.indexName) != null ? _B : (_A = (_z = base == null ? void 0 : base.vectorDb) == null ? void 0 : _z.options) == null ? void 0 : _A.indexName) != null ? _C : "vector_index";
100
+ vectorDbOptions.uri = (_t = (_s = readString(env, "MONGODB_URI")) != null ? _s : (_r = (_q = base == null ? void 0 : base.vectorDb) == null ? void 0 : _q.options) == null ? void 0 : _r.uri) != null ? _t : "";
101
+ vectorDbOptions.database = (_x = (_w = readString(env, "MONGODB_DB")) != null ? _w : (_v = (_u = base == null ? void 0 : base.vectorDb) == null ? void 0 : _u.options) == null ? void 0 : _v.database) != null ? _x : "";
102
+ vectorDbOptions.collection = (_B = (_A = readString(env, "MONGODB_COLLECTION")) != null ? _A : (_z = (_y = base == null ? void 0 : base.vectorDb) == null ? void 0 : _y.options) == null ? void 0 : _z.collection) != null ? _B : "";
103
+ vectorDbOptions.indexName = (_H = (_G = (_D = readString(env, "MONGODB_INDEX_NAME")) != null ? _D : (_C = base == null ? void 0 : base.vectorDb) == null ? void 0 : _C.indexName) != null ? _G : (_F = (_E = base == null ? void 0 : base.vectorDb) == null ? void 0 : _E.options) == null ? void 0 : _F.indexName) != null ? _H : "vector_index";
103
104
  } else if (vectorProvider === "qdrant") {
104
- vectorDbOptions.baseUrl = (_G = (_F = readString(env, "QDRANT_URL")) != null ? _F : (_E = (_D = base == null ? void 0 : base.vectorDb) == null ? void 0 : _D.options) == null ? void 0 : _E.baseUrl) != null ? _G : "http://localhost:6333";
105
- vectorDbOptions.apiKey = (_J = readString(env, "QDRANT_API_KEY")) != null ? _J : (_I = (_H = base == null ? void 0 : base.vectorDb) == null ? void 0 : _H.options) == null ? void 0 : _I.apiKey;
105
+ vectorDbOptions.baseUrl = (_L = (_K = readString(env, "QDRANT_URL")) != null ? _K : (_J = (_I = base == null ? void 0 : base.vectorDb) == null ? void 0 : _I.options) == null ? void 0 : _J.baseUrl) != null ? _L : "http://localhost:6333";
106
+ vectorDbOptions.apiKey = (_O = readString(env, "QDRANT_API_KEY")) != null ? _O : (_N = (_M = base == null ? void 0 : base.vectorDb) == null ? void 0 : _M.options) == null ? void 0 : _N.apiKey;
106
107
  vectorDbOptions.dimensions = embeddingDimensions;
107
108
  } else if (vectorProvider === "milvus") {
108
- vectorDbOptions.baseUrl = (_K = readString(env, "MILVUS_URL")) != null ? _K : "http://localhost:19530";
109
+ vectorDbOptions.baseUrl = (_P = readString(env, "MILVUS_URL")) != null ? _P : "http://localhost:19530";
109
110
  vectorDbOptions.apiKey = readString(env, "MILVUS_API_KEY");
110
111
  } else if (vectorProvider === "chromadb") {
111
- vectorDbOptions.baseUrl = (_L = readString(env, "CHROMADB_URL")) != null ? _L : "http://localhost:8000";
112
+ vectorDbOptions.baseUrl = (_Q = readString(env, "CHROMADB_URL")) != null ? _Q : "http://localhost:8000";
112
113
  } else if (vectorProvider === "weaviate") {
113
- vectorDbOptions.baseUrl = (_M = readString(env, "WEAVIATE_URL")) != null ? _M : "http://localhost:8080";
114
+ vectorDbOptions.baseUrl = (_R = readString(env, "WEAVIATE_URL")) != null ? _R : "http://localhost:8080";
114
115
  vectorDbOptions.apiKey = readString(env, "WEAVIATE_API_KEY");
115
116
  } else if (vectorProvider === "redis") {
116
- vectorDbOptions.baseUrl = (_N = readString(env, "REDIS_URL")) != null ? _N : "";
117
+ vectorDbOptions.baseUrl = (_S = readString(env, "REDIS_URL")) != null ? _S : "";
117
118
  vectorDbOptions.apiKey = readString(env, "REDIS_API_KEY");
118
119
  } else if (vectorProvider === "rest") {
119
- vectorDbOptions.baseUrl = (_O = readString(env, "VECTOR_DB_REST_URL")) != null ? _O : "";
120
+ vectorDbOptions.baseUrl = (_T = readString(env, "VECTOR_DB_REST_URL")) != null ? _T : "";
120
121
  vectorDbOptions.headers = readString(env, "VECTOR_DB_REST_API_KEY") ? { "api-key": readString(env, "VECTOR_DB_REST_API_KEY") } : {};
121
122
  } else if (vectorProvider === "universal_rest") {
122
- vectorDbOptions.baseUrl = (_Q = (_P = readString(env, "VECTOR_BASE_URL")) != null ? _P : readString(env, "VECTOR_DB_REST_URL")) != null ? _Q : "";
123
+ vectorDbOptions.baseUrl = (_V = (_U = readString(env, "VECTOR_BASE_URL")) != null ? _U : readString(env, "VECTOR_DB_REST_URL")) != null ? _V : "";
123
124
  vectorDbOptions.profile = readString(env, "VECTOR_UNIVERSAL_PROFILE");
124
125
  vectorDbOptions.headers = readString(env, "VECTOR_DB_REST_API_KEY") ? { Authorization: `Bearer ${readString(env, "VECTOR_DB_REST_API_KEY")}` } : {};
125
126
  }
@@ -136,20 +137,20 @@ function getEnvConfig(env = process.env, base) {
136
137
  openai: readString(env, "OPENAI_API_KEY"),
137
138
  gemini: readString(env, "GEMINI_API_KEY"),
138
139
  ollama: void 0,
139
- universal_rest: (_R = readString(env, "EMBEDDING_API_KEY")) != null ? _R : readString(env, "OPENAI_API_KEY"),
140
- custom: (_S = readString(env, "EMBEDDING_API_KEY")) != null ? _S : readString(env, "OPENAI_API_KEY")
140
+ universal_rest: (_W = readString(env, "EMBEDDING_API_KEY")) != null ? _W : readString(env, "OPENAI_API_KEY"),
141
+ custom: (_X = readString(env, "EMBEDDING_API_KEY")) != null ? _X : readString(env, "OPENAI_API_KEY")
141
142
  };
142
143
  return {
143
144
  projectId,
144
145
  vectorDb: {
145
146
  provider: vectorProvider,
146
- indexName: (_T = readString(env, "VECTOR_DB_INDEX")) != null ? _T : "rag-index",
147
+ indexName: (_Z = (_Y = readString(env, "VECTOR_DB_INDEX")) != null ? _Y : vectorDbOptions.indexName) != null ? _Z : "rag-index",
147
148
  options: vectorDbOptions
148
149
  },
149
150
  llm: {
150
151
  provider: llmProvider,
151
- model: (_U = readString(env, "LLM_MODEL")) != null ? _U : "gpt-4o",
152
- apiKey: (_V = llmApiKeyByProvider[llmProvider]) != null ? _V : "",
152
+ model: (__ = readString(env, "LLM_MODEL")) != null ? __ : "gpt-4o",
153
+ apiKey: (_$ = llmApiKeyByProvider[llmProvider]) != null ? _$ : "",
153
154
  baseUrl: readString(env, "LLM_BASE_URL"),
154
155
  systemPrompt: readString(env, "LLM_SYSTEM_PROMPT"),
155
156
  maxTokens: readNumber(env, "LLM_MAX_TOKENS", 1024),
@@ -160,7 +161,7 @@ function getEnvConfig(env = process.env, base) {
160
161
  },
161
162
  embedding: {
162
163
  provider: embeddingProvider,
163
- model: (_W = readString(env, "EMBEDDING_MODEL")) != null ? _W : "text-embedding-3-small",
164
+ model: (_aa = readString(env, "EMBEDDING_MODEL")) != null ? _aa : "text-embedding-3-small",
164
165
  apiKey: embeddingApiKeyByProvider[embeddingProvider],
165
166
  baseUrl: readString(env, "EMBEDDING_BASE_URL"),
166
167
  dimensions: embeddingDimensions,
@@ -171,17 +172,17 @@ function getEnvConfig(env = process.env, base) {
171
172
  }
172
173
  },
173
174
  ui: {
174
- title: (_Y = (_X = readString(env, "NEXT_PUBLIC_UI_TITLE")) != null ? _X : readString(env, "UI_TITLE")) != null ? _Y : "AI Assistant",
175
- subtitle: (__ = (_Z = readString(env, "NEXT_PUBLIC_UI_SUBTITLE")) != null ? _Z : readString(env, "UI_SUBTITLE")) != null ? __ : "Powered by RAG",
176
- primaryColor: (_aa = (_$ = readString(env, "NEXT_PUBLIC_PRIMARY_COLOR")) != null ? _$ : readString(env, "UI_PRIMARY_COLOR")) != null ? _aa : "#10b981",
177
- accentColor: (_ca = (_ba = readString(env, "NEXT_PUBLIC_ACCENT_COLOR")) != null ? _ba : readString(env, "UI_ACCENT_COLOR")) != null ? _ca : "#3b82f6",
178
- logoUrl: (_da = readString(env, "NEXT_PUBLIC_LOGO_URL")) != null ? _da : readString(env, "UI_LOGO_URL"),
179
- placeholder: (_fa = (_ea = readString(env, "NEXT_PUBLIC_PLACEHOLDER")) != null ? _ea : readString(env, "UI_PLACEHOLDER")) != null ? _fa : "Ask me anything\u2026",
180
- showSources: ((_ha = (_ga = readString(env, "NEXT_PUBLIC_SHOW_SOURCES")) != null ? _ga : readString(env, "UI_SHOW_SOURCES")) != null ? _ha : "true") !== "false",
181
- welcomeMessage: (_ja = (_ia = readString(env, "NEXT_PUBLIC_WELCOME_MESSAGE")) != null ? _ia : readString(env, "UI_WELCOME_MESSAGE")) != null ? _ja : "Hello! I'm your AI assistant. Ask me anything about your documents.",
182
- visualStyle: (_la = (_ka = readString(env, "NEXT_PUBLIC_UI_VISUAL_STYLE")) != null ? _ka : readString(env, "UI_VISUAL_STYLE")) != null ? _la : "glass",
183
- borderRadius: (_na = (_ma = readString(env, "NEXT_PUBLIC_UI_BORDER_RADIUS")) != null ? _ma : readString(env, "UI_BORDER_RADIUS")) != null ? _na : "xl",
184
- allowUpload: ((_pa = (_oa = readString(env, "NEXT_PUBLIC_ALLOW_UPLOAD")) != null ? _oa : readString(env, "UI_ALLOW_UPLOAD")) != null ? _pa : "false") === "true"
175
+ title: (_ca = (_ba = readString(env, "NEXT_PUBLIC_UI_TITLE")) != null ? _ba : readString(env, "UI_TITLE")) != null ? _ca : "AI Assistant",
176
+ subtitle: (_ea = (_da = readString(env, "NEXT_PUBLIC_UI_SUBTITLE")) != null ? _da : readString(env, "UI_SUBTITLE")) != null ? _ea : "Powered by RAG",
177
+ primaryColor: (_ga = (_fa = readString(env, "NEXT_PUBLIC_PRIMARY_COLOR")) != null ? _fa : readString(env, "UI_PRIMARY_COLOR")) != null ? _ga : "#10b981",
178
+ accentColor: (_ia = (_ha = readString(env, "NEXT_PUBLIC_ACCENT_COLOR")) != null ? _ha : readString(env, "UI_ACCENT_COLOR")) != null ? _ia : "#3b82f6",
179
+ logoUrl: (_ja = readString(env, "NEXT_PUBLIC_LOGO_URL")) != null ? _ja : readString(env, "UI_LOGO_URL"),
180
+ placeholder: (_la = (_ka = readString(env, "NEXT_PUBLIC_PLACEHOLDER")) != null ? _ka : readString(env, "UI_PLACEHOLDER")) != null ? _la : "Ask me anything\u2026",
181
+ showSources: ((_na = (_ma = readString(env, "NEXT_PUBLIC_SHOW_SOURCES")) != null ? _ma : readString(env, "UI_SHOW_SOURCES")) != null ? _na : "true") !== "false",
182
+ welcomeMessage: (_pa = (_oa = readString(env, "NEXT_PUBLIC_WELCOME_MESSAGE")) != null ? _oa : readString(env, "UI_WELCOME_MESSAGE")) != null ? _pa : "Hello! I'm your AI assistant. Ask me anything about your documents.",
183
+ visualStyle: (_ra = (_qa = readString(env, "NEXT_PUBLIC_UI_VISUAL_STYLE")) != null ? _qa : readString(env, "UI_VISUAL_STYLE")) != null ? _ra : "glass",
184
+ borderRadius: (_ta = (_sa = readString(env, "NEXT_PUBLIC_UI_BORDER_RADIUS")) != null ? _sa : readString(env, "UI_BORDER_RADIUS")) != null ? _ta : "xl",
185
+ allowUpload: ((_va = (_ua = readString(env, "NEXT_PUBLIC_ALLOW_UPLOAD")) != null ? _ua : readString(env, "UI_ALLOW_UPLOAD")) != null ? _va : "false") === "true"
185
186
  },
186
187
  rag: {
187
188
  topK: readNumber(env, "RAG_TOP_K", 5),
@@ -1689,7 +1689,7 @@ function readEnum(env, name, fallback, allowed) {
1689
1689
  throw new Error(`[getRagConfig] ${name} must be one of: ${allowed.join(", ")}`);
1690
1690
  }
1691
1691
  function getEnvConfig(env = process.env, base) {
1692
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V, _W, _X, _Y, _Z, __, _$, _aa, _ba, _ca, _da, _ea, _fa, _ga, _ha, _ia, _ja, _ka, _la, _ma, _na, _oa, _pa;
1692
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V, _W, _X, _Y, _Z, __, _$, _aa, _ba, _ca, _da, _ea, _fa, _ga, _ha, _ia, _ja, _ka, _la, _ma, _na, _oa, _pa, _qa, _ra, _sa, _ta, _ua, _va;
1693
1693
  const projectId = (_c = (_b = (_a = readString(env, "RAG_PROJECT_ID")) != null ? _a : readString(env, "NEXT_PUBLIC_PROJECT_ID")) != null ? _b : base == null ? void 0 : base.projectId) != null ? _c : "__default__";
1694
1694
  const vectorProvider = readEnum(env, "VECTOR_DB_PROVIDER", "pinecone", VECTOR_DB_PROVIDERS);
1695
1695
  const llmProvider = readEnum(env, "LLM_PROVIDER", "openai", LLM_PROVIDERS);
@@ -1698,34 +1698,35 @@ function getEnvConfig(env = process.env, base) {
1698
1698
  const vectorDbOptions = {};
1699
1699
  if (vectorProvider === "pinecone") {
1700
1700
  vectorDbOptions.apiKey = (_g = (_f = readString(env, "PINECONE_API_KEY")) != null ? _f : (_e = (_d = base == null ? void 0 : base.vectorDb) == null ? void 0 : _d.options) == null ? void 0 : _e.apiKey) != null ? _g : "";
1701
+ vectorDbOptions.indexName = (_l = (_i = readString(env, "PINECONE_INDEX")) != null ? _i : (_h = base == null ? void 0 : base.vectorDb) == null ? void 0 : _h.indexName) != null ? _l : (_k = (_j = base == null ? void 0 : base.vectorDb) == null ? void 0 : _j.options) == null ? void 0 : _k.indexName;
1701
1702
  } else if (vectorProvider === "pgvector" || vectorProvider === "postgresql") {
1702
- vectorDbOptions.connectionString = (_k = (_j = readString(env, "PGVECTOR_CONNECTION_STRING")) != null ? _j : (_i = (_h = base == null ? void 0 : base.vectorDb) == null ? void 0 : _h.options) == null ? void 0 : _i.connectionString) != null ? _k : "";
1703
+ vectorDbOptions.connectionString = (_p = (_o = readString(env, "PGVECTOR_CONNECTION_STRING")) != null ? _o : (_n = (_m = base == null ? void 0 : base.vectorDb) == null ? void 0 : _m.options) == null ? void 0 : _n.connectionString) != null ? _p : "";
1703
1704
  vectorDbOptions.dimensions = embeddingDimensions;
1704
1705
  } else if (vectorProvider === "mongodb") {
1705
- vectorDbOptions.uri = (_o = (_n = readString(env, "MONGODB_URI")) != null ? _n : (_m = (_l = base == null ? void 0 : base.vectorDb) == null ? void 0 : _l.options) == null ? void 0 : _m.uri) != null ? _o : "";
1706
- vectorDbOptions.database = (_s = (_r = readString(env, "MONGODB_DB")) != null ? _r : (_q = (_p = base == null ? void 0 : base.vectorDb) == null ? void 0 : _p.options) == null ? void 0 : _q.database) != null ? _s : "";
1707
- vectorDbOptions.collection = (_w = (_v = readString(env, "MONGODB_COLLECTION")) != null ? _v : (_u = (_t = base == null ? void 0 : base.vectorDb) == null ? void 0 : _t.options) == null ? void 0 : _u.collection) != null ? _w : "";
1708
- vectorDbOptions.indexName = (_C = (_B = (_y = readString(env, "MONGODB_INDEX_NAME")) != null ? _y : (_x = base == null ? void 0 : base.vectorDb) == null ? void 0 : _x.indexName) != null ? _B : (_A = (_z = base == null ? void 0 : base.vectorDb) == null ? void 0 : _z.options) == null ? void 0 : _A.indexName) != null ? _C : "vector_index";
1706
+ vectorDbOptions.uri = (_t = (_s = readString(env, "MONGODB_URI")) != null ? _s : (_r = (_q = base == null ? void 0 : base.vectorDb) == null ? void 0 : _q.options) == null ? void 0 : _r.uri) != null ? _t : "";
1707
+ vectorDbOptions.database = (_x = (_w = readString(env, "MONGODB_DB")) != null ? _w : (_v = (_u = base == null ? void 0 : base.vectorDb) == null ? void 0 : _u.options) == null ? void 0 : _v.database) != null ? _x : "";
1708
+ vectorDbOptions.collection = (_B = (_A = readString(env, "MONGODB_COLLECTION")) != null ? _A : (_z = (_y = base == null ? void 0 : base.vectorDb) == null ? void 0 : _y.options) == null ? void 0 : _z.collection) != null ? _B : "";
1709
+ vectorDbOptions.indexName = (_H = (_G = (_D = readString(env, "MONGODB_INDEX_NAME")) != null ? _D : (_C = base == null ? void 0 : base.vectorDb) == null ? void 0 : _C.indexName) != null ? _G : (_F = (_E = base == null ? void 0 : base.vectorDb) == null ? void 0 : _E.options) == null ? void 0 : _F.indexName) != null ? _H : "vector_index";
1709
1710
  } else if (vectorProvider === "qdrant") {
1710
- vectorDbOptions.baseUrl = (_G = (_F = readString(env, "QDRANT_URL")) != null ? _F : (_E = (_D = base == null ? void 0 : base.vectorDb) == null ? void 0 : _D.options) == null ? void 0 : _E.baseUrl) != null ? _G : "http://localhost:6333";
1711
- vectorDbOptions.apiKey = (_J = readString(env, "QDRANT_API_KEY")) != null ? _J : (_I = (_H = base == null ? void 0 : base.vectorDb) == null ? void 0 : _H.options) == null ? void 0 : _I.apiKey;
1711
+ vectorDbOptions.baseUrl = (_L = (_K = readString(env, "QDRANT_URL")) != null ? _K : (_J = (_I = base == null ? void 0 : base.vectorDb) == null ? void 0 : _I.options) == null ? void 0 : _J.baseUrl) != null ? _L : "http://localhost:6333";
1712
+ vectorDbOptions.apiKey = (_O = readString(env, "QDRANT_API_KEY")) != null ? _O : (_N = (_M = base == null ? void 0 : base.vectorDb) == null ? void 0 : _M.options) == null ? void 0 : _N.apiKey;
1712
1713
  vectorDbOptions.dimensions = embeddingDimensions;
1713
1714
  } else if (vectorProvider === "milvus") {
1714
- vectorDbOptions.baseUrl = (_K = readString(env, "MILVUS_URL")) != null ? _K : "http://localhost:19530";
1715
+ vectorDbOptions.baseUrl = (_P = readString(env, "MILVUS_URL")) != null ? _P : "http://localhost:19530";
1715
1716
  vectorDbOptions.apiKey = readString(env, "MILVUS_API_KEY");
1716
1717
  } else if (vectorProvider === "chromadb") {
1717
- vectorDbOptions.baseUrl = (_L = readString(env, "CHROMADB_URL")) != null ? _L : "http://localhost:8000";
1718
+ vectorDbOptions.baseUrl = (_Q = readString(env, "CHROMADB_URL")) != null ? _Q : "http://localhost:8000";
1718
1719
  } else if (vectorProvider === "weaviate") {
1719
- vectorDbOptions.baseUrl = (_M = readString(env, "WEAVIATE_URL")) != null ? _M : "http://localhost:8080";
1720
+ vectorDbOptions.baseUrl = (_R = readString(env, "WEAVIATE_URL")) != null ? _R : "http://localhost:8080";
1720
1721
  vectorDbOptions.apiKey = readString(env, "WEAVIATE_API_KEY");
1721
1722
  } else if (vectorProvider === "redis") {
1722
- vectorDbOptions.baseUrl = (_N = readString(env, "REDIS_URL")) != null ? _N : "";
1723
+ vectorDbOptions.baseUrl = (_S = readString(env, "REDIS_URL")) != null ? _S : "";
1723
1724
  vectorDbOptions.apiKey = readString(env, "REDIS_API_KEY");
1724
1725
  } else if (vectorProvider === "rest") {
1725
- vectorDbOptions.baseUrl = (_O = readString(env, "VECTOR_DB_REST_URL")) != null ? _O : "";
1726
+ vectorDbOptions.baseUrl = (_T = readString(env, "VECTOR_DB_REST_URL")) != null ? _T : "";
1726
1727
  vectorDbOptions.headers = readString(env, "VECTOR_DB_REST_API_KEY") ? { "api-key": readString(env, "VECTOR_DB_REST_API_KEY") } : {};
1727
1728
  } else if (vectorProvider === "universal_rest") {
1728
- vectorDbOptions.baseUrl = (_Q = (_P = readString(env, "VECTOR_BASE_URL")) != null ? _P : readString(env, "VECTOR_DB_REST_URL")) != null ? _Q : "";
1729
+ vectorDbOptions.baseUrl = (_V = (_U = readString(env, "VECTOR_BASE_URL")) != null ? _U : readString(env, "VECTOR_DB_REST_URL")) != null ? _V : "";
1729
1730
  vectorDbOptions.profile = readString(env, "VECTOR_UNIVERSAL_PROFILE");
1730
1731
  vectorDbOptions.headers = readString(env, "VECTOR_DB_REST_API_KEY") ? { Authorization: `Bearer ${readString(env, "VECTOR_DB_REST_API_KEY")}` } : {};
1731
1732
  }
@@ -1742,20 +1743,20 @@ function getEnvConfig(env = process.env, base) {
1742
1743
  openai: readString(env, "OPENAI_API_KEY"),
1743
1744
  gemini: readString(env, "GEMINI_API_KEY"),
1744
1745
  ollama: void 0,
1745
- universal_rest: (_R = readString(env, "EMBEDDING_API_KEY")) != null ? _R : readString(env, "OPENAI_API_KEY"),
1746
- custom: (_S = readString(env, "EMBEDDING_API_KEY")) != null ? _S : readString(env, "OPENAI_API_KEY")
1746
+ universal_rest: (_W = readString(env, "EMBEDDING_API_KEY")) != null ? _W : readString(env, "OPENAI_API_KEY"),
1747
+ custom: (_X = readString(env, "EMBEDDING_API_KEY")) != null ? _X : readString(env, "OPENAI_API_KEY")
1747
1748
  };
1748
1749
  return {
1749
1750
  projectId,
1750
1751
  vectorDb: {
1751
1752
  provider: vectorProvider,
1752
- indexName: (_T = readString(env, "VECTOR_DB_INDEX")) != null ? _T : "rag-index",
1753
+ indexName: (_Z = (_Y = readString(env, "VECTOR_DB_INDEX")) != null ? _Y : vectorDbOptions.indexName) != null ? _Z : "rag-index",
1753
1754
  options: vectorDbOptions
1754
1755
  },
1755
1756
  llm: {
1756
1757
  provider: llmProvider,
1757
- model: (_U = readString(env, "LLM_MODEL")) != null ? _U : "gpt-4o",
1758
- apiKey: (_V = llmApiKeyByProvider[llmProvider]) != null ? _V : "",
1758
+ model: (__ = readString(env, "LLM_MODEL")) != null ? __ : "gpt-4o",
1759
+ apiKey: (_$ = llmApiKeyByProvider[llmProvider]) != null ? _$ : "",
1759
1760
  baseUrl: readString(env, "LLM_BASE_URL"),
1760
1761
  systemPrompt: readString(env, "LLM_SYSTEM_PROMPT"),
1761
1762
  maxTokens: readNumber(env, "LLM_MAX_TOKENS", 1024),
@@ -1766,7 +1767,7 @@ function getEnvConfig(env = process.env, base) {
1766
1767
  },
1767
1768
  embedding: {
1768
1769
  provider: embeddingProvider,
1769
- model: (_W = readString(env, "EMBEDDING_MODEL")) != null ? _W : "text-embedding-3-small",
1770
+ model: (_aa = readString(env, "EMBEDDING_MODEL")) != null ? _aa : "text-embedding-3-small",
1770
1771
  apiKey: embeddingApiKeyByProvider[embeddingProvider],
1771
1772
  baseUrl: readString(env, "EMBEDDING_BASE_URL"),
1772
1773
  dimensions: embeddingDimensions,
@@ -1777,17 +1778,17 @@ function getEnvConfig(env = process.env, base) {
1777
1778
  }
1778
1779
  },
1779
1780
  ui: {
1780
- title: (_Y = (_X = readString(env, "NEXT_PUBLIC_UI_TITLE")) != null ? _X : readString(env, "UI_TITLE")) != null ? _Y : "AI Assistant",
1781
- subtitle: (__ = (_Z = readString(env, "NEXT_PUBLIC_UI_SUBTITLE")) != null ? _Z : readString(env, "UI_SUBTITLE")) != null ? __ : "Powered by RAG",
1782
- primaryColor: (_aa = (_$ = readString(env, "NEXT_PUBLIC_PRIMARY_COLOR")) != null ? _$ : readString(env, "UI_PRIMARY_COLOR")) != null ? _aa : "#10b981",
1783
- accentColor: (_ca = (_ba = readString(env, "NEXT_PUBLIC_ACCENT_COLOR")) != null ? _ba : readString(env, "UI_ACCENT_COLOR")) != null ? _ca : "#3b82f6",
1784
- logoUrl: (_da = readString(env, "NEXT_PUBLIC_LOGO_URL")) != null ? _da : readString(env, "UI_LOGO_URL"),
1785
- placeholder: (_fa = (_ea = readString(env, "NEXT_PUBLIC_PLACEHOLDER")) != null ? _ea : readString(env, "UI_PLACEHOLDER")) != null ? _fa : "Ask me anything\u2026",
1786
- showSources: ((_ha = (_ga = readString(env, "NEXT_PUBLIC_SHOW_SOURCES")) != null ? _ga : readString(env, "UI_SHOW_SOURCES")) != null ? _ha : "true") !== "false",
1787
- welcomeMessage: (_ja = (_ia = readString(env, "NEXT_PUBLIC_WELCOME_MESSAGE")) != null ? _ia : readString(env, "UI_WELCOME_MESSAGE")) != null ? _ja : "Hello! I'm your AI assistant. Ask me anything about your documents.",
1788
- visualStyle: (_la = (_ka = readString(env, "NEXT_PUBLIC_UI_VISUAL_STYLE")) != null ? _ka : readString(env, "UI_VISUAL_STYLE")) != null ? _la : "glass",
1789
- borderRadius: (_na = (_ma = readString(env, "NEXT_PUBLIC_UI_BORDER_RADIUS")) != null ? _ma : readString(env, "UI_BORDER_RADIUS")) != null ? _na : "xl",
1790
- allowUpload: ((_pa = (_oa = readString(env, "NEXT_PUBLIC_ALLOW_UPLOAD")) != null ? _oa : readString(env, "UI_ALLOW_UPLOAD")) != null ? _pa : "false") === "true"
1781
+ title: (_ca = (_ba = readString(env, "NEXT_PUBLIC_UI_TITLE")) != null ? _ba : readString(env, "UI_TITLE")) != null ? _ca : "AI Assistant",
1782
+ subtitle: (_ea = (_da = readString(env, "NEXT_PUBLIC_UI_SUBTITLE")) != null ? _da : readString(env, "UI_SUBTITLE")) != null ? _ea : "Powered by RAG",
1783
+ primaryColor: (_ga = (_fa = readString(env, "NEXT_PUBLIC_PRIMARY_COLOR")) != null ? _fa : readString(env, "UI_PRIMARY_COLOR")) != null ? _ga : "#10b981",
1784
+ accentColor: (_ia = (_ha = readString(env, "NEXT_PUBLIC_ACCENT_COLOR")) != null ? _ha : readString(env, "UI_ACCENT_COLOR")) != null ? _ia : "#3b82f6",
1785
+ logoUrl: (_ja = readString(env, "NEXT_PUBLIC_LOGO_URL")) != null ? _ja : readString(env, "UI_LOGO_URL"),
1786
+ placeholder: (_la = (_ka = readString(env, "NEXT_PUBLIC_PLACEHOLDER")) != null ? _ka : readString(env, "UI_PLACEHOLDER")) != null ? _la : "Ask me anything\u2026",
1787
+ showSources: ((_na = (_ma = readString(env, "NEXT_PUBLIC_SHOW_SOURCES")) != null ? _ma : readString(env, "UI_SHOW_SOURCES")) != null ? _na : "true") !== "false",
1788
+ welcomeMessage: (_pa = (_oa = readString(env, "NEXT_PUBLIC_WELCOME_MESSAGE")) != null ? _oa : readString(env, "UI_WELCOME_MESSAGE")) != null ? _pa : "Hello! I'm your AI assistant. Ask me anything about your documents.",
1789
+ visualStyle: (_ra = (_qa = readString(env, "NEXT_PUBLIC_UI_VISUAL_STYLE")) != null ? _qa : readString(env, "UI_VISUAL_STYLE")) != null ? _ra : "glass",
1790
+ borderRadius: (_ta = (_sa = readString(env, "NEXT_PUBLIC_UI_BORDER_RADIUS")) != null ? _sa : readString(env, "UI_BORDER_RADIUS")) != null ? _ta : "xl",
1791
+ allowUpload: ((_va = (_ua = readString(env, "NEXT_PUBLIC_ALLOW_UPLOAD")) != null ? _ua : readString(env, "UI_ALLOW_UPLOAD")) != null ? _va : "false") === "true"
1791
1792
  },
1792
1793
  rag: {
1793
1794
  topK: readNumber(env, "RAG_TOP_K", 5),
@@ -8,7 +8,7 @@ import {
8
8
  sseFrame,
9
9
  sseMetaFrame,
10
10
  sseTextFrame
11
- } from "../chunk-JBZEUFW3.mjs";
11
+ } from "../chunk-OCDCJUNE.mjs";
12
12
  import "../chunk-YLTMFW4M.mjs";
13
13
  import "../chunk-X4TOT24V.mjs";
14
14
  export {