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

Support URI format #129

Merged
merged 7 commits into from
Dec 19, 2024
Merged

Support URI format #129

merged 7 commits into from
Dec 19, 2024

Conversation

sky-2002
Copy link
Contributor

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

Adds URI parsing code and tests. Lmk if regex needs to cover other cases (regex credits chatgpt 😅 )
Closes #127

Note: Created separate PR than email format so that no blocking if update/refactor needed

src/json_schema/mod.rs Outdated Show resolved Hide resolved
src/json_schema/parsing.rs Outdated Show resolved Hide resolved
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.

Hi @sky-2002 👋

Thank you for contributing here! There are couple of issues, which needs to be addressed before we can merge it.

src/json_schema/mod.rs Outdated Show resolved Hide resolved
@torymur torymur added enhancement New feature or request json schema labels Dec 19, 2024
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.

Great, thank you for contributing @sky-2002 🚀

@torymur torymur merged commit 60e58fb into dottxt-ai:main Dec 19, 2024
12 of 14 checks passed
@torymur torymur mentioned this pull request Dec 19, 2024
sky-2002 added a commit to sky-2002/outlines-core that referenced this pull request Dec 19, 2024
Adds URI parsing code and tests

Refer dottxt-ai#127
sky-2002 added a commit to sky-2002/outlines-core that referenced this pull request Dec 19, 2024
Adds URI parsing code and tests

Refer dottxt-ai#127
sky-2002 added a commit to sky-2002/outlines-core that referenced this pull request Dec 19, 2024
Adds URI parsing code and tests

Refer dottxt-ai#127
sky-2002 added a commit to sky-2002/outlines-core that referenced this pull request Dec 19, 2024
Adds URI parsing code and tests

Refer dottxt-ai#127
torymur pushed a commit to sky-2002/outlines-core that referenced this pull request Dec 20, 2024
Adds URI parsing code and tests

Refer dottxt-ai#127
torymur pushed a commit to sky-2002/outlines-core that referenced this pull request Dec 20, 2024
Adds URI parsing code and tests

Refer dottxt-ai#127
@@ -34,13 +34,15 @@ pub static DATE_TIME: &str = r#""(-?(?:[1-9][0-9]*)?[0-9]{4})-(1[0-2]|0[1-9])-(3
pub static DATE: &str = r#""(?:\d{4})-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])""#;
pub static TIME: &str = r#""(2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9])(\\.[0-9]+)?(Z)?""#;
pub static UUID: &str = r#""[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}""#;
pub static URI: &str = r#"^(https?|ftp):\/\/([^\s:@]+(:[^\s:@]*)?@)?([a-zA-Z\d.-]+\.[a-zA-Z]{2,}|localhost)(:\d+)?(\/[^\s?#]*)?(\?[^\s#]*)?(#[^\s]*)?$|^urn:[a-zA-Z\d][a-zA-Z\d\-]{0,31}:[^\s]+$"#;

Choose a reason for hiding this comment

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

I would be curious to see a pointer to the specifications where most of these regexes are defined, as I wouldn't be able to confirm later with my own eyeballs that they're 100% correct!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@yvan-sraka I am also searching for specifications where regexes are defined (because same is the case with my eyeballs 👀 )

@sky-2002 sky-2002 deleted the support-uri-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 uri format
3 participants