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

Allow escaped strings in json_schema.py #991

Merged
merged 1 commit into from
Jun 20, 2024
Merged

Conversation

lapp0
Copy link
Contributor

@lapp0 lapp0 commented Jun 20, 2024

Fixes #935

Problem

On main in json_schema.py,

STRING_INNER = r'([^"\\\x00-\x1f\x7f-\x9f]|\\\\)'

This pattern requires \ to be followed by a second \.

\\ is legal, \" is not.

Solution

Modify the pattern so \\ AND \" are allowed.

@lapp0 lapp0 added JSON correctness Everything related to the generation correctness labels Jun 20, 2024
@rlouf rlouf merged commit a9d58ef into dottxt-ai:main Jun 20, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
correctness Everything related to the generation correctness JSON
Projects
None yet
Development

Successfully merging this pull request may close these issues.

JSON strings cannot generate with "\" character in them
2 participants