This IntelliJ plugin allows you to generate Python function documentation using OpenAI's ChatGPT.
- Generate code documentation using OpenAI's
gpt-3.5-turbo
model - Option to use a custom prompt
- Open IntelliJ IDEA
- Make sure that the Python plugin is installed
- Go to
Preferences
- Select
Plugins
- Click on
Marketplace
and search forDocgen
- Install the plugin and restart IntelliJ IDEA
- To set your OpenAI API key, go to
Preferences > Tools > Docgen
- Enter your API key in the provided input field and click 'Apply'
- Set your keyboard shortcut: go to
Preferences > Keymap
and look forPlugins > Docgen > Generate docstring
- Right-click on the function you want to generate documentation for
- Choose
Generate docstring
from the context menu - Wait for the OpenAI model to generate the documentation
- The generated documentation will be displayed in a popup window
- Click
Insert
to add the documentation to your Python function
The default prompt is:
Generate high-quality docstring for the following Python function including function signature:
To use a custom prompt, go to Preferences > Tools > Docgen
and enter your prompt in the provided input field.
Contributions are welcome! Please open an issue or submit a pull request if you have any suggestions or improvements.