You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR supports allowing any whitespace by the grammar converted from JSON schema.
Previously the json_schema_converter only allows strictly formatted JSON schema by specifying the indentation and separators. However, some model could tend to generate unformatted JSON schema. Forcing them to generate strictly formatted json may degrade the output quality, because these models will generate a dummy json following the format constraint.
This PR provides an option `any_whitespace` in `Grammar.from_json_schema` and `GrammarCompiler.compile_json_schema`, default true, to allow any whitespace in the generated json, therefore allowing non-strictly formatted json output.
Note that this PR changes the behavior of these two functions that the converted grammar will by default allow any whitespace, unless a indentation is specifyed.
It also addresses #104.
Good Job! Can you provide the specific limitations of JSON Schema? Like, additionalProperties,defs,min/max,patternProperties. Thanks.
The text was updated successfully, but these errors were encountered: