Skip to content

Commit bcc4bb3

Browse files
committed
update notebooks
1 parent 39b9c0c commit bcc4bb3

16 files changed

+841
-1169
lines changed

docs/examples/bug_free_python_code.ipynb

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@
132132
},
133133
{
134134
"cell_type": "code",
135-
"execution_count": 14,
135+
"execution_count": 4,
136136
"metadata": {},
137137
"outputs": [],
138138
"source": [
@@ -148,7 +148,7 @@
148148
},
149149
{
150150
"cell_type": "code",
151-
"execution_count": 4,
151+
"execution_count": 5,
152152
"metadata": {},
153153
"outputs": [],
154154
"source": [
@@ -165,7 +165,7 @@
165165
},
166166
{
167167
"cell_type": "code",
168-
"execution_count": 5,
168+
"execution_count": 6,
169169
"metadata": {},
170170
"outputs": [
171171
{
@@ -182,7 +182,7 @@
182182
"Given below is XML that describes the information to extract from this document and the tags to extract it into.\n",
183183
"\n",
184184
"<span style=\"font-weight: bold\">&lt;</span><span style=\"color: #ff00ff; text-decoration-color: #ff00ff; font-weight: bold\">output</span><span style=\"color: #000000; text-decoration-color: #000000\">&gt;</span>\n",
185-
"<span style=\"color: #000000; text-decoration-color: #000000\"> &lt;pythoncode </span><span style=\"color: #808000; text-decoration-color: #808000\">name</span><span style=\"color: #000000; text-decoration-color: #000000\">=</span><span style=\"color: #008000; text-decoration-color: #008000\">\"python_code\"</span><span style=\"color: #000000; text-decoration-color: #000000\"> </span><span style=\"color: #808000; text-decoration-color: #808000\">format</span><span style=\"color: #000000; text-decoration-color: #000000\">=</span><span style=\"color: #008000; text-decoration-color: #008000\">\"bug-free-python\"</span><span style=\"color: #800080; text-decoration-color: #800080\">/</span><span style=\"color: #000000; text-decoration-color: #000000\">&gt;</span>\n",
185+
"<span style=\"color: #000000; text-decoration-color: #000000\"> &lt;string </span><span style=\"color: #808000; text-decoration-color: #808000\">name</span><span style=\"color: #000000; text-decoration-color: #000000\">=</span><span style=\"color: #008000; text-decoration-color: #008000\">\"python_code\"</span><span style=\"color: #000000; text-decoration-color: #000000\"> </span><span style=\"color: #808000; text-decoration-color: #808000\">format</span><span style=\"color: #000000; text-decoration-color: #000000\">=</span><span style=\"color: #008000; text-decoration-color: #008000\">\"bug-free-python\"</span><span style=\"color: #800080; text-decoration-color: #800080\">/</span><span style=\"color: #000000; text-decoration-color: #000000\">&gt;</span>\n",
186186
"<span style=\"color: #000000; text-decoration-color: #000000\">&lt;</span><span style=\"color: #800080; text-decoration-color: #800080\">/</span><span style=\"color: #ff00ff; text-decoration-color: #ff00ff\">output</span><span style=\"color: #000000; text-decoration-color: #000000\">&gt;</span>\n",
187187
"\n",
188188
"\n",
@@ -211,7 +211,7 @@
211211
"Given below is XML that describes the information to extract from this document and the tags to extract it into.\n",
212212
"\n",
213213
"\u001b[1m<\u001b[0m\u001b[1;95moutput\u001b[0m\u001b[39m>\u001b[0m\n",
214-
"\u001b[39m <pythoncode \u001b[0m\u001b[33mname\u001b[0m\u001b[39m=\u001b[0m\u001b[32m\"python_code\"\u001b[0m\u001b[39m \u001b[0m\u001b[33mformat\u001b[0m\u001b[39m=\u001b[0m\u001b[32m\"bug\u001b[0m\u001b[32m-free-python\"\u001b[0m\u001b[35m/\u001b[0m\u001b[39m>\u001b[0m\n",
214+
"\u001b[39m <string \u001b[0m\u001b[33mname\u001b[0m\u001b[39m=\u001b[0m\u001b[32m\"python_code\"\u001b[0m\u001b[39m \u001b[0m\u001b[33mformat\u001b[0m\u001b[39m=\u001b[0m\u001b[32m\"bug\u001b[0m\u001b[32m-free-python\"\u001b[0m\u001b[35m/\u001b[0m\u001b[39m>\u001b[0m\n",
215215
"\u001b[39m<\u001b[0m\u001b[35m/\u001b[0m\u001b[95moutput\u001b[0m\u001b[39m>\u001b[0m\n",
216216
"\n",
217217
"\n",
@@ -246,25 +246,17 @@
246246
},
247247
{
248248
"cell_type": "code",
249-
"execution_count": 6,
249+
"execution_count": 7,
250250
"metadata": {},
251-
"outputs": [
252-
{
253-
"name": "stderr",
254-
"output_type": "stream",
255-
"text": [
256-
"Async event loop found, but guard was invoked synchronously.For validator parallelization, please call `validate_async` instead.\n"
257-
]
258-
}
259-
],
251+
"outputs": [],
260252
"source": [
261253
"import openai\n",
262254
"\n",
263255
"leetcode_problem = \"\"\"\n",
264256
"Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000.\n",
265257
"\"\"\"\n",
266258
"\n",
267-
"raw_llm_response, validated_response = guard(\n",
259+
"raw_llm_response, validated_response, *rest = guard(\n",
268260
" openai.Completion.create,\n",
269261
" prompt_params={\"leetcode_problem\": leetcode_problem},\n",
270262
" engine=\"text-davinci-003\",\n",
@@ -285,7 +277,7 @@
285277
},
286278
{
287279
"cell_type": "code",
288-
"execution_count": 7,
280+
"execution_count": 8,
289281
"metadata": {},
290282
"outputs": [
291283
{
@@ -326,7 +318,7 @@
326318
},
327319
{
328320
"cell_type": "code",
329-
"execution_count": 8,
321+
"execution_count": 9,
330322
"metadata": {},
331323
"outputs": [
332324
{
@@ -371,7 +363,7 @@
371363
},
372364
{
373365
"cell_type": "code",
374-
"execution_count": 9,
366+
"execution_count": 10,
375367
"metadata": {},
376368
"outputs": [
377369
{
@@ -413,7 +405,7 @@
413405
"name": "python",
414406
"nbconvert_exporter": "python",
415407
"pygments_lexer": "ipython3",
416-
"version": "3.11.4"
408+
"version": "3.11.5"
417409
},
418410
"orig_nbformat": 4,
419411
"vscode": {

0 commit comments

Comments
 (0)