-
Notifications
You must be signed in to change notification settings - Fork 409
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
Guard as action #810
base: develop
Are you sure you want to change the base?
Guard as action #810
Conversation
@Pouyanpi, this is one half of the upcoming integration with Guardrails AI -- they've got the other half on their side. |
|
||
def register_guardrails_guard_actions(rails: LLMRails, guard: Guard, guard_name: str): | ||
def fix_action(text, metadata={}): | ||
return guard.validate(llm_output=text, metadata=metadata).validated_output |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
Hi @zsimjee, is your PR ready for review? If it is, please mark it as ready for review. Thanks 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @zsimjee, Thank you for your pull request. I’ve suggested some high-level adjustments; please review the comments. If there were specific reasons for your chosen structure, please let me know.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please make necessary adjustments and move this to https://github.com/NVIDIA/NeMo-Guardrails/blob/develop/docs/user_guides/community
And you can add a brief intro to it similar to the other community integerations at https://github.com/NVIDIA/NeMo-Guardrails/blob/develop/docs/user_guides/guardrails-library.md
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Notebooks should be placed at https://github.com/NVIDIA/NeMo-Guardrails/tree/develop/examples/notebooks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I need to review it more closely, but this is not consistent with other community integrations. Please have a look at https://github.com/NVIDIA/NeMo-Guardrails/tree/develop/nemoguardrails/library
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was built in the model of the langchain integration, not for a single guardrail. It's a framework level integration that gives nemoguardrails users access to 60+ validators available on the hub and the features , not a singular type of guardrail.
pyproject.toml
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pyproject.toml
will only include the core dependencies. Other integerations have either instructed the user in docs on what are the requirements or have included a
requirements.txt
at https://github.com/NVIDIA/NeMo-Guardrails/tree/develop/nemoguardrails/library
I can also suggest you to use a lazy import and raise an error to install the package with the desired constraint. Deffered imports delay ImportError
or ModuleNotFoundError
exceptions for optional dependencies until the specific functionality is invoked, and you can instruct the user to install the package, look how it is used in the package 
Signed-off-by: Zayd <[email protected]>
Description
This PR contains helper functions and docs that show nemoguardrails users how to use Guardrails AI-style validation in their nemoguardrails code flow.
Related Issue(s)
N/A
Checklist