From 4ec7184da9ed660c2806612e44cf869f816df1cb Mon Sep 17 00:00:00 2001 From: Nicolas Brichet Date: Fri, 10 Jul 2026 09:03:36 +0200 Subject: [PATCH 1/5] Add configuration traits in README --- README.md | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index fb12595..01c1230 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,23 @@ It currently relies on [jupyter-ai-jupyternaut](https://github.com/jupyter-ai-co Once Jupyterlab started, the model must be configured via the menu `Settings>Jupyternaut settings` (model and API key). -See Jupyternaut [documentation](https://jupyter-ai.readthedocs.io/en/v3/users/jupyternaut/index.html#model-selection) to set it up. +See Jupyternaut [documentation](https://jupyter-ai.readthedocs.io/en/v3/users/jupyternaut/index.html#model-selection) for details about setting up the agent. + +## Configuration + +The extension can be configured via `jupyter_server_config.py` (or any traitlets CLI config): + +```python +c.JupyterAITutorApp.discover_tutor_md = True # default +c.JupyterAITutorApp.tutor_md = "" # default (uses built-in TUTOR.md) +c.JupyterAITutorApp.debug = False # default +``` + +| Parameter | Type | Default | Description | +| ------------------- | ---- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `discover_tutor_md` | bool | `True` | When enabled, the extension searches for a `TUTOR.md` file starting from the active notebook's directory and walking up to the server root. The first file found takes precedence over the configured system prompt. | +| `tutor_md` | str | `""` | Path to a Markdown file used as the system prompt. When empty, falls back to the built-in `TUTOR.md` shipped with the extension. | +| `debug` | bool | `False` | When enabled, prompts and model replies are logged to `jupyter-ai-tutor` temp directory for debugging purposes. | ## Requirements From 90fb4b8cda37a5194896641a88d89a1cff510dfe Mon Sep 17 00:00:00 2001 From: Nicolas Brichet Date: Fri, 10 Jul 2026 09:19:41 +0200 Subject: [PATCH 2/5] Add some how to doc --- README.md | 12 ++++++++++++ info.png | Bin 0 -> 1046 bytes 2 files changed, 12 insertions(+) create mode 100644 info.png diff --git a/README.md b/README.md index 01c1230..7e42eef 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,18 @@ Once Jupyterlab started, the model must be configured via the menu `Settings>Jup See Jupyternaut [documentation](https://jupyter-ai.readthedocs.io/en/v3/users/jupyternaut/index.html#model-selection) for details about setting up the agent. +## How it works + +Each code cell in a notebook gets an **Explain Code** button in its toolbar ![info icon](./info.png) \ +Clicking it opens a chat panel on the right side and sends the following context to the AI: + +- The **cell source code** and its **kernel language** +- Any **error output** produced by the cell (traceback included) +- **Preceding markdown cells** (up to the previous code cell), used as the exercise description +- An optional **reference solution** and **evaluation criteria** stored in the cell metadata (the solution is ROT13-encoded to keep it hidden from students) + +The AI replies using a configurable **system prompt** (`TUTOR.md`) that shapes its pedagogical behavior. By default the extension looks for a `TUTOR.md` file walking up from the notebook's directory to the server root, so different courses or folders can each have their own tutor persona. + ## Configuration The extension can be configured via `jupyter_server_config.py` (or any traitlets CLI config): diff --git a/info.png b/info.png new file mode 100644 index 0000000000000000000000000000000000000000..71ec3bd92605b836691c292f531ecaaf0ee77eeb GIT binary patch literal 1046 zcmV+x1nK*UP)y{D4^000SaNLh0L01FcU01FcV0GgZ_00007 zbV*G`2kHk32M{_h7jsqs00UY{L_t(Y$K6)XODa(qJ=W_7l$jQoEedMUkXcjUA_!Us z5pIHZK@hcRA$Qu>pU}V1re$pmOpDw_>Xf2ckc5OeBWh}fg+IQxlNUNVz2Gh0+0EtL z@7#Om-tQa@5fT0&+VGF@OAV=5EW+pWK@>&EvW(Z)R{(%suZPiS#N6B*tX3-7?2j4m%Psa!5oE0oJ+y12L?#uxac${Lf7*#42MP4)-rS0u) zN~Ka?#=l&e!^1=L_4UDKvo-wRPft%cI5dF~%sL&)3Fk58vnf&fJT^_nnExbtQV9d38SNP^72wISSS?G+uN(UC%WBkcsw4guCAh^qeGErFc@mB@Jlb%Xf&$D9v&WW zbaaHx%}vbD&o_66wl@6PJ!?DE>2xR*3aSJh4hJSCCR&OCz}wp!`uqFq1x+Rs;_;cyrn$F(f7wYAmU5&po<%?)N|X6kpy^E~{1KdRMg z%OXyv6QNM3C9hmA!{_sX=lOa;gTa8w$w{1_pSLXZ`1puqGTD;n@pv#jJq@i^+t?5D z`8)}NK+n(5^iw30Nn(sqCX;DyPoYqV7-K)SCqWR%>-DNLV3*59j4_fV>Dyw7M1llC zAeYOf-tmcuL{TKh7`feU)e*z(b`xWaL{U`aH4RbOY!(iOqZW`jj)T!?#Ngl{s?{pe z=`>_n#{K<0!r`#05T#KQgp0)@Zf|dKeSKXQ6HO))tX3;{p8t7F{4bLCZ^dt-;NpKz Qr~m)}07*qoM6N<$f@wM14*&oF literal 0 HcmV?d00001 From cff0c1763d36ed65fbe54a68f76a34e3c4f336a7 Mon Sep 17 00:00:00 2001 From: Nicolas Brichet Date: Fri, 10 Jul 2026 09:43:18 +0200 Subject: [PATCH 3/5] Quick note about setting up Jupyternaut --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index 7e42eef..60872d4 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,8 @@ The AI replies using a configurable **system prompt** (`TUTOR.md`) that shapes i ## Configuration +### TUTOR + The extension can be configured via `jupyter_server_config.py` (or any traitlets CLI config): ```python @@ -41,6 +43,15 @@ c.JupyterAITutorApp.debug = False # default | `tutor_md` | str | `""` | Path to a Markdown file used as the system prompt. When empty, falls back to the built-in `TUTOR.md` shipped with the extension. | | `debug` | bool | `False` | When enabled, prompts and model replies are logged to `jupyter-ai-tutor` temp directory for debugging purposes. | +### Jupyternaut + +The default model and API key used with Jupyternaut agent can be setup via `jupyter_server_config.py` (or any traitlets CLI config): + +```python +c.AiExtension.initial_language_model=mistral/devstral-latest +c.AiExtension.default_api_keys={'MISTRAL_API_KEY': '***'} +``` + ## Requirements - JupyterLab >= 4.0.0 From bc3aabf70573f36d307854e148a3bc4fb62805e2 Mon Sep 17 00:00:00 2001 From: Nicolas Brichet Date: Fri, 10 Jul 2026 10:00:34 +0200 Subject: [PATCH 4/5] Update doc --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 60872d4..7a414f1 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ Clicking it opens a chat panel on the right side and sends the following context - The **cell source code** and its **kernel language** - Any **error output** produced by the cell (traceback included) -- **Preceding markdown cells** (up to the previous code cell), used as the exercise description +- **Preceding code cells and markdown cells** (up to the previous code cell), used as the exercise description - An optional **reference solution** and **evaluation criteria** stored in the cell metadata (the solution is ROT13-encoded to keep it hidden from students) The AI replies using a configurable **system prompt** (`TUTOR.md`) that shapes its pedagogical behavior. By default the extension looks for a `TUTOR.md` file walking up from the notebook's directory to the server root, so different courses or folders can each have their own tutor persona. From 7c86de6ed888ecf1595d0e7eb2d4de85a148c785 Mon Sep 17 00:00:00 2001 From: Nicolas Brichet Date: Fri, 10 Jul 2026 14:21:27 +0200 Subject: [PATCH 5/5] Fix description --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7a414f1..895e80e 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ Clicking it opens a chat panel on the right side and sends the following context - The **cell source code** and its **kernel language** - Any **error output** produced by the cell (traceback included) -- **Preceding code cells and markdown cells** (up to the previous code cell), used as the exercise description +- **Preceding code cells and markdown cell** (up to the previous markdown cell), used as the exercise description - An optional **reference solution** and **evaluation criteria** stored in the cell metadata (the solution is ROT13-encoded to keep it hidden from students) The AI replies using a configurable **system prompt** (`TUTOR.md`) that shapes its pedagogical behavior. By default the extension looks for a `TUTOR.md` file walking up from the notebook's directory to the server root, so different courses or folders can each have their own tutor persona.