File tree Expand file tree Collapse file tree 4 files changed +25
-5
lines changed Expand file tree Collapse file tree 4 files changed +25
-5
lines changed Original file line number Diff line number Diff line change 99jobs :
1010  install_from_hub :
1111    runs-on : ubuntu-latest 
12+     env :
13+       GUARDRAILS_API_KEY : ${{ secrets.GUARDRAILS_API_KEY }} 
1214    steps :
1315    - name : Set up Python 
1416      uses : actions/setup-python@v5 
1719    - name : pip install from main 
1820      run : pip install git+https://github.com/guardrails-ai/guardrails.git@main 
1921    - name : Install PII validator 
20-       run : guardrails hub install hub://guardrails/detect_pii 
22+       run : | 
23+         guardrails configure --token $GUARDRAILS_API_KEY --disable-metrics --enable-remote-inferencing; 
24+         guardrails hub install hub://guardrails/detect_pii; 
2125name : Verify PII validator is addressable 
2226      run : echo 'from guardrails.hub import DetectPII' | python  
Original file line number Diff line number Diff line change 1010from  guardrails .cli .version  import  version_warnings_if_applicable 
1111
1212
13- @hub_command .command () 
13+ # Quick note: This is the command for `guardrails hub install`.  We change the name of 
14+ # the function def to prevent confusion, lest people import it directly and calling it 
15+ # with a string for package_uris instead of a list, which behaves oddly. If you need to 
16+ # call install from a script, please consider importing install from guardrails, 
17+ # not guardrails.cli.hub.install. 
18+ @hub_command .command (name = "install" ) 
1419@trace (name = "guardrails-cli/hub/install" ) 
15- def  install (
20+ def  install_cli (
1621    package_uris : List [str ] =  typer .Argument (
1722        ...,
1823        help = "URIs to the packages to install. Example: hub://guardrails/regex_match hub://guardrails/toxic_language" ,
@@ -33,6 +38,17 @@ def install(
3338    ),
3439):
3540    try :
41+         if  isinstance (package_uris , str ):
42+             logger .error (
43+                 f"`install` in { __file__ }  
44+                 "a list! This can happen if it is invoked directly instead of " 
45+                 "being run via the CLI. Did you mean to import `from guardrails import " 
46+                 "install` instead?  Recovering..." 
47+             )
48+             package_uris  =  [
49+                 package_uris ,
50+             ]
51+ 
3652        from  guardrails .hub .install  import  install_multiple 
3753
3854        def  confirm ():
Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ def install(
5353    Examples: 
5454        >>> RegexMatch = install("hub://guardrails/regex_match").RegexMatch 
5555
56-         >>> install("hub://guardrails/regex_match);  
56+         >>> install("hub://guardrails/regex_match")  
5757        >>> import guardrails.hub.regex_match as regex_match 
5858    """ 
5959
Original file line number Diff line number Diff line change 11[tool .poetry ]
22name  = " guardrails-ai" 
3- version  = " 0.5.10 " 
3+ version  = " 0.5.11 " 
44description  = " Adding guardrails to large language models." 
55authors  = [
" Guardrails AI <[email protected] >" ]
66license  = " Apache License 2.0" 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments