Skip to content

Commit 95e2767

Browse files
committed
update more docs and start migration guide
1 parent d2df838 commit 95e2767

File tree

3 files changed

+129
-121
lines changed

3 files changed

+129
-121
lines changed

docs/examples/guardrails_with_chat_models.ipynb

Lines changed: 8 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,7 @@
2121
"✅Successfully installed guardrails/one_line!\n",
2222
"\n",
2323
"\n",
24-
"Requirement already satisfied: pypdfium2 in /Users/dtam/.pyenv/versions/3.12.1/lib/python3.12/site-packages (4.30.0)\n",
25-
"\n",
26-
"\u001b[1m[\u001b[0m\u001b[34;49mnotice\u001b[0m\u001b[1;39;49m]\u001b[0m\u001b[39;49m A new release of pip is available: \u001b[0m\u001b[31;49m23.2.1\u001b[0m\u001b[39;49m -> \u001b[0m\u001b[32;49m24.1.2\u001b[0m\n",
27-
"\u001b[1m[\u001b[0m\u001b[34;49mnotice\u001b[0m\u001b[1;39;49m]\u001b[0m\u001b[39;49m To update, run: \u001b[0m\u001b[32;49mpip install --upgrade pip\u001b[0m\n",
24+
"Requirement already satisfied: pypdfium2 in /Users/dtam/.pyenv/versions/3.12.3/envs/litellm/lib/python3.12/site-packages (4.30.0)\n",
2825
"Note: you may need to restart the kernel to use updated packages.\n"
2926
]
3027
}
@@ -62,49 +59,9 @@
6259
},
6360
{
6461
"cell_type": "code",
65-
"execution_count": 1,
62+
"execution_count": null,
6663
"metadata": {},
67-
"outputs": [
68-
{
69-
"name": "stderr",
70-
"output_type": "stream",
71-
"text": [
72-
"/Users/dtam/.pyenv/versions/3.12.3/envs/litellm/lib/python3.12/site-packages/pypdfium2/_helpers/textpage.py:80: UserWarning: get_text_range() call with default params will be implicitly redirected to get_text_bounded()\n",
73-
" warnings.warn(\"get_text_range() call with default params will be implicitly redirected to get_text_bounded()\")\n"
74-
]
75-
},
76-
{
77-
"data": {
78-
"text/html": [
79-
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">Chase Credit Card Document:\n",
80-
"\n",
81-
"<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">2</span>/<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">25</span>/<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">23</span>, <span style=\"color: #00ff00; text-decoration-color: #00ff00; font-weight: bold\">7:59</span> PM about:blank\n",
82-
"about:blank <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">1</span>/<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">4</span>\n",
83-
"PRICING INFORMATION\n",
84-
"INTEREST RATES AND INTEREST CHARGES\n",
85-
"Purchase Annual\n",
86-
"Percentage Rate <span style=\"font-weight: bold\">(</span>APR<span style=\"font-weight: bold\">)</span> <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">0</span>% Intro APR for the first <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">18</span> months that your Account is open.\n",
87-
"After that, <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">19.49</span>%. This APR will vary with the market based on the Prim\n",
88-
"<span style=\"color: #808000; text-decoration-color: #808000\">...</span>\n",
89-
"</pre>\n"
90-
],
91-
"text/plain": [
92-
"Chase Credit Card Document:\n",
93-
"\n",
94-
"\u001b[1;36m2\u001b[0m/\u001b[1;36m25\u001b[0m/\u001b[1;36m23\u001b[0m, \u001b[1;92m7:59\u001b[0m PM about:blank\n",
95-
"about:blank \u001b[1;36m1\u001b[0m/\u001b[1;36m4\u001b[0m\n",
96-
"PRICING INFORMATION\n",
97-
"INTEREST RATES AND INTEREST CHARGES\n",
98-
"Purchase Annual\n",
99-
"Percentage Rate \u001b[1m(\u001b[0mAPR\u001b[1m)\u001b[0m \u001b[1;36m0\u001b[0m% Intro APR for the first \u001b[1;36m18\u001b[0m months that your Account is open.\n",
100-
"After that, \u001b[1;36m19.49\u001b[0m%. This APR will vary with the market based on the Prim\n",
101-
"\u001b[33m...\u001b[0m\n"
102-
]
103-
},
104-
"metadata": {},
105-
"output_type": "display_data"
106-
}
107-
],
64+
"outputs": [],
10865
"source": [
10966
"import guardrails as gd\n",
11067
"from rich import print\n",
@@ -149,6 +106,7 @@
149106
" ```\n",
150107
"\n",
151108
"=== \"Pydantic with messages\"\n",
109+
"\n",
152110
" ```py\n",
153111
" instructions = \"\"\"You are a helpful assistant only capable of communicating with valid JSON, and no other text.\n",
154112
"\n",
@@ -163,7 +121,7 @@
163121
" ${gr.xml_prefix_prompt}\n",
164122
"\n",
165123
" ${output_schema}\"\"\"\n",
166-
" ```\n",
124+
" \n",
167125
" messages=[\n",
168126
" {\n",
169127
" \"role\":\"system\",\n",
@@ -174,6 +132,7 @@
174132
" \"content\":prompt\n",
175133
" }\n",
176134
" ]\n",
135+
" ```\n",
177136
"\n",
178137
"=== \"RAIL Spec without user message\"\n",
179138
" \n",
@@ -194,6 +153,7 @@
194153
" ```\n",
195154
"\n",
196155
"=== \"Pydantic without instructions\"\n",
156+
"\n",
197157
" ```py\n",
198158
" prompt = \"\"\"Given the following document, answer the following questions. If the answer doesn't exist in the document, enter `null`.\n",
199159
"\n",
@@ -325,7 +285,7 @@
325285
},
326286
{
327287
"cell_type": "code",
328-
"execution_count": 3,
288+
"execution_count": null,
329289
"metadata": {},
330290
"outputs": [],
331291
"source": [

0 commit comments

Comments
 (0)