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

[docs][Bug] #982

Open
1 task done
Paniraj2010 opened this issue Aug 1, 2024 · 1 comment
Open
1 task done

[docs][Bug] #982

Paniraj2010 opened this issue Aug 1, 2024 · 1 comment
Labels
documentation Improvements or additions to documentation

Comments

@Paniraj2010
Copy link

Description
I just followed the code sample provided in website.
image

But when i run the code getting KeyError: 'guardrails.hub.guardrails', how can I get ride of this, stuck in this issue since a week.
image

Current documentation
[Provide a link to the current documentation page or section that needs attention]

Suggested changes
[If you have specific changes in mind, describe them here. Be as detailed as possible]

Additional context
[Add any other context, screenshots, or examples that could help explain the issue or improvement]

Checklist

  • [X ] 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
  • [ X] For simple typos or fixes, I have considered submitting a pull request instead
@Paniraj2010 Paniraj2010 added the documentation Improvements or additions to documentation label Aug 1, 2024
@Paniraj2010 Paniraj2010 changed the title [docs] [docs][Bug] Aug 1, 2024
@CalebCourier
Copy link
Collaborator

Hi @Paniraj2010 here are a couple things you can check to work through this issue:

  1. Since the example you posted and the error do not match, I would first suggest double checking that you are installing the validator that you are trying to use. i.e. if you are trying to use the ToxicLanguage validator; be sure to run guardrails hub install hub://guardrails/toxic_language;.
  2. Since bin executables are generally evaluated top down, we generally recommend that you use a properly activated virtual environment. You can create on with common packages such as venv, virtualenv, conda, etc.. Once this is set up, activated, and you have installed guardrails via pip install guardrails-ai, make sure your current terminal environment is using the correct bin path for the guardrails cli. You can check this by running which guardrails. The result from the which command should be {PATH TO YOUR VIRTUAL ENV}/bin/guardrails. If it is not, then you may need to re-activate your virtual environment (e.g. source ./.venv/bin/activate on mac and linux assuming you created it via python -m venv ./.venv).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants