add main.py

This commit is contained in:
2026-05-25 21:03:39 +00:00
parent 84c6a4c6b7
commit f7393e46f9
+74 -27
View File
@@ -1,33 +1,80 @@
# Personal AI Fluency Plan #!/usr/bin/env python3
"""Personal AI Fluency Plan
## Overview This script demonstrates a simple personal AI fluency plan.
This plan outlines the steps to develop AI fluency using the framework from the Ai Fluency course. It prints a structured plan with learning objectives, resources, and milestones.
"""
## Goals from datetime import datetime
1. Understand core concepts of AI fluency.
2. Apply LangChain and LangGraph to build simple agents.
3. Create a personal learning roadmap.
## Plan plan = {
1. **Foundations** Complete the course modules. "goal": "Become proficient in using AI tools for personal productivity and creative projects.",
2. **Handson** Build a small LangChain chain that answers a question. "timeline": "6 months",
3. **LangGraph** Create a graph that routes queries to different tools. "milestones": [
4. **Reflection** Document lessons learned and next steps. {
"month": 1,
"focus": "Foundations of AI and language models",
"resources": [
"https://anthropic.skilljar.com/ai-fluency-framework-foundations",
"Coursera: AI For Everyone by Andrew Ng",
],
},
{
"month": 2,
"focus": "Handson with LangChain and OpenAI API",
"resources": [
"LangChain documentation",
"OpenAI API quickstart",
],
},
{
"month": 3,
"focus": "Building simple chatbots and retrievalaugmented generation",
"resources": [
"LangChain tutorials",
"Hugging Face Spaces",
],
},
{
"month": 4,
"focus": "Advanced prompting and chain composition",
"resources": [
"Prompt Engineering Guide",
"LangChain advanced examples",
],
},
{
"month": 5,
"focus": "Deploying AI solutions locally and in the cloud",
"resources": [
"Docker for AI",
"AWS SageMaker",
],
},
{
"month": 6,
"focus": "Reflect, iterate, and plan next steps",
"resources": [
"Personal portfolio of AI projects",
"Community feedback and mentorship",
],
},
],
"evaluation": "Selfassessment and peer review after each milestone.",
}
## Deliverable
A written plan (this file) and a minimal working example in `main.py`.
## Example Code def print_plan(p):
```python print("Personal AI Fluency Plan")
from langchain import OpenAI, LLMChain print("Goal:", p["goal"])
from langchain.prompts import PromptTemplate print("Timeline:", p["timeline"])
print("\nMilestones:")
for m in p["milestones"]:
print(f" Month {m['month']}: {m['focus']}")
for r in m["resources"]:
print(f" - {r}")
print("\nEvaluation:", p["evaluation"])
print("\nGenerated on", datetime.utcnow().isoformat(), "UTC")
prompt = PromptTemplate( if __name__ == "__main__":
input_variables=["question"], print_plan(plan)
template="Answer the following question concisely: {question}"
)
llm = OpenAI(temperature=0.7)
chain = LLMChain(llm=llm, prompt=prompt)
print(chain.run(question="What is AI fluency?"))
```