Skip to content
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

Json Schema translation does not support objects in enum fields #100

Open
rlouf opened this issue Dec 2, 2024 · 1 comment
Open

Json Schema translation does not support objects in enum fields #100

rlouf opened this issue Dec 2, 2024 · 1 comment
Labels
bug Something isn't working json schema

Comments

@rlouf
Copy link
Member

rlouf commented Dec 2, 2024

Here is a minimal reproducible example:

from outlines_core.fsm.json_schema import build_regex_from_schema


schema = {"title": "Foo", "enum": [{"properties": {"a": {"title": "A", "type": "number"}}}]}
build_regex_from_schema(schema)
# ValueError: Unsupported data type in enum: Object {"properties": Object {"a": Object {"title": String("A"), "type": String("number")}}}

This currently works with outlines.fsm.json_schema.build_regex_from_schema.

@rlouf rlouf added the bug Something isn't working label Dec 2, 2024
@torymur torymur added json schema help wanted Extra attention is needed and removed help wanted Extra attention is needed labels Dec 21, 2024
@sky-2002
Copy link
Contributor

This currently works with outlines.fsm.json_schema.build_regex_from_schema.

@torymur I don't see build_regex_from_schema in outlines.fsm.json_schema ? Am I referring to some other version??
I only see outlines_core.fsm.json_schema.build_regex_from_schema imported from the outlines_core_rs.pyi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working json schema
Projects
None yet
Development

No branches or pull requests

3 participants