-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The specific limitations of JSON Schema? #104
Comments
Yes. We will update our doc to cover the supported and unsupported keywords soon. |
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.
is the doc updated? i'd like to evaluate if xgrammar can meet my required json schema. Thanks! |
Hi @gryffindor-rr, thanks for asking that. We are recently working on a project aiming to enhance the completeness of json schema support. We expect almost all features (except some high-level features) will be supported in weeks. Feel free to raise issues if any feature in your json schema is not supported well! |
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: