This IntelliJ plugin allows you to generate Python function documentation using OpenAI's ChatGPT.
You can download the plugin from the JetBrains MarketPlace - Docgen
Preferences
Plugins
Marketplace
and search for Docgen
Preferences > Tools > Docgen
Preferences > Keymap
and look for Plugins > Docgen > Generate docstring
Generate docstring
from the context menuInsert
to add the documentation to your Python functionThe 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.
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.
We recommend using IntelliJ IDEA for development. After installing IDEA you can simply open the project folder.
You also need JDK 17. If IDEA can't find this JDK version on your machine it should
suggest downloading it for you after opening any .java
file. You can also go to File > New > Project > JDK > Add SDK
and download the correct JDK version manually.
To test the plugin you go to Run > Run...
and select the Run Plugin
configuration. This will start a new isolated IDEA
instance with Docgen already installed.
To create a ZIP file for distributing the plugin first open the Gradle tool window by clicking View > Tool Windows > Gradle
.
Then select Tasks > intelij > buildPlugin
. If the Gradle tool window is empty click the "reload" button. It will force
IDEA to download all missing tools.
Contributions are welcome! Please open an issue or submit a pull request if you have any suggestions or improvements.