AI Agent Use Cases

Added today

44All 189

Prompt to Prepare a Shopping Cart from a Recipe Photo

The author reports that Grok Bot receives a recipe photo, organizes the ingredients and quantities, and creates a shopping list by excluding ingredients already available at home.

Grok Bot
Life & Hobbies

1–20 of 189

DevWalkthrough

Drafting a README and Function Descriptions by Reading a Python File

The author reads the structure of functions and classes, then creates a separate Python file with usage instructions and added explanations.

How it works

  1. The author specifies the target file using --file and selects readme, docstrings, or both with --format.
  2. After extracting the structure of functions and classes, the program has the model write installation instructions, usage examples, and API descriptions. In function description mode, the entire code is provided to the model.
  3. The documentation is saved as README_module-name.md, and the code with added explanations is saved as documented_filename. The original file is not overwritten directly.

Results

This is an implementation example that generates documentation and a file with function descriptions. It does not automatically verify the preservation of code behavior or the examples in the documentation.

Notes

When creating the README, the code body provided to the model is limited to the first 3,000 characters. For long files, the latter parts may be missing from the documentation, so separate review is necessary.

Source

GitHub Original post ↗

Example prompt · LangChain

Create a draft README and function descriptions for [Python module]. Refer to the structure extraction and documentation generation code of agents/16-documentation-writer, and summarize the Python environment and model API settings. Save the results in [an empty output folder].

Check the actual function names, input values, return values, and exceptions in the code for your explanations, and do not create unpublished installation commands or environment variables. The original README path only provides up to 3,000 characters of code, so for long files, check for missing sections and supplement by reading in parts. Keep the code with added explanations in a separate file from the original.

Test with small modules containing synchronous/asynchronous functions, default values, and exceptions. Run the examples in the documentation on a working copy and compare with the original to ensure that only the function descriptions have changed. The deliverables are the README, the file with added explanations, a comparison of changes, and execution logs. Do not mark unexecuted usage examples as verified, and distinguish between the improved handling of long files and the verification scope in this task.