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

Email format in JSON schema #128

Merged
merged 13 commits into from
Dec 20, 2024
Merged

Conversation

sky-2002
Copy link
Contributor

@sky-2002 sky-2002 commented Dec 18, 2024

I have added a basic email parsing regex, refer #107 .
Lmk if a more complex regex (compliant with some RFC) is needed.

Closes #107.

@sky-2002
Copy link
Contributor Author

sky-2002 commented Dec 19, 2024

@rlouf @torymur I think I have misunderstood here, email is present in string built-in formats, maybe this also needs to be handled via FormatType ??

@torymur torymur added enhancement New feature or request json schema labels Dec 19, 2024
@torymur
Copy link
Contributor

torymur commented Dec 19, 2024

@sky-2002 Yes, it's correct now! We just need to resolve conflicts with main

@sky-2002 sky-2002 force-pushed the support-email-format branch from 55b3e4f to 3275dd5 Compare December 19, 2024 17:32
@sky-2002
Copy link
Contributor Author

sky-2002 commented Dec 19, 2024

@torymur sorry for the messy commits, had to force push due to some unwanted accept both changes clicks😅 , resolved conflicts,
Fixing some tests

@sky-2002
Copy link
Contributor Author

sky-2002 commented Dec 19, 2024

I could not find a perfect regex, and had to remove some tests like [email protected] to pass tests.
@torymur I don't think this is an ideal way. Any workarounds ?

Update: I checked the email regex from outlines python repo, and used it in rust.

@torymur
Copy link
Contributor

torymur commented Dec 19, 2024

One thing I forgot to ask you in the previous PR too, could you please add EMAIL & URI in these, so that they'd be available from python:

  • python/outlines_core/fsm/outlines_core_rs.pyi
  • python/outlines_core/fsm/json_schema.py
  • src/python_bindings/mod.rs

@torymur torymur force-pushed the support-email-format branch from 2461618 to 0c955c1 Compare December 20, 2024 14:34
Copy link
Contributor

@torymur torymur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for adding this @sky-2002 🌟 Appreciate your effort!

To speed up the process I will merge this right now and do a tiny follow up to expose these new types to python.

@sky-2002
Copy link
Contributor Author

@torymur cool, I will add those in a separate PR right away, thanks a lot for quick reviews

@torymur torymur merged commit 346798c into dottxt-ai:main Dec 20, 2024
7 checks passed
@sky-2002 sky-2002 deleted the support-email-format branch December 20, 2024 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request json schema
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support the email format in JSON Schema
2 participants