Skip to content

Commit b258ff1

Browse files
ahmadelmalahErick Friis
andauthored
Docs: Add 'Optional' to installation section to fix an issue (#28902)
Problem: "Optional" object is used in one example without importing, which raises the following error when copying the example into IDE or Jupyter Lab ![image](https://github.com/user-attachments/assets/3a6c48cc-937f-4774-979b-b3da64ced247) Solution: Just importing Optional from typing_extensions module, this solves the problem! --------- Co-authored-by: Erick Friis <[email protected]>
1 parent 97dc906 commit b258ff1

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

docs/docs/how_to/structured_output.ipynb

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,8 @@
165165
}
166166
],
167167
"source": [
168+
"from typing import Optional\n",
169+
"\n",
168170
"from typing_extensions import Annotated, TypedDict\n",
169171
"\n",
170172
"\n",
@@ -206,10 +208,10 @@
206208
{
207209
"data": {
208210
"text/plain": [
209-
"{'setup': 'Why was the cat sitting on the computer?',\n",
210-
" 'punchline': 'Because it wanted to keep an eye on the mouse!',\n",
211-
" 'rating': 7}"
212-
]
211+
"{'setup': 'Why was the cat sitting on the computer?',\n",
212+
" 'punchline': 'Because it wanted to keep an eye on the mouse!',\n",
213+
" 'rating': 7}"
214+
]
213215
},
214216
"execution_count": 4,
215217
"metadata": {},

0 commit comments

Comments
 (0)