diff --git a/book/jupyternotebook/Chapter.ipynb b/book/jupyternotebook/Chapter.ipynb index 0cbfae9..91d005b 100644 --- a/book/jupyternotebook/Chapter.ipynb +++ b/book/jupyternotebook/Chapter.ipynb @@ -468,6 +468,61 @@ "source": [ "!nbstripout FILE.ipynb" ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Bring LLMs Into Your Notebook with `jupyter-ai`" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Bring GenAI into your Jupyter Notebooks with `jupyter-ai`\n", + "\n", + "`jupyter-ai` lets you use LLMs from vendors like OpenAI, Huggingface and Anthropic within your Notebook cells.\n", + "\n", + "You can just ask for a code snippet and the result will be rendered into your Notebook." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "%env PROVIDER_API_KEY=YOUR_API_KEY_HERE" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "!pip install jupyter_ai" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "%load_ext jupyter_ai" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "%%ai chatgpt\n", + "Provide a hello world function in Python" + ] } ], "metadata": {