@jaypie/llm 1.2.3 → 1.2.4
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) {
|