@jaypie/llm 1.2.3 → 1.2.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.
package/dist/cjs/index.cjs
CHANGED
|
@@ -2909,6 +2909,15 @@ class Toolkit {
|
|
|
2909
2909
|
const toolCopy = { ...tool };
|
|
2910
2910
|
delete toolCopy.call;
|
|
2911
2911
|
delete toolCopy.message;
|
|
2912
|
+
// Convert Zod schema to JSON Schema if needed
|
|
2913
|
+
if (toolCopy.parameters instanceof v4.z.ZodType) {
|
|
2914
|
+
const jsonSchema = v4.z.toJSONSchema(toolCopy.parameters);
|
|
2915
|
+
// Remove $schema property (causes issues with some providers)
|
|
2916
|
+
if (jsonSchema.$schema) {
|
|
2917
|
+
delete jsonSchema.$schema;
|
|
2918
|
+
}
|
|
2919
|
+
toolCopy.parameters = jsonSchema;
|
|
2920
|
+
}
|
|
2912
2921
|
if (this.explain && toolCopy.parameters?.type === "object") {
|
|
2913
2922
|
if (toolCopy.parameters?.properties) {
|
|
2914
2923
|
if (!toolCopy.parameters.properties.__Explanation) {
|
|
@@ -3707,7 +3716,8 @@ class RetryExecutor {
|
|
|
3707
3716
|
providerRequest: options.context.providerRequest,
|
|
3708
3717
|
error,
|
|
3709
3718
|
});
|
|
3710
|
-
|
|
3719
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
3720
|
+
throw new errors.BadGatewayError(errorMessage);
|
|
3711
3721
|
}
|
|
3712
3722
|
// Check if error is not retryable
|
|
3713
3723
|
if (!this.errorClassifier.isRetryable(error)) {
|
|
@@ -3719,7 +3729,8 @@ class RetryExecutor {
|
|
|
3719
3729
|
providerRequest: options.context.providerRequest,
|
|
3720
3730
|
error,
|
|
3721
3731
|
});
|
|
3722
|
-
|
|
3732
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
3733
|
+
throw new errors.BadGatewayError(errorMessage);
|
|
3723
3734
|
}
|
|
3724
3735
|
// Warn if this is an unknown error type
|
|
3725
3736
|
if (!this.errorClassifier.isKnownError(error)) {
|