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

0.4.4 dev #759

Merged
merged 114 commits into from
May 22, 2024
Merged

0.4.4 dev #759

merged 114 commits into from
May 22, 2024

Conversation

zsimjee
Copy link
Collaborator

@zsimjee zsimjee commented May 8, 2024

No description provided.

guardrails/guard.py Outdated Show resolved Hide resolved
pyproject.toml Outdated Show resolved Hide resolved
poetry.lock Outdated Show resolved Hide resolved
Copy link
Collaborator

@CalebCourier CalebCourier left a comment

Choose a reason for hiding this comment

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

Looks good so far. Talked offline about a small issue in uninstall that's being fixed.

@zsimjee
Copy link
Collaborator Author

zsimjee commented May 22, 2024

Ran some CLI tests after installing from prod

rm ~/.guardrailsrc
guardrails hub install hub://guardrails/regex_match --quiet
ls .venv/lib/python3.11/site-packages/guardrails/hub/guardrails
guardrails hub uninstall hub://guardrails/regex_match
ls .venv/lib/python3.11/site-packages/guardrails/hub/guardrails

guardrails configure --disable-metrics
tail ~/.guardrailsrc
guardrails hub install hub://guardrails/regex_match --quiet
guardrails hub uninstall hub://guardrails/regex_match
guardrails configure --enable-metrics --token INVALID
tail ~/.guardrailsrc
guardrails hub install hub://guardrails/regex_match # expect fail
guardrails configure --clear-token
guardrails hub install hub://guardrails/regex_match # expect success
guardrails hub uninstall hub://guardrails/regex_match
guardrails configure --enable-metrics --token INVALID
guardrails hub install hub://guardrails/regex_match # expect fail

guardrails configure --disable-metrics --token [MY VALID TOKEN]
tail ~/.guardrailsrc
guardrails hub install hub://guardrails/regex_match

here's the printout

(.venv) zmac :: ~/workspace/test % rm ~/.guardrailsrc                                                                                                                            

(.venv) zmac :: ~/workspace/test % guardrails hub install hub://guardrails/regex_match --quiet                                                                                   
Installing hub://guardrails/regex_match...
✅Successfully installed guardrails/regex_match!


(.venv) zmac :: ~/workspace/test % ls .venv/lib/python3.11/site-packages/guardrails/hub/guardrails                                                                               
__init__.py regex_match
(.venv) zmac :: ~/workspace/test % guardrails hub uninstall hub://guardrails/regex_match                                                                                         


Uninstalling hub://guardrails/regex_match...

✅ Successfully uninstalled!
(.venv) zmac :: ~/workspace/test % ls .venv/lib/python3.11/site-packages/guardrails/hub/guardrails                                                                               

ls: .venv/lib/python3.11/site-packages/guardrails/hub/guardrails: No such file or directory
(.venv) zmac :: ~/workspace/test % guardrails configure --disable-metrics                                                                                                     1 ↵
Token (optional) []: 
(.venv) zmac :: ~/workspace/test % tail ~/.guardrailsrc                                                                                                                          
id=fcd75faa-014a-4eff-9426-aa4bd042e922
token=
enable_metrics=false%                                                                                                                                                             (.venv) zmac :: ~/workspace/test % guardrails hub install hub://guardrails/regex_match --quiet                                                                                   

Installing hub://guardrails/regex_match...
✅Successfully installed guardrails/regex_match!


(.venv) zmac :: ~/workspace/test % guardrails hub uninstall hub://guardrails/regex_match                                                                                         

Uninstalling hub://guardrails/regex_match...

✅ Successfully uninstalled!
(.venv) zmac :: ~/workspace/test % guardrails configure --enable-metrics --token INVALID                                                                                         

Your token is invalid. Please run `guardrails configure`to update your token.
You can find a new token at https://hub.guardrailsai.com/tokens
(.venv) zmac :: ~/workspace/test % tail ~/.guardrailsrc                                                                                                                          

