@stackfactor/agent-utils 1.0.16 → 1.0.18
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 +33 -27
- package/dist/esm/langChain.d.ts.map +1 -1
- package/dist/esm/langChain.js +33 -27
- 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":";wBAgWQ,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
|
@@ -31,33 +31,39 @@ Do NOT include raw newlines, tabs, or unescaped quotes inside JSON string values
|
|
|
31
31
|
* @returns A formatted string describing all validation failures
|
|
32
32
|
*/
|
|
33
33
|
const formatZodErrors = (zodError) => {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
34
|
+
try {
|
|
35
|
+
const errors = zodError.issues && Array.isArray(zodError.issues)
|
|
36
|
+
? zodError.issues.map((err) => {
|
|
37
|
+
const path = err.path.length > 0 ? err.path.join(".") : "root";
|
|
38
|
+
// Provide more context based on error type
|
|
39
|
+
switch (err.code) {
|
|
40
|
+
case "invalid_type":
|
|
41
|
+
return `Field "${path}": Expected ${err.expected}, but received ${err.received}`;
|
|
42
|
+
case "invalid_literal":
|
|
43
|
+
return `Field "${path}": Expected literal value ${JSON.stringify(err.expected)}, but received ${JSON.stringify(err.received)}`;
|
|
44
|
+
case "unrecognized_keys":
|
|
45
|
+
return `Field "${path}": Unrecognized keys: ${err.keys.join(", ")}`;
|
|
46
|
+
case "invalid_union":
|
|
47
|
+
return `Field "${path}": Invalid union - none of the expected types matched`;
|
|
48
|
+
case "invalid_enum_value":
|
|
49
|
+
return `Field "${path}": Invalid enum value. Expected one of: ${err.options.join(", ")}`;
|
|
50
|
+
case "invalid_string":
|
|
51
|
+
return `Field "${path}": Invalid string format (${err.validation})`;
|
|
52
|
+
case "too_small":
|
|
53
|
+
return `Field "${path}": Value is too small (minimum: ${err.minimum})`;
|
|
54
|
+
case "too_big":
|
|
55
|
+
return `Field "${path}": Value is too large (maximum: ${err.maximum})`;
|
|
56
|
+
default:
|
|
57
|
+
return `Field "${path}": ${err.message}`;
|
|
58
|
+
}
|
|
59
|
+
})
|
|
60
|
+
: ["Schema validation error"];
|
|
61
|
+
return `Schema validation failed:\n - ${errors.join("\n - ")}`;
|
|
62
|
+
}
|
|
63
|
+
catch {
|
|
64
|
+
// Fallback in case of unexpected error structure
|
|
65
|
+
return `Schema validation failed with an unexpected error format`;
|
|
66
|
+
}
|
|
61
67
|
};
|
|
62
68
|
/**
|
|
63
69
|
* Validates a parsed JavaScript value against a Zod schema using `safeParse`. On
|
|
@@ -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":";wBAgWQ,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
|
@@ -26,33 +26,39 @@ Do NOT include raw newlines, tabs, or unescaped quotes inside JSON string values
|
|
|
26
26
|
* @returns A formatted string describing all validation failures
|
|
27
27
|
*/
|
|
28
28
|
const formatZodErrors = (zodError) => {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
29
|
+
try {
|
|
30
|
+
const errors = zodError.issues && Array.isArray(zodError.issues)
|
|
31
|
+
? zodError.issues.map((err) => {
|
|
32
|
+
const path = err.path.length > 0 ? err.path.join(".") : "root";
|
|
33
|
+
// Provide more context based on error type
|
|
34
|
+
switch (err.code) {
|
|
35
|
+
case "invalid_type":
|
|
36
|
+
return `Field "${path}": Expected ${err.expected}, but received ${err.received}`;
|
|
37
|
+
case "invalid_literal":
|
|
38
|
+
return `Field "${path}": Expected literal value ${JSON.stringify(err.expected)}, but received ${JSON.stringify(err.received)}`;
|
|
39
|
+
case "unrecognized_keys":
|
|
40
|
+
return `Field "${path}": Unrecognized keys: ${err.keys.join(", ")}`;
|
|
41
|
+
case "invalid_union":
|
|
42
|
+
return `Field "${path}": Invalid union - none of the expected types matched`;
|
|
43
|
+
case "invalid_enum_value":
|
|
44
|
+
return `Field "${path}": Invalid enum value. Expected one of: ${err.options.join(", ")}`;
|
|
45
|
+
case "invalid_string":
|
|
46
|
+
return `Field "${path}": Invalid string format (${err.validation})`;
|
|
47
|
+
case "too_small":
|
|
48
|
+
return `Field "${path}": Value is too small (minimum: ${err.minimum})`;
|
|
49
|
+
case "too_big":
|
|
50
|
+
return `Field "${path}": Value is too large (maximum: ${err.maximum})`;
|
|
51
|
+
default:
|
|
52
|
+
return `Field "${path}": ${err.message}`;
|
|
53
|
+
}
|
|
54
|
+
})
|
|
55
|
+
: ["Schema validation error"];
|
|
56
|
+
return `Schema validation failed:\n - ${errors.join("\n - ")}`;
|
|
57
|
+
}
|
|
58
|
+
catch {
|
|
59
|
+
// Fallback in case of unexpected error structure
|
|
60
|
+
return `Schema validation failed with an unexpected error format`;
|
|
61
|
+
}
|
|
56
62
|
};
|
|
57
63
|
/**
|
|
58
64
|
* Validates a parsed JavaScript value against a Zod schema using `safeParse`. On
|