outlines
outlines copied to clipboard
Prevent Infinite Repetition in JSON Schemas with `number`
What behavior of the library made you think about the improvement?
In JSON Schema safe_subset mode
- whitespace cannot continue infinitely https://github.com/outlines-dev/outlines/pull/916
integerandstringcannot continue infinitely https://github.com/dottxt-ai/outlines/pull/1154
However you can still produce infinite numbers in safe_subset mode.
How would you like it to behave?
Finish the safe_subset implementation in JSON Schema through
json_schema.py already has the following attributes which can be provided a safe_subset-mode default:
bounds = {
"minDigitsInteger",
"maxDigitsInteger",
"minDigitsFraction",
"maxDigitsFraction",
"minDigitsExponent",
"maxDigitsExponent",
}
Questions
- Should we include details about reporting to the Outlines team or an explanation in the error dict? Or perhaps use a
warning?