id=7d34ed8f-edec-4a75-bb49-2807017cd9f5
token=INVALID
enable_metrics=true%                                                                                                                                                              (.venv) zmac :: ~/workspace/test % guardrails hub install hub://guardrails/regex_match # expect fail                                                                             
Installing hub://guardrails/regex_match...
Your token is invalid. Please run `guardrails configure`to update your token.
You can find a new token at https://hub.guardrailsai.com/tokens
(.venv) zmac :: ~/workspace/test % guardrails configure --clear-token                                                                                                         1 ↵
Token (optional) [INVALID]: 
Enable anonymous metrics reporting? [Y/n]: 
(.venv) zmac :: ~/workspace/test % guardrails hub install hub://guardrails/regex_match # expect success                                                                          
Installing hub://guardrails/regex_match...
[=   ] Downloading dependencies  Running command git clone --filter=blob:none --quiet https://github.com/guardrails-ai/regex_match.git /private/var/folders/c8/jqt82fpx785dpwpp36ljkgm40000gn/T/pip-req-build-p_27vv9f
[==  ] Downloading dependenciesWARNING: There was an error checking the latest version of pip.
[   =] Downloading dependenciesWARNING: There was an error checking the latest version of pip.
[====] Downloading dependenciesWARNING: There was an error checking the latest version of pip.
✅Successfully installed guardrails/regex_match!


Import validator:
from guardrails.hub import RegexMatch

Get more info:
https://hub.guardrailsai.com/validator/guardrails/regex_match

(.venv) zmac :: ~/workspace/test % guardrails hub uninstall hub://guardrails/regex_match                                                                                         

Uninstalling hub://guardrails/regex_match...

✅ Successfully uninstalled!
(.venv) zmac :: ~/workspace/test % guardrails configure --enable-metrics --token INVALID                                                                                         
Your token is invalid. Please run `guardrails configure`to update your token.
You can find a new token at https://hub.guardrailsai.com/tokens
(.venv) zmac :: ~/workspace/test % guardrails hub install hub://guardrails/regex_match                                                                                           
Installing hub://guardrails/regex_match...
Your token is invalid. Please run `guardrails configure`to update your token.
You can find a new token at https://hub.guardrailsai.com/tokens
(.venv) zmac :: ~/workspace/test % guardrails configure --disable-metrics --token MY_VALID_TOKEN

            Login successful.

            Get started by installing our RegexMatch validator:
            https://hub.guardrailsai.com/validator/guardrails_ai/regex_match

            You can install it by running:
            guardrails hub install hub://guardrails/regex_match

            Find more validators at https://hub.guardrailsai.com
            
(.venv) zmac :: ~/workspace/test % tail ~/.guardrailsrc                                                                                                                          
id=8c2297c9-cab4-459b-b60f-faaae16ba005
token=MY_VALID_TOKEN
enable_metrics=false%                                                                                                                                                             (.venv) zmac :: ~/workspace/test % guardrails hub install hub://guardrails/regex_match                                                                                           
Installing hub://guardrails/regex_match...
[    ] Downloading dependencies  Running command git clone --filter=blob:none --quiet https://github.com/guardrails-ai/regex_match.git /private/var/folders/c8/jqt82fpx785dpwpp36ljkgm40000gn/T/pip-req-build-tug0x4p6
[=   ] Downloading dependenciesWARNING: There was an error checking the latest version of pip.
[   =] Downloading dependenciesWARNING: There was an error checking the latest version of pip.
[=== ] Downloading dependenciesWARNING: There was an error checking the latest version of pip.
✅Successfully installed guardrails/regex_match!


Import validator:
from guardrails.hub import RegexMatch

Get more info:
https://hub.guardrailsai.com/validator/guardrails/regex_match

@zsimjee zsimjee merged commit 5363c07 into main May 22, 2024
20 checks passed
@zsimjee zsimjee deleted the 0.4.4-dev branch May 22, 2024 20:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release For PRs that go version branch -> main
Projects
Development

Successfully merging this pull request may close these issues.

None yet

6 participants