elsium-ai 0.9.0 → 0.9.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/index.js +20 -14
- package/package.json +12 -12
package/dist/index.js
CHANGED
|
@@ -3862,27 +3862,33 @@ function createProviderMesh(config) {
|
|
|
3862
3862
|
}
|
|
3863
3863
|
return { success: true };
|
|
3864
3864
|
}
|
|
3865
|
+
async function attemptStreamProvider(entry, nextProvider, request, emit) {
|
|
3866
|
+
try {
|
|
3867
|
+
const result = await tryStreamProvider(entry, request, emit);
|
|
3868
|
+
if (result.success)
|
|
3869
|
+
return { success: true };
|
|
3870
|
+
logStreamFailover(entry.name, nextProvider, result.error);
|
|
3871
|
+
return { success: false, error: result.error };
|
|
3872
|
+
} catch (err2) {
|
|
3873
|
+
const error = toError2(err2);
|
|
3874
|
+
logStreamFailover(entry.name, nextProvider, error);
|
|
3875
|
+
return { success: false, error };
|
|
3876
|
+
}
|
|
3877
|
+
}
|
|
3865
3878
|
async function runStreamFallbackLoop(available, request, emit) {
|
|
3866
3879
|
let lastError = null;
|
|
3867
3880
|
let failedProvider = null;
|
|
3868
3881
|
for (let i = 0;i < available.length; i++) {
|
|
3869
3882
|
const entry = available[i];
|
|
3870
3883
|
const nextProvider = i + 1 < available.length ? available[i + 1].name : "none";
|
|
3871
|
-
|
|
3872
|
-
|
|
3873
|
-
if (
|
|
3874
|
-
|
|
3875
|
-
|
|
3876
|
-
return;
|
|
3877
|
-
}
|
|
3878
|
-
lastError = result.error ?? null;
|
|
3879
|
-
failedProvider = entry.name;
|
|
3880
|
-
logStreamFailover(entry.name, nextProvider, result.error);
|
|
3881
|
-
} catch (err2) {
|
|
3882
|
-
failedProvider = entry.name;
|
|
3883
|
-
lastError = toError2(err2);
|
|
3884
|
-
logStreamFailover(entry.name, nextProvider, lastError);
|
|
3884
|
+
const attempt = await attemptStreamProvider(entry, nextProvider, request, emit);
|
|
3885
|
+
if (attempt.success) {
|
|
3886
|
+
if (failedProvider)
|
|
3887
|
+
logFailover(failedProvider, entry.name, lastError?.message);
|
|
3888
|
+
return;
|
|
3885
3889
|
}
|
|
3890
|
+
lastError = attempt.error ?? null;
|
|
3891
|
+
failedProvider = entry.name;
|
|
3886
3892
|
}
|
|
3887
3893
|
emit({
|
|
3888
3894
|
type: "error",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "elsium-ai",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.1",
|
|
4
4
|
"description": "ElsiumAI — A high-performance, TypeScript-first AI framework",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Eric Utrera <ebutrera9103@gmail.com>",
|
|
@@ -25,17 +25,17 @@
|
|
|
25
25
|
"build": "bun build ./src/index.ts --outdir ./dist --target node && bun x tsc -p tsconfig.build.json --emitDeclarationOnly"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@elsium-ai/core": "^0.9.
|
|
29
|
-
"@elsium-ai/gateway": "^0.9.
|
|
30
|
-
"@elsium-ai/agents": "^0.9.
|
|
31
|
-
"@elsium-ai/tools": "^0.9.
|
|
32
|
-
"@elsium-ai/rag": "^0.9.
|
|
33
|
-
"@elsium-ai/workflows": "^0.9.
|
|
34
|
-
"@elsium-ai/observe": "^0.9.
|
|
35
|
-
"@elsium-ai/app": "^0.9.
|
|
36
|
-
"@elsium-ai/testing": "^0.9.
|
|
37
|
-
"@elsium-ai/mcp": "^0.9.
|
|
38
|
-
"@elsium-ai/client": "^0.9.
|
|
28
|
+
"@elsium-ai/core": "^0.9.1",
|
|
29
|
+
"@elsium-ai/gateway": "^0.9.1",
|
|
30
|
+
"@elsium-ai/agents": "^0.9.1",
|
|
31
|
+
"@elsium-ai/tools": "^0.9.1",
|
|
32
|
+
"@elsium-ai/rag": "^0.9.1",
|
|
33
|
+
"@elsium-ai/workflows": "^0.9.1",
|
|
34
|
+
"@elsium-ai/observe": "^0.9.1",
|
|
35
|
+
"@elsium-ai/app": "^0.9.1",
|
|
36
|
+
"@elsium-ai/testing": "^0.9.1",
|
|
37
|
+
"@elsium-ai/mcp": "^0.9.1",
|
|
38
|
+
"@elsium-ai/client": "^0.9.1"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"typescript": "^5.7.0"
|