@ax-llm/ax 11.0.33 → 11.0.34

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 CHANGED
@@ -4923,6 +4923,9 @@ function matchesContent(content, prefix, startIndex = 0, prefixCache = globalPre
4923
4923
  );
4924
4924
  for (let i = 0; i < prefixes.length - 1; i++) {
4925
4925
  const partialPrefix = prefixes[i];
4926
+ if (partialPrefix === "\n" || partialPrefix === ":") {
4927
+ continue;
4928
+ }
4926
4929
  if (partialPrefix && contentEnd.endsWith(partialPrefix)) {
4927
4930
  return -2;
4928
4931
  }
@@ -5705,7 +5708,7 @@ var streamingExtractValues = (sig, values, xstate, content, streamingValidation
5705
5708
  }
5706
5709
  const isFirst = xstate.extractedFields.length === 0;
5707
5710
  const prefix = (isFirst ? "" : "\n") + field.title + ":";
5708
- let e = matchesContent(content, prefix, xstate.s === 0 ? 0 : xstate.s + 1);
5711
+ let e = matchesContent(content, prefix, xstate.s);
5709
5712
  switch (e) {
5710
5713
  case -1:
5711
5714
  if (streamingValidation && values.length == 0 && !field.isOptional) {
@@ -6635,7 +6638,7 @@ var AxGen = class extends AxProgramWithSignature {
6635
6638
  }
6636
6639
  }
6637
6640
  }
6638
- throw new Error(`Unable to fix validation error: ${err}`);
6641
+ throw new Error(`Unable to fix validation error: ${err?.toString()}`);
6639
6642
  }
6640
6643
  throw new Error(`Max steps reached: ${maxSteps}`);
6641
6644
  }