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

Use json_string kwarg from llguidance 0.1.7to properly escape json string patterns #1008

Merged
merged 5 commits into from
Sep 4, 2024

Conversation

hudson-ai
Copy link
Collaborator

  • Pass json_string down into Lexeme/llguidance
  • Rewrite json_string definition in library/_json.py
  • Add some tests to ensure that user specified patterns like .* can only produce valid json strings

@hudson-ai hudson-ai requested a review from riedgar-ms September 4, 2024 18:15
@hudson-ai
Copy link
Collaborator Author

@mmoskal a quick glance-over from you would be appreciated :)

@codecov-commenter
Copy link

codecov-commenter commented Sep 4, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 77.77778% with 2 lines in your changes missing coverage. Please review.

Project coverage is 61.28%. Comparing base (958145c) to head (2394cc8).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
guidance/_grammar.py 50.00% 2 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1008      +/-   ##
==========================================
- Coverage   70.11%   61.28%   -8.84%     
==========================================
  Files          62       62              
  Lines        4421     4422       +1     
==========================================
- Hits         3100     2710     -390     
- Misses       1321     1712     +391     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@mmoskal mmoskal left a comment

Choose a reason for hiding this comment

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

looks great!

guidance/library/_subgrammar.py Outdated Show resolved Hide resolved
Co-authored-by: Michał Moskal <[email protected]>
@hudson-ai hudson-ai merged commit 5eaf240 into guidance-ai:main Sep 4, 2024
20 checks passed
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.

4 participants