@exulu/backend 5.7.2 → 5.8.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/{catalog-3QLU2G7R.js → catalog-4P3TKOV7.js} +2 -1
- package/dist/chunk-4W3V7IHR.js +1166 -0
- package/dist/chunk-6URU62NI.js +54 -0
- package/dist/{chunk-4PDWNVNT.js → chunk-F534XOQR.js} +3 -50
- package/dist/{chunk-RELZZYVA.js → chunk-NUEM3HMI.js} +460 -1471
- package/dist/chunk-RNZ4IDCT.js +946 -0
- package/dist/{convert-exulu-tools-to-ai-sdk-tools-L6SESYPH.js → convert-exulu-tools-to-ai-sdk-tools-3UCQOIY6.js} +4 -2
- package/dist/doc_processor-E5GCE2ZT.js +10 -0
- package/dist/index.cjs +29618 -29397
- package/dist/index.d.cts +118 -105
- package/dist/index.d.ts +118 -105
- package/dist/index.js +184 -1051
- package/ee/invoke-skills/binary-file-guard.test.ts +0 -0
- package/ee/invoke-skills/binary-file-guard.ts +0 -0
- package/ee/python/documents/processing/doc_processor.ts +3 -3
- package/package.json +1 -1
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import "dotenv/config";
|
|
2
|
+
|
|
3
|
+
// src/exulu/litellm/env.ts
|
|
4
|
+
var LiteLLMAdminError = class extends Error {
|
|
5
|
+
constructor(message, status) {
|
|
6
|
+
super(message);
|
|
7
|
+
this.status = status;
|
|
8
|
+
this.name = "LiteLLMAdminError";
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
function litellmBase() {
|
|
12
|
+
const host = process.env.LITELLM_HOST ?? "127.0.0.1";
|
|
13
|
+
const port = process.env.LITELLM_PORT ?? "4000";
|
|
14
|
+
const masterKey = process.env.LITELLM_MASTER_KEY;
|
|
15
|
+
if (!masterKey) {
|
|
16
|
+
throw new LiteLLMAdminError("LITELLM_MASTER_KEY is not configured.");
|
|
17
|
+
}
|
|
18
|
+
return { url: `http://${host}:${port}`, masterKey };
|
|
19
|
+
}
|
|
20
|
+
var _clientMode = false;
|
|
21
|
+
var isLiteLLMClientMode = () => _clientMode;
|
|
22
|
+
var setLiteLLMClientMode = (value) => {
|
|
23
|
+
_clientMode = value;
|
|
24
|
+
};
|
|
25
|
+
function resolveLiteLLMTarget() {
|
|
26
|
+
const rawBase = process.env.LITELLM_BASE_URL;
|
|
27
|
+
if (isLiteLLMClientMode() && rawBase && rawBase.trim().length > 0) {
|
|
28
|
+
const apiKey = process.env.EXULU_API_KEY;
|
|
29
|
+
if (!apiKey) {
|
|
30
|
+
throw new Error("EXULU_API_KEY is required when LITELLM_BASE_URL is set (remote LiteLLM client mode).");
|
|
31
|
+
}
|
|
32
|
+
return {
|
|
33
|
+
baseUrl: rawBase.trim().replace(/\/+$/, ""),
|
|
34
|
+
authHeaders: { "exulu-api-key": apiKey },
|
|
35
|
+
remote: true
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
const host = process.env.LITELLM_HOST ?? "127.0.0.1";
|
|
39
|
+
const port = process.env.LITELLM_PORT ?? "4000";
|
|
40
|
+
const masterKey = process.env.LITELLM_MASTER_KEY;
|
|
41
|
+
return {
|
|
42
|
+
baseUrl: `http://${host}:${port}`,
|
|
43
|
+
authHeaders: masterKey ? { Authorization: `Bearer ${masterKey}` } : {},
|
|
44
|
+
remote: false
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export {
|
|
49
|
+
LiteLLMAdminError,
|
|
50
|
+
litellmBase,
|
|
51
|
+
isLiteLLMClientMode,
|
|
52
|
+
setLiteLLMClientMode,
|
|
53
|
+
resolveLiteLLMTarget
|
|
54
|
+
};
|
|
@@ -1,49 +1,7 @@
|
|
|
1
1
|
import "dotenv/config";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
constructor(message, status) {
|
|
6
|
-
super(message);
|
|
7
|
-
this.status = status;
|
|
8
|
-
this.name = "LiteLLMAdminError";
|
|
9
|
-
}
|
|
10
|
-
};
|
|
11
|
-
function litellmBase() {
|
|
12
|
-
const host = process.env.LITELLM_HOST ?? "127.0.0.1";
|
|
13
|
-
const port = process.env.LITELLM_PORT ?? "4000";
|
|
14
|
-
const masterKey = process.env.LITELLM_MASTER_KEY;
|
|
15
|
-
if (!masterKey) {
|
|
16
|
-
throw new LiteLLMAdminError("LITELLM_MASTER_KEY is not configured.");
|
|
17
|
-
}
|
|
18
|
-
return { url: `http://${host}:${port}`, masterKey };
|
|
19
|
-
}
|
|
20
|
-
var _clientMode = false;
|
|
21
|
-
var isLiteLLMClientMode = () => _clientMode;
|
|
22
|
-
var setLiteLLMClientMode = (value) => {
|
|
23
|
-
_clientMode = value;
|
|
24
|
-
};
|
|
25
|
-
function resolveLiteLLMTarget() {
|
|
26
|
-
const rawBase = process.env.LITELLM_BASE_URL;
|
|
27
|
-
if (isLiteLLMClientMode() && rawBase && rawBase.trim().length > 0) {
|
|
28
|
-
const apiKey = process.env.EXULU_API_KEY;
|
|
29
|
-
if (!apiKey) {
|
|
30
|
-
throw new Error("EXULU_API_KEY is required when LITELLM_BASE_URL is set (remote LiteLLM client mode).");
|
|
31
|
-
}
|
|
32
|
-
return {
|
|
33
|
-
baseUrl: rawBase.trim().replace(/\/+$/, ""),
|
|
34
|
-
authHeaders: { "exulu-api-key": apiKey },
|
|
35
|
-
remote: true
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
const host = process.env.LITELLM_HOST ?? "127.0.0.1";
|
|
39
|
-
const port = process.env.LITELLM_PORT ?? "4000";
|
|
40
|
-
const masterKey = process.env.LITELLM_MASTER_KEY;
|
|
41
|
-
return {
|
|
42
|
-
baseUrl: `http://${host}:${port}`,
|
|
43
|
-
authHeaders: masterKey ? { Authorization: `Bearer ${masterKey}` } : {},
|
|
44
|
-
remote: false
|
|
45
|
-
};
|
|
46
|
-
}
|
|
2
|
+
import {
|
|
3
|
+
resolveLiteLLMTarget
|
|
4
|
+
} from "./chunk-6URU62NI.js";
|
|
47
5
|
|
|
48
6
|
// src/exulu/litellm/catalog.ts
|
|
49
7
|
var CACHE_TTL_MS = 3e4;
|
|
@@ -127,11 +85,6 @@ var findLiteLLMModel = async (modelName) => {
|
|
|
127
85
|
};
|
|
128
86
|
|
|
129
87
|
export {
|
|
130
|
-
LiteLLMAdminError,
|
|
131
|
-
litellmBase,
|
|
132
|
-
isLiteLLMClientMode,
|
|
133
|
-
setLiteLLMClientMode,
|
|
134
|
-
resolveLiteLLMTarget,
|
|
135
88
|
__resetLiteLLMCatalogCacheForTesting,
|
|
136
89
|
fetchLiteLLMCatalog,
|
|
137
90
|
findLiteLLMModel
|