-
Notifications
You must be signed in to change notification settings - Fork 431
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
Seems like passing a discriminated union crashes #823
Labels
Comments
Thanks for the good reproduction script and issue! Schema:
pattern:
Error:
This PR should resolve your issue, please let me know if it works! #897 |
rlouf
pushed a commit
that referenced
this issue
May 17, 2024
Fixes #823 This comment details the issues error: #823 (comment) The reproduction code provided results in a json schema with `OneOf[pets]`: ``` class Model(BaseModel): pet: Union[Cat, Dog] = Field(..., discriminator='pet_type') ``` Before this PR: `OneOf` uses negative lookaheads to assert that only one schema member is included. This is illegal in `interegular`, more details available here: #456 After `OneOf` uses or-joined non-capturing groups which don't have the same issues with `interegular`.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the issue as clearly as possible:
Seems like discriminated unions crashes outlines
Steps/code to reproduce the bug:
Error message:
Outlines/Python version information:
Version information
Context for the issue:
This would allow for multiple tool calling with reliability, because JSON mode is not enough and Json Schema only allwo
The text was updated successfully, but these errors were encountered: