Ask AI (Cloud version only)
The Ask AI feature helps you code faster and better with the support of code generation and modification via natural language commands. You can use it when coding in Python, R, and SQL.
With Ask AI, you can do the following:
Save time by delegating the feature to do routine coding tasks you would do manually.
Modify your work by following suggestions based on the code you already have
Do follow-up tasks including data analysis, visualization, and machine learning
Learn programming languages by using and analyzing automatically generated code
Before you start
- Check feature accessibility>
Visit this page to make sure the AI service for JetBrains is permitted in your country.
- Accept terms and conditions
The step is required to ensure transparency and data protection.
- Limitations
At the moment, the feature is available to all users. However, in future versions, it will only be available to paid plan users.
AI usage is limited to 20 requests per 3 hours.
Use Ask AI
Add a code cell to your notebook.
On the cell toolbar, click the Ask AI icon. A Generate command line will appear in the cell.
(Optional) Enable review mode by clicking the settings icon and selecting the With review checkbox.
Provide a command using natural language and click Generate.
Once the code is generated, you have the following options:
If With review is disabled:
Click Accept to add the code to the cell.
Click Regenerate to get a different code suggestion.
Click Reject to cancel the provided command and resulting code generation.
If With review is enabled:
Review the code and deselect pieces of data you don't want to have sent.
Click Submit to add the code to the cell.
(Optional) Click Cancel to close the review window and reject the code.
Once the code suggestion is submitted, you have the following options:
Accept and run: to add the code to the cell and run it as-is
Accept: to add the code to the cell and continue working on it
Regenerate: to have the code regenerated and suggested again.
Reject: to reject the code suggestion.
In the picture below, you can see a cell with code generated to create a table form an uploaded .csv file. The command provided using Ask AI was 'generate table from player_stats.csv '.
Modify code using Ask AI
In a code cell with some code, click Ask AI. A Modify command line will appear.
Provide a command with a request to modify the code.
View the generated code and click Accept (Submit in preview mode) to apply the changes to the code.
Run the code to view the results.
In the example below:
The first command provided to Ask AI was 'Show correlation diagram between Pos and AST'. The resulting code produced a heatmap plot diagram.
The next step was modifying the code by prompting Ask AI to change the graph to a bar chart using hues of the red color.