Pluto can help you fix syntax errors automatically! If you make a typo or your code doesnโt parse, Pluto will offer a button to fix it for you automatically, powered by a cloud AI model.
๐จ Experimental! This feature is available in Pluto v0.20.8 and above. See the announcement PR for more details.
end
The first time that you use the feature, Pluto will show a message explaining the current privacy policy of the feature. This might change over time, so check Pluto for the current information. (If the privacy policy changes in the future, you will be asked to accept the new policy.)
The feature currently works without sign-in: you can use the feature directly in Pluto without creating an account.
Does this not work for you? Or do you have other feedback? Use the built-in feedback form in Pluto, or let us know on GitHub.
We notice that people often use Pluto side-by-side with other AI chat systems, like chatgpt.com or claude.ai. This feature will make that workflow more effective!
There is a button to generate a prompt about a cell with context from your notebook. When you ask a question like โWhat does this code do?โ or โHelp me add a linear trendlineโ, it helps to tell the AI model not just the code, but also code from other cells, packages, current output, etc. The prompt generation will automatically add the relevant context to the prompt, so you can get better answers from AI models.
Here is a video of the feature in action:
๐จ Experimental! This feature is available in Pluto v0.20.9 and above, and is currently in beta. See the announcement PR for more details.
In any cell in your notebook, click the cell context menu in the top right of the cell TODO ICON, and click โAsk AIโ. This will open the prompt generation UI.
Now you see the prompt generation UI. If you want, you can type a question that is added to the prompt. When you press Enter or click the โCopyโ button, the prompt is copied to your clipboard. You can paste it into an AI chat on another website, like chatgpt.com or claude.ai.
The prompt is auto-generated based on notebook context. Pluto uses cell inputs, some cell outputs, package information and the reactive dependency graph to generate a prompt. The important feature is that the reactive dependency graph is used to determine which cells are relevant to the current cell.
The prompt contains XML tags like <pluto-ai-context-current-cell>. These tags are completely made up, but they help AI models understand the structure of the generated prompt.
<pluto-ai-context-current-cell>
Try it out on a complicated notebook, and take a look at the generated prompt.
Most AI chat systems have a token limit, which limits the length of the prompt. Pluto will try to generate the best possible prompt that fits within a fixed token limit (currently 3000 tokens). If the token limit is reached, less context will be provided.
This feature does not use any LLMs or other web services, it just generates a prompt that you can use as you wish.
You can enable or disable Plutoโs AI features with the enable_ai_editor_features setting. To turn off all features, set it to false:
enable_ai_editor_features
false
Pluto.run(enable_ai_editor_features=false)
Some AI features will be disabled automatically if Pluto detects that ChatGPT is blocked on your network.
This is for universities/workplaces that donโt allow LLM tools as a policy. If this university has already blocked the chat.openai.com (ChatGPT) domain, then Pluto will โgo with the flowโ and also not offer the AI service. (We check ChatGPT regardless of which LLM is used by Pluto.)
chat.openai.com
More info
Are you a teacher who wants to block AI features in your course? You have the following options:
Does this not work for you? Or do you have other feedback? Let us know on GitHub, or send Fons an email!