Use this prompt to help generating detailed documentation for specific functions. It directs ChatGPT to include specified documentation elements like function name, descriptions, parameters, etc. The user can attach a sample for reference.
Special Note: Avoid uploading sensitive or confidential information to the AI.
Prompt Content:
Create detailed documentation for the attached function. Include [documentation elements]. Here’s an example of the expected documentation: [example].
<< Attach Code >>
Usage Instructions:
- [code]: The code of the function you’re documenting.
- [documentation elements]: Specify the elements to include in the documentation, such as function name, description, parameters, and return values.
- [example]: Provide an example of the desired documentation format to guide ChatGPT.
Example Prompt:
Create detailed documentation for the attached function. Include the function name, description, parameters, and return values. Here’s an example of the expected documentation:
“””
Function Name: calculate_average
Description: Computes the average of a list of numbers.
Parameters: – numbers (list): A list of numerical values.
Returns: – float: The calculated average.
“””
Disclaimer: You are advised to research, understand, and test these prompts and their outputs. Adjust them as needed to fit your specific requirements. Use these prompts at your own risk, as outputs may not be correct. Follow best practices when using AI, keeping in mind potential security and privacy risks. Avoid uploading sensitive or confidential information. The user is solely responsible for any outcomes resulting from the use of these prompts.
Please share this article if you like it!
No Comment! Be the first one.