Docgen
This IntelliJ plugin allows you to generate Python function documentation using OpenAI's ChatGPT.
You can download the plugin from the JetBrains MarketPlace - Docgen
Features
- Generate code documentation using OpenAI's models
- Option to use a custom prompt
Installation
- 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
Configuration
- 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
Usage
- 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
Model
The default model is gpt-3.5-turbo
. To use another model go to Preferences > Tools > Docgen
and
enter the model name in the provided input field.
Prompt
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.
Contributing
Contributions are welcome! Please open an issue or submit a pull request if you have any suggestions or improvements.