@ax-llm/ax 11.0.39 → 11.0.41
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/index.cjs +23 -11
- package/index.cjs.map +1 -1
- package/index.d.cts +15 -1
- package/index.d.ts +15 -1
- package/index.js +22 -11
- package/index.js.map +1 -1
- package/package.json +1 -1
package/index.cjs
CHANGED
|
@@ -90,6 +90,7 @@ __export(index_exports, {
|
|
|
90
90
|
AxFunctionError: () => AxFunctionError,
|
|
91
91
|
AxFunctionProcessor: () => AxFunctionProcessor,
|
|
92
92
|
AxGen: () => AxGen,
|
|
93
|
+
AxGenerateError: () => AxGenerateError,
|
|
93
94
|
AxHFDataLoader: () => AxHFDataLoader,
|
|
94
95
|
AxInstanceRegistry: () => AxInstanceRegistry,
|
|
95
96
|
AxJSInterpreter: () => AxJSInterpreter,
|
|
@@ -6794,21 +6795,31 @@ Content: ${result.content}`
|
|
|
6794
6795
|
});
|
|
6795
6796
|
}
|
|
6796
6797
|
};
|
|
6798
|
+
var AxGenerateError = class extends Error {
|
|
6799
|
+
details;
|
|
6800
|
+
constructor(message, details, options) {
|
|
6801
|
+
super(message, options);
|
|
6802
|
+
this.name = "AxGenerateError";
|
|
6803
|
+
this.details = details;
|
|
6804
|
+
}
|
|
6805
|
+
};
|
|
6797
6806
|
function enhanceError(e, ai, signature) {
|
|
6798
6807
|
const originalError = e instanceof Error ? e : new Error(String(e));
|
|
6799
6808
|
const model = ai.getLastUsedChatModel();
|
|
6800
6809
|
const modelConfig = ai.getLastUsedModelConfig();
|
|
6801
|
-
const details =
|
|
6802
|
-
|
|
6803
|
-
|
|
6804
|
-
|
|
6805
|
-
|
|
6806
|
-
|
|
6807
|
-
|
|
6808
|
-
|
|
6809
|
-
|
|
6810
|
-
|
|
6811
|
-
|
|
6810
|
+
const details = {
|
|
6811
|
+
model,
|
|
6812
|
+
maxTokens: modelConfig?.maxTokens,
|
|
6813
|
+
streaming: modelConfig?.stream ?? false,
|
|
6814
|
+
signature: {
|
|
6815
|
+
input: signature.getInputFields(),
|
|
6816
|
+
output: signature.getOutputFields(),
|
|
6817
|
+
description: signature.getDescription()
|
|
6818
|
+
}
|
|
6819
|
+
};
|
|
6820
|
+
return new AxGenerateError("Generate failed", details, {
|
|
6821
|
+
cause: originalError
|
|
6822
|
+
});
|
|
6812
6823
|
}
|
|
6813
6824
|
|
|
6814
6825
|
// prompts/agent.ts
|
|
@@ -11560,6 +11571,7 @@ var AxRAG = class extends AxChainOfThought {
|
|
|
11560
11571
|
AxFunctionError,
|
|
11561
11572
|
AxFunctionProcessor,
|
|
11562
11573
|
AxGen,
|
|
11574
|
+
AxGenerateError,
|
|
11563
11575
|
AxHFDataLoader,
|
|
11564
11576
|
AxInstanceRegistry,
|
|
11565
11577
|
AxJSInterpreter,
|