add main.py
This commit is contained in:
@@ -1,33 +1,80 @@
|
||||
# Personal AI Fluency Plan
|
||||
#!/usr/bin/env python3
|
||||
"""Personal AI Fluency Plan
|
||||
|
||||
## Overview
|
||||
This plan outlines the steps to develop AI fluency using the framework from the Ai Fluency course.
|
||||
This script demonstrates a simple personal AI fluency plan.
|
||||
It prints a structured plan with learning objectives, resources, and milestones.
|
||||
"""
|
||||
|
||||
## Goals
|
||||
1. Understand core concepts of AI fluency.
|
||||
2. Apply LangChain and LangGraph to build simple agents.
|
||||
3. Create a personal learning roadmap.
|
||||
from datetime import datetime
|
||||
|
||||
## Plan
|
||||
1. **Foundations** – Complete the course modules.
|
||||
2. **Hands‑on** – Build a small LangChain chain that answers a question.
|
||||
3. **LangGraph** – Create a graph that routes queries to different tools.
|
||||
4. **Reflection** – Document lessons learned and next steps.
|
||||
plan = {
|
||||
"goal": "Become proficient in using AI tools for personal productivity and creative projects.",
|
||||
"timeline": "6 months",
|
||||
"milestones": [
|
||||
{
|
||||
"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": "Hands‑on with LangChain and OpenAI API",
|
||||
"resources": [
|
||||
"LangChain documentation",
|
||||
"OpenAI API quickstart",
|
||||
],
|
||||
},
|
||||
{
|
||||
"month": 3,
|
||||
"focus": "Building simple chatbots and retrieval‑augmented 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": "Self‑assessment and peer review after each milestone.",
|
||||
}
|
||||
|
||||
## Deliverable
|
||||
A written plan (this file) and a minimal working example in `main.py`.
|
||||
|
||||
## Example Code
|
||||
```python
|
||||
from langchain import OpenAI, LLMChain
|
||||
from langchain.prompts import PromptTemplate
|
||||
def print_plan(p):
|
||||
print("Personal AI Fluency Plan")
|
||||
print("Goal:", p["goal"])
|
||||
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(
|
||||
input_variables=["question"],
|
||||
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?"))
|
||||
```
|
||||
if __name__ == "__main__":
|
||||
print_plan(plan)
|
||||
|
||||
Reference in New Issue
Block a user