Skip to content

Commit 9e01819

Browse files
authored
Merge pull request #1011 from guardrails-ai/0.5.4-release
bump version, log on to hub
2 parents a5f7ae0 + e621c4b commit 9e01819

File tree

4 files changed

+12
-10
lines changed

4 files changed

+12
-10
lines changed

.github/workflows/examples_check.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ jobs:
2121
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
2222
HUGGINGFACE_API_KEY: ${{ secrets.HUGGINGFACE_API_KEY }}
2323
MISTRAL_API_KEY: ${{ secrets.MISTRAL_API_KEY }}
24+
GUARDRAILS_API_KEY: ${{ secrets.GUARDRAILS_API_KEY }}
2425
NLTK_DATA: /tmp/nltk_data
2526
steps:
2627
- name: Checkout repository
@@ -58,6 +59,10 @@ jobs:
5859
source .venv/bin/activate
5960
mkdir /tmp/nltk_data;
6061
python -m nltk.downloader -d /tmp/nltk_data punkt;
62+
- name: Login to Guardrails
63+
run: |
64+
source .venv/bin/activate
65+
guardrails configure --token $GUARDRAILS_API_KEY --disable-metrics --enable-remote-inferencing
6166
- name: Execute notebooks and check for errors
6267
run: |
6368
source .venv/bin/activate

docs/examples/toxic_language.ipynb

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,8 @@
6666
"# Here, we'll use the default validation method of \"sentence\"\n",
6767
"# and the default threshold of 0.25\n",
6868
"\n",
69-
"guard = gd.Guard.from_string(\n",
70-
" validators=[ToxicLanguage(on_fail=\"fix\")],\n",
71-
" description=\"testmeout\",\n",
69+
"guard = gd.Guard().use(\n",
70+
" ToxicLanguage(on_fail=\"fix\")\n",
7271
")"
7372
]
7473
},
@@ -170,9 +169,8 @@
170169
"outputs": [],
171170
"source": [
172171
"# Test with validation method 'full'\n",
173-
"full_guard = gd.Guard.from_string(\n",
174-
" validators=[ToxicLanguage(validation_method=\"full\", on_fail=\"fix\")],\n",
175-
" description=\"testmeout\",\n",
172+
"full_guard = gd.Guard().use(\n",
173+
" ToxicLanguage(validation_method=\"full\", on_fail=\"fix\")\n",
176174
")"
177175
]
178176
},

poetry.lock

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "guardrails-ai"
3-
version = "0.5.3"
3+
version = "0.5.4"
44
description = "Adding guardrails to large language models."
55
authors = ["Guardrails AI <[email protected]>"]
66
license = "Apache License 2.0"
@@ -28,7 +28,7 @@ rstr = "^3.2.2"
2828
typing-extensions = "^4.8.0"
2929
python-dateutil = "^2.8.2"
3030
tiktoken = ">=0.5.1"
31-
nltk = "^3.8.1"
31+
nltk = ">3.0, <=3.8.1"
3232
litellm = "^1.37.14"
3333
sqlvalidator = {version = "^0.0.20", optional = true}
3434
sqlalchemy = {version = ">=2.0.9", optional = true}

0 commit comments

Comments
 (0)