@stackfactor/agent-utils 1.0.12 → 1.0.13
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/langChain.d.ts.map +1 -1
- package/dist/cjs/langChain.js +27 -25
- package/dist/esm/langChain.d.ts.map +1 -1
- package/dist/esm/langChain.js +27 -25
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"langChain.d.ts","sourceRoot":"","sources":["../../src/langChain.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"langChain.d.ts","sourceRoot":"","sources":["../../src/langChain.ts"],"names":[],"mappings":";wBAmSQ,MAAM,aACD,MAAM,gBACH,MAAM,SACb,GAAG,EAAE,kBACI,GAAG,UACX,GAAG,KACV,GAAG;sBAyBG,GAAG,UACF,MAAM,UACN,GAAG,eACC,QAAQ,GAAG,IAAI,KAC1B,OAAO,CAAC,GAAG,CAAC;wCAmfF,MAAM,UACT,GAAG,UACH,GAAG,oBACO,GAAG,KACpB,GAAG;oCAxYO,MAAM,UACT,GAAG,UACH,GAAG,oBACO,GAAG,eACT,MAAM,eACN,MAAM,wBACG,OAAO,WACpB,GAAG,cACA,MAAM,UACV,GAAG,EAAE,KACX,OAAO,CAAC,GAAG,CAAC;sDA6rBF,MAAM,UACT,GAAG,UACH,MAAM,YACL,GAAG,KACX,OAAO,CAAC,GAAG,CAAC;0CA7vB8B,GAAG,KAAG,MAAM;;AAwzBzD,wBAOE"}
|
package/dist/cjs/langChain.js
CHANGED
|
@@ -27,34 +27,36 @@ Do NOT include raw newlines, tabs, or unescaped quotes inside JSON string values
|
|
|
27
27
|
* Each failing field is described with its dot-notation path and a contextual message
|
|
28
28
|
* that depends on the Zod error code (e.g. `invalid_type`, `too_small`, `invalid_enum_value`).
|
|
29
29
|
* The output is prefixed with `"Schema validation failed:"` followed by a bulleted list.
|
|
30
|
-
* @param zodError - The Zod `ZodError` instance whose `
|
|
30
|
+
* @param zodError - The Zod `ZodError` instance whose `issues` array will be formatted
|
|
31
31
|
* @returns A formatted string describing all validation failures
|
|
32
32
|
*/
|
|
33
33
|
const formatZodErrors = (zodError) => {
|
|
34
|
-
const errors = zodError.
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
34
|
+
const errors = zodError.issues
|
|
35
|
+
? zodError.issues.map((err) => {
|
|
36
|
+
const path = err.path.length > 0 ? err.path.join(".") : "root";
|
|
37
|
+
// Provide more context based on error type
|
|
38
|
+
switch (err.code) {
|
|
39
|
+
case "invalid_type":
|
|
40
|
+
return `Field "${path}": Expected ${err.expected}, but received ${err.received}`;
|
|
41
|
+
case "invalid_literal":
|
|
42
|
+
return `Field "${path}": Expected literal value ${JSON.stringify(err.expected)}, but received ${JSON.stringify(err.received)}`;
|
|
43
|
+
case "unrecognized_keys":
|
|
44
|
+
return `Field "${path}": Unrecognized keys: ${err.keys.join(", ")}`;
|
|
45
|
+
case "invalid_union":
|
|
46
|
+
return `Field "${path}": Invalid union - none of the expected types matched`;
|
|
47
|
+
case "invalid_enum_value":
|
|
48
|
+
return `Field "${path}": Invalid enum value. Expected one of: ${err.options.join(", ")}`;
|
|
49
|
+
case "invalid_string":
|
|
50
|
+
return `Field "${path}": Invalid string format (${err.validation})`;
|
|
51
|
+
case "too_small":
|
|
52
|
+
return `Field "${path}": Value is too small (minimum: ${err.minimum})`;
|
|
53
|
+
case "too_big":
|
|
54
|
+
return `Field "${path}": Value is too large (maximum: ${err.maximum})`;
|
|
55
|
+
default:
|
|
56
|
+
return `Field "${path}": ${err.message}`;
|
|
57
|
+
}
|
|
58
|
+
})
|
|
59
|
+
: [];
|
|
58
60
|
return `Schema validation failed:\n - ${errors.join("\n - ")}`;
|
|
59
61
|
};
|
|
60
62
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"langChain.d.ts","sourceRoot":"","sources":["../../src/langChain.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"langChain.d.ts","sourceRoot":"","sources":["../../src/langChain.ts"],"names":[],"mappings":";wBAmSQ,MAAM,aACD,MAAM,gBACH,MAAM,SACb,GAAG,EAAE,kBACI,GAAG,UACX,GAAG,KACV,GAAG;sBAyBG,GAAG,UACF,MAAM,UACN,GAAG,eACC,QAAQ,GAAG,IAAI,KAC1B,OAAO,CAAC,GAAG,CAAC;wCAmfF,MAAM,UACT,GAAG,UACH,GAAG,oBACO,GAAG,KACpB,GAAG;oCAxYO,MAAM,UACT,GAAG,UACH,GAAG,oBACO,GAAG,eACT,MAAM,eACN,MAAM,wBACG,OAAO,WACpB,GAAG,cACA,MAAM,UACV,GAAG,EAAE,KACX,OAAO,CAAC,GAAG,CAAC;sDA6rBF,MAAM,UACT,GAAG,UACH,MAAM,YACL,GAAG,KACX,OAAO,CAAC,GAAG,CAAC;0CA7vB8B,GAAG,KAAG,MAAM;;AAwzBzD,wBAOE"}
|
package/dist/esm/langChain.js
CHANGED
|
@@ -22,34 +22,36 @@ Do NOT include raw newlines, tabs, or unescaped quotes inside JSON string values
|
|
|
22
22
|
* Each failing field is described with its dot-notation path and a contextual message
|
|
23
23
|
* that depends on the Zod error code (e.g. `invalid_type`, `too_small`, `invalid_enum_value`).
|
|
24
24
|
* The output is prefixed with `"Schema validation failed:"` followed by a bulleted list.
|
|
25
|
-
* @param zodError - The Zod `ZodError` instance whose `
|
|
25
|
+
* @param zodError - The Zod `ZodError` instance whose `issues` array will be formatted
|
|
26
26
|
* @returns A formatted string describing all validation failures
|
|
27
27
|
*/
|
|
28
28
|
const formatZodErrors = (zodError) => {
|
|
29
|
-
const errors = zodError.
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
29
|
+
const errors = zodError.issues
|
|
30
|
+
? zodError.issues.map((err) => {
|
|
31
|
+
const path = err.path.length > 0 ? err.path.join(".") : "root";
|
|
32
|
+
// Provide more context based on error type
|
|
33
|
+
switch (err.code) {
|
|
34
|
+
case "invalid_type":
|
|
35
|
+
return `Field "${path}": Expected ${err.expected}, but received ${err.received}`;
|
|
36
|
+
case "invalid_literal":
|
|
37
|
+
return `Field "${path}": Expected literal value ${JSON.stringify(err.expected)}, but received ${JSON.stringify(err.received)}`;
|
|
38
|
+
case "unrecognized_keys":
|
|
39
|
+
return `Field "${path}": Unrecognized keys: ${err.keys.join(", ")}`;
|
|
40
|
+
case "invalid_union":
|
|
41
|
+
return `Field "${path}": Invalid union - none of the expected types matched`;
|
|
42
|
+
case "invalid_enum_value":
|
|
43
|
+
return `Field "${path}": Invalid enum value. Expected one of: ${err.options.join(", ")}`;
|
|
44
|
+
case "invalid_string":
|
|
45
|
+
return `Field "${path}": Invalid string format (${err.validation})`;
|
|
46
|
+
case "too_small":
|
|
47
|
+
return `Field "${path}": Value is too small (minimum: ${err.minimum})`;
|
|
48
|
+
case "too_big":
|
|
49
|
+
return `Field "${path}": Value is too large (maximum: ${err.maximum})`;
|
|
50
|
+
default:
|
|
51
|
+
return `Field "${path}": ${err.message}`;
|
|
52
|
+
}
|
|
53
|
+
})
|
|
54
|
+
: [];
|
|
53
55
|
return `Schema validation failed:\n - ${errors.join("\n - ")}`;
|
|
54
56
|
};
|
|
55
57
|
/**
|