Skip to content

Commit 685bf3b

Browse files
committed
correct nemoguardrails usage syntax
1 parent 63aba28 commit 685bf3b

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

docs/integrations/nemo_guardrails/guardrails_rails.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,6 @@ from guardrails.hub import ToxicLanguage
1616
# Load a guardrails configuration from the specified path.
1717
config = RailsConfig.from_path("PATH/TO/CONFIG")
1818
rails = LLMRails(config)
19-
20-
# Define a guardrails guard.
21-
guard = Guard().use(
22-
ToxicLanguage()
23-
)
2419
```
2520

2621
Then, we have the guard validate the completions generated by the Rails application.
@@ -29,7 +24,7 @@ Then, we have the guard validate the completions generated by the Rails applicat
2924
from guardrails.integrations.nemoguardrails.nemoguardrails_guard import (
3025
NemoguardrailsGuard
3126
)
32-
railsguard = NemoguardrailsGuards(rails, guard)
27+
railsguard = NemoguardrailsGuards(rails).use(ToxicLanguage)
3328

3429
result = railsguard(
3530
messages: [{

0 commit comments

Comments
 (0)