From 63823a518b3db4dbb7b860de2c617fb58c899f47 Mon Sep 17 00:00:00 2001 From: Akshay Agrawal Date: Tue, 3 Sep 2024 10:30:25 -0700 Subject: [PATCH 1/2] Update docs for ai features --- docs/guides/editor_features/ai_completion.md | 38 ++++++++++++-------- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/docs/guides/editor_features/ai_completion.md b/docs/guides/editor_features/ai_completion.md index 0bd4ef2400c..e74a40a080d 100644 --- a/docs/guides/editor_features/ai_completion.md +++ b/docs/guides/editor_features/ai_completion.md @@ -35,9 +35,28 @@ copilot = "codeium" codeium_api_key = "" ``` -## Using AI to modify cells +## Generate code with our AI assistant + +marimo has built-in support for generating and refactoring code with AI, with a +variety of providers. marimo works with both hosted AI providers, such as +OpenAI and Anthropic, as well as local models served via Ollama. + +Below we describe how to connect marimo to your AI provider. Once enabled, you +can generate entirely new cells by clicking the "Generate with AI" button at +the bottom of your notebook. You can also refactor existing cells by inputting +`Ctrl/Cmd-Shift-e` in a cell, opening an input to modify the cell using AI. + + +
+
+ +
Use AI to modify a cell by pressing `Ctrl/Cmd-Shift-e`.
+
+
+ + +### Using OpenAI -This feature is currently experimental and is not enabled by default. To enable it: 1. Install openai: `pip install openai` @@ -53,16 +72,6 @@ model = "gpt-4-turbo" base_url = "https://api.openai.com/v1" ``` -Once enabled, you can use AI completion by pressing `Ctrl/Cmd-Shift-e` in a -cell. This will open an input to modify the cell using AI. - -
-
- -
Use AI to modify a cell by pressing `Ctrl/Cmd-Shift-e`.
-
-
- ### Using Anthropic To use Anthropic with marimo: @@ -85,9 +94,10 @@ marimo supports OpenAI's GPT-3.5 API by default. If your provider is compatible For other providers not compatible with OpenAI's API, please submit a [feature request](https://github.com/marimo-team/marimo/issues) or "thumbs up" an existing one. -### Using Ollama +### Using local models with Ollama -Ollama allows you to run open-source LLMs (e.g. Llama 3.1, Phi 3, Mistral, Gemma 2) on your local machine. To integrate Ollama with marimo: +Ollama allows you to run open-source LLMs (e.g. Llama 3.1, Phi 3, Mistral, +Gemma 2) on your local machine. To integrate Ollama with marimo: 1. Download and install [Ollama](https://ollama.com/). 2. Download the model you want to use: From 73da8d149e6237fda8bc968a0e5f53b5d897adb9 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 3 Sep 2024 17:31:05 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- docs/guides/editor_features/ai_completion.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/docs/guides/editor_features/ai_completion.md b/docs/guides/editor_features/ai_completion.md index e74a40a080d..de80924b7e7 100644 --- a/docs/guides/editor_features/ai_completion.md +++ b/docs/guides/editor_features/ai_completion.md @@ -46,7 +46,6 @@ can generate entirely new cells by clicking the "Generate with AI" button at the bottom of your notebook. You can also refactor existing cells by inputting `Ctrl/Cmd-Shift-e` in a cell, opening an input to modify the cell using AI. -
@@ -54,10 +53,8 @@ the bottom of your notebook. You can also refactor existing cells by inputting
- ### Using OpenAI - 1. Install openai: `pip install openai` 2. Add the following to your `~/.marimo.toml`: