@retrivora-ai/rag-engine 2.3.8 → 2.3.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.
- package/dist/handlers/index.js +64 -35
- package/dist/handlers/index.mjs +64 -35
- package/dist/index.css +0 -15
- package/dist/index.js +35 -19
- package/dist/index.mjs +35 -19
- package/dist/server.js +64 -35
- package/dist/server.mjs +64 -35
- package/package.json +1 -1
- package/src/components/DocumentUpload.tsx +34 -15
- package/src/config/serverConfig.ts +14 -3
- package/src/core/ConfigFetcher.ts +6 -0
- package/src/handlers/index.ts +2 -0
- package/src/index.css +0 -15
- package/src/llm/providers/UniversalLLMAdapter.ts +18 -2
|
@@ -113,6 +113,7 @@ export class ConfigFetcher {
|
|
|
113
113
|
for (const baseUrl of controlPlaneUrls) {
|
|
114
114
|
try {
|
|
115
115
|
const url = `${baseUrl}/api/v1/config?projectId=${encodeURIComponent(projectId)}`;
|
|
116
|
+
console.log(`[ConfigFetcher] Fetching config from: ${url}`);
|
|
116
117
|
const res = await fetch(url, {
|
|
117
118
|
method: 'GET',
|
|
118
119
|
headers: {
|
|
@@ -122,6 +123,11 @@ export class ConfigFetcher {
|
|
|
122
123
|
},
|
|
123
124
|
});
|
|
124
125
|
|
|
126
|
+
console.log(`[ConfigFetcher] Response status: ${res.status}`);
|
|
127
|
+
if (!res.ok) {
|
|
128
|
+
console.warn(`[ConfigFetcher] Error text: ${await res.text()}`);
|
|
129
|
+
}
|
|
130
|
+
|
|
125
131
|
if (res.ok) {
|
|
126
132
|
const data = await res.json();
|
|
127
133
|
// NOTE: The config API intentionally does NOT return vectorDb.apiKey (server-only secret).
|
package/src/handlers/index.ts
CHANGED
|
@@ -998,6 +998,8 @@ export function createLicenseHandler(
|
|
|
998
998
|
|
|
999
999
|
const projectId = body?.projectId || config.projectId || '';
|
|
1000
1000
|
|
|
1001
|
+
console.log(`[DEBUG] createLicenseHandler: projectId="${projectId}", body.projectId="${body?.projectId}", config.projectId="${config.projectId}"`);
|
|
1002
|
+
|
|
1001
1003
|
const payload = await LicenseVerifier.verifyAsync(licenseKey, projectId);
|
|
1002
1004
|
|
|
1003
1005
|
return NextResponse.json({
|
package/src/index.css
CHANGED
|
@@ -2360,11 +2360,6 @@
|
|
|
2360
2360
|
cursor: not-allowed;
|
|
2361
2361
|
}
|
|
2362
2362
|
}
|
|
2363
|
-
.disabled\:text-slate-400 {
|
|
2364
|
-
&:disabled {
|
|
2365
|
-
color: var(--color-slate-400);
|
|
2366
|
-
}
|
|
2367
|
-
}
|
|
2368
2363
|
.disabled\:opacity-30 {
|
|
2369
2364
|
&:disabled {
|
|
2370
2365
|
opacity: 30%;
|
|
@@ -3578,16 +3573,6 @@
|
|
|
3578
3573
|
}
|
|
3579
3574
|
}
|
|
3580
3575
|
}
|
|
3581
|
-
.dark\:disabled\:text-white\/30 {
|
|
3582
|
-
@media (prefers-color-scheme: dark) {
|
|
3583
|
-
&:disabled {
|
|
3584
|
-
color: color-mix(in srgb, #fff 30%, transparent);
|
|
3585
|
-
@supports (color: color-mix(in lab, red, red)) {
|
|
3586
|
-
color: color-mix(in oklab, var(--color-white) 30%, transparent);
|
|
3587
|
-
}
|
|
3588
|
-
}
|
|
3589
|
-
}
|
|
3590
|
-
}
|
|
3591
3576
|
.dark\:disabled\:hover\:text-white\/40 {
|
|
3592
3577
|
@media (prefers-color-scheme: dark) {
|
|
3593
3578
|
&:disabled {
|
|
@@ -70,6 +70,13 @@ export class UniversalLLMAdapter implements ILLMProvider {
|
|
|
70
70
|
...(this.opts.headers || {}),
|
|
71
71
|
};
|
|
72
72
|
|
|
73
|
+
console.log('[UniversalLLMAdapter] Initialized with:', {
|
|
74
|
+
model: this.model,
|
|
75
|
+
baseUrl: this.baseUrl,
|
|
76
|
+
hasApiKey: !!this.apiKey,
|
|
77
|
+
apiKeyPrefix: this.apiKey ? `${this.apiKey.slice(0, 12)}...` : undefined,
|
|
78
|
+
});
|
|
79
|
+
|
|
73
80
|
this.http = axios.create({
|
|
74
81
|
baseURL: this.baseUrl,
|
|
75
82
|
headers: this.resolvedHeaders,
|
|
@@ -318,10 +325,17 @@ export class UniversalLLMAdapter implements ILLMProvider {
|
|
|
318
325
|
|
|
319
326
|
// First attempt: try HTTP call with fallback
|
|
320
327
|
try {
|
|
328
|
+
console.log(`[UniversalLLMAdapter] Posting to embedding endpoint: ${this.baseUrl}${path}`, {
|
|
329
|
+
model: this.model,
|
|
330
|
+
inputLength: typeof text === 'string' ? text.length : 'unknown',
|
|
331
|
+
});
|
|
321
332
|
const { data } = await this.http.post(path, payload);
|
|
322
333
|
const extractPath = this.opts.embedExtractPath ?? 'data[0].embedding';
|
|
323
334
|
const vector = resolvePath(data, extractPath) as number[] | undefined;
|
|
324
|
-
if (Array.isArray(vector))
|
|
335
|
+
if (Array.isArray(vector)) {
|
|
336
|
+
console.log(`[UniversalLLMAdapter] Embedding HTTP request successful. Vector size: ${vector.length}`);
|
|
337
|
+
return vector;
|
|
338
|
+
}
|
|
325
339
|
|
|
326
340
|
// If we get here, the API succeeded but the response format was invalid
|
|
327
341
|
console.warn(
|
|
@@ -331,7 +345,7 @@ export class UniversalLLMAdapter implements ILLMProvider {
|
|
|
331
345
|
} catch (err: any) {
|
|
332
346
|
console.warn(
|
|
333
347
|
`[UniversalLLMAdapter] HTTP embedding request failed: ${err?.message || err}`,
|
|
334
|
-
{ path, model: this.model }
|
|
348
|
+
{ path, model: this.model, response: err?.response?.data }
|
|
335
349
|
);
|
|
336
350
|
|
|
337
351
|
// In-process fallback for embeddings
|
|
@@ -352,11 +366,13 @@ export class UniversalLLMAdapter implements ILLMProvider {
|
|
|
352
366
|
|
|
353
367
|
// Second attempt: retry the HTTP call
|
|
354
368
|
try {
|
|
369
|
+
console.log(`[UniversalLLMAdapter] Retrying embedding request to: ${this.baseUrl}${path}`);
|
|
355
370
|
const { data } = await this.http.post(path, payload);
|
|
356
371
|
const extractPath = this.opts.embedExtractPath ?? 'data[0].embedding';
|
|
357
372
|
const vector = resolvePath(data, extractPath) as number[] | undefined;
|
|
358
373
|
|
|
359
374
|
if (Array.isArray(vector)) {
|
|
375
|
+
console.log(`[UniversalLLMAdapter] Retry embedding HTTP request successful. Vector size: ${vector.length}`);
|
|
360
376
|
return vector;
|
|
361
377
|
}
|
|
362
378
|
|