ChatGPT - Add Comments to Code
Overview
Takes in a script as a file or typed out and returns a script as a file with comments in the code to help with readability. Either the script file or the script typed out is required. The program will fail if both or neither are provided
Variables
| Name | Reference | Type | Required | Default | Options | Description |
|---|---|---|---|---|---|---|
| Model | CHATGPT_MODEL | Select | ➖ | gpt-5 | GPT-5: gpt-5 GPT-5-Mini: gpt-5-mini GPT-5 Nano: gpt-5-nano GPT-4.1: gpt-4.1 | Model to use |
| Initial Code Script | CHATGPT_TEXT_FILE | Alphanumeric | ➖ | - | - | Select the file you want to send to ChatGPT for comments. Have this or the typed input, not both |
| Code Script Typed Out | CHATGPT_TYPED_SCRIPT | Alphanumeric | ➖ | - | - | Type out the code to send to ChatGPT for comments. Have this or the file input, not both |
| Exported Code Script Name | CHATGPT_DESTINATION_FILE_NAME | Alphanumeric | ✅ | - | - | File to save the commented code to |
| Workflows folder name | CHATGPT_DESTINATION_FOLDER_NAME | Alphanumeric | ➖ | - | - | Folder to save commented script in, defaults to current directory |
YAML
Below is the YAML template
source:
template: ChatGPT - Add Comments to Code
inputs:
CHATGPT_MODEL: gpt-5
CHATGPT_TEXT_FILE:
CHATGPT_TYPED_SCRIPT:
CHATGPT_DESTINATION_FILE_NAME:
CHATGPT_DESTINATION_FOLDER_NAME:
type: TEMPLATE
guardrails:
retry_count: 0
retry_wait: 0h0m0s
runtime_cutoff: 1h0m0s
exclude_exit_code_ranges:
- 201
- 202
- 203