Sign inGet started

Code editing

Refine your code efficiently with Deepnote AI's editing suggestions.

Need to revise your code, refactor it, or make it more readable? Deepnote AI can help edit any existing code. Just open the block sidebar in a code block, select the AI button and simply tell Deepnote AI how you want your code edited.

Edited code will be displayed side by side of the original code in a diff view so you can easily see what's been changed. Press the Run code button to see the new code in action. If you're satisfied, press Done to accept the code. If the suggested code does not suit your needs, you can Undo it, returning to your previous code. From there, you can easily modify your prompt to get different results.

edit.png

Pro tip: When the diff view is presented by Deepnote AI, the active state of the block is automatically set to that of the new suggestion. Therefore, if you were to run the whole notebook, the AI suggestion would get executed even if you have not accepted the suggestion before. This behavior is slightly different from other code editor applications, but rest assured, you can always Undo the change if you want to get back to your previous state.

SQL blocks

You can also use Deepnote AI to edit your SQL queries. Just click on Deepnote AI in a SQL block and tell Deepnote AI how it should edit your existing SQL code. Behind the scenes, Deepnote AI will inspect and use your database schema to better understand the written SQL code. Read more