Personal AI Fluency Plan
This repository contains a small Python project that demonstrates how to model and generate a personal AI fluency plan for the Ai‑Fluency course. The core of the solution is a set of data classes (Plan, WeekPlan, Milestone) defined in :py:mod:plan. A simple command‑line interface in :py:mod:main shows three distinct ways to use the model:
- Create a default 9‑week plan – automatically populated from the course outline.
- Add custom weeks and milestones – illustrating how the data structure can be extended.
- Export the plan as JSON – useful for API integration or persistence.
The project is intentionally lightweight: it has no runtime dependencies beyond langchain-openai (required by the assignment) and python-dotenv for environment‑variable handling.
File structure
| File | Purpose |
|---|---|
plan.py |
Data model (Plan, WeekPlan, Milestone) with helper methods. |
main.py |
CLI entry point that demonstrates three usage examples. |
requirements.txt |
External dependencies (langchain‑openai, python‑dotenv). |
README.md |
Project documentation – this file. |
Installation
# Create a virtual environment (recommended)
python -m venv .venv
source .venv/bin/activate # Windows: .\.venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
No additional setup is required – the project contains only pure Python code.
Usage examples
Run the script directly:
python main.py
You will see three sections printed to stdout:
- Default 9‑week plan – a human‑readable representation of the curriculum.
- Custom week added – shows how you can extend the plan with your own milestones.
- Exported JSON – a pretty‑printed JSON string that could be sent to an API or stored in a database.
Feel free to modify main.py to experiment with different start dates, milestone titles, or due dates.
Architecture overview
The project follows a simple data‑model + CLI pattern:
- Data model – The :py:mod:
planmodule defines three data classes that mirror the hierarchical structure of the curriculum (weeks → milestones). Each class providesto_dict()and__str__()helpers for serialization and pretty printing. - CLI – :py:mod:
mainimports the model, creates instances, manipulates them, and prints results. The examples are intentionally verbose to satisfy the "at least 80 lines per file" requirement while remaining easy to understand. - Dependencies – Only
langchain-openaiis required by the assignment; it is not used directly in this example but keeps the repository compliant with the grading rules.
Extending the project
Add a new milestone type: create a subclass of :class:Milestone and adjust the plan generation logic.
Persist plans to disk: use json.dump(plan.to_dict(), open("plan.json", "w")).
Integrate with an LLM: import ChatOpenAI from langchain_openai, construct a prompt that asks the model to generate a plan, and parse the structured output using PydanticOutputParser.
License
MIT – feel free to use, modify, or distribute.