Skip to content

Commit 6aa716e

Browse files
committed
update more notebooks
1 parent 09b89bc commit 6aa716e

File tree

2 files changed

+22
-4
lines changed

2 files changed

+22
-4
lines changed

docs/examples/check_for_pii.ipynb

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,15 @@
4040
"! python -m spacy download en_core_web_lg -q"
4141
]
4242
},
43+
{
44+
"cell_type": "markdown",
45+
"metadata": {},
46+
"source": [
47+
"We also have to install the ```DetectPII``` validator from Guardrails Hub:\n",
48+
"\n",
49+
"```guardrails hub install hub://guardrails/detect_pii```"
50+
]
51+
},
4352
{
4453
"cell_type": "code",
4554
"execution_count": 2,
@@ -57,7 +66,7 @@
5766
"source": [
5867
"# Import the guardrails package\n",
5968
"import guardrails as gd\n",
60-
"from guardrails.validators import PIIFilter\n",
69+
"from guardrails.hub import DetectPII\n",
6170
"from rich import print"
6271
]
6372
},
@@ -140,7 +149,7 @@
140149
"\n",
141150
"# One can also pass in a list of entities supported by Presidio to the `pii_entities` argument.\n",
142151
"guard = gd.Guard.from_string(\n",
143-
" validators=[PIIFilter(pii_entities=\"pii\", on_fail=\"fix\")],\n",
152+
" validators=[DetectPII(pii_entities=\"pii\", on_fail=\"fix\")],\n",
144153
" description=\"testmeout\",\n",
145154
")"
146155
]
@@ -327,7 +336,7 @@
327336
"# Let's try with SPI entities\n",
328337
"# Create a new guard object\n",
329338
"guard = gd.Guard.from_string(\n",
330-
" validators=[PIIFilter(pii_entities=\"spi\", on_fail=\"fix\")],\n",
339+
" validators=[DetectPII(pii_entities=\"spi\", on_fail=\"fix\")],\n",
331340
" description=\"testmeout\",\n",
332341
")"
333342
]

docs/examples/competitors_check.ipynb

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,15 @@
1010
"To download this example as a Jupyter notebook, click [here](https://github.com/guardrails-ai/guardrails/blob/main/docs/examples/competitors_check.ipynb).\n"
1111
]
1212
},
13+
{
14+
"cell_type": "markdown",
15+
"metadata": {},
16+
"source": [
17+
"We first need to install the ```CompetitorCheck``` validator from Guardrails Hub: \n",
18+
"\n",
19+
"```guardrails hub install hub://guardrails/competitor_check```\n"
20+
]
21+
},
1322
{
1423
"cell_type": "code",
1524
"execution_count": 1,
@@ -26,7 +35,7 @@
2635
],
2736
"source": [
2837
"import guardrails as gd\n",
29-
"from guardrails.validators import CompetitorCheck\n",
38+
"from guardrails.hub import CompetitorCheck\n",
3039
"from rich import print"
3140
]
3241
},

0 commit comments

Comments
 (0)