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

[Feature] Allow json-loads-able strings to be passed as schema #1028

Merged
merged 5 commits into from
Oct 29, 2024

Conversation

hudson-ai
Copy link
Collaborator

No description provided.

@codecov-commenter
Copy link

codecov-commenter commented Sep 16, 2024

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

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 64.18%. Comparing base (dc5a080) to head (fb4c57c).
Report is 1 commits behind head on main.

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

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1028      +/-   ##
==========================================
- Coverage   65.53%   64.18%   -1.35%     
==========================================
  Files          63       63              
  Lines        4842     4844       +2     
==========================================
- Hits         3173     3109      -64     
- Misses       1669     1735      +66     

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

@hudson-ai hudson-ai force-pushed the json_string_schemas branch from d31faa8 to 67f0b4b Compare October 22, 2024 17:36
@hudson-ai
Copy link
Collaborator Author

@Harsha-Nori @riedgar-ms ping :)

@@ -937,7 +938,9 @@ def json(
# Default schema is empty, "anything goes" schema
# TODO: consider default being `{"type": "object"}`
schema = {}
elif isinstance(schema, (Mapping, bool)):
elif isinstance(schema, (Mapping, bool, str)):
if isinstance(schema, str):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Test?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@riedgar-ms done :)

@hudson-ai hudson-ai merged commit c8c6a11 into guidance-ai:main Oct 29, 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.

3 participants