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

[Draft] Add option to ignore fields order #733

Closed

Conversation

leloykun
Copy link
Contributor

@leloykun leloykun commented Mar 6, 2024

Description

Predibase recently published an article wherein they discussed an issue with the fact that Outlines imposes an ordering constraint on object fields. See below:
image

This PR just adds an option to turn this constraint off. This does not change the default API interface at all.

There are probably a lot of smarter ways to do this, but this is good enough of a hack.

TODOs:

  • Add tests
  • Add docs

@leloykun leloykun changed the title add option to ignore fields order [Draft] Add option to ignore fields order Mar 6, 2024
@rlouf
Copy link
Member

rlouf commented Mar 7, 2024

Thank you! My worry with this technique is that it will make the regexes much longer and therefore increase compilation time for all schemas. Would you mind taking a couple examples and giving the length of the resulting regexes with and without your change?

@leloykun
Copy link
Contributor Author

leloykun commented May 4, 2024

Closing this as I have a better idea in mind

@leloykun leloykun closed this May 4, 2024
@Maximilian-Winter
Copy link

@leloykun Would you mind telling me your idea? I have a problem with ordering. Can I somehow make it like in the schema?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants