Skip to content

Commit

Permalink
Added tutorial notebook
Browse files Browse the repository at this point in the history
  • Loading branch information
namitasshah committed Mar 26, 2024
1 parent 706c5ad commit 7efc375
Showing 1 changed file with 56 additions and 4 deletions.
60 changes: 56 additions & 4 deletions nbs/01_tutorial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -41,25 +41,45 @@
"\n",
"- Magic Commands: If users don't want to use the chatbox and instead want to interact with JupyterAI within the notebook itself, users are able to invoke magic commands (called using %ai). After calling the command, you can specify which model and/or version you want your chosen LLM to be as well as the format. For example: (give example). We are going to be building our own magic commands to activate the \"jupyter-mentor\" add-on to only interact with the user in a specific way.\n",
" \n",
"- prompt templates: "
"- Retrieval-augmented generation (RAG): Think of RAG as an SSD that is stored in the LLMs so that when answering a user's prompt, they reference their earlier conversations with you to check for data that they use to answer your current prompt. This makes their answer more curated towards the user and more accurate without having to prompt the user again for more clarification. "
]
},
{
"cell_type": "markdown",
"id": "31ed5591-77ac-4d85-8713-61e72199b225",
"metadata": {},
"source": [
"#### Why JupyterAI?\n",
"#### **Why JupyterAI?**\n",
"\n",
"The JupyterNotebooks IDE is a quite popular platform for many researchers, research software-engineers, and students who use it particularly for purposes like data analysis, submitting homeworks because it is intuitive and a u. \n",
"The JupyterNotebooks IDE is a quite popular platform for many researchers, research software-engineers, and students who use it particularly for purposes like data analysis, submitting homeworks because it is... \n",
"\n",
"**Design principles from the web**\n",
"\n",
"- Vendor-agnostic. Users can choose any model\n",
"- Currently is explicit prompt-base. Does not read/watch files are send prompts unsolicited\n",
"- Transparent: chat interface and magic commands using items that are open source so user know what gets sent to lm\n",
"- traceable. \\\"users know when it has been used to generate content. When Jupyter AI generates a notebook, the notebook says that it was generated by Jupyter AI. When a user runs a Jupyter AI magic command in a notebook, output cells say, in their metadata, that they were generated by Jupyter AI\n",
"- Human-centered design: Chat interface looks and feels like chat applications availble. The magic commands should look and work like other IPython magic commands. Settings screens should be used minimally, and wherever they are used, they should be readable and understandable, even for users not fluent in the user interface language"
"\n",
"#### **Why JupyterAI over other LLMs like ChatGPT?**\n",
"\n",
"The biggest advantage that JupyterAI provides is the ability to be use within the Jupyter Notebook environment. It can perform a lot of functionalities which are directly embedded within the platform, removing the need to ask a third-party source externally. Jupyternaut -- the coined nickname for JupyterAI chat assistant -- has a chatbox like ChatGPT where the human and machine can interact with one another. Jupyternaut also interacts with files in JupyterLab and can answer questions as a general-purpose AI assistant. It can only see and read the information when you specifcally ask it to by sending chat commands. \n",
"\n",
" Here are a few functionalities that Jupyternaut -- the coined nickname for JupyterAI chat assistant -- provides: \n",
"- Gives a description of what a function does if you highlight the function within a code cell\n",
"- Create a new notebook from a prompt \n",
"- Writes AI-generated code within the notebook that answer a user's code request\n",
"- Interpolate iPython expressions which allow users to run prompts that include variable values\n",
"- Learns from and ask questions about your local files\n",
"- Create images\n",
"- special In and Out variables which contains the inputs and outputs of code cells\n",
"- Err variable which will explain the error you got when you input \"{Err[line #]}\"\n",
"\n",
"Additionally, with the %ai magic command, you can select which library/model you want to render from and have it perform the output within the code cell, i.e.: \n",
"- \"Generate the 2D heat equation\"\n",
"- \"Create a square using SVG with a black border and white fill\"\n",
"\n",
"Ultimately, any question you may have a knee-jerk reaction to ask ChatGPT to process, JupyterAI can do the same things with the added benefit of actually *executing* those tasks instead of merely telling you how to do those actions since it has access to your Jupyter notebook environment. \n",
"\n"
]
},
{
Expand All @@ -72,6 +92,30 @@
"Answer the following questions with the help of Jupyter-AI"
]
},
{
"cell_type": "markdown",
"id": "dc3286d6-236f-4eab-9604-6994b989306c",
"metadata": {},
"source": [
"#### Exercise 1: Ask Jupyternaut to create a new notebook that calculates the volume of a triangular prisim"
]
},
{
"cell_type": "markdown",
"id": "692495a9-778c-42e6-881a-78ffba083e09",
"metadata": {},
"source": [
"#### Exercise 2: Highlight one of the functions and ask Jupyternaut what it does"
]
},
{
"cell_type": "markdown",
"id": "679b038e-1675-42be-9bb5-4001143c6815",
"metadata": {},
"source": [
"#### Exercise 3: Use the Err call to see what the error is in this line"
]
},
{
"cell_type": "markdown",
"id": "6f8d320c-9b6b-4237-8c17-22bab370c4db",
Expand All @@ -81,6 +125,14 @@
"\n",
"Our use case for this project is to develop a more refined version of the existing Jupyter-AI to specfically tailor the chatbox to be trained as if it were a tutor or mentor. When prompted with a question, we expect Jupyter-mentor to not answer the question directly but rather give the user a step-by-step instructions without actually imemdiately giving away the answer. This would encourage the user to develop their critical-thinking skills while not having to figure out the hassle of directing the AI model with how they want to be given the answer. "
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "f8419628-437e-477f-b89c-1a7b9c48bfcf",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down

0 comments on commit 7efc375

Please sign in to comment.