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

Fix validator imports #687

Merged
merged 14 commits into from
Apr 4, 2024
Merged

Conversation

aaravnavani
Copy link
Contributor

@aaravnavani aaravnavani commented Mar 28, 2024

This PR fixes this issue and fixes all the notebooks so that the validators are imported from Guardrails Hub instead of the guardrails library.

Note: In the value_within_distribution.ipynb notebook, the SimilarToList validator is imported but I cannot find this validator on Guardrails Hub.

@codecov-commenter
Copy link

codecov-commenter commented Mar 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

❗ No coverage uploaded for pull request base (main@26756ee). Click here to learn what that means.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #687   +/-   ##
=======================================
  Coverage        ?   80.49%           
=======================================
  Files           ?      123           
  Lines           ?     7041           
  Branches        ?        0           
=======================================
  Hits            ?     5668           
  Misses          ?     1373           
  Partials        ?        0           
Flag Coverage Δ
unittests 80.49% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@aaravnavani aaravnavani marked this pull request as ready for review March 28, 2024 22:18
@zsimjee
Copy link
Collaborator

zsimjee commented Mar 29, 2024

Thanks for this one too! SimilarToList was renamed to this one https://hub.guardrailsai.com/validator/guardrails/similar_to_previous_values

@zsimjee
Copy link
Collaborator

zsimjee commented Mar 29, 2024

In each notebook, it also makes sense to add a cell to the top of the notebook that installs the relevant validators

ex:

!guardrails hub install hub://guardrails/regex_match

This would make the notebooks self-contained and run on their own. The callout here is that this doesn't work in notebooks yet in 0.4.2, but it was fixed on main in PR https://github.com/guardrails-ai/guardrails/pull/676/files (take a look at guardrails/cli/hub/install.py) so you'll have to install from Github for now to test this out

pip install git+https://github.com/guardrails-ai/guardrails.git@main

@zsimjee zsimjee merged commit f2824e2 into guardrails-ai:main Apr 4, 2024
36 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