From 5bd035aea189b08be3eefc913e843cd16c2ff578 Mon Sep 17 00:00:00 2001 From: krassowski <5832902+krassowski@users.noreply.github.com> Date: Mon, 19 Aug 2024 20:34:51 +0100 Subject: [PATCH] Add documentation --- docs/source/users/index.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/docs/source/users/index.md b/docs/source/users/index.md index d42209e93..58bdba7e9 100644 --- a/docs/source/users/index.md +++ b/docs/source/users/index.md @@ -675,6 +675,29 @@ We currently support the following language model providers: - `openai-chat` - `sagemaker-endpoint` +### Configuring a default model + +To configure a default model you can use the IPython `%config` magic: + +```python +%config AiMagics.default_language_model = "anthropic:claude-v1.2" +``` + +Then subsequent magics can be invoked without typing in the model: + +``` +%%ai +Write a poem about C++. +``` + +You can configure the default model for all notebooks by specifying `c.AiMagics.default_language_model` tratilet in `ipython_config.py`, for example: + +```python +c.AiMagics.default_language_model = "anthropic:claude-v1.2" +``` + +The location of `ipython_config.py` file is documented in [IPython configuration reference](https://ipython.readthedocs.io/en/stable/config/intro.html). + ### Listing available models Jupyter AI also includes multiple subcommands, which may be invoked via the