Skip to content

Commit 4a9a327

Browse files
authored
fix generated example (#36)
1 parent 2e14c47 commit 4a9a327

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

docs/examples/generate_structured_data.ipynb

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -193,37 +193,33 @@
193193
},
194194
{
195195
"cell_type": "code",
196-
"execution_count": 41,
196+
"execution_count": 43,
197197
"metadata": {},
198198
"outputs": [],
199199
"source": [
200200
"import openai\n",
201201
"\n",
202-
"leetcode_problem = \"\"\"\n",
203-
"Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000.\n",
204-
"\"\"\"\n",
205-
"\n",
206202
"raw_llm_response, validated_response = guard(\n",
207203
" openai.Completion.create,\n",
208-
" prompt_params={'leetcode_problem': leetcode_problem},\n",
209204
" engine='text-davinci-003',\n",
210205
" max_tokens=2048,\n",
211206
" temperature=0\n",
212207
")"
213208
]
214209
},
215210
{
211+
"attachments": {},
216212
"cell_type": "markdown",
217213
"metadata": {},
218214
"source": [
219215
"Running the cell above returns:\n",
220216
"1. The raw LLM text output as a single string.\n",
221-
"2. A dictionary where the key is `python_code` and the value is the generated code."
217+
"2. A dictionary where the key `user_orders` key contains a list of dictionaries, where each dictionary represents a row in the dataframe."
222218
]
223219
},
224220
{
225221
"cell_type": "code",
226-
"execution_count": 42,
222+
"execution_count": 44,
227223
"metadata": {},
228224
"outputs": [
229225
{
@@ -269,6 +265,13 @@
269265
"source": [
270266
"print(validated_response)"
271267
]
268+
},
269+
{
270+
"cell_type": "code",
271+
"execution_count": null,
272+
"metadata": {},
273+
"outputs": [],
274+
"source": []
272275
}
273276
],
274277
"metadata": {

0 commit comments

Comments
 (0)