Skip to content

[docs] Footgun: install function should not fail when given a string. #1091

@JosephCatrambone

Description

@JosephCatrambone

Description
from guardrails.cli.hub.install import install is a footgun on two levels.

Current documentation
Right now, if one does from guardrails.cli.hub.install import install and install("hub://guardrails/nsfw_text"), the function will show, "Invalid URI! The package URI must start with 'hub://'". In reality, install is expecting a LIST of hub URIs, so the "hub://" is decomposed into ['h', 'u', 'b', ...].

Additionally, one should be using from guardrails.hub import install.

Suggested changes
First, we should detect if a string is passed and warn about using directly, second, we should rename the install CLI function to install_cli or something else. The actual command line instruction can be the same, guardrails hub install is good, but we should rename the def so people don't import it by mistake.

Checklist

  • I have checked that this issue hasn't already been reported
  • I have checked the latest version of the documentation to ensure this issue still exists
  • For simple typos or fixes, I have considered submitting a pull request instead

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions