Skip to content

AI Code Generation Task

This assignment challenges you to craft a prompt that instructs an LLM to produce a small command‑line tool. You will iterate on the prompt, run the generated code, and document your results.

Objectives

  1. Write a clear, structured prompt asking the model to generate a basic CLI utility (such as a to‑do list manager or calculator).
  2. Evaluate the completeness of the generated code and fix any issues.
  3. Document how you refined the prompt and debugged the output.

Setup

  1. Reuse the Python environment from previous assignments or create a new one.
  2. Install required packages:
    pip install openai python-dotenv
    
  3. Create a working folder with a log file named ai_code_gen_log.md.

Instructions

  1. Choose a Tool – decide on a simple CLI utility you want the model to build.
  2. Initial Prompt – use the prompt testing harness to request the full Python code for your tool.
  3. Run & Review – save the generated script, execute it, and note any errors.
  4. Refine – adjust your prompt to address the issues and request an improved version. Repeat until the tool works as intended.
  5. Document – record each prompt, the resulting code snippets, and your testing notes in ai_code_gen_log.md.

Deliverables

  1. Final working Python script for the CLI utility.
  2. ai_code_gen_log.md detailing your prompt iterations and debugging steps.

Submission

Commit your script and log file to the repository. In your pull request description, summarize what changes to the prompt produced the best results and mention any remaining limitations.