Skip to content

Commit eb42b39

Browse files
authored
Merge pull request #526 from guardrails-ai/status-fix
Fix Status
2 parents 02ba65c + 19bd9b5 commit eb42b39

27 files changed

+193
-72
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ jobs:
173173
- name: Install dependencies
174174
run: |
175175
make full;
176-
poetry add openai==0.28.1 jupyter nbconvert cohere;
176+
poetry add "openai>=1.2.4" jupyter nbconvert cohere;
177177
- name: Check for pypdfium2
178178
run: poetry run pip show pypdfium2
179179
- name: Huggingface Hub Login

.github/workflows/examples_check.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
- name: Install dependencies
3939
run: |
4040
make full;
41-
poetry add openai==0.28.1 jupyter nbconvert cohere;
41+
poetry add "openai>=1.2.4" jupyter nbconvert cohere;
4242
- name: Check for pypdfium2
4343
run: poetry run pip show pypdfium2
4444
- name: Huggingface Hub Login
@@ -48,7 +48,7 @@ jobs:
4848
mkdir /tmp/nltk_data;
4949
poetry run python -m nltk.downloader -d /tmp/nltk_data punkt;
5050
- name: Use venv
51-
run: source .venv/bin/activate
51+
run: source $VENV
5252
- name: Execute notebooks and check for errors
5353
run: bash ./.github/workflows/scripts/run_notebooks.sh ${{ matrix.notebook }}
5454

docs/examples/extracting_entities.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@
342342
"source": [
343343
"import openai\n",
344344
"\n",
345-
"validated_response = guard(\n",
345+
"_, validated_response, *rest = guard(\n",
346346
" openai.chat.completions.create,\n",
347347
" prompt_params={\"document\": content[:6000]},\n",
348348
" max_tokens=2048,\n",
@@ -1724,7 +1724,7 @@
17241724
}
17251725
],
17261726
"source": [
1727-
"guard.state.most_recent_call.tree"
1727+
"guard.history.last.tree"
17281728
]
17291729
}
17301730
],

docs/examples/generate_structured_data.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@
279279
"import openai\n",
280280
"\n",
281281
"\n",
282-
"validated_output = guard(\n",
282+
"_, validated_output, *rest = guard(\n",
283283
" openai.chat.completions.create,\n",
284284
" max_tokens=2048,\n",
285285
" temperature=0\n",

docs/examples/guardrails_with_chat_models.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1712,7 +1712,7 @@
17121712
"name": "python",
17131713
"nbconvert_exporter": "python",
17141714
"pygments_lexer": "ipython3",
1715-
"version": "3.9.17"
1715+
"version": "3.11.6"
17161716
},
17171717
"orig_nbformat": 4
17181718
},

docs/examples/input_validation.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@
136136
"name": "python",
137137
"nbconvert_exporter": "python",
138138
"pygments_lexer": "ipython3",
139-
"version": "3.9.17"
139+
"version": "3.11.6"
140140
}
141141
},
142142
"nbformat": 4,

docs/examples/no_secrets_in_generated_text.ipynb

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,19 @@
293293
"We can see that the output is a dictionary with the correct schema and types."
294294
]
295295
},
296+
{
297+
"cell_type": "code",
298+
"execution_count": null,
299+
"metadata": {},
300+
"outputs": [],
301+
"source": [
302+
"import openai\n",
303+
"\n",
304+
"raw_llm_response, validated_response, *rest = guard(\n",
305+
" openai.completions.create, model=\"text-davinci-003\", max_tokens=2048, temperature=0\n",
306+
")"
307+
]
308+
},
296309
{
297310
"cell_type": "code",
298311
"execution_count": 9,

docs/examples/response_is_on_topic.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@
279279
"name": "python",
280280
"nbconvert_exporter": "python",
281281
"pygments_lexer": "ipython3",
282-
"version": "3.9.17"
282+
"version": "3.11.6"
283283
}
284284
},
285285
"nbformat": 4,

docs/examples/select_choice_based_on_action.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -730,7 +730,7 @@
730730
"name": "python",
731731
"nbconvert_exporter": "python",
732732
"pygments_lexer": "ipython3",
733-
"version": "3.9.17"
733+
"version": "3.11.6"
734734
}
735735
},
736736
"nbformat": 4,

docs/examples/text_summarization_quality.ipynb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -344,10 +344,10 @@
344344
"source": [
345345
"import openai\n",
346346
"\n",
347-
"raw_llm_response, validated_response = guard(\n",
348-
" openai.Completion.create,\n",
347+
"raw_llm_response, validated_response, *rest = guard(\n",
348+
" openai.completions.create,\n",
349349
" prompt_params={'document': document},\n",
350-
" engine='text-davinci-003',\n",
350+
" model='text-davinci-003',\n",
351351
" max_tokens=2048,\n",
352352
" temperature=0\n",
353353
")\n",
@@ -565,7 +565,7 @@
565565
}
566566
],
567567
"source": [
568-
"print(guard.state.most_recent_call.tree)"
568+
"print(guard.history.last.tree)"
569569
]
570570
},
571571
{
@@ -598,10 +598,10 @@
598598
}
599599
],
600600
"source": [
601-
"raw_llm_response, validated_response = guard(\n",
602-
" openai.Completion.create,\n",
601+
"raw_llm_response, validated_response, *rest = guard(\n",
602+
" openai.completions.create,\n",
603603
" prompt_params={'document': open(\"data/article1.txt\", \"r\").read()},\n",
604-
" engine='text-ada-001',\n",
604+
" model='text-ada-001',\n",
605605
" max_tokens=512,\n",
606606
" temperature=0\n",
607607
")\n",
@@ -927,7 +927,7 @@
927927
}
928928
],
929929
"source": [
930-
"print(guard.state.most_recent_call.tree)"
930+
"print(guard.history.last.tree)"
931931
]
932932
}
933933
],

0 commit comments

Comments
 (0)