Spaces:
Sleeping
Sleeping
Commit ยท
65638b6
1
Parent(s): dc2d297
final-version
Browse files- OBJECTIVES_AGENT_README.md +413 -0
- agents/analysis_phase/objectives.py +601 -311
- app.py +56 -11
- schemas/objectives_schema.py +64 -39
- test_objectives.py +292 -0
OBJECTIVES_AGENT_README.md
ADDED
|
@@ -0,0 +1,413 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# ๐ Objectives Agent - Complete Rebuild
|
| 2 |
+
|
| 3 |
+
## ๐ฏ Overview
|
| 4 |
+
|
| 5 |
+
ุชู
ุฅุนุงุฏุฉ ุจูุงุก Objectives Agent ุจุงููุงู
ู ู
ู ุงูุตูุฑ ูุชูููุฏ ุฃูุฏุงู ุชุนููู
ูุฉ ูุงุถุญุฉ ููุงุจูุฉ ููููุงุณ ููู ู
ุญูุฑ (axis) ูู ุงูู
ููุฌ ุงูุชุฏุฑูุจู.
|
| 6 |
+
|
| 7 |
+
---
|
| 8 |
+
|
| 9 |
+
## ๐ Files Modified/Created
|
| 10 |
+
|
| 11 |
+
### 1. `schemas/objectives_schema.py` โจ (REBUILT)
|
| 12 |
+
**ุงูุชุนุฏููุงุช:**
|
| 13 |
+
- ุฅุนุงุฏุฉ ูุชุงุจุฉ Pydantic models ุจุงููุงู
ู
|
| 14 |
+
- ูู
ูุฐุฌ `ObjectiveItem`: ูู
ุซู ูุฏู ุชุนููู
ู ูุงุญุฏ ูู
ุญูุฑ ูุงุญุฏ
|
| 15 |
+
- ูู
ูุฐุฌ `ObjectivesOutput`: ูุญุชูู ุนูู ูุงุฆู
ุฉ ูุงู
ูุฉ ุจุงูุฃูุฏุงู
|
| 16 |
+
|
| 17 |
+
**ุงูุญููู ุงูุฌุฏูุฏุฉ:**
|
| 18 |
+
```python
|
| 19 |
+
class ObjectiveItem(BaseModel):
|
| 20 |
+
unit: str # ุนููุงู ุงููุญุฏุฉ
|
| 21 |
+
unit_description: str # ูุตู ุงููุญุฏุฉ (focus)
|
| 22 |
+
axis: str # ุนููุงู ุงูู
ุญูุฑ
|
| 23 |
+
module_description: str # ูุตู ุงูู
ุญูุฑ (purpose)
|
| 24 |
+
level: str # ู
ุณุชูู Bloom
|
| 25 |
+
verbs: List[str] # 3 ุฃูุนุงู ู
ูุชุฑุญุฉ
|
| 26 |
+
objective: str # ุงููุฏู ุงูุชุนููู
ู ุจุงูุนุฑุจูุฉ
|
| 27 |
+
```
|
| 28 |
+
|
| 29 |
+
---
|
| 30 |
+
|
| 31 |
+
### 2. `agents/analysis_phase/objectives.py` โจ (REBUILT)
|
| 32 |
+
**ุงูุชุนุฏููุงุช:**
|
| 33 |
+
- ุฅุนุงุฏุฉ ูุชุงุจุฉ Agent ูTask ุจุงููุงู
ู
|
| 34 |
+
- ุชูุซูู ุดุงู
ู ูู
ูุตู
|
| 35 |
+
- Helper functions ู
ุญุณููุฉ
|
| 36 |
+
- Instructions ูุงุถุญุฉ ูู
ูุธู
ุฉ
|
| 37 |
+
|
| 38 |
+
**ุงูู
ูููุงุช ุงูุฑุฆูุณูุฉ:**
|
| 39 |
+
|
| 40 |
+
#### ๐ง Helper Functions:
|
| 41 |
+
```python
|
| 42 |
+
get_bloom_verb(level: str)
|
| 43 |
+
get_verbs_by_domain_and_level(domain: str, level_name: str)
|
| 44 |
+
format_domain_levels_info() โ str
|
| 45 |
+
```
|
| 46 |
+
|
| 47 |
+
#### ๐ค Agent:
|
| 48 |
+
- **Role:** Expert Learning Objectives Designer
|
| 49 |
+
- **Goal:** ุชูููุฏ ูุฏู ูุงุญุฏ ููู axis
|
| 50 |
+
- **Backstory:** ุฎุจูุฑ ุชุตู
ูู
ุชุนููู
ู ู
ุชุฎุตุต
|
| 51 |
+
|
| 52 |
+
#### ๐ Task:
|
| 53 |
+
- **Description:** ุชุนููู
ุงุช ู
ูุตูุฉ ุจู 80+ ุณุทุฑ
|
| 54 |
+
- **Expected Output:** JSON structure ูุงุถุญ
|
| 55 |
+
- **Output Schema:** ObjectivesOutput
|
| 56 |
+
|
| 57 |
+
#### ๐ฏ Main Function:
|
| 58 |
+
```python
|
| 59 |
+
generate_objectives(
|
| 60 |
+
topic: str,
|
| 61 |
+
domain: str,
|
| 62 |
+
content_type: str,
|
| 63 |
+
audience: str,
|
| 64 |
+
material_type: list,
|
| 65 |
+
outlines: dict
|
| 66 |
+
) โ dict
|
| 67 |
+
```
|
| 68 |
+
|
| 69 |
+
---
|
| 70 |
+
|
| 71 |
+
### 3. `test_objectives.py` โจ (NEW)
|
| 72 |
+
**ุงูุบุฑุถ:**
|
| 73 |
+
- ุงุฎุชุจุงุฑ ุงูู agent ุจุงุณุชุฎุฏุงู
ุจูุงูุงุช ูุนููุฉ
|
| 74 |
+
- ุนุฑุถ ุงูุฅุญุตุงุฆูุงุช ูุงูุชุญูููุงุช
|
| 75 |
+
- ุญูุธ ุงููุชุงุฆุฌ ูู `objectives_output.json`
|
| 76 |
+
|
| 77 |
+
**ุงูู
ูุฒุงุช:**
|
| 78 |
+
- โ
ุนุฑุถ Input Summary
|
| 79 |
+
- โ
Count Verification (objectives vs axes)
|
| 80 |
+
- โ
Verb Diversity Analysis
|
| 81 |
+
- โ
Domain Distribution Analysis
|
| 82 |
+
- โ
Sample Objectives Display
|
| 83 |
+
- โ
Error Handling & Traceback
|
| 84 |
+
|
| 85 |
+
---
|
| 86 |
+
|
| 87 |
+
## ๐ Input Structure
|
| 88 |
+
|
| 89 |
+
```json
|
| 90 |
+
{
|
| 91 |
+
"Metadata": [{
|
| 92 |
+
"topic": "...",
|
| 93 |
+
"domain": "...",
|
| 94 |
+
"content_type": "...",
|
| 95 |
+
"audience": "...",
|
| 96 |
+
"material_type": [...]
|
| 97 |
+
}],
|
| 98 |
+
"main_concept": "...",
|
| 99 |
+
"related_concepts": [...],
|
| 100 |
+
"units": [
|
| 101 |
+
{
|
| 102 |
+
"unit_number": 1,
|
| 103 |
+
"title": "ุนููุงู ุงููุญุฏุฉ",
|
| 104 |
+
"focus": "ูุตู ุงููุญุฏุฉ",
|
| 105 |
+
"axes": [
|
| 106 |
+
{
|
| 107 |
+
"axis_number": 1,
|
| 108 |
+
"title": "ุนููุงู ุงูู
ุญูุฑ",
|
| 109 |
+
"purpose": "ุงูุบุฑุถ ู
ู ุงูู
ุญูุฑ"
|
| 110 |
+
}
|
| 111 |
+
]
|
| 112 |
+
}
|
| 113 |
+
]
|
| 114 |
+
}
|
| 115 |
+
```
|
| 116 |
+
|
| 117 |
+
---
|
| 118 |
+
|
| 119 |
+
## ๐ค Output Structure
|
| 120 |
+
|
| 121 |
+
```json
|
| 122 |
+
{
|
| 123 |
+
"objectives": [
|
| 124 |
+
{
|
| 125 |
+
"unit": "ุงููุตู ุงูุฃูู: ู
ูุงููู
ูู
ุจุงุฏุฆ ุงูุชูููุฑ ุงูุชุตู
ูู
ู",
|
| 126 |
+
"unit_description": "ูู
ูุญ ุงูู
ุชุนูู
ูู ููู
ุงู ู
ุชุทูุฑุงู...",
|
| 127 |
+
"axis": "ุชุนุฑูู ุงูู
ุตุทูุญุงุช ุงูุฃุณุงุณูุฉ ููุชูููุฑ ุงูุชุตู
ูู
ู",
|
| 128 |
+
"module_description": "ุชุนุฑูู ุงูู
ุตุทูุญุงุช ุงูุฃุณุงุณูุฉ...",
|
| 129 |
+
"level": "Cognitive - Remember",
|
| 130 |
+
"verbs": ["ูุฐูุฑ", "ูุนุฏุฏ", "ูุณู
ู"],
|
| 131 |
+
"objective": "ุฃู ูุฐูุฑ ุงูู
ุชุนูู
ุงูู
ุตุทูุญุงุช ุงูุฃุณุงุณูุฉ ููุชูููุฑ ุงูุชุตู
ูู
ู ุจุฏูุฉ."
|
| 132 |
+
}
|
| 133 |
+
]
|
| 134 |
+
}
|
| 135 |
+
```
|
| 136 |
+
|
| 137 |
+
---
|
| 138 |
+
|
| 139 |
+
## โ
Key Rules Implemented
|
| 140 |
+
|
| 141 |
+
### 1. One-to-One Mapping
|
| 142 |
+
- โ
**ูุฏู ูุงุญุฏ ููุท** ููู ู
ุญูุฑ (axis)
|
| 143 |
+
- โ
ุนุฏุฏ ุงูุฃูุฏุงู = ุนุฏุฏ ุงูู
ุญุงูุฑ
|
| 144 |
+
- โ
ูุง ูุชู
ุฅูุดุงุก ู
ุญุงูุฑ ุฌุฏูุฏุฉ
|
| 145 |
+
- โ
ูุง ูุชู
ุชุฎุทู ุฃู ู
ุญูุฑ
|
| 146 |
+
|
| 147 |
+
### 2. Verb Diversity
|
| 148 |
+
- โ
ุงุณุชุฎุฏุงู
ุฃูุนุงู ู
ุชููุนุฉ ู
ู Bloom
|
| 149 |
+
- โ
ุชุฌูุจ ุชูุฑุงุฑ ููุณ ุงููุนู
|
| 150 |
+
- โ
ูุฏู: 70-80% ุฃูุนุงู ูุฑูุฏุฉ
|
| 151 |
+
- โ
ุชุชุจุน ุงูุฃูุนุงู ุงูู
ุณุชุฎุฏู
ุฉ
|
| 152 |
+
|
| 153 |
+
### 3. Domain Balance
|
| 154 |
+
- โ
Cognitive (Knowledge): 50-60%
|
| 155 |
+
- โ
Affective (Attitude): 20-30%
|
| 156 |
+
- โ
Psychomotor (Skills): 20-30%
|
| 157 |
+
|
| 158 |
+
### 4. Bloom's Progression
|
| 159 |
+
- โ
ุชุฏุฑุฌ ู
ูุทูู ุฏุงุฎู ูู ูุญุฏุฉ:
|
| 160 |
+
- ุงูุจุฏุงูุฉ: Remember, Understand
|
| 161 |
+
- ุงููุณุท: Apply, Analyze
|
| 162 |
+
- ุงูููุงูุฉ: Evaluate, Create
|
| 163 |
+
|
| 164 |
+
### 5. Quality Standards
|
| 165 |
+
- โ
ุฃูุฏุงู ูุงุจูุฉ ููููุงุณ
|
| 166 |
+
- โ
ุฃูุฏุงู ูุงุถุญุฉ ูู
ุญุฏุฏุฉ
|
| 167 |
+
- โ
ุจุฏูู ุบู
ูุถ ุฃู ุชุนููุฏ
|
| 168 |
+
- โ
ู
ูุงุณุจุฉ ููุฌู
ููุฑ ุงูู
ุณุชูุฏู
|
| 169 |
+
- โ
ุจุงููุบุฉ ุงูุนุฑุจูุฉ ุงููุตุญู
|
| 170 |
+
|
| 171 |
+
---
|
| 172 |
+
|
| 173 |
+
## ๐ Usage
|
| 174 |
+
|
| 175 |
+
### ุงูุจุณูุท (Simple):
|
| 176 |
+
```python
|
| 177 |
+
from agents.analysis_phase.objectives import generate_objectives
|
| 178 |
+
|
| 179 |
+
result = generate_objectives(
|
| 180 |
+
topic="Design Thinking",
|
| 181 |
+
domain="Management",
|
| 182 |
+
content_type="Training",
|
| 183 |
+
audience="Professionals",
|
| 184 |
+
material_type=["Conceptual", "Procedural"],
|
| 185 |
+
outlines=curriculum_structure
|
| 186 |
+
)
|
| 187 |
+
|
| 188 |
+
print(result['objectives'])
|
| 189 |
+
```
|
| 190 |
+
|
| 191 |
+
### ุงูุงุฎุชุจุงุฑ (Testing):
|
| 192 |
+
```bash
|
| 193 |
+
cd Project
|
| 194 |
+
python test_objectives.py
|
| 195 |
+
```
|
| 196 |
+
|
| 197 |
+
---
|
| 198 |
+
|
| 199 |
+
## ๐ Expected Metrics
|
| 200 |
+
|
| 201 |
+
ุนูุฏ ุงูุชุดุบูู ุงูุตุญูุญุ ูุฌุจ ุฃู ุชุญุตู ุนูู:
|
| 202 |
+
|
| 203 |
+
| Metric | Target | Status |
|
| 204 |
+
|--------|--------|--------|
|
| 205 |
+
| Objectives Count | = Axes Count | โ
Match |
|
| 206 |
+
| Verb Diversity | 70-80% | โ
Pass |
|
| 207 |
+
| Cognitive Domain | 50-60% | โ
Balanced |
|
| 208 |
+
| Affective Domain | 20-30% | โ
Balanced |
|
| 209 |
+
| Psychomotor Domain | 20-30% | โ
Balanced |
|
| 210 |
+
| Measurability | 100% | โ
All Clear |
|
| 211 |
+
| Arabic Language | 100% | โ
Correct |
|
| 212 |
+
|
| 213 |
+
---
|
| 214 |
+
|
| 215 |
+
## ๐ฏ Learning Domains Reference
|
| 216 |
+
|
| 217 |
+
### 1. ุงูู
ุฌุงู ุงูู
ุนุฑูู (Cognitive)
|
| 218 |
+
**Levels:**
|
| 219 |
+
- Remember (ูุฐูุฑุ ูุญุฏุฏุ ูุณู
ู)
|
| 220 |
+
- Understand (ููุณุฑุ ูุดุฑุญุ ููุถุญ)
|
| 221 |
+
- Apply (ูุทุจูุ ูุณุชุฎุฏู
ุ ูููุฐ)
|
| 222 |
+
- Analyze (ูุญููุ ููุงุฑูุ ูู
ูุฒ)
|
| 223 |
+
- Evaluate (ูููู
ุ ูููุฏุ ูุจุฑุฑ)
|
| 224 |
+
- Create (ูุจุชูุฑุ ูุตู
ู
ุ ูุทูุฑ)
|
| 225 |
+
|
| 226 |
+
### 2. ุงูู
ุฌุงู ุงููุฌุฏุงูู (Affective)
|
| 227 |
+
**Levels:**
|
| 228 |
+
- Reception (ููุชุจูุ ูุณุชูุจูุ ููุงุญุธ)
|
| 229 |
+
- Response (ูุณุชุฌูุจุ ูุดุงุฑูุ ูุชุทูุน)
|
| 230 |
+
- Valuing (ููุฏุฑุ ูุญุชุฑู
ุ ูุคูุฏ)
|
| 231 |
+
- Organization (ููุธู
ุ ููุชุฒู
ุ ููุงุฒู)
|
| 232 |
+
- Characterization (ูู
ูุฒุ ูุชุจููุ ูู
ุงุฑุณ)
|
| 233 |
+
|
| 234 |
+
### 3. ุงูู
ุฌุงู ุงูู
ูุงุฑู (Psychomotor)
|
| 235 |
+
**Levels:**
|
| 236 |
+
- Readiness (ูุณุชุนุฏุ ูุชููุฃ)
|
| 237 |
+
- Guided Response (ูููุฏุ ูุญุงููุ ูุฌุฑุจ)
|
| 238 |
+
- Mechanism (ูู
ุงุฑุณุ ูุทุจูุ ูููุฐ)
|
| 239 |
+
- Complex Response (ูุชููุ ูุคุฏู ุจุณูุงุณุฉ)
|
| 240 |
+
- Adaptation (ูุนุฏูุ ููููุ ูุญุณู)
|
| 241 |
+
- Origination (ูุจุชูุฑุ ูุตู
ู
ุ ูุจุฏุน)
|
| 242 |
+
|
| 243 |
+
---
|
| 244 |
+
|
| 245 |
+
## ๐ Example Test Data
|
| 246 |
+
|
| 247 |
+
ุงูู
ูู `test_objectives.py` ูุญุชูู ุนูู ุจูุงูุงุช ุชุฌุฑูุจูุฉ ูุงู
ูุฉ:
|
| 248 |
+
|
| 249 |
+
**ุงูู
ูุถูุน:**
|
| 250 |
+
```
|
| 251 |
+
ุชูููุงุช ุงูุชูููุฑ ุงูุชุตู
ูู
ู ูุญู ุงูู
ุดููุงุช ูุงุชุฎุงุฐ ุงููุฑุงุฑุงุช
|
| 252 |
+
```
|
| 253 |
+
|
| 254 |
+
**ุงููุญุฏุงุช (4 units):**
|
| 255 |
+
1. ู
ูุงููู
ูู
ุจุงุฏุฆ ุงูุชูููุฑ ุงูุชุตู
ูู
ู (5 axes)
|
| 256 |
+
2. ุงูุนู
ููุฉ ุงูู
ูุฏุงููุฉ ูุชูููุงุช ุงูุชูููุฑ ุงูุชุตู
ูู
ู (5 axes)
|
| 257 |
+
3. ุชุทุจููุงุช ุงูุชูููุฑ ุงูุชุตู
ูู
ู (5 axes)
|
| 258 |
+
4. ุงูุชูููุฐ ูุงูุชูููู
(5 axes)
|
| 259 |
+
|
| 260 |
+
**ุฅุฌู
ุงูู ุงูู
ุญุงูุฑ:** 20 axes
|
| 261 |
+
**ุงูุฃูุฏุงู ุงูู
ุชููุนุฉ:** 20 objectives
|
| 262 |
+
|
| 263 |
+
---
|
| 264 |
+
|
| 265 |
+
## ๐ Troubleshooting
|
| 266 |
+
|
| 267 |
+
### ู
ุดููุฉ: ุนุฏุฏ ุงูุฃูุฏุงู โ ุนุฏุฏ ุงูู
ุญุงูุฑ
|
| 268 |
+
**ุงูุญู:**
|
| 269 |
+
- ุชุญูู ู
ู ุจููุฉ ุงูู `outlines` input
|
| 270 |
+
- ุชุฃูุฏ ู
ู ูุฌูุฏ `axes` ูู ูู unit
|
| 271 |
+
- ุฑุงุฌุน ุงูู Task description
|
| 272 |
+
|
| 273 |
+
### ู
ุดููุฉ: ุชูุฑุงุฑ ุงูุฃูุนุงู
|
| 274 |
+
**ุงูุญู:**
|
| 275 |
+
- ุฑุงุฌุน Verb Diversity Instructions
|
| 276 |
+
- ุชุญูู ู
ู `get_verbs_by_domain_and_level()`
|
| 277 |
+
- ุฒูุงุฏุฉ ุนุฏุฏ ุงูุฃูุนุงู ุงูู
ุชุงุญุฉ
|
| 278 |
+
|
| 279 |
+
### ู
ุดููุฉ: ุนุฏู
ุงูุชูุงุฒู ุจูู ุงูู
ุฌุงูุงุช
|
| 280 |
+
**ุงูุญู:**
|
| 281 |
+
- ุฑุงุฌุน Domain Balance Rules
|
| 282 |
+
- ุชุฃูุฏ ู
ู ุชูุฒูุน ุงูุฃูุฏุงู ุนูู ุงูู
ุฌุงูุงุช ุงูุซูุงุซุฉ
|
| 283 |
+
- ุงุถุจุท ุงููุณุจ ุญุณุจ ุทุจูุนุฉ ุงูู
ุญุชูู
|
| 284 |
+
|
| 285 |
+
---
|
| 286 |
+
|
| 287 |
+
## ๐ Integration
|
| 288 |
+
|
| 289 |
+
ููุชูุงู
ู ู
ุน ุงูู API:
|
| 290 |
+
|
| 291 |
+
```python
|
| 292 |
+
# ูู routers/objective_route.py
|
| 293 |
+
|
| 294 |
+
from agents.analysis_phase.objectives import generate_objectives
|
| 295 |
+
|
| 296 |
+
@app.post("/objectives/generate")
|
| 297 |
+
async def generate_objectives_route(data: OutlineInput):
|
| 298 |
+
result = generate_objectives(
|
| 299 |
+
topic=data.topic,
|
| 300 |
+
domain=data.domain,
|
| 301 |
+
content_type=data.content_type,
|
| 302 |
+
audience=data.audience,
|
| 303 |
+
material_type=data.material_type,
|
| 304 |
+
outlines=data.outlines
|
| 305 |
+
)
|
| 306 |
+
return result
|
| 307 |
+
```
|
| 308 |
+
|
| 309 |
+
---
|
| 310 |
+
|
| 311 |
+
## ๐ Documentation
|
| 312 |
+
|
| 313 |
+
### ูู ุงูููุฏ:
|
| 314 |
+
- โ
Docstrings ุดุงู
ูุฉ ููู function
|
| 315 |
+
- โ
Type hints ูุงุถุญุฉ
|
| 316 |
+
- โ
Comments ุชูุถูุญูุฉ
|
| 317 |
+
- โ
Examples ูู ุงูู docstrings
|
| 318 |
+
|
| 319 |
+
### Instructions ููู AI:
|
| 320 |
+
- โ
80+ ุณุทุฑ ู
ู ุงูุชุนููู
ุงุช ุงูู
ูุตูุฉ
|
| 321 |
+
- โ
ุฃู
ุซูุฉ ูุงุถุญุฉ
|
| 322 |
+
- โ
ููุงุนุฏ ุตุงุฑู
ุฉ
|
| 323 |
+
- โ
Checklists ููุชุญูู
|
| 324 |
+
|
| 325 |
+
---
|
| 326 |
+
|
| 327 |
+
## โจ Features Highlights
|
| 328 |
+
|
| 329 |
+
### 1. Comprehensive Instructions
|
| 330 |
+
- ุชุนููู
ุงุช ู
ูุตูุฉ ุจู 80+ ุณุทุฑ
|
| 331 |
+
- ุฃู
ุซูุฉ ูุงุถุญุฉ
|
| 332 |
+
- ููุงุนุฏ ุตุงุฑู
ุฉ ููุฌูุฏุฉ
|
| 333 |
+
|
| 334 |
+
### 2. Helper Functions
|
| 335 |
+
- `get_bloom_verb()`: ุงุณุชุฎุฑุงุฌ ุงูุฃูุนุงู ู
ู Bloom
|
| 336 |
+
- `get_verbs_by_domain_and_level()`: ุฃูุนุงู ุญุณุจ ุงูู
ุฌุงู
|
| 337 |
+
- `format_domain_levels_info()`: ุชูุณูู ู
ุนููู
ุงุช ุงูู
ุฌุงูุงุช
|
| 338 |
+
|
| 339 |
+
### 3. Validation & Quality
|
| 340 |
+
- ุนุฏ ุงูุฃูุฏุงู vs ุงูู
ุญุงูุฑ
|
| 341 |
+
- ุชุญููู ุชููุน ุงูุฃูุนุงู
|
| 342 |
+
- ุชูุฒูุน ุงูู
ุฌุงูุงุช
|
| 343 |
+
- ูุงุจููุฉ ุงูููุงุณ
|
| 344 |
+
|
| 345 |
+
### 4. Error Handling
|
| 346 |
+
- Try-except blocks
|
| 347 |
+
- Traceback display
|
| 348 |
+
- Clear error messages
|
| 349 |
+
|
| 350 |
+
### 5. Test Suite
|
| 351 |
+
- ุจูุงูุงุช ุชุฌุฑูุจูุฉ ูุงู
ูุฉ
|
| 352 |
+
- ุชุญูููุงุช ูุฅุญุตุงุฆูุงุช
|
| 353 |
+
- ุญูุธ ุงููุชุงุฆุฌ
|
| 354 |
+
|
| 355 |
+
---
|
| 356 |
+
|
| 357 |
+
## ๐ Best Practices Implemented
|
| 358 |
+
|
| 359 |
+
1. โ
**Type Safety:** ุงุณุชุฎุฏุงู
Pydantic ููุชุญูู ู
ู ุงูุจูุงูุงุช
|
| 360 |
+
2. โ
**Documentation:** ุชูุซูู ุดุงู
ู ููู component
|
| 361 |
+
3. โ
**Modularity:** ูุตู ุงูู
ูุงู
ุฅูู functions ุตุบูุฑุฉ
|
| 362 |
+
4. โ
**Testing:** ู
ูู ุงุฎุชุจุงุฑ ู
ุณุชูู
|
| 363 |
+
5. โ
**Error Handling:** ู
ุนุงูุฌุฉ ุงูุฃุฎุทุงุก ุจุดูู ุตุญูุญ
|
| 364 |
+
6. โ
**Code Style:** PEP 8 compliant
|
| 365 |
+
7. โ
**Comments:** ุชุนูููุงุช ูุงุถุญุฉ ุจุงูุนุฑุจูุฉ ูุงูุฅูุฌููุฒูุฉ
|
| 366 |
+
8. โ
**Examples:** ุฃู
ุซูุฉ ูุงูุนูุฉ ูู ุงูููุฏ
|
| 367 |
+
|
| 368 |
+
---
|
| 369 |
+
|
| 370 |
+
## ๐ฆ Status
|
| 371 |
+
|
| 372 |
+
| Component | Status | Notes |
|
| 373 |
+
|-----------|--------|-------|
|
| 374 |
+
| Schema | โ
Complete | Rebuilt from scratch |
|
| 375 |
+
| Agent | โ
Complete | Fully documented |
|
| 376 |
+
| Task | โ
Complete | 80+ lines instructions |
|
| 377 |
+
| Helpers | โ
Complete | 3 utility functions |
|
| 378 |
+
| Tests | โ
Complete | Full test suite |
|
| 379 |
+
| Docs | โ
Complete | This README |
|
| 380 |
+
|
| 381 |
+
---
|
| 382 |
+
|
| 383 |
+
## ๐ Support
|
| 384 |
+
|
| 385 |
+
ููุฃุณุฆูุฉ ุฃู ุงูู
ุดุงูู:
|
| 386 |
+
1. ุฑุงุฌุน ูุฐุง ุงูู README
|
| 387 |
+
2. ุงูุญุต ู
ูู `test_objectives.py`
|
| 388 |
+
3. ุฑุงุฌุน ุงูู docstrings ูู ุงูููุฏ
|
| 389 |
+
4. ุชุญูู ู
ู ุงูู error messages
|
| 390 |
+
|
| 391 |
+
---
|
| 392 |
+
|
| 393 |
+
## ๐ Summary
|
| 394 |
+
|
| 395 |
+
โ
**ุชู
ุฅุนุงุฏุฉ ุจูุงุก Objectives Agent ุจุงููุงู
ู**
|
| 396 |
+
|
| 397 |
+
**ุงูุชุญุณููุงุช ุงูุฑุฆูุณูุฉ:**
|
| 398 |
+
- ๐ Pydantic schema ู
ุญุณูู
|
| 399 |
+
- ๐ค Agent instructions ู
ูุตูุฉ (80+ ุณุทุฑ)
|
| 400 |
+
- ๐ง Helper functions ู
ุญุณููุฉ
|
| 401 |
+
- ๐งช Test suite ูุงู
ู
|
| 402 |
+
- ๐ Documentation ุดุงู
ู
|
| 403 |
+
- โจ Quality standards ุนุงููุฉ
|
| 404 |
+
|
| 405 |
+
**ุงููุชูุฌุฉ:**
|
| 406 |
+
ูุธุงู
ููู ูู
ุชูุงู
ู ูุชูููุฏ ุฃูุฏุงู ุชุนููู
ูุฉ ุนุงููุฉ ุงูุฌูุฏุฉุ ูุงุจูุฉ ููููุงุณุ ูู
ุชููุนุฉ ููู ู
ุญูุฑ ูู ุงูู
ููุฌ ุงูุชุฏุฑูุจู.
|
| 407 |
+
|
| 408 |
+
---
|
| 409 |
+
|
| 410 |
+
**๐ฏ Ready to use!**
|
| 411 |
+
|
| 412 |
+
Run: `python test_objectives.py`
|
| 413 |
+
|
agents/analysis_phase/objectives.py
CHANGED
|
@@ -1,358 +1,648 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
from modules import bloom_taxonomy_2, objectives_dimensions, llm_g
|
| 5 |
from schemas import ObjectivesOutput
|
|
|
|
| 6 |
|
| 7 |
|
| 8 |
-
|
| 9 |
-
|
|
|
|
| 10 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
if level not in bloom_taxonomy_2:
|
| 12 |
-
raise ValueError(f"Invalid Bloom level: {level}")
|
|
|
|
| 13 |
verbs_key = [k for k in bloom_taxonomy_2[level].keys() if "_verbs_examples" in k][0]
|
| 14 |
return bloom_taxonomy_2[level][verbs_key]
|
| 15 |
|
| 16 |
|
| 17 |
-
def get_verbs_by_domain_and_level(domain, level_name):
|
| 18 |
"""
|
| 19 |
-
ุงุณุชุฎุฑุงุฌ ุงูุฃูุนุงู ุงูู
ูุงุณุจุฉ ู
ู ูุงู
ูุณ ุงูุฃุจุนุงุฏ ุงูุชุนููู
ูุฉ
|
| 20 |
-
|
| 21 |
Args:
|
| 22 |
-
domain: "Knowledge", "Ability", or "Skills"
|
| 23 |
level_name: ุงุณู
ุงูู
ุณุชูู ู
ุซู "Remember", "Response", "Practice"
|
| 24 |
-
|
| 25 |
Returns:
|
| 26 |
-
ูุงุฆู
ุฉ ุจุงูุฃูุนุงู ุงูู
ุชุงุญ
|
| 27 |
"""
|
| 28 |
if domain not in objectives_dimensions:
|
| 29 |
return []
|
| 30 |
-
|
| 31 |
for level in objectives_dimensions[domain]["levels"]:
|
| 32 |
if level_name.lower() in level["level_name"].lower():
|
| 33 |
return level["verbs_examples"]
|
| 34 |
-
|
| 35 |
return []
|
| 36 |
|
| 37 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 38 |
objectives_generator = Agent(
|
| 39 |
-
role="Expert Learning Objectives Designer (
|
|
|
|
| 40 |
goal=(
|
| 41 |
-
"Design
|
| 42 |
-
"for
|
| 43 |
-
|
| 44 |
-
"
|
| 45 |
-
"
|
| 46 |
-
"
|
| 47 |
-
"
|
| 48 |
-
"
|
| 49 |
-
"
|
| 50 |
-
"**
|
| 51 |
-
"
|
| 52 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 53 |
),
|
|
|
|
| 54 |
backstory=(
|
| 55 |
-
"
|
| 56 |
-
|
| 57 |
-
"
|
| 58 |
-
"
|
| 59 |
-
"
|
| 60 |
-
"
|
| 61 |
-
"
|
| 62 |
-
"
|
| 63 |
-
|
| 64 |
-
"
|
| 65 |
-
"
|
| 66 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 67 |
),
|
|
|
|
| 68 |
llm=llm_g,
|
| 69 |
verbose=True,
|
| 70 |
-
max_iter=
|
|
|
|
| 71 |
)
|
| 72 |
|
| 73 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 74 |
objectives_task = Task(
|
| 75 |
description=(
|
| 76 |
-
"
|
| 77 |
-
|
| 78 |
-
"
|
| 79 |
-
"
|
| 80 |
-
"
|
| 81 |
-
"
|
| 82 |
-
"
|
| 83 |
-
""
|
| 84 |
-
"
|
| 85 |
-
"
|
| 86 |
-
"
|
| 87 |
-
"
|
| 88 |
-
"
|
| 89 |
-
"
|
| 90 |
-
""
|
| 91 |
-
"
|
| 92 |
-
""
|
| 93 |
-
"
|
| 94 |
-
"
|
| 95 |
-
"
|
| 96 |
-
"
|
| 97 |
-
"
|
| 98 |
-
"- `module_description` (axis purpose)"
|
| 99 |
-
"- `level` (Bloomโs level)"
|
| 100 |
-
"- `verbs` (three suggested verbs)"
|
| 101 |
-
"- `objective` (one clear Arabic measurable learning objective)"
|
| 102 |
-
""
|
| 103 |
-
"---"
|
| 104 |
-
""
|
| 105 |
-
"### Example (Simplified)"
|
| 106 |
-
"**Example Input:**"
|
| 107 |
-
"```json"
|
| 108 |
-
"{"
|
| 109 |
-
' "units": ['
|
| 110 |
-
" {"
|
| 111 |
-
' "title": "ุงููุญุฏุฉ ุงูุฃููู: ู
ูุฏู
ุฉ ูู ุงูุชูููุฑ ุงูุชุตู
ูู
ู",'
|
| 112 |
-
' "focus": "ูุชุนุฑู ุงูู
ุชุนูู
ุนูู ู
ูููู
ุงูุชูููุฑ ุงูุชุตู
ูู
ู ูุฃูู
ูุชู.",'
|
| 113 |
-
' "axes": ['
|
| 114 |
-
" {"
|
| 115 |
-
' "title": "ุชุนุฑูู ุงูุชูููุฑ ุงูุชุตู
ูู
ู",'
|
| 116 |
-
' "purpose": "ูููู
ุงูู
ุชุนูู
ู
ุนูู ุงูุชูููุฑ ุงูุชุตู
ูู
ู ูู
ูููุงุชู."'
|
| 117 |
-
" },"
|
| 118 |
-
" {"
|
| 119 |
-
' "title": "ุฃูู
ูุฉ ุงูุชูููุฑ ุงูุชุตู
ูู
ู",'
|
| 120 |
-
' "purpose": "ูุดุฑุญ ุงูู
ุชุนูู
ููู ูุณุงูู
ุงูุชูููุฑ ุงูุชุตู
ูู
ู ูู ุญู ุงูู
ุดููุงุช."'
|
| 121 |
-
" }"
|
| 122 |
-
" ]"
|
| 123 |
-
" }"
|
| 124 |
-
" ]"
|
| 125 |
"}\n"
|
| 126 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 127 |
' "objectives": [\n'
|
| 128 |
" {\n"
|
| 129 |
-
' "unit": "ุงู
|
| 130 |
-
' "unit_description": "ู
|
| 131 |
-
' "axis": "ุชุนุฑูู ุงูุชูููุฑ ุงูุชุตู
ูู
ู",\n'
|
| 132 |
-
' "module_description": "ูู
|
| 133 |
-
' "level": "Cognitive -
|
| 134 |
-
' "verbs": ["ู
|
| 135 |
-
' "objective": "ุฃู ู
|
| 136 |
" },\n"
|
| 137 |
" {\n"
|
| 138 |
-
' "unit": "ุงู
|
| 139 |
-
' "unit_description": "ู
|
| 140 |
-
' "axis": "
|
| 141 |
-
' "module_description": "ู
|
| 142 |
' "level": "Cognitive - Understand",\n'
|
| 143 |
-
' "verbs": ["ู
|
| 144 |
-
' "objective": "ุฃู ู
|
| 145 |
" }\n"
|
|
|
|
| 146 |
" ]\n"
|
| 147 |
-
"}"
|
| 148 |
-
"```\n"
|
| 149 |
-
|
| 150 |
-
"
|
| 151 |
-
"
|
| 152 |
-
"
|
| 153 |
-
"
|
| 154 |
-
"
|
| 155 |
-
"
|
| 156 |
-
"
|
| 157 |
-
"
|
| 158 |
-
"
|
| 159 |
-
"
|
| 160 |
-
"
|
| 161 |
-
|
| 162 |
-
"
|
| 163 |
-
"
|
| 164 |
-
"
|
| 165 |
-
"
|
| 166 |
-
"
|
| 167 |
-
"
|
| 168 |
-
"
|
| 169 |
-
|
| 170 |
-
|
| 171 |
-
"
|
| 172 |
-
+ "\n".join(
|
| 173 |
-
[
|
| 174 |
-
f" - {level['level_name']}: {level['description']}\n Verbs: {', '.join(level['verbs_examples'])}"
|
| 175 |
-
for level in objectives_dimensions["Knowledge"]["levels"]
|
| 176 |
-
]
|
| 177 |
-
)
|
| 178 |
-
+ "\n\n"
|
| 179 |
-
f"**2. Affective Domain (Attitude/Ability):**\n"
|
| 180 |
-
f"{objectives_dimensions['Ability']['description']}\n"
|
| 181 |
-
"**Levels:**\n"
|
| 182 |
-
+ "\n".join(
|
| 183 |
-
[
|
| 184 |
-
f" - {level['level_name']}: {level['description']}\n Verbs: {', '.join(level['verbs_examples'])}"
|
| 185 |
-
for level in objectives_dimensions["Ability"]["levels"]
|
| 186 |
-
]
|
| 187 |
-
)
|
| 188 |
-
+ "\n\n"
|
| 189 |
-
f"**3. Psychomotor Domain (Skills):**\n"
|
| 190 |
-
f"{objectives_dimensions['Skills']['description']}\n"
|
| 191 |
-
"**Levels:**\n"
|
| 192 |
-
+ "\n".join(
|
| 193 |
-
[
|
| 194 |
-
f" - {level['level_name']}: {level['description']}\n Verbs: {', '.join(level['verbs_examples'])}"
|
| 195 |
-
for level in objectives_dimensions["Skills"]["levels"]
|
| 196 |
-
]
|
| 197 |
-
)
|
| 198 |
-
+ "\n\n"
|
| 199 |
-
"### Critical Requirement: Verb Diversity \n"
|
| 200 |
-
"**This is a top-priority rule that must be followed precisely:**\n\n"
|
| 201 |
-
"**Verb Non-Repetition Rules:**\n"
|
| 202 |
-
"1. **Maximize verb diversity** โ each objective should ideally use a different verb than all previous ones.\n"
|
| 203 |
-
"2. **Before selecting a verb, check:** Have I used this verb before? If yes, choose another.\n"
|
| 204 |
-
"3. **Repeat a verb only when:**\n"
|
| 205 |
-
" - All suitable alternative verbs in that Bloom level or domain are exhausted.\n"
|
| 206 |
-
" - The axisโs content explicitly requires that verb for accuracy.\n"
|
| 207 |
-
" - You can justify why no other verb fits.\n"
|
| 208 |
-
"4. **Prioritize diversity over perfect synonyms** โ itโs better to use a slightly different but valid verb than to repeat.\n"
|
| 209 |
-
"5. **Use the full range of verbs from Bloom and the three domains** โ avoid overusing common ones like 'define' or 'explain'.\n"
|
| 210 |
-
"6. **Track verb usage:** after writing each objective, note the verb and consciously avoid it in the next.\n"
|
| 211 |
-
"7. **If repetition is necessary:**\n"
|
| 212 |
-
" - Space it out by at least 3โ5 objectives.\n"
|
| 213 |
-
" - Add a justification note in your internal reasoning.\n"
|
| 214 |
-
" - Try using it in a different context or content area.\n\n"
|
| 215 |
-
"### The 12 Mandatory Design Standards โ Each Objective Must Meet All\n"
|
| 216 |
-
"**Based on the detailed objectives reference document:**\n\n"
|
| 217 |
-
"1. **Linked to the general goal:**\n"
|
| 218 |
-
" - Every objective must connect to the courseโs overall goal.\n"
|
| 219 |
-
" - Example: If the general goal is 'Understand the concept of e-learning', "
|
| 220 |
-
"the specific objective could be 'The trainee accurately defines e-learning.'\n\n"
|
| 221 |
-
"2. **Measurable:**\n"
|
| 222 |
-
" - Objectives must be assessable using measurable performance indicators or outcomes.\n"
|
| 223 |
-
" - Correct: 'The trainee compares synchronous and asynchronous learning accurately.'\n"
|
| 224 |
-
" - Incorrect: 'The trainee understands e-learning.' (Not measurable)\n\n"
|
| 225 |
-
"3. **Achievable:**\n"
|
| 226 |
-
" - Realistic, suitable for learner ability and course duration.\n"
|
| 227 |
-
" - Correct: 'The trainee applies the steps to create a learning management account.'\n"
|
| 228 |
-
" - Incorrect: 'The trainee develops a full e-learning system in one hour.' (Unrealistic)\n\n"
|
| 229 |
-
"4. **Covers all three domains (Cognitive, Psychomotor, Affective):**\n"
|
| 230 |
-
" - Cognitive: 'The trainee defines e-learning accurately.'\n"
|
| 231 |
-
" - Psychomotor: 'The trainee practices using LMS assessment tools.'\n"
|
| 232 |
-
" - Affective: 'The trainee demonstrates interest in participating in e-learning activities.'\n\n"
|
| 233 |
-
"5. **Aligned with Bloomโs hierarchy:**\n"
|
| 234 |
-
" - Objectives must progress logically from lower to higher levels (Remember โ Create).\n\n"
|
| 235 |
-
"6. **Clarity and precision:** Objective must be completely clear and specific.\n\n"
|
| 236 |
-
"7. **Free from ambiguity:** No vague or overly complex phrasing.\n\n"
|
| 237 |
-
"8. **Vocabulary clarity:** All terms must be understandable to {audience}.\n\n"
|
| 238 |
-
"9. **Single, focused goal:** Each objective expresses only one learning outcome.\n"
|
| 239 |
-
" - Correct: 'The trainee identifies the components of a virtual classroom.'\n"
|
| 240 |
-
" - Incorrect: 'The trainee identifies and applies virtual classroom components.'\n\n"
|
| 241 |
-
"10. **Realistic and feasible:** Achievable within program time and resources.\n\n"
|
| 242 |
-
"11. **Consistent with program outcomes:** Must align with the general and specific learning outcomes.\n\n"
|
| 243 |
-
"12. **Content-linked:** Directly related to the unit or module content.\n\n"
|
| 244 |
-
"### Objective Writing Rules\n"
|
| 245 |
-
"- One objective per axis โ no more, no less.\n"
|
| 246 |
-
"- Each must directly and precisely reflect the axisโs purpose.\n"
|
| 247 |
-
"- Follow Bloomโs sequence within each unit (from lower to higher order thinking).\n"
|
| 248 |
-
"- If a level doesnโt logically fit, skip it but maintain general progression.\n"
|
| 249 |
-
"- You may combine two levels (e.g., Understand + Apply) if justified by axis purpose.\n"
|
| 250 |
-
"- Start each objective with '[verb in present]' and keep length between 6โ10 words.\n"
|
| 251 |
-
"- Use verbs suitable for {audience} โ e.g., children cannot 'evaluate' or 'analyze' like professionals.\n"
|
| 252 |
-
"- **Core rule: Avoid verb repetition โ use the widest possible range from all three domains.**\n"
|
| 253 |
-
"- Ensure objectives are **measurable** and **achievable**.\n"
|
| 254 |
-
"- Maintain linguistic clarity โ no vague or double meanings.\n"
|
| 255 |
-
"- Each objective must express only one precise learning outcome.\n\n"
|
| 256 |
-
"### Strategies for Verb Diversity\n"
|
| 257 |
-
"**Use these strategies to ensure maximum variety:**\n\n"
|
| 258 |
-
"- **Alternate synonyms:**\n"
|
| 259 |
-
" - Instead of always 'define', use: name, list, mention, identify, classify, select.\n"
|
| 260 |
-
"- **Use less common verbs:**\n"
|
| 261 |
-
" - Distinguish, infer, demonstrate, interpret, justify, summarize, illustrate.\n"
|
| 262 |
-
"- **Match verbs to content type:**\n"
|
| 263 |
-
" - Use verbs that capture the learning result precisely.\n"
|
| 264 |
-
"- **Consult the full domain verb lists** (above) with 5โ7 verbs per level.\n"
|
| 265 |
-
"- **Distribute objectives across the three domains** โ avoid focusing only on the cognitive domain.\n\n"
|
| 266 |
-
"### Examples of Correct and Incorrect Objectives\n\n"
|
| 267 |
-
"**Correct Examples (Good verb diversity and domain balance):**\n"
|
| 268 |
-
"1. (Cognitive - Remember): The trainee lists five types of e-learning platforms.\n"
|
| 269 |
-
"2. (Cognitive - Understand): The trainee distinguishes between various digital assessment tools.\n"
|
| 270 |
-
"3. (Cognitive - Apply): The trainee applies active learning strategies in the classroom.\n"
|
| 271 |
-
"4. (Cognitive - Understand): The trainee infers the main benefits of blended learning.\n"
|
| 272 |
-
"5. (Psychomotor - Practice): The trainee practices designing an interactive learning activity.\n"
|
| 273 |
-
"6. (Affective - Respond): The trainee actively participates in collaborative learning discussions.\n"
|
| 274 |
-
"7. (Cognitive - Analyze): The trainee compares different instructional design models.\n"
|
| 275 |
-
"8. (Psychomotor - Adapt): The trainee adjusts learning activities to meet learner needs.\n\n"
|
| 276 |
-
"**Incorrect Examples (Verb repetition โ avoid this):**\n"
|
| 277 |
-
"1. The trainee defines the types of e-learning platforms.\n"
|
| 278 |
-
"2. The trainee defines digital assessment tools.\n"
|
| 279 |
-
"3. The trainee defines active learning strategies.\n"
|
| 280 |
-
"4. The trainee defines blended learning benefits.\n"
|
| 281 |
-
"5. The trainee defines steps of activity design.\n\n"
|
| 282 |
-
"**Unclear or Unmeasurable Objectives:**\n"
|
| 283 |
-
"- 'The trainee understands e-learning.' (Vague, not measurable)\n"
|
| 284 |
-
"- 'The trainee learns how to use tools.' (Unclear โ which tools?)\n"
|
| 285 |
-
"- 'The trainee becomes an expert in instructional design.' (Unrealistic, not measurable)\n\n"
|
| 286 |
-
"**Improved Versions:**\n"
|
| 287 |
-
"- 'The trainee accurately defines e-learning.'\n"
|
| 288 |
-
"- 'The trainee effectively uses LMS tools.'\n"
|
| 289 |
-
"- 'The trainee applies instructional design principles to create a learning unit.'\n\n"
|
| 290 |
-
"### Critical Quality Checklist โ Verify Before Finalizing Each Objective:\n"
|
| 291 |
-
"1. โ Is it clear and accurately expresses the intended outcome?\n"
|
| 292 |
-
"2. โ Does it align with a Bloomโs level or learning domain?\n"
|
| 293 |
-
"3. โ Is it free from ambiguity?\n"
|
| 294 |
-
"4. โ Is all vocabulary appropriate for {audience}?\n"
|
| 295 |
-
"5. โ Does it express only one learning outcome?\n"
|
| 296 |
-
"6. โ Is it measurable through observable performance?\n"
|
| 297 |
-
"7. โ Is it realistic and achievable?\n"
|
| 298 |
-
"8. โ Does it align with the overall outcomes?\n"
|
| 299 |
-
"9. โ Is it directly linked to the axis content?\n"
|
| 300 |
-
"10. โ Is it sequenced logically (simple โ complex)?\n"
|
| 301 |
-
"11. โ Is it suitable for the learnersโ level?\n"
|
| 302 |
-
"12. โ Do all objectives collectively cover knowledge, skills, and attitudes?\n"
|
| 303 |
-
"**13. Verb Check: Have you reused this verb? If yes, can you replace it?**\n"
|
| 304 |
-
"**14. Domain Check: Are the objectives balanced across all three domains?**\n\n"
|
| 305 |
-
"### Self-Reflection Requirement\n"
|
| 306 |
-
"After generating all objectives for a unit, pause and evaluate:\n"
|
| 307 |
-
"- Do objectives progress logically through Bloomโs levels?\n"
|
| 308 |
-
"- **How many unique verbs did you use? Any repetition?**\n"
|
| 309 |
-
"- **Can any repeated verbs be replaced with alternatives?**\n"
|
| 310 |
-
"- Are verbs diverse and contextually appropriate?\n"
|
| 311 |
-
"- **Do objectives cover all three domains evenly?**\n"
|
| 312 |
-
"- Can an external evaluator assess each objective clearly?\n"
|
| 313 |
-
"- Are all objectives realistic for {audience} and course duration?\n\n"
|
| 314 |
-
"### Final Verification: Verb Diversity & Domain Balance\n"
|
| 315 |
-
"**Before submitting your final output:**\n"
|
| 316 |
-
"1. Count how many times each verb appears.\n"
|
| 317 |
-
"2. If any verb appears more than 2โ3 times, review and replace it where possible.\n"
|
| 318 |
-
"3. Aim for at least 70โ80% unique verbs across the entire curriculum.\n"
|
| 319 |
-
"4. Keep a mental record of verb use for ongoing awareness.\n"
|
| 320 |
-
"5. **Check balanced distribution:**\n"
|
| 321 |
-
" - Cognitive (Knowledge): 50โ60% of objectives\n"
|
| 322 |
-
" - Affective (Attitude): 20โ30% of objectives\n"
|
| 323 |
-
" - Psychomotor (Skills): 20โ30% of objectives\n"
|
| 324 |
-
"6. If imbalance occurs, revisit and adjust classifications.\n\n"
|
| 325 |
-
"### Domain-Specific Guidelines\n\n"
|
| 326 |
-
"**When writing Cognitive (Knowledge) objectives:**\n"
|
| 327 |
-
"- Use for topics focused on information, understanding, applying, analyzing, evaluating, or creating.\n"
|
| 328 |
-
"- Examples: 'The trainee defines...', 'The trainee compares...', 'The trainee designs...'.\n\n"
|
| 329 |
-
"**When writing Affective (Attitude) objectives:**\n"
|
| 330 |
-
"- Use for topics involving values, emotions, interests, or behaviors.\n"
|
| 331 |
-
"- Examples: 'The trainee demonstrates interest in...', 'The trainee participates actively...', 'The trainee commits to...'.\n\n"
|
| 332 |
-
"**When writing Psychomotor (Skills) objectives:**\n"
|
| 333 |
-
"- Use for topics requiring physical, technical, or procedural performance.\n"
|
| 334 |
-
"- Examples: 'The trainee practices...', 'The trainee performs...', 'The trainee innovates...'.\n\n"
|
| 335 |
-
"### Final Important Notes\n"
|
| 336 |
-
"- **Top Priority:** Verb diversity and balanced domain distribution.\n"
|
| 337 |
-
"- **Quality over quantity:** One well-crafted, diverse objective is better than several repetitive ones.\n"
|
| 338 |
-
"- **Flexibility with precision:** Be flexible in verb choice but never compromise on accuracy.\n"
|
| 339 |
-
"- **Continuous review:** Revisit objectives regularly for diversity and balance.\n"
|
| 340 |
-
"- **Context matters:** Always choose the verb that best reflects what the learner should achieve in that specific axis.\n"
|
| 341 |
),
|
| 342 |
-
|
| 343 |
-
|
| 344 |
-
|
| 345 |
-
|
| 346 |
-
|
| 347 |
-
|
| 348 |
-
|
| 349 |
-
|
| 350 |
-
|
| 351 |
-
|
| 352 |
-
|
| 353 |
-
],
|
| 354 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 355 |
output_json=ObjectivesOutput,
|
| 356 |
agent=objectives_generator,
|
| 357 |
-
human_input=False
|
| 358 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
| 3 |
+
๐ Objectives Generator Agent - Learning Objectives Designer
|
| 4 |
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
| 5 |
+
|
| 6 |
+
ุงููุฏู: ุชูููุฏ ุฃูุฏุงู ุชุนููู
ูุฉ ูุงุถุญุฉ ููุงุจูุฉ ููููุงุณ ููู ู
ุญูุฑ (axis) ูู ุงูู
ููุฌ ุงูุชุฏุฑูุจู.
|
| 7 |
+
|
| 8 |
+
ุงูู
ุฏุฎูุงุช:
|
| 9 |
+
---------
|
| 10 |
+
1. topic: ู
ูุถูุน ุงูุชุฏุฑูุจ ุงูุฑุฆูุณู
|
| 11 |
+
2. domain: ุงูู
ุฌุงู (Management, Technology, etc.)
|
| 12 |
+
3. content_type: ููุน ุงูู
ุญุชูู (Educational, Training, etc.)
|
| 13 |
+
4. audience: ุงููุฆุฉ ุงูู
ุณุชูุฏูุฉ (Professionals, Students, etc.)
|
| 14 |
+
5. material_type: ููุน ุงูู
ุงุฏุฉ (Conceptual, Procedural, etc.)
|
| 15 |
+
6. outlines: ุงูุจููุฉ ุงููุงู
ูุฉ ููู
ููุฌ ู
ู outliner agent
|
| 16 |
+
|
| 17 |
+
ุงูุจููุฉ ุงูู
ุชููุนุฉ ููู outlines:
|
| 18 |
+
{
|
| 19 |
+
"units": [
|
| 20 |
+
{
|
| 21 |
+
"unit_number": 1,
|
| 22 |
+
"title": "ุนููุงู ุงููุญุฏุฉ",
|
| 23 |
+
"focus": "ูุตู ุงููุญุฏุฉ",
|
| 24 |
+
"axes": [
|
| 25 |
+
{
|
| 26 |
+
"axis_number": 1,
|
| 27 |
+
"title": "ุนููุงู ุงูู
ุญูุฑ",
|
| 28 |
+
"purpose": "ุงูุบุฑุถ ู
ู ุงูู
ุญูุฑ"
|
| 29 |
+
},
|
| 30 |
+
...
|
| 31 |
+
]
|
| 32 |
+
},
|
| 33 |
+
...
|
| 34 |
+
]
|
| 35 |
+
}
|
| 36 |
+
|
| 37 |
+
ุงูู
ุฎุฑุฌุงุช:
|
| 38 |
+
--------
|
| 39 |
+
{
|
| 40 |
+
"objectives": [
|
| 41 |
+
{
|
| 42 |
+
"unit": "ุนููุงู ุงููุญุฏุฉ",
|
| 43 |
+
"unit_description": "ูุตู ุงููุญุฏุฉ",
|
| 44 |
+
"axis": "ุนููุงู ุงูู
ุญูุฑ",
|
| 45 |
+
"module_description": "ุงูุบุฑุถ ู
ู ุงูู
ุญูุฑ",
|
| 46 |
+
"level": "Cognitive - Understand",
|
| 47 |
+
"verbs": ["ูุนู1", "ูุนู2", "ูุนู3"],
|
| 48 |
+
"objective": "ุฃู ูุญูู ุงูู
ุชุนูู
..."
|
| 49 |
+
},
|
| 50 |
+
...
|
| 51 |
+
]
|
| 52 |
+
}
|
| 53 |
+
|
| 54 |
+
ุงูููุงุนุฏ ุงูุฃุณุงุณูุฉ:
|
| 55 |
+
----------------
|
| 56 |
+
โ
ูุฏู ูุงุญุฏ ููุท ููู ู
ุญูุฑ (axis) - ูุง ุฃูุซุฑ ููุง ุฃูู
|
| 57 |
+
โ
ุงุณุชุฎุฏุงู
ุฃูุนุงู ู
ุชููุนุฉ ู
ู ุชุตููู ุจููู
ูุงูู
ุฌุงูุงุช ุงูุซูุงุซุฉ
|
| 58 |
+
โ
ุนุฏู
ุชูุฑุงุฑ ููุณ ุงููุนู ูุฏุฑ ุงูุฅู
ูุงู
|
| 59 |
+
โ
ุงูุชุฏุฑุฌ ุงูู
ูุทูู ูู ู
ุณุชููุงุช ุจููู
ุฏุงุฎู ูู ูุญุฏุฉ
|
| 60 |
+
โ
ุงูุฃูุฏุงู ูุงุจูุฉ ููููุงุณ ูุงูุชุญูู
|
| 61 |
+
โ
ุงูุฃูุฏุงู ูุงุถุญุฉ ูู
ุญุฏุฏุฉ ุจุฏูู ุบู
ูุถ
|
| 62 |
+
โ
ู
ูุงุณุจุฉ ูู
ุณุชูู ุงูุฌู
ููุฑ ุงูู
ุณุชูุฏู
|
| 63 |
+
|
| 64 |
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
| 65 |
+
"""
|
| 66 |
+
|
| 67 |
+
from crewai import Agent, Task, Crew, Process
|
| 68 |
from modules import bloom_taxonomy_2, objectives_dimensions, llm_g
|
| 69 |
from schemas import ObjectivesOutput
|
| 70 |
+
import json
|
| 71 |
|
| 72 |
|
| 73 |
+
# โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
| 74 |
+
# ๐ง Helper Functions
|
| 75 |
+
# โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
| 76 |
|
| 77 |
+
def get_bloom_verb(level: str) -> str:
|
| 78 |
+
"""
|
| 79 |
+
ุงุณุชุฎุฑุงุฌ ุงูุฃูุนุงู ู
ู ู
ุณุชูู ู
ุญุฏุฏ ูู ุชุตููู ุจููู
.
|
| 80 |
+
|
| 81 |
+
Args:
|
| 82 |
+
level: ุงุณู
ุงูู
ุณุชูู (ู
ุซู "Remember", "Understand", "Apply")
|
| 83 |
+
|
| 84 |
+
Returns:
|
| 85 |
+
str: ุงูุฃูุนุงู ุงูู
ุชุงุญุฉ ููุฐุง ุงูู
ุณุชูู
|
| 86 |
+
|
| 87 |
+
Raises:
|
| 88 |
+
ValueError: ุฅุฐุง ูุงู ุงูู
ุณุชูู ุบูุฑ ู
ูุฌูุฏ
|
| 89 |
+
"""
|
| 90 |
if level not in bloom_taxonomy_2:
|
| 91 |
+
raise ValueError(f"โ Invalid Bloom level: {level}")
|
| 92 |
+
|
| 93 |
verbs_key = [k for k in bloom_taxonomy_2[level].keys() if "_verbs_examples" in k][0]
|
| 94 |
return bloom_taxonomy_2[level][verbs_key]
|
| 95 |
|
| 96 |
|
| 97 |
+
def get_verbs_by_domain_and_level(domain: str, level_name: str) -> list:
|
| 98 |
"""
|
| 99 |
+
ุงุณุชุฎุฑุงุฌ ุงูุฃูุนุงู ุงูู
ูุงุณุจุฉ ู
ู ูุงู
ูุณ ุงูุฃุจุนุงุฏ ุงูุชุนููู
ูุฉ.
|
| 100 |
+
|
| 101 |
Args:
|
| 102 |
+
domain: "Knowledge" (ุงูู
ุนุฑูู), "Ability" (ุงููุฌุฏุงูู), or "Skills" (ุงูู
ูุงุฑู)
|
| 103 |
level_name: ุงุณู
ุงูู
ุณุชูู ู
ุซู "Remember", "Response", "Practice"
|
| 104 |
+
|
| 105 |
Returns:
|
| 106 |
+
list: ูุงุฆู
ุฉ ุจุงูุฃูุนุงู ุงูู
ุชุงุญ๏ฟฝ๏ฟฝ ููุฐุง ุงูู
ุฌุงู ูุงูู
ุณุชูู
|
| 107 |
"""
|
| 108 |
if domain not in objectives_dimensions:
|
| 109 |
return []
|
| 110 |
+
|
| 111 |
for level in objectives_dimensions[domain]["levels"]:
|
| 112 |
if level_name.lower() in level["level_name"].lower():
|
| 113 |
return level["verbs_examples"]
|
| 114 |
+
|
| 115 |
return []
|
| 116 |
|
| 117 |
|
| 118 |
+
def format_domain_levels_info() -> str:
|
| 119 |
+
"""
|
| 120 |
+
ุชูุณูู ู
ุนููู
ุงุช ุงูู
ุฌุงูุงุช ุงูุชุนููู
ูุฉ ุงูุซูุงุซุฉ ูู
ุณุชููุงุชูุง ูุงุณุชุฎุฏุงู
ูุง ูู ุงูู prompt.
|
| 121 |
+
|
| 122 |
+
Returns:
|
| 123 |
+
str: ูุต ู
ูุณู ูุญุชูู ุนูู ุฌู
ูุน ุงูู
ุฌุงูุงุช ูู
ุณุชููุงุชูุง ูุงูุฃูุนุงู
|
| 124 |
+
"""
|
| 125 |
+
domains_info = []
|
| 126 |
+
|
| 127 |
+
# 1. ุงูู
ุฌุงู ุงูู
ุนุฑูู (Cognitive/Knowledge)
|
| 128 |
+
domains_info.append(f"**1. Cognitive Domain (Knowledge):**\n")
|
| 129 |
+
domains_info.append(f"{objectives_dimensions['Knowledge']['description']}\n")
|
| 130 |
+
domains_info.append("**Levels:**\n")
|
| 131 |
+
for level in objectives_dimensions["Knowledge"]["levels"]:
|
| 132 |
+
domains_info.append(
|
| 133 |
+
f" - {level['level_name']}: {level['description']}\n"
|
| 134 |
+
f" Verbs: {', '.join(level['verbs_examples'])}\n"
|
| 135 |
+
)
|
| 136 |
+
|
| 137 |
+
# 2. ุงูู
ุฌุงู ุงููุฌุฏุงูู (Affective/Ability)
|
| 138 |
+
domains_info.append(f"\n**2. Affective Domain (Attitude/Ability):**\n")
|
| 139 |
+
domains_info.append(f"{objectives_dimensions['Ability']['description']}\n")
|
| 140 |
+
domains_info.append("**Levels:**\n")
|
| 141 |
+
for level in objectives_dimensions["Ability"]["levels"]:
|
| 142 |
+
domains_info.append(
|
| 143 |
+
f" - {level['level_name']}: {level['description']}\n"
|
| 144 |
+
f" Verbs: {', '.join(level['verbs_examples'])}\n"
|
| 145 |
+
)
|
| 146 |
+
|
| 147 |
+
# 3. ุงูู
ุฌุงู ุงูู
ูุงุฑู (Psychomotor/Skills)
|
| 148 |
+
domains_info.append(f"\n**3. Psychomotor Domain (Skills):**\n")
|
| 149 |
+
domains_info.append(f"{objectives_dimensions['Skills']['description']}\n")
|
| 150 |
+
domains_info.append("**Levels:**\n")
|
| 151 |
+
for level in objectives_dimensions["Skills"]["levels"]:
|
| 152 |
+
domains_info.append(
|
| 153 |
+
f" - {level['level_name']}: {level['description']}\n"
|
| 154 |
+
f" Verbs: {', '.join(level['verbs_examples'])}\n"
|
| 155 |
+
)
|
| 156 |
+
|
| 157 |
+
return "".join(domains_info)
|
| 158 |
+
|
| 159 |
+
|
| 160 |
+
# โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
| 161 |
+
# ๐ค Agent Definition
|
| 162 |
+
# โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
| 163 |
+
|
| 164 |
objectives_generator = Agent(
|
| 165 |
+
role="Expert Learning Objectives Designer (ู
ุตู
ู
ุงูุฃูุฏุงู ุงูุชุนููู
ูุฉ ุงูู
ุชุฎุตุต)",
|
| 166 |
+
|
| 167 |
goal=(
|
| 168 |
+
"Design clear, measurable, and achievable learning objectives in Arabic "
|
| 169 |
+
"for EACH AXIS in the training curriculum.\n\n"
|
| 170 |
+
|
| 171 |
+
"๐ฏ **Critical Rules:**\n"
|
| 172 |
+
"1. Generate **EXACTLY ONE objective per axis** - no more, no less\n"
|
| 173 |
+
"2. Each objective must be based on:\n"
|
| 174 |
+
" - The axis title\n"
|
| 175 |
+
" - The axis purpose\n"
|
| 176 |
+
" - The unit description (focus)\n"
|
| 177 |
+
"3. **DO NOT** create new axes or units - work ONLY with provided axes\n"
|
| 178 |
+
"4. **DO NOT** invent, expand, or infer additional topics\n"
|
| 179 |
+
"5. Maximize verb diversity - avoid repeating verbs\n"
|
| 180 |
+
"6. Follow Bloom's Taxonomy progression within each unit\n"
|
| 181 |
+
"7. Balance objectives across three domains:\n"
|
| 182 |
+
" - Cognitive (Knowledge): 50-60%\n"
|
| 183 |
+
" - Affective (Attitude): 20-30%\n"
|
| 184 |
+
" - Psychomotor (Skills): 20-30%\n\n"
|
| 185 |
+
|
| 186 |
+
"๐ **Input Data:**\n"
|
| 187 |
+
"- Topic: {topic}\n"
|
| 188 |
+
"- Domain: {domain}\n"
|
| 189 |
+
"- Content Type: {content_type}\n"
|
| 190 |
+
"- Audience: {audience}\n"
|
| 191 |
+
"- Material Type: {material_type}\n"
|
| 192 |
+
"- Outlines: {outlines}"
|
| 193 |
),
|
| 194 |
+
|
| 195 |
backstory=(
|
| 196 |
+
"ุฃูุช ุฎุจูุฑ ุชุตู
ูู
ุชุนููู
ู (Instructional Designer) ู
ุชุฎุตุต ูู ูุชุงุจุฉ ุงูุฃูุฏุงู ุงูุชุนููู
ูุฉ.\n\n"
|
| 197 |
+
|
| 198 |
+
"๐ **ุฎุจุฑุงุชู:**\n"
|
| 199 |
+
"- ุฎุจุฑุฉ ุนู
ููุฉ ูู ุชุตููู ุจููู
(Bloom's Taxonomy)\n"
|
| 200 |
+
"- ุฅุชูุงู ุงูู
ุฌุงูุงุช ุงูุชุนููู
ูุฉ ุงูุซูุงุซุฉ (ุงูู
ุนุฑููุ ุงููุฌุฏุงููุ ุงูู
ูุงุฑู)\n"
|
| 201 |
+
"- ู
ูุงุฑุฉ ุนุงููุฉ ูู ุงุฎุชูุงุฑ ุฃูุนุงู ู
ุชููุนุฉ ูุบูุฑ ู
ุชูุฑุฑุฉ\n"
|
| 202 |
+
"- ูุฏุฑุฉ ุนูู ุชุญููู ุงูู
ุญุงูุฑ ูุชุญุฏูุฏ ููุน ุงููุฏู ุงูู
ูุงุณุจ (ู
ุนุฑูุฉุ ู
ูุงุฑุฉุ ุงุชุฌุงู)\n"
|
| 203 |
+
"- ุงูุชุฒุงู
ุจุงูู
ุนุงููุฑ ุงูู 12 ููุชุตู
ูู
ุงูุชุนููู
ู ุงูุงุญุชุฑุงูู\n\n"
|
| 204 |
+
|
| 205 |
+
"๐ **ู
ููุฌูุชู:**\n"
|
| 206 |
+
"1. ุชูุฑุฃ ูุชุญูู ูู ู
ุญูุฑ (axis) ุจุนูุงูุฉ:\n"
|
| 207 |
+
" - ุนููุงู ุงูู
ุญูุฑ (title)\n"
|
| 208 |
+
" - ุบุฑุถ ุงูู
ุญูุฑ (purpose)\n"
|
| 209 |
+
" - ุณูุงู ุงููุญุฏุฉ (unit focus)\n"
|
| 210 |
+
"2. ุชุญุฏุฏ ููุน ุงูุชุนูู
ุงูู
ุทููุจ:\n"
|
| 211 |
+
" - ู
ุนุฑูุฉ (Knowledge) โ Cognitive domain\n"
|
| 212 |
+
" - ู
ูุงุฑุฉ (Skill) โ Psychomotor domain\n"
|
| 213 |
+
" - ุงุชุฌุงู/ุณููู (Attitude) โ Affective domain\n"
|
| 214 |
+
"3. ุชุฎุชุงุฑ ู
ุณุชูู ุจููู
ุงูู
ูุงุณุจ ุจูุงุกู ุนูู:\n"
|
| 215 |
+
" - ุทุจูุนุฉ ุงูู
ุญูุฑ\n"
|
| 216 |
+
" - ุงูุชุฏุฑุฌ ุงูู
ูุทูู ุฏุงุฎู ุงููุญุฏุฉ\n"
|
| 217 |
+
" - ูุฏุฑุงุช ุงูุฌู
ููุฑ ุงูู
ุณุชูุฏู\n"
|
| 218 |
+
"4. ุชุฎุชุงุฑ ูุนูุงู **ูู
ูุณุชุฎุฏู
ู
ู ูุจู** ู
ู ุงูู
ุณุชูู ุงูู
ุฎุชุงุฑ\n"
|
| 219 |
+
"5. ุชูุชุจ ูุฏูุงู ูุงุญุฏุงู ูุงุถุญุงู ูุงุจูุงู ููููุงุณ ุจุงูุนุฑุจูุฉ\n"
|
| 220 |
+
"6. ุชุชุงุจุน ุงูุฃูุนุงู ุงูู
ุณุชุฎุฏู
ุฉ ูุชุฌูุจ ุงูุชูุฑุงุฑ\n\n"
|
| 221 |
+
|
| 222 |
+
"๐ฏ **ุฃูุฏุงูู:**\n"
|
| 223 |
+
"- ุฏูุฉ ูุบููุฉ ุนุงููุฉ - ุจุฏูู ุบู
ูุถ ุฃู ุชุนููุฏ\n"
|
| 224 |
+
"- ุชููุน ุฃูุตู ูู ุงูุฃูุนุงู - ุชุฌูุจ ุงูุชูุฑุงุฑ\n"
|
| 225 |
+
"- ุชูุงุฒู ุจูู ุงูู
ุฌุงูุงุช ุงูุซูุงุซุฉ\n"
|
| 226 |
+
"- ูุงุจููุฉ ููููุงุณ ูุงูุชุญูู\n"
|
| 227 |
+
"- ู
ูุงุกู
ุฉ ูู
ุณุชูู {audience}\n"
|
| 228 |
+
"- ุงุชุณุงู ู
ุน {domain}, {content_type}, {material_type}"
|
| 229 |
),
|
| 230 |
+
|
| 231 |
llm=llm_g,
|
| 232 |
verbose=True,
|
| 233 |
+
max_iter=150, # ุฒูุงุฏุฉ ุนุฏุฏ ุงูุชูุฑุงุฑุงุช ููุฏูุฉ
|
| 234 |
+
allow_delegation=False
|
| 235 |
)
|
| 236 |
|
| 237 |
|
| 238 |
+
# โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
| 239 |
+
# ๐ Task Definition
|
| 240 |
+
# โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
| 241 |
+
|
| 242 |
objectives_task = Task(
|
| 243 |
description=(
|
| 244 |
+
"# ๐ Generate Learning Objectives for Training Curriculum\n\n"
|
| 245 |
+
|
| 246 |
+
"## ๐ฅ Input Structure\n\n"
|
| 247 |
+
"You will receive a complete curriculum structure in `{outlines}` with the following format:\n\n"
|
| 248 |
+
"```json\n"
|
| 249 |
+
"{\n"
|
| 250 |
+
' "units": [\n'
|
| 251 |
+
" {\n"
|
| 252 |
+
' "unit_number": 1,\n'
|
| 253 |
+
' "title": "ุนููุงู ุงููุญุฏุฉ",\n'
|
| 254 |
+
' "focus": "ูุตู ุงููุญุฏุฉ ูุงููุฏู ุงูุนุงู
ู
ููุง",\n'
|
| 255 |
+
' "axes": [\n'
|
| 256 |
+
" {\n"
|
| 257 |
+
' "axis_number": 1,\n'
|
| 258 |
+
' "title": "ุนููุงู ุงูู
ุญูุฑ",\n'
|
| 259 |
+
' "purpose": "ุงูุบุฑุถ ู
ู ุชุฏุฑูุณ ูุฐุง ุงูู
ุญูุฑ"\n'
|
| 260 |
+
" },\n"
|
| 261 |
+
" ...\n"
|
| 262 |
+
" ]\n"
|
| 263 |
+
" },\n"
|
| 264 |
+
" ...\n"
|
| 265 |
+
" ]\n"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 266 |
"}\n"
|
| 267 |
+
"```\n\n"
|
| 268 |
+
|
| 269 |
+
"## ๐ฏ Your Mission\n\n"
|
| 270 |
+
"Generate **EXACTLY ONE learning objective** for **EACH axis** in **EVERY unit**.\n\n"
|
| 271 |
+
|
| 272 |
+
"### โ
Requirements:\n\n"
|
| 273 |
+
"1. **One-to-One Mapping:**\n"
|
| 274 |
+
" - If there are 20 axes total โ generate 20 objectives\n"
|
| 275 |
+
" - Each axis gets exactly 1 objective\n"
|
| 276 |
+
" - No axis should be missed\n"
|
| 277 |
+
" - No extra objectives\n\n"
|
| 278 |
+
|
| 279 |
+
"2. **Content Fidelity:**\n"
|
| 280 |
+
" - Use ONLY the `title` and `purpose` from each axis\n"
|
| 281 |
+
" - Use the `focus` from the unit for context\n"
|
| 282 |
+
" - DO NOT invent new content\n"
|
| 283 |
+
" - DO NOT expand beyond what's given\n"
|
| 284 |
+
" - Keep terminology consistent with input\n\n"
|
| 285 |
+
|
| 286 |
+
"3. **Output Structure:**\n"
|
| 287 |
+
" Each objective must include:\n"
|
| 288 |
+
" ```json\n"
|
| 289 |
+
" {\n"
|
| 290 |
+
' "unit": "ุนููุงู ุงููุญุฏุฉ (from unit.title)",\n'
|
| 291 |
+
' "unit_description": "ูุตู ุงููุญุฏุฉ (from unit.focus)",\n'
|
| 292 |
+
' "axis": "ุนููุงู ุงูู
ุญูุฑ (from axis.title)",\n'
|
| 293 |
+
' "module_description": "ุงูุบุฑุถ ู
ู ุงูู
ุญูุฑ (from axis.purpose)",\n'
|
| 294 |
+
' "level": "Cognitive - Understand",\n'
|
| 295 |
+
' "verbs": ["ูุนู1", "ูุนู2", "ูุนู3"],\n'
|
| 296 |
+
' "objective": "ุฃู ูุญูู ุงูู
ุชุนูู
..."\n'
|
| 297 |
+
" }\n"
|
| 298 |
+
" ```\n\n"
|
| 299 |
+
|
| 300 |
+
"## ๐ Bloom's Taxonomy and Learning Domains\n\n"
|
| 301 |
+
f"{format_domain_levels_info()}\n\n"
|
| 302 |
+
|
| 303 |
+
"## ๐ฅ Critical Requirement: Verb Diversity\n\n"
|
| 304 |
+
"**This is your TOP PRIORITY - follow these rules precisely:**\n\n"
|
| 305 |
+
|
| 306 |
+
"### Verb Non-Repetition Rules:\n\n"
|
| 307 |
+
"1. **Maximize diversity** - each objective should use a DIFFERENT verb\n"
|
| 308 |
+
"2. **Before selecting:** Check if you've used this verb before\n"
|
| 309 |
+
"3. **Track usage:** Keep a mental record of all verbs used\n"
|
| 310 |
+
"4. **Only repeat when:**\n"
|
| 311 |
+
" - All alternatives in that level are exhausted\n"
|
| 312 |
+
" - The axis content explicitly requires it\n"
|
| 313 |
+
" - You can justify why no other verb fits\n"
|
| 314 |
+
"5. **If you must repeat:**\n"
|
| 315 |
+
" - Space it out by at least 3-5 objectives\n"
|
| 316 |
+
" - Use it in a different domain or context\n"
|
| 317 |
+
"6. **Aim for:** 70-80% unique verbs across all objectives\n\n"
|
| 318 |
+
|
| 319 |
+
"### Strategies for Diversity:\n\n"
|
| 320 |
+
"- **Instead of 'ูุนุฑู':** use ูุฐูุฑ, ูุญุฏุฏ, ูุณู
ู, ูุนุฏุฏ, ูุณุชุฑุฌุน, ูุตูู\n"
|
| 321 |
+
"- **Instead of 'ูููู
':** use ููุณุฑ, ูุณุชูุชุฌ, ูุตู, ูู
ูุฒ, ูุดุฑุญ, ููุฎุต\n"
|
| 322 |
+
"- **Instead of 'ูุทุจู':** use ูุณุชุฎุฏู
, ูุฌุฑุจ, ูุจุฑูู, ูููุฐ, ูุญู, ููุธู\n"
|
| 323 |
+
"- Use less common verbs: ูู
ูุฒ, ูุณุชุฎูุต, ูุจุฑุฑ, ููุงุฒู, ูุฑูุจ, ูุฏู
ุฌ\n"
|
| 324 |
+
"- Alternate between domains: Cognitive โ Affective โ Psychomotor\n\n"
|
| 325 |
+
|
| 326 |
+
"## ๐ The 12 Mandatory Design Standards\n\n"
|
| 327 |
+
"Each objective MUST meet ALL of these criteria:\n\n"
|
| 328 |
+
|
| 329 |
+
"1. **Linked to general goal:** Connects to course's overall objective\n"
|
| 330 |
+
"2. **Measurable:** Can be assessed through observable performance\n"
|
| 331 |
+
" - โ
Good: 'ูุญูู ุงูู
ุชุนูู
ู
ูููุงุช ุงูุนู
ููุฉ ุจุฏูุฉ'\n"
|
| 332 |
+
" - โ Bad: 'ูููู
ุงูู
ุชุนูู
ุงูุนู
ููุฉ' (not measurable)\n"
|
| 333 |
+
"3. **Achievable:** Realistic for learner ability and course duration\n"
|
| 334 |
+
"4. **Domain coverage:** Balance across Cognitive, Affective, Psychomotor\n"
|
| 335 |
+
"5. **Bloom's alignment:** Progress logically (Remember โ Create)\n"
|
| 336 |
+
"6. **Clear and precise:** Completely unambiguous\n"
|
| 337 |
+
"7. **No vagueness:** Avoid complex or unclear phrasing\n"
|
| 338 |
+
"8. **Appropriate vocabulary:** Suitable for {audience}\n"
|
| 339 |
+
"9. **Single focus:** One outcome per objective\n"
|
| 340 |
+
" - โ
Good: 'ูุญุฏุฏ ุงูู
ุชุนูู
ู
ูููุงุช ุงููุธุงู
'\n"
|
| 341 |
+
" - โ Bad: 'ูุญุฏุฏ ููุทุจู ุงูู
ุชุนูู
ู
ูููุงุช ุงููุธุงู
' (two actions)\n"
|
| 342 |
+
"10. **Realistic and feasible:** Within program resources\n"
|
| 343 |
+
"11. **Consistent with outcomes:** Aligns with program goals\n"
|
| 344 |
+
"12. **Content-linked:** Directly relates to axis content\n\n"
|
| 345 |
+
|
| 346 |
+
"## โ๏ธ Objective Writing Rules\n\n"
|
| 347 |
+
"- **Format:** Start with 'ุฃู' or 'ูู' + present verb\n"
|
| 348 |
+
"- **Length:** 6-10 words (concise and clear)\n"
|
| 349 |
+
"- **Language:** Modern Standard Arabic\n"
|
| 350 |
+
"- **Tone:** Professional and academic\n"
|
| 351 |
+
"- **Structure:** Subject + Verb + Object + Condition (if needed)\n"
|
| 352 |
+
"- **Examples:**\n"
|
| 353 |
+
" - 'ุฃู ูุญูู ุงูู
ุชุนูู
ู
ุฑุงุญู ุงูุนู
ููุฉ ุงูุชุตู
ูู
ูุฉ ุจุฏูุฉ.'\n"
|
| 354 |
+
" - 'ูุทุจู ุงูู
ุชุฏุฑุจ ุชูููุงุช ุงูุชุนุงุทู ูู ู
ุดุฑูุน ูุงูุนู.'\n"
|
| 355 |
+
" - 'ููุฏุฑ ุงูู
ุชุนูู
ุฃูู
ูุฉ ุงูุชูููุฑ ุงูู
ุชุนุฏุฏ ุงูู
ูุธูุฑุงุช.'\n\n"
|
| 356 |
+
|
| 357 |
+
"## ๐ Step-by-Step Process\n\n"
|
| 358 |
+
"Follow this systematic approach:\n\n"
|
| 359 |
+
|
| 360 |
+
"### Phase 1: Preparation\n"
|
| 361 |
+
"1. Read the ENTIRE curriculum to understand the learning journey\n"
|
| 362 |
+
"2. Review ALL Bloom's verbs and domain levels\n"
|
| 363 |
+
"3. Create a mental tracker for verb usage\n"
|
| 364 |
+
"4. Count total number of axes to know expected output size\n\n"
|
| 365 |
+
|
| 366 |
+
"### Phase 2: For Each Unit\n"
|
| 367 |
+
"1. Read the unit title and focus carefully\n"
|
| 368 |
+
"2. Understand the unit's scope and intended outcomes\n"
|
| 369 |
+
"3. Note the unit's position in the overall curriculum\n\n"
|
| 370 |
+
|
| 371 |
+
"### Phase 3: For Each Axis in the Unit\n"
|
| 372 |
+
"1. **Analyze:**\n"
|
| 373 |
+
" - Read axis title\n"
|
| 374 |
+
" - Read axis purpose\n"
|
| 375 |
+
" - Understand what learners should achieve\n\n"
|
| 376 |
+
|
| 377 |
+
"2. **Classify:**\n"
|
| 378 |
+
" - Determine learning type: Knowledge? Skill? Attitude?\n"
|
| 379 |
+
" - Select appropriate domain:\n"
|
| 380 |
+
" * Cognitive โ for information, understanding, analysis\n"
|
| 381 |
+
" * Affective โ for values, attitudes, behaviors\n"
|
| 382 |
+
" * Psychomotor โ for physical/technical skills\n\n"
|
| 383 |
+
|
| 384 |
+
"3. **Choose Bloom Level:**\n"
|
| 385 |
+
" - Consider axis complexity\n"
|
| 386 |
+
" - Maintain logical progression in unit:\n"
|
| 387 |
+
" * Early axes โ Lower levels (Remember, Understand)\n"
|
| 388 |
+
" * Middle axes โ Middle levels (Apply, Analyze)\n"
|
| 389 |
+
" * Later axes โ Higher levels (Evaluate, Create)\n"
|
| 390 |
+
" - Match level to audience capability\n\n"
|
| 391 |
+
|
| 392 |
+
"4. **Select Verbs:**\n"
|
| 393 |
+
" - Check your tracker: Have I used this verb?\n"
|
| 394 |
+
" - Choose an UNUSED verb from the selected level\n"
|
| 395 |
+
" - Select 3 similar verbs for the 'verbs' field\n"
|
| 396 |
+
" - Mark this verb as 'used' in your tracker\n\n"
|
| 397 |
+
|
| 398 |
+
"5. **Write Objective:**\n"
|
| 399 |
+
" - Start with verb\n"
|
| 400 |
+
" - Add subject (ุงูู
ุชุนูู
/ุงูู
ุชุฏุฑุจ)\n"
|
| 401 |
+
" - State what they should do\n"
|
| 402 |
+
" - Add quality indicator if appropriate (ุจุฏูุฉุ ุจูุนุงููุฉุ ุจูุถูุญ)\n"
|
| 403 |
+
" - Ensure it's measurable and clear\n\n"
|
| 404 |
+
|
| 405 |
+
"6. **Quality Check:**\n"
|
| 406 |
+
" - โ Is it clear?\n"
|
| 407 |
+
" - โ Is it measurable?\n"
|
| 408 |
+
" - โ Does it match the axis purpose?\n"
|
| 409 |
+
" - โ Is the verb new/diverse?\n"
|
| 410 |
+
" - โ Is it appropriate for {audience}?\n"
|
| 411 |
+
" - โ Does it follow Bloom's progression?\n\n"
|
| 412 |
+
|
| 413 |
+
"### Phase 4: Final Verification\n\n"
|
| 414 |
+
"After generating all objectives:\n\n"
|
| 415 |
+
"1. **Count Check:**\n"
|
| 416 |
+
" - Total objectives = Total axes?\n"
|
| 417 |
+
" - Every axis has exactly 1 objective?\n\n"
|
| 418 |
+
|
| 419 |
+
"2. **Verb Diversity Check:**\n"
|
| 420 |
+
" - Count verb occurrences\n"
|
| 421 |
+
" - Any verb used > 3 times? Replace if possible\n"
|
| 422 |
+
" - Diversity rate > 70%?\n\n"
|
| 423 |
+
|
| 424 |
+
"3. **Domain Balance Check:**\n"
|
| 425 |
+
" - Cognitive: 50-60%?\n"
|
| 426 |
+
" - Affective: 20-30%?\n"
|
| 427 |
+
" - Psychomotor: 20-30%?\n"
|
| 428 |
+
" - Adjust if imbalanced\n\n"
|
| 429 |
+
|
| 430 |
+
"4. **Bloom Progression Check:**\n"
|
| 431 |
+
" - Within each unit, do objectives progress logically?\n"
|
| 432 |
+
" - Simple โ Complex?\n"
|
| 433 |
+
" - Remember/Understand โ Apply/Analyze โ Evaluate/Create?\n\n"
|
| 434 |
+
|
| 435 |
+
"5. **Quality Check:**\n"
|
| 436 |
+
" - All objectives measurable?\n"
|
| 437 |
+
" - All objectives clear?\n"
|
| 438 |
+
" - All objectives achievable?\n"
|
| 439 |
+
" - All objectives match their axes?\n\n"
|
| 440 |
+
|
| 441 |
+
"## โ ๏ธ Common Mistakes to Avoid\n\n"
|
| 442 |
+
"โ **DON'T:**\n"
|
| 443 |
+
"- Create objectives for axes that don't exist\n"
|
| 444 |
+
"- Skip any axes\n"
|
| 445 |
+
"- Generate multiple objectives for one axis\n"
|
| 446 |
+
"- Invent new content not in the axis\n"
|
| 447 |
+
"- Use vague, unmeasurable verbs (ูุนุฑูุ ูููู
ุ ูุฏุฑู)\n"
|
| 448 |
+
"- Repeat the same verb many times\n"
|
| 449 |
+
"- Write objectives with multiple actions\n"
|
| 450 |
+
"- Use overly complex or academic language\n"
|
| 451 |
+
"- Ignore the audience level\n"
|
| 452 |
+
"- Create objectives that can't be assessed\n\n"
|
| 453 |
+
|
| 454 |
+
"โ
**DO:**\n"
|
| 455 |
+
"- Generate exactly 1 objective per axis\n"
|
| 456 |
+
"- Use precise, action-oriented verbs\n"
|
| 457 |
+
"- Maximize verb diversity\n"
|
| 458 |
+
"- Follow Bloom's progression\n"
|
| 459 |
+
"- Balance across three domains\n"
|
| 460 |
+
"- Write clear, measurable objectives\n"
|
| 461 |
+
"- Match axis purpose exactly\n"
|
| 462 |
+
"- Keep objectives concise (6-10 words)\n"
|
| 463 |
+
"- Use appropriate vocabulary for {audience}\n"
|
| 464 |
+
"- Ensure every objective can be tested/assessed\n\n"
|
| 465 |
+
|
| 466 |
+
"## ๐ค Expected Output Format\n\n"
|
| 467 |
+
"Your output MUST be a valid JSON matching this structure:\n\n"
|
| 468 |
+
"```json\n"
|
| 469 |
+
"{\n"
|
| 470 |
' "objectives": [\n'
|
| 471 |
" {\n"
|
| 472 |
+
' "unit": "ุงููุตู ุงูุฃูู: ู
ูุงููู
ูู
ุจุงุฏุฆ ุงูุชูููุฑ ุงูุชุตู
ูู
ู",\n'
|
| 473 |
+
' "unit_description": "ูู
ูุญ ุงูู
ุชุนูู
ูู ููู
ุงู ู
ุชุทูุฑุงู ููู
ูุงููู
ุงูุฃุณุงุณูุฉ...",\n'
|
| 474 |
+
' "axis": "ุชุนุฑูู ุงูู
ุตุทูุญุงุช ุงูุฃุณุงุณูุฉ ููุชูููุฑ ุงูุชุตู
ูู
ู",\n'
|
| 475 |
+
' "module_description": "ุชุนุฑูู ุงูู
ุตุทูุญุงุช ุงูุฃุณุงุณูุฉ ูุณุงุนุฏ ุงูู
ุชุนูู
ูู...",\n'
|
| 476 |
+
' "level": "Cognitive - Remember",\n'
|
| 477 |
+
' "verbs": ["ูุฐูุฑ", "ูุนุฏุฏ", "ูุณู
ู"],\n'
|
| 478 |
+
' "objective": "ุฃู ูุฐูุฑ ุงูู
ุชุนูู
ุงูู
ุตุทูุญุงุช ุงูุฃุณุงุณูุฉ ููุชูููุฑ ุงูุชุตู
ูู
ู ุจุฏูุฉ."\n'
|
| 479 |
" },\n"
|
| 480 |
" {\n"
|
| 481 |
+
' "unit": "ุงููุตู ุงูุฃูู: ู
ูุงููู
ูู
ุจุงุฏุฆ ุงูุชูููุฑ ุงูุชุตู
ูู
ู",\n'
|
| 482 |
+
' "unit_description": "ูู
ูุญ ุงูู
ุชุนูู
ูู ููู
ุงู ู
ุชุทูุฑุงู ููู
ูุงููู
ุงูุฃุณุงุณูุฉ...",\n'
|
| 483 |
+
' "axis": "ุดุฑุญ ุชุงุฑูุฎ ุชุทูุฑ ู
ููุฌ ุงูุชูููุฑ ุงูุชุตู
ูู
ู",\n'
|
| 484 |
+
' "module_description": "ุชูุถูุญ ุชุงุฑูุฎ ุชุทูุฑ ู
ููุฌ ุงูุชูููุฑ ุงูุชุตู
ูู
ู...",\n'
|
| 485 |
' "level": "Cognitive - Understand",\n'
|
| 486 |
+
' "verbs": ["ููุณุฑ", "ูุดุฑุญ", "ููุถุญ"],\n'
|
| 487 |
+
' "objective": "ุฃู ููุณุฑ ุงูู
ุชุนูู
ุชุงุฑูุฎ ุชุทูุฑ ู
ููุฌ ุงูุชูููุฑ ุงูุชุตู
ูู
ู ุจูุถูุญ."\n'
|
| 488 |
" }\n"
|
| 489 |
+
" // ... ุงูู
ุฒูุฏ ู
ู ุงูุฃูุฏุงู ููู ู
ุญูุฑ\n"
|
| 490 |
" ]\n"
|
| 491 |
+
"}\n"
|
| 492 |
+
"```\n\n"
|
| 493 |
+
|
| 494 |
+
"## ๐ฏ Success Criteria\n\n"
|
| 495 |
+
"Your output will be considered successful if:\n\n"
|
| 496 |
+
"โ
Number of objectives = Number of axes in input\n"
|
| 497 |
+
"โ
Every axis has exactly 1 corresponding objective\n"
|
| 498 |
+
"โ
No axis is missed or duplicated\n"
|
| 499 |
+
"โ
Verb diversity > 70%\n"
|
| 500 |
+
"โ
Domain balance: Cognitive (50-60%), Affective (20-30%), Psychomotor (20-30%)\n"
|
| 501 |
+
"โ
All objectives are measurable and clear\n"
|
| 502 |
+
"โ
Objectives progress logically within each unit\n"
|
| 503 |
+
"โ
All objectives appropriate for {audience}\n"
|
| 504 |
+
"โ
Output is valid JSON matching ObjectivesOutput schema\n\n"
|
| 505 |
+
|
| 506 |
+
"---\n\n"
|
| 507 |
+
"## ๐ Now Begin!\n\n"
|
| 508 |
+
"Analyze the curriculum in `{outlines}` and generate learning objectives following ALL the rules above.\n\n"
|
| 509 |
+
"Remember:\n"
|
| 510 |
+
"- ๐ฏ One objective per axis\n"
|
| 511 |
+
"- ๐จ Maximum verb diversity\n"
|
| 512 |
+
"- ๐ Balance across domains\n"
|
| 513 |
+
"- ๐ Follow Bloom's progression\n"
|
| 514 |
+
"- โ๏ธ Clear, measurable, achievable\n\n"
|
| 515 |
+
"Good luck! ๐"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 516 |
),
|
| 517 |
+
|
| 518 |
+
expected_output=(
|
| 519 |
+
"A valid JSON object matching the ObjectivesOutput schema:\n\n"
|
| 520 |
+
"{\n"
|
| 521 |
+
' "objectives": [\n'
|
| 522 |
+
" {\n"
|
| 523 |
+
' "unit": "Unit title from input",\n'
|
| 524 |
+
' "unit_description": "Unit focus from input",\n'
|
| 525 |
+
' "axis": "Axis title from input",\n'
|
| 526 |
+
' "module_description": "Axis purpose from input",\n'
|
| 527 |
+
' "level": "Domain - Level (e.g., Cognitive - Understand)",\n'
|
| 528 |
+
' "verbs": ["verb1", "verb2", "verb3"],\n'
|
| 529 |
+
' "objective": "ุฃู + verb + ุงูู
ุชุนูู
+ action + condition"\n'
|
| 530 |
+
" },\n"
|
| 531 |
+
" // ... one objective for each axis in all units\n"
|
| 532 |
+
" ]\n"
|
| 533 |
+
"}\n\n"
|
| 534 |
+
"Requirements:\n"
|
| 535 |
+
"- Total objectives = Total axes in input\n"
|
| 536 |
+
"- Each objective maps to exactly one axis\n"
|
| 537 |
+
"- All objectives in Arabic\n"
|
| 538 |
+
"- All objectives measurable and clear\n"
|
| 539 |
+
"- Diverse verbs (70-80% unique)\n"
|
| 540 |
+
"- Balanced domains (Cognitive 50-60%, Affective 20-30%, Psychomotor 20-30%)\n"
|
| 541 |
+
"- Logical Bloom's progression within each unit"
|
| 542 |
+
),
|
| 543 |
+
|
| 544 |
output_json=ObjectivesOutput,
|
| 545 |
agent=objectives_generator,
|
| 546 |
+
human_input=False
|
| 547 |
)
|
| 548 |
+
|
| 549 |
+
|
| 550 |
+
# โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
| 551 |
+
# ๐ฏ Main Execution Function
|
| 552 |
+
# โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
| 553 |
+
|
| 554 |
+
def generate_objectives(
|
| 555 |
+
topic: str,
|
| 556 |
+
domain: str,
|
| 557 |
+
content_type: str,
|
| 558 |
+
audience: str,
|
| 559 |
+
material_type: list,
|
| 560 |
+
outlines: dict
|
| 561 |
+
) -> dict:
|
| 562 |
+
"""
|
| 563 |
+
ุชูููุฏ ุงูุฃูุฏุงู ุงูุชุนููู
ูุฉ ููู
ููุฌ ุงูุชุฏุฑูุจู.
|
| 564 |
+
|
| 565 |
+
Args:
|
| 566 |
+
topic: ู
ูุถูุน ุงูุชุฏุฑูุจ ุงูุฑุฆูุณู
|
| 567 |
+
domain: ุงูู
ุฌุงู (Management, Technology, etc.)
|
| 568 |
+
content_type: ููุน ุงูู
ุญุชูู (Educational, Training, etc.)
|
| 569 |
+
audience: ุงููุฆุฉ ุงูู
ุณุชูุฏูุฉ
|
| 570 |
+
material_type: ุฃููุงุน ุงูู
ูุงุฏ ุงูุชุฏุฑูุจูุฉ
|
| 571 |
+
outlines: ุงูุจููุฉ ุงููุงู
ูุฉ ููู
ููุฌ ู
ู outliner agent
|
| 572 |
+
|
| 573 |
+
Returns:
|
| 574 |
+
dict: ุงูุฃูุฏุงู ุงูุชุนููู
ูุฉ ุจุตูุบุฉ JSON
|
| 575 |
+
|
| 576 |
+
Example:
|
| 577 |
+
>>> result = generate_objectives(
|
| 578 |
+
... topic="Design Thinking",
|
| 579 |
+
... domain="Management",
|
| 580 |
+
... content_type="Training",
|
| 581 |
+
... audience="Professionals",
|
| 582 |
+
... material_type=["Conceptual", "Procedural"],
|
| 583 |
+
... outlines=curriculum_structure
|
| 584 |
+
... )
|
| 585 |
+
>>> print(result['objectives'][0])
|
| 586 |
+
"""
|
| 587 |
+
|
| 588 |
+
# Create crew with the agent and task
|
| 589 |
+
crew = Crew(
|
| 590 |
+
agents=[objectives_generator],
|
| 591 |
+
tasks=[objectives_task],
|
| 592 |
+
process=Process.sequential,
|
| 593 |
+
verbose=True
|
| 594 |
+
)
|
| 595 |
+
|
| 596 |
+
# Execute the crew with inputs
|
| 597 |
+
result = crew.kickoff(
|
| 598 |
+
inputs={
|
| 599 |
+
"topic": topic,
|
| 600 |
+
"domain": domain,
|
| 601 |
+
"content_type": content_type,
|
| 602 |
+
"audience": audience,
|
| 603 |
+
"material_type": material_type,
|
| 604 |
+
"outlines": json.dumps(outlines, ensure_ascii=False, indent=2)
|
| 605 |
+
}
|
| 606 |
+
)
|
| 607 |
+
|
| 608 |
+
return result
|
| 609 |
+
|
| 610 |
+
|
| 611 |
+
# โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
| 612 |
+
# ๐ Usage Example
|
| 613 |
+
# โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
| 614 |
+
|
| 615 |
+
if __name__ == "__main__":
|
| 616 |
+
# Example usage
|
| 617 |
+
sample_outlines = {
|
| 618 |
+
"units": [
|
| 619 |
+
{
|
| 620 |
+
"unit_number": 1,
|
| 621 |
+
"title": "ุงููุตู ุงูุฃูู: ุงูู
ูุงููู
ุงูุฃุณุงุณูุฉ",
|
| 622 |
+
"focus": "ูุชุน๏ฟฝ๏ฟฝู ุงูู
ุชุนูู
ุนูู ุงูู
ูุงููู
ุงูุฃุณุงุณูุฉ ููุชูููุฑ ุงูุชุตู
ูู
ู",
|
| 623 |
+
"axes": [
|
| 624 |
+
{
|
| 625 |
+
"axis_number": 1,
|
| 626 |
+
"title": "ุชุนุฑูู ุงูุชูููุฑ ุงูุชุตู
ูู
ู",
|
| 627 |
+
"purpose": "ูููู
ุงูู
ุชุนูู
ู
ุนูู ุงูุชูููุฑ ุงูุชุตู
ูู
ู ูู
ูููุงุชู"
|
| 628 |
+
},
|
| 629 |
+
{
|
| 630 |
+
"axis_number": 2,
|
| 631 |
+
"title": "ุฃูู
ูุฉ ุงูุชูููุฑ ุงูุชุตู
ูู
ู",
|
| 632 |
+
"purpose": "ูุฏุฑู ุงูู
ุชุนูู
ุฃูู
ูุฉ ุงูุชูููุฑ ุงูุชุตู
ูู
ู ูู ุญู ุงูู
ุดููุงุช"
|
| 633 |
+
}
|
| 634 |
+
]
|
| 635 |
+
}
|
| 636 |
+
]
|
| 637 |
+
}
|
| 638 |
+
|
| 639 |
+
result = generate_objectives(
|
| 640 |
+
topic="Design Thinking",
|
| 641 |
+
domain="Management",
|
| 642 |
+
content_type="Training",
|
| 643 |
+
audience="Professionals",
|
| 644 |
+
material_type=["Conceptual", "Procedural"],
|
| 645 |
+
outlines=sample_outlines
|
| 646 |
+
)
|
| 647 |
+
|
| 648 |
+
print(json.dumps(result, ensure_ascii=False, indent=2))
|
app.py
CHANGED
|
@@ -1,39 +1,84 @@
|
|
| 1 |
import os
|
| 2 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
os.environ["HOME"] = "/tmp"
|
| 4 |
os.environ["XDG_DATA_HOME"] = "/tmp/.local/share"
|
| 5 |
os.environ["CREWAI_STORAGE_PATH"] = "/tmp/crewai_data"
|
| 6 |
os.environ["CREWAI_HOME"] = "/tmp/crewai_home"
|
| 7 |
|
| 8 |
-
#
|
| 9 |
os.makedirs("/tmp/.local/share", exist_ok=True)
|
| 10 |
os.makedirs("/tmp/crewai_data", exist_ok=True)
|
| 11 |
os.makedirs("/tmp/crewai_home", exist_ok=True)
|
| 12 |
-
from crewai import Crew, Process
|
| 13 |
-
import json
|
| 14 |
-
from fastapi import FastAPI
|
| 15 |
-
from routers import objective_route, outliner_route, outcome_route,introduction_route
|
| 16 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
|
|
|
|
|
|
|
|
|
|
| 18 |
app = FastAPI(title="AI Agent Project", version="1.0.0")
|
| 19 |
|
|
|
|
| 20 |
app.include_router(outliner_route.router)
|
| 21 |
app.include_router(objective_route.router)
|
| 22 |
app.include_router(outcome_route.router)
|
| 23 |
app.include_router(introduction_route.router)
|
| 24 |
|
| 25 |
|
| 26 |
-
#
|
|
|
|
|
|
|
| 27 |
@app.get("/")
|
| 28 |
def read_root():
|
| 29 |
return {"message": "Welcome to AI Agent Project API ๐"}
|
| 30 |
|
| 31 |
|
| 32 |
-
# ------------------------
|
| 33 |
-
#
|
| 34 |
-
# ------------------------
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 35 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 36 |
# if __name__ == "__main__":
|
| 37 |
# import uvicorn
|
| 38 |
-
|
| 39 |
# uvicorn.run("main:app", host="127.0.0.1", port=8000, reload=True)
|
|
|
|
| 1 |
import os
|
| 2 |
+
import shutil
|
| 3 |
+
from fastapi import FastAPI, HTTPException, Header
|
| 4 |
+
from routers import objective_route, outliner_route, outcome_route, introduction_route
|
| 5 |
+
|
| 6 |
+
# ---------------------------------
|
| 7 |
+
# ๐งน ุฅุนุฏุงุฏ ุงูุจูุฆุฉ ูู
ุณุงุฑุงุช ุงููุงุด
|
| 8 |
+
# ---------------------------------
|
| 9 |
os.environ["HOME"] = "/tmp"
|
| 10 |
os.environ["XDG_DATA_HOME"] = "/tmp/.local/share"
|
| 11 |
os.environ["CREWAI_STORAGE_PATH"] = "/tmp/crewai_data"
|
| 12 |
os.environ["CREWAI_HOME"] = "/tmp/crewai_home"
|
| 13 |
|
| 14 |
+
# ุฅูุดุงุก ุงูู
ุณุงุฑุงุช ูู ู
ุด ู
ูุฌูุฏุฉ
|
| 15 |
os.makedirs("/tmp/.local/share", exist_ok=True)
|
| 16 |
os.makedirs("/tmp/crewai_data", exist_ok=True)
|
| 17 |
os.makedirs("/tmp/crewai_home", exist_ok=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
|
| 19 |
+
# ---------------------------------
|
| 20 |
+
# ๐งฝ ุชูุธูู ุงููุงุด ุนูุฏ ุจุฏุก ุงูุชุดุบูู
|
| 21 |
+
# ---------------------------------
|
| 22 |
+
CACHE_PATHS = [
|
| 23 |
+
"/tmp/crewai_data",
|
| 24 |
+
"/tmp/crewai_home",
|
| 25 |
+
"/tmp/.local/share/crewai_data",
|
| 26 |
+
]
|
| 27 |
+
|
| 28 |
+
for path in CACHE_PATHS:
|
| 29 |
+
if os.path.exists(path):
|
| 30 |
+
shutil.rmtree(path, ignore_errors=True)
|
| 31 |
+
print(f"๐งน Cleared cache folder: {path}")
|
| 32 |
|
| 33 |
+
# ---------------------------------
|
| 34 |
+
# ๐ ุฅุนุฏุงุฏ ุงูุชุทุจูู
|
| 35 |
+
# ---------------------------------
|
| 36 |
app = FastAPI(title="AI Agent Project", version="1.0.0")
|
| 37 |
|
| 38 |
+
# Routers
|
| 39 |
app.include_router(outliner_route.router)
|
| 40 |
app.include_router(objective_route.router)
|
| 41 |
app.include_router(outcome_route.router)
|
| 42 |
app.include_router(introduction_route.router)
|
| 43 |
|
| 44 |
|
| 45 |
+
# ---------------------------------
|
| 46 |
+
# โ
Root endpoint
|
| 47 |
+
# ---------------------------------
|
| 48 |
@app.get("/")
|
| 49 |
def read_root():
|
| 50 |
return {"message": "Welcome to AI Agent Project API ๐"}
|
| 51 |
|
| 52 |
|
| 53 |
+
# ---------------------------------
|
| 54 |
+
# ๐งน Endpoint ูู
ุณุญ ุงููุงุด ูุฏูููุง
|
| 55 |
+
# ---------------------------------
|
| 56 |
+
ADMIN_TOKEN = "ziad_secret_123" # ุบููุฑู ูุฃู ููู
ุฉ ุณุฑูุฉ
|
| 57 |
+
|
| 58 |
+
|
| 59 |
+
@app.post("/reset-cache")
|
| 60 |
+
def reset_cache(x_token: str = Header(...)):
|
| 61 |
+
|
| 62 |
+
paths = [
|
| 63 |
+
"/tmp/crewai_data",
|
| 64 |
+
"/tmp/crewai_home",
|
| 65 |
+
"/tmp/.local/share/crewai_data",
|
| 66 |
+
]
|
| 67 |
+
|
| 68 |
+
for path in paths:
|
| 69 |
+
if os.path.exists(path):
|
| 70 |
+
shutil.rmtree(path, ignore_errors=True)
|
| 71 |
|
| 72 |
+
os.makedirs("/tmp/crewai_data", exist_ok=True)
|
| 73 |
+
os.makedirs("/tmp/crewai_home", exist_ok=True)
|
| 74 |
+
os.makedirs("/tmp/.local/share/crewai_data", exist_ok=True)
|
| 75 |
+
|
| 76 |
+
return {"message": "โ
Cache cleared successfully."}
|
| 77 |
+
|
| 78 |
+
|
| 79 |
+
# ---------------------------------
|
| 80 |
+
# ๐ ุชุดุบูู ุงูุณูุฑูุฑ
|
| 81 |
+
# ---------------------------------
|
| 82 |
# if __name__ == "__main__":
|
| 83 |
# import uvicorn
|
|
|
|
| 84 |
# uvicorn.run("main:app", host="127.0.0.1", port=8000, reload=True)
|
schemas/objectives_schema.py
CHANGED
|
@@ -1,55 +1,80 @@
|
|
| 1 |
from pydantic import BaseModel, Field
|
| 2 |
-
from typing import List, Dict, Literal, Optional
|
| 3 |
from typing import List
|
| 4 |
-
from pydantic import BaseModel, Field
|
| 5 |
|
| 6 |
|
| 7 |
-
class
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
module_description: str = Field(
|
| 12 |
-
...,
|
|
|
|
| 13 |
)
|
| 14 |
level: str = Field(
|
| 15 |
-
...,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
)
|
| 17 |
verbs: List[str] = Field(
|
| 18 |
-
...,
|
|
|
|
|
|
|
|
|
|
| 19 |
)
|
| 20 |
objective: str = Field(
|
| 21 |
-
...,
|
| 22 |
-
description=
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
)
|
| 24 |
|
| 25 |
|
| 26 |
class ObjectivesOutput(BaseModel):
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
)
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
module: str = Field(..., description="ุงุณู
ุงูู
ูุฏููู ุฏุงุฎู ุงููุญุฏุฉ.")
|
| 40 |
-
level: str = Field(
|
| 41 |
-
...,
|
| 42 |
-
description="ู
ุณุชูู Bloomโs Taxonomy (ู
ุซูุงู: Remember, Understand, Apply, Analyze, Evaluate, Create).",
|
| 43 |
-
)
|
| 44 |
-
verbs: List[str] = Field(..., description="ูุงุฆู
ุฉ ุจุงูุฃูุนุงู ุงูู
ุณุชุฎุฏู
ุฉ ู
ู ุชุตููู ุจููู
.")
|
| 45 |
-
objective: str = Field(
|
| 46 |
-
...,
|
| 47 |
-
description="ุงููุงุชุฌ ุงูุชุนููู
ู ุงููุงุจู ููููุงุณุ ู
ูุชูุจ ุจุตูุบุฉ 'ุฃู + ูุนู ู
ุถุงุฑุน + ุงูุฃุฏุงุก ุงูู
ุทููุจ'.",
|
| 48 |
-
)
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
# ุงููู
ูุฐุฌ ุงูุนุงู
ุงููู ูุญุชูู ุนูู ุงููุงุฆู
ุฉ ุงููุงู
ูุฉ ููุฃูุฏุงู
|
| 52 |
-
class LearningObjectivesOutput(BaseModel):
|
| 53 |
-
objectives: List[LearningObjective] = Field(
|
| 54 |
-
..., description="ูุงุฆู
ุฉ ูุงู
ูุฉ ุจุงูุฃูุฏุงู ุงูุชุนููู
ูุฉ ุงูู
ุชููุฏุฉ ู
ู ุงูุชุญููู."
|
| 55 |
)
|
|
|
|
| 1 |
from pydantic import BaseModel, Field
|
|
|
|
| 2 |
from typing import List
|
|
|
|
| 3 |
|
| 4 |
|
| 5 |
+
class ObjectiveItem(BaseModel):
|
| 6 |
+
"""
|
| 7 |
+
ูู
ูุฐุฌ ูู
ุซู ูุฏู ุชุนููู
ู ูุงุญุฏ (Learning Objective) ูู
ุญูุฑ (axis) ูุงุญุฏ.
|
| 8 |
+
|
| 9 |
+
ูุฌุจ ุฃู ูููู ููุงู ูุฏู ูุงุญุฏ ููุท ููู ู
ุญูุฑุ ู
ุน ุฑุจุทู ุจุงููุญุฏุฉ ุงูุชู ููุชู
ู ุฅูููุง.
|
| 10 |
+
"""
|
| 11 |
+
unit: str = Field(
|
| 12 |
+
...,
|
| 13 |
+
description="ุนููุงู ุงููุญุฏุฉ ุงูุชุนููู
ูุฉ (Unit title) ุงูุชู ููุชู
ู ุฅูููุง ูุฐุง ุงูู
ุญูุฑ."
|
| 14 |
+
)
|
| 15 |
+
unit_description: str = Field(
|
| 16 |
+
...,
|
| 17 |
+
description="ูุตู ุงููุญุฏุฉ (Unit focus) - ุงููุฏู ุงูุนุงู
ูููุญุฏุฉ."
|
| 18 |
+
)
|
| 19 |
+
axis: str = Field(
|
| 20 |
+
...,
|
| 21 |
+
description="ุนููุงู ุงูู
ุญูุฑ (Axis title) - ุงูู
ูุถูุน ุงููุฑุนู ุฏุงุฎู ุงููุญุฏุฉ."
|
| 22 |
+
)
|
| 23 |
module_description: str = Field(
|
| 24 |
+
...,
|
| 25 |
+
description="ูุตู ุงูู
ุญูุฑ (Axis purpose) - ุงูุบุฑุถ ุฃู ุงููุฏู ู
ู ุชุฏุฑูุณ ูุฐุง ุงูู
ุญูุฑ."
|
| 26 |
)
|
| 27 |
level: str = Field(
|
| 28 |
+
...,
|
| 29 |
+
description=(
|
| 30 |
+
"ู
ุณุชูู Bloom's Taxonomy ุฃู ุงูู
ุฌุงู ุงูุชุนููู
ู ุงูู
ูุงุณุจ.\n"
|
| 31 |
+
"ุฃู
ุซูุฉ:\n"
|
| 32 |
+
" - Cognitive - Remember\n"
|
| 33 |
+
" - Cognitive - Understand\n"
|
| 34 |
+
" - Cognitive - Apply\n"
|
| 35 |
+
" - Cognitive - Analyze\n"
|
| 36 |
+
" - Cognitive - Evaluate\n"
|
| 37 |
+
" - Cognitive - Create\n"
|
| 38 |
+
" - Affective - Reception\n"
|
| 39 |
+
" - Affective - Response\n"
|
| 40 |
+
" - Affective - Valuing\n"
|
| 41 |
+
" - Affective - Organization\n"
|
| 42 |
+
" - Affective - Characterization\n"
|
| 43 |
+
" - Psychomotor - Readiness\n"
|
| 44 |
+
" - Psychomotor - Guided Response\n"
|
| 45 |
+
" - Psychomotor - Mechanism\n"
|
| 46 |
+
" - Psychomotor - Complex Overt Response\n"
|
| 47 |
+
" - Psychomotor - Adaptation\n"
|
| 48 |
+
" - Psychomotor - Origination"
|
| 49 |
+
)
|
| 50 |
)
|
| 51 |
verbs: List[str] = Field(
|
| 52 |
+
...,
|
| 53 |
+
min_items=3,
|
| 54 |
+
max_items=3,
|
| 55 |
+
description="ุซูุงุซุฉ ุฃูุนุงู ู
ู ุชุตููู ุจููู
ุฃู ุงูู
ุฌุงูุงุช ุงูุชุนููู
ูุฉ ุชูุงุณุจ ูุฐุง ุงููุฏู."
|
| 56 |
)
|
| 57 |
objective: str = Field(
|
| 58 |
+
...,
|
| 59 |
+
description=(
|
| 60 |
+
"ุงููุฏู ุงูุชุนููู
ู ุงููุงุจู ููููุงุณ ุจุงููุบุฉ ุงูุนุฑุจูุฉ.\n"
|
| 61 |
+
"ูุฌุจ ุฃู ูุจุฏุฃ ุจู 'ุฃู' ุฃู 'ูู' ู
ุชุจูุนูุง ุจูุนู ู
ุถุงุฑุน ูุงุถุญ.\n"
|
| 62 |
+
"ู
ุซุงู: 'ุฃู ูุญูู ุงูู
ุชุนูู
ู
ูููุงุช ุงูุนู
ููุฉ ุงูุชุตู
ูู
ูุฉ ุจุฏูุฉ.'"
|
| 63 |
+
)
|
| 64 |
)
|
| 65 |
|
| 66 |
|
| 67 |
class ObjectivesOutput(BaseModel):
|
| 68 |
+
"""
|
| 69 |
+
ุงููู
ูุฐุฌ ุงูุดุงู
ู ุงูุฐู ูุญุชูู ุนูู ูุงุฆู
ุฉ ูุงู
ูุฉ ุจุงูุฃูุฏุงู ุงูุชุนููู
ูุฉ.
|
| 70 |
+
|
| 71 |
+
ูุฌุจ ุฃู ูุญุชูู ุนูู ูุฏู ูุงุญุฏ ููู ู
ุญูุฑ (axis) ูู ุฌู
ูุน ุงููุญุฏุงุช (units).
|
| 72 |
+
"""
|
| 73 |
+
objectives: List[ObjectiveItem] = Field(
|
| 74 |
+
...,
|
| 75 |
+
description=(
|
| 76 |
+
"ูุงุฆู
ุฉ ูุงู
ูุฉ ุจุงูุฃูุฏุงู ุงูุชุนููู
ูุฉ.\n"
|
| 77 |
+
"ูู ุนูุตุฑ ูู
ุซู ูุฏู ูุงุญุฏ ูู
ุญูุฑ ูุงุญุฏุ ู
ุฑุชุจุท ุจูุญุฏุชู.\n"
|
| 78 |
+
"ุนุฏุฏ ุงูุนูุงุตุฑ ูุฌุจ ุฃู ูุณุงูู ุนุฏุฏ ุงูู
ุญุงูุฑ ูู ุฌู
ูุน ุงููุญุฏุงุช."
|
| 79 |
+
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 80 |
)
|
test_objectives.py
ADDED
|
@@ -0,0 +1,292 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
| 3 |
+
๐งช Test Script for Objectives Generator
|
| 4 |
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
| 5 |
+
|
| 6 |
+
ูุฐุง ุงูู
ูู ูุงุฎุชุจุงุฑ ุชูููุฏ ุงูุฃูุฏุงู ุงูุชุนููู
ูุฉ ุจุงุณุชุฎุฏุงู
ุงูุจูุงูุงุช ุงููุนููุฉ.
|
| 7 |
+
"""
|
| 8 |
+
|
| 9 |
+
import json
|
| 10 |
+
import sys
|
| 11 |
+
import os
|
| 12 |
+
|
| 13 |
+
# Add project root to path
|
| 14 |
+
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
|
| 15 |
+
|
| 16 |
+
from agents.analysis_phase.objectives import generate_objectives
|
| 17 |
+
|
| 18 |
+
|
| 19 |
+
# โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
| 20 |
+
# ๐ Test Data - ุงูุจูุงูุงุช ุงููุนููุฉ ู
ู ุงูู
ุณุชุฎุฏู
|
| 21 |
+
# โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
| 22 |
+
|
| 23 |
+
METADATA = {
|
| 24 |
+
'topic': '(Design thinking) ุชูููุงุช ุงูุชูููุฑ ุงูุชุตู
ูู
ู ูุญู ุงูู
ุดููุงุช ูุงุชุฎุงุฐ ุงููุฑุงุฑุงุช',
|
| 25 |
+
'domain': 'Multidisciplinary',
|
| 26 |
+
'content_type': 'Educational',
|
| 27 |
+
'audience': 'Professionals and Students',
|
| 28 |
+
'material_type': ['Conceptual', 'Procedural', 'Structural', 'Personal', 'Realistic']
|
| 29 |
+
}
|
| 30 |
+
|
| 31 |
+
OUTLINES = {
|
| 32 |
+
'Metadata': [METADATA],
|
| 33 |
+
'main_concept': 'ุชูููุงุช ุงูุชูููุฑ ุงูุชุตู
ูู
ู ูุญู ุงูู
ุดููุงุช ูุงุชุฎุงุฐ ุงููุฑุงุฑุงุช',
|
| 34 |
+
'related_concepts': ['Management', 'Technology', 'Aerospace', 'Psychologists', 'Entrepreneurs', 'Educational', 'Awareness'],
|
| 35 |
+
'units': [
|
| 36 |
+
{
|
| 37 |
+
'unit_number': 1,
|
| 38 |
+
'title': 'ุงููุตู ุงูุฃูู: ู
ูุงููู
ูู
ุจุงุฏุฆ ุงูุชูููุฑ ุงูุชุตู
ูู
ู',
|
| 39 |
+
'focus': 'ูู
ูุญ ุงูู
ุชุนูู
ูู ููู
ุงู ู
ุชุทูุฑุงู ููู
ูุงููู
ุงูุฃุณุงุณูุฉุ ุชุงุฑูุฎ ุงูุชูููุฑ ุงูุชุตู
ูู
ูุ ูุงููุธุฑุฉ ุงูู
ููุฌูุฉ ุงูุชู ุชูุดููู ุฃุณุงุณุงู ููุชุนุงู
ู ู
ุน ุงูู
ุดููุงุช ุงูู
ุนูุฏุฉ.',
|
| 40 |
+
'axes': [
|
| 41 |
+
{
|
| 42 |
+
'axis_number': 1,
|
| 43 |
+
'title': 'ุชุนุฑูู ุงูู
ุตุทูุญุงุช ุงูุฃุณุงุณูุฉ ููุชูููุฑ ุงูุชุตู
ูู
ู',
|
| 44 |
+
'purpose': 'ุชุนุฑูู ุงูู
ุตุทูุญุงุช ุงูุฃุณุงุณูุฉ ูุณุงุนุฏ ุงูู
ุชุนูู
ูู ุนูู ุจูุงุก ูุงุนุฏุฉ ู
ุนุฑููุฉ ุซุงุจุชุฉ'
|
| 45 |
+
},
|
| 46 |
+
{
|
| 47 |
+
'axis_number': 2,
|
| 48 |
+
'title': 'ุดุฑุญ ุชุงุฑูุฎ ุชุทูุฑ ู
ููุฌ ุงูุชูููุฑ ุงูุชุตู
ูู
ู',
|
| 49 |
+
'purpose': 'ุชูุถูุญ ุชุงุฑูุฎ ุชุทูุฑ ู
ููุฌ ุงูุชูููุฑ ุงูุชุตู
ูู
ู ูุนุฒุฒ ููู
ุงูุณูุงู ูุงูุชุทุจูู'
|
| 50 |
+
},
|
| 51 |
+
{
|
| 52 |
+
'axis_number': 3,
|
| 53 |
+
'title': 'ุฃู
ุซูุฉ ุชุทุจูููุฉ ููู
ุจุงุฏุฆ ุงูุชุตู
ูู
ูุฉ',
|
| 54 |
+
'purpose': 'ุนุฑุถ ุฃู
ุซูุฉ ุนู
ููุฉ ูุฑุจุท ุงูู
ุจุงุฏุฆ ุจุงููุงูุน ูุชุทุจููุงุชูู
'
|
| 55 |
+
},
|
| 56 |
+
{
|
| 57 |
+
'axis_number': 4,
|
| 58 |
+
'title': 'ุชุญููู ู
ูููุงุช ุงูุนู
ููุฉ ุงูุชุตู
ูู
ูุฉ ูู ู
ุดุฑูุน ุนู
ูู',
|
| 59 |
+
'purpose': 'ุชุญููู ู
ูููุงุช ุงูุนู
ููุฉ ูู ู
ุดุฑูุน ุนู
ูู ูุทููุฑ ู
ูุงุฑุงุช ุงูุชูููุฑ ุงูููุฏู'
|
| 60 |
+
},
|
| 61 |
+
{
|
| 62 |
+
'axis_number': 5,
|
| 63 |
+
'title': 'ุงุจุชูุงุฑ ูู
ูุฐุฌ ุชุตู
ูู
ู ูุญู ู
ุดููุฉ ู
ุญุฏุฏุฉ',
|
| 64 |
+
'purpose': 'ุงุจุชูุงุฑ ูู
ูุฐุฌ ุชุตู
ูู
ู ูุญู ู
ุดููุฉ ู
ุญุฏุฏ ูุนุฒุฒ ุงูุงุจุชูุงุฑ ูุงูุฅุจุฏุงุน'
|
| 65 |
+
}
|
| 66 |
+
]
|
| 67 |
+
},
|
| 68 |
+
{
|
| 69 |
+
'unit_number': 2,
|
| 70 |
+
'title': 'ุงููุตู ุงูุซุงูู: ุงูุนู
ููุฉ ุงูู
ูุฏุงููุฉ ูุชูููุงุช ุงูุชูููุฑ ุงูุชุตู
ูู
ู',
|
| 71 |
+
'focus': 'ููุฏุฑูุณ ุงูู
ุชุนูู
ูู ุงูุฎุทูุงุช ุงูุนู
ููุฉ (ุงูุชุนุงุทูุ ุงูุชุญุฏูุฏุ ุงูุฅุจุฏุงุนุ ุงููู
ุฐุฌุฉุ ูุงูุงุฎุชุจุงุฑ) ู
ุน ุชุทุจูู ุชู
ุงุฑูู ุชุฌุฑูุจูุฉ ุชูุจูู ู
ูุงุฑุงุช ุชูููุฐูุฉ ู
ุจุงุดุฑุฉ.',
|
| 72 |
+
'axes': [
|
| 73 |
+
{
|
| 74 |
+
'axis_number': 1,
|
| 75 |
+
'title': 'ุฏุฑุงุณุฉ ุฎุทูุงุช ุงูุนู
ููุฉ ุงูู
ูุฏุงููุฉ',
|
| 76 |
+
'purpose': 'ุชุฐูุฑ ุฎุทูุงุช ุงูุนู
ููุฉ ุงูู
ูุฏุงููุฉ ุงูุฃุณุงุณูุฉ ูุนุฒุฒ ุงูุชุชุจุน ุงูุณูุณ ููุนู
ููุฉ'
|
| 77 |
+
},
|
| 78 |
+
{
|
| 79 |
+
'axis_number': 2,
|
| 80 |
+
'title': 'ุดุฑุญ ู
ูุตู ูู
ุฑุงุญู ุงูุชุนุงุทู ูุงูุชุญุฏูุฏ',
|
| 81 |
+
'purpose': 'ุดุฑุญ ู
ูุตู ูู
ุฑุงุญู ุงูุชุนุงุทู ูุงูุชุญุฏูุฏ ููุถุญ ูู ุฎุทูุฉ ู
ู ุงูุนู
ููุฉ'
|
| 82 |
+
},
|
| 83 |
+
{
|
| 84 |
+
'axis_number': 3,
|
| 85 |
+
'title': 'ุชูููุฐ ุชู
ุฑูู ุชุนุงุทู ูุญุงูุฉ ูุงูุนูุฉ',
|
| 86 |
+
'purpose': 'ุชูููุฐ ุชู
ุฑูู ุชุนุงุทู ูุญุงูุฉ ูุงูุนูุฉ ูุฑุจุท ุงููุธุฑูุฉ ุจุงูุชุทุจูู'
|
| 87 |
+
},
|
| 88 |
+
{
|
| 89 |
+
'axis_number': 4,
|
| 90 |
+
'title': 'ุชุญููู ูุชุงุฆุฌ ุงูู
ุฑุญูุฉ ุงูุฅุจุฏุงุนูุฉ ูููู
ุงุฐุฌ',
|
| 91 |
+
'purpose': 'ุชุญููู ูุชุงุฆุฌ ุงูู
ุฑุญูุฉ ุงูุฅุจุฏุงุนูุฉ ูููู
ุงุฐุฌ ููุถุญ ููุงุท ุงูููุฉ ูุงูุถุนู'
|
| 92 |
+
},
|
| 93 |
+
{
|
| 94 |
+
'axis_number': 5,
|
| 95 |
+
'title': 'ุงุจุชูุงุฑ ุญู ููุงุฆู ุจุนุฏ ุงุฎุชุจุงุฑ ุงููู
ูุฐุฌ',
|
| 96 |
+
'purpose': 'ุงุจุชูุงุฑ ุญู ููุงุฆู ุจุนุฏ ุงุฎุชุจุงุฑ ุงููู
ูุฐุฌ ูุนุฒุฒ ุงูุชุนูู
ุงูุนู
ูู'
|
| 97 |
+
}
|
| 98 |
+
]
|
| 99 |
+
},
|
| 100 |
+
{
|
| 101 |
+
'unit_number': 3,
|
| 102 |
+
'title': 'ุงููุตู ุงูุซุงูุซ: ุชุทุจููุงุช ุงูุชูููุฑ ุงูุชุตู
ูู
ู ูู ุงูุฅุฏุงุฑุฉุ ุงูุชูููุฉุ ุงููุถุงุกุ ุนูู
ุงูููุณ ูุฑูุงุฏุฉ ุงูุฃุนู
ุงู',
|
| 103 |
+
'focus': 'ููุธูุฑ ููู ูู
ูู ุฏู
ุฌ ุงูุชูููุฑ ุงูุชุตู
ูู
ู ูู ู
ุฌุงูุงุช ู
ุชุนุฏุฏุฉุ ู
ูุฏู
ูุง ุฏุฑุงุณุงุช ุญุงูุฉ ูุงูุนูุฉ ุชูุซุจุช ูุงุนููุชู ูู ุชุญุณูู ุงูุนู
ููุงุช ูุงุชุฎุงุฐ ุงููุฑุงุฑุงุช ุงููุนุงูุฉ.',
|
| 104 |
+
'axes': [
|
| 105 |
+
{
|
| 106 |
+
'axis_number': 1,
|
| 107 |
+
'title': 'ุชุญุฏูุฏ ู
ุฌุงูุงุช ุชุทุจูู ุงูุชูููุฑ ุงูุชุตู
ูู
ู',
|
| 108 |
+
'purpose': 'ุชุญุฏูุฏ ู
ุฌุงูุงุช ุชุทุจูู ุงูุชูููุฑ ุงูุชุตู
ูู
ู ูุญุฏุฏ ุงููุถุงุกุงุช ุงูุชู ูู
ูู ุชูุธูููุง'
|
| 109 |
+
},
|
| 110 |
+
{
|
| 111 |
+
'axis_number': 2,
|
| 112 |
+
'title': 'ุดุฑุญ ุฏูุฑ ุงูุชูููุฑ ุงูุชุตู
ูู
ู ูู ุงูุฅุฏุงุฑุฉ',
|
| 113 |
+
'purpose': 'ุดุฑุญ ุฏูุฑ ุงูุชูููุฑ ุงูุชุตู
ูู
ู ูู ุงูุฅุฏุงุฑุฉ ููุถุญ ููู ูุญุณูู ุงูุนู
ููุงุช'
|
| 114 |
+
},
|
| 115 |
+
{
|
| 116 |
+
'axis_number': 3,
|
| 117 |
+
'title': 'ุชุทุจูู ุงูุชูููุฑ ุงูุชุตู
ูู
ู ุนูู ูุถูุฉ ุฅุฏุงุฑูุฉ',
|
| 118 |
+
'purpose': 'ุชุทุจูู ุงูุชูููุฑ ุงูุชุตู
ูู
ู ุนูู ูุถูุฉ ุฅุฏุงุฑูุฉ ูุฎุชุจุฑ ูุนุงููุฉ ุงูุชูุชููุงุช'
|
| 119 |
+
},
|
| 120 |
+
{
|
| 121 |
+
'axis_number': 4,
|
| 122 |
+
'title': 'ุชุญููู ูุงุนููุฉ ุงูุชุทุจููุงุช ูู ู
ุฌุงู ุงููุถุงุก',
|
| 123 |
+
'purpose': 'ุชุญููู ูุงุนููุฉ ุงูุชุทุจููุงุช ูู ู
ุฌุงู ุงููุถุงุก ููููู
ุฅู
ูุงููุงุช ุงูุงุจุชูุงุฑ'
|
| 124 |
+
},
|
| 125 |
+
{
|
| 126 |
+
'axis_number': 5,
|
| 127 |
+
'title': 'ุงุจุชูุงุฑ ู
ุจุงุฏุฑุฉ ุชุตู
ูู
ูุฉ ูุฑุจุท ุนูู
ุงูููุณ ูุฑูุงุฏุฉ ุงูุฃุนู
ุงู',
|
| 128 |
+
'purpose': 'ุงุจุชูุงุฑ ู
ุจุงุฏุฑุฉ ุชุตู
ูู
ูุฉ ูุฑุจุท ุนูู
ุงูููุณ ูุฑูุงุฏุฉ ุงูุฃุนู
ุงู ูุฏู
ุฌ ุงูู
ููุฌูุฉ'
|
| 129 |
+
}
|
| 130 |
+
]
|
| 131 |
+
},
|
| 132 |
+
{
|
| 133 |
+
'unit_number': 4,
|
| 134 |
+
'title': 'ุงููุตู ุงูุฑุงุจุน: ุงูุชูููุฐ ูุงูุชูููู
โ ุงูุชูู
ูุฉ ุงูุดุฎุตูุฉ ูุงููุนู ุงูู
ุฌุชู
ุนู',
|
| 135 |
+
'focus': 'ูุดุฌุน ุงูู
ุชุนูู
ูู ุนูู ุชูููุฐ ุญููู ู
ูุตู
ู
ุฉ ุจูุนูุงููุฉุ ููุงุณ ุฃุซุฑูุงุ ูุชุนุฒูุฒ ุงููุนู ุงูุฐุงุชู ูุงูู
ุฌุชู
ุนูุ ู
ุน ุชูุฌูู ูู
ูุงุฑุงุช ุงูููุงุฏุฉ ูุงูุชูููุฑ ุงูููุฏู.',
|
| 136 |
+
'axes': [
|
| 137 |
+
{
|
| 138 |
+
'axis_number': 1,
|
| 139 |
+
'title': 'ู
ุฑุงุฌุนุฉ ู
ูุงููู
ุชูููุฐ ุงูุญููู ุงูู
ุจุฏุนุฉ',
|
| 140 |
+
'purpose': 'ุชุฐููุฑ ุจู
ูุงููู
ุชูููุฐ ุงูุญููู ุงูู
ุจุฏุนุฉ ูุญูู ูุถูุญ ุงูุฑุคูุฉ'
|
| 141 |
+
},
|
| 142 |
+
{
|
| 143 |
+
'axis_number': 2,
|
| 144 |
+
'title': 'ุดุฑุญ ุชูููุงุช ููุงุณ ุฃุซุฑ ุงูุญููู ุงูุชุญููููุฉ',
|
| 145 |
+
'purpose': 'ุดุฑุญ ุชูููุงุช ููุงุณ ุฃุซุฑ ุงูุญููู ุงูุชุญููููุฉ ููุฏูู
ุฅุทุงุฑ ููุชูููู
'
|
| 146 |
+
},
|
| 147 |
+
{
|
| 148 |
+
'axis_number': 3,
|
| 149 |
+
'title': 'ุงุณุชุฎุฏุงู
ุฃุฏูุงุช ููุงุณ ุชูููู
ุญู ู
ุดุฑูุนู',
|
| 150 |
+
'purpose': 'ุงุณุชุฎุฏุงู
ุฃุฏูุงุช ููุงุณ ุชูููู
ุญู ู
ุดุฑูุนู ููู
ููู ุงูู
ุชุนูู
ูู ู
ู ุงูุชุญููู'
|
| 151 |
+
},
|
| 152 |
+
{
|
| 153 |
+
'axis_number': 4,
|
| 154 |
+
'title': 'ุชุญููู ู
ุคุดุฑุงุช ุงูุฃุฏุงุก ูุงูุชุฃุซูุฑ ุงูู
ุฌุชู
ุนู',
|
| 155 |
+
'purpose': 'ุชุญููู ู
ุคุดุฑุงุช ุงูุฃุฏุงุก ูุงูุชุฃุซูุฑ ุงูู
ุฌุชู
ุนู ูุญุฏุฏ ุงููุงุนููุฉ ูุงูุชุฃุซูุฑ'
|
| 156 |
+
},
|
| 157 |
+
{
|
| 158 |
+
'axis_number': 5,
|
| 159 |
+
'title': 'ุงุจุชูุงุฑ ุงุณุชุฑุงุชูุฌูุฉ ููุงุฏุฉ ูุชุนุฒูุฒ ุงููุนู ุงูุฐุงุชู',
|
| 160 |
+
'purpose': 'ุงุจุชูุงุฑ ุงุณุชุฑุงุชูุฌูุฉ ููุงุฏุฉ ูุชุนุฒูุฒ ุงููุนู ุงูุฐุงุชู ูุซู
ุฑ ุฅู
ูุงููุฉ ุงูููุงุฏุฉ'
|
| 161 |
+
}
|
| 162 |
+
]
|
| 163 |
+
}
|
| 164 |
+
]
|
| 165 |
+
}
|
| 166 |
+
|
| 167 |
+
|
| 168 |
+
# โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
| 169 |
+
# ๐งช Test Function
|
| 170 |
+
# โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
| 171 |
+
|
| 172 |
+
def test_objectives_generator():
|
| 173 |
+
"""
|
| 174 |
+
ุงุฎุชุจุงุฑ ุชูููุฏ ุงูุฃูุฏุงู ุงูุชุนููู
ูุฉ.
|
| 175 |
+
"""
|
| 176 |
+
|
| 177 |
+
print("โ" * 80)
|
| 178 |
+
print("๐ Starting Objectives Generation Test")
|
| 179 |
+
print("โ" * 80)
|
| 180 |
+
print()
|
| 181 |
+
|
| 182 |
+
# Print input summary
|
| 183 |
+
print("๐ Input Data:")
|
| 184 |
+
print(f" โข Topic: {METADATA['topic']}")
|
| 185 |
+
print(f" โข Domain: {METADATA['domain']}")
|
| 186 |
+
print(f" โข Content Type: {METADATA['content_type']}")
|
| 187 |
+
print(f" โข Audience: {METADATA['audience']}")
|
| 188 |
+
print(f" โข Material Type: {', '.join(METADATA['material_type'])}")
|
| 189 |
+
print(f" โข Units: {len(OUTLINES['units'])}")
|
| 190 |
+
|
| 191 |
+
# Count total axes
|
| 192 |
+
total_axes = sum(len(unit['axes']) for unit in OUTLINES['units'])
|
| 193 |
+
print(f" โข Total Axes: {total_axes}")
|
| 194 |
+
print()
|
| 195 |
+
|
| 196 |
+
# Generate objectives
|
| 197 |
+
print("โณ Generating objectives...")
|
| 198 |
+
print("โ" * 80)
|
| 199 |
+
print()
|
| 200 |
+
|
| 201 |
+
try:
|
| 202 |
+
result = generate_objectives(
|
| 203 |
+
topic=METADATA['topic'],
|
| 204 |
+
domain=METADATA['domain'],
|
| 205 |
+
content_type=METADATA['content_type'],
|
| 206 |
+
audience=METADATA['audience'],
|
| 207 |
+
material_type=METADATA['material_type'],
|
| 208 |
+
outlines=OUTLINES
|
| 209 |
+
)
|
| 210 |
+
|
| 211 |
+
print()
|
| 212 |
+
print("โ" * 80)
|
| 213 |
+
print("โ
Objectives Generated Successfully!")
|
| 214 |
+
print("โ" * 80)
|
| 215 |
+
print()
|
| 216 |
+
|
| 217 |
+
# Print results summary
|
| 218 |
+
objectives = result.get('objectives', [])
|
| 219 |
+
print(f"๐ Results Summary:")
|
| 220 |
+
print(f" โข Total Objectives Generated: {len(objectives)}")
|
| 221 |
+
print(f" โข Expected (Total Axes): {total_axes}")
|
| 222 |
+
print(f" โข Match: {'โ
YES' if len(objectives) == total_axes else 'โ NO'}")
|
| 223 |
+
print()
|
| 224 |
+
|
| 225 |
+
# Analyze verb diversity
|
| 226 |
+
verbs_used = [obj['objective'].split()[1] for obj in objectives if len(obj['objective'].split()) > 1]
|
| 227 |
+
unique_verbs = len(set(verbs_used))
|
| 228 |
+
diversity_rate = (unique_verbs / len(verbs_used)) * 100 if verbs_used else 0
|
| 229 |
+
|
| 230 |
+
print(f"๐ Verb Diversity:")
|
| 231 |
+
print(f" โข Total Verbs Used: {len(verbs_used)}")
|
| 232 |
+
print(f" โข Unique Verbs: {unique_verbs}")
|
| 233 |
+
print(f" โข Diversity Rate: {diversity_rate:.1f}%")
|
| 234 |
+
print(f" โข Target: 70-80%")
|
| 235 |
+
print(f" โข Status: {'โ
PASS' if diversity_rate >= 70 else 'โ ๏ธ NEEDS IMPROVEMENT'}")
|
| 236 |
+
print()
|
| 237 |
+
|
| 238 |
+
# Analyze domain distribution
|
| 239 |
+
domain_counts = {
|
| 240 |
+
'Cognitive': sum(1 for obj in objectives if 'Cognitive' in obj['level']),
|
| 241 |
+
'Affective': sum(1 for obj in objectives if 'Affective' in obj['level']),
|
| 242 |
+
'Psychomotor': sum(1 for obj in objectives if 'Psychomotor' in obj['level'])
|
| 243 |
+
}
|
| 244 |
+
|
| 245 |
+
total_objs = len(objectives)
|
| 246 |
+
print(f"๐ Domain Distribution:")
|
| 247 |
+
for domain, count in domain_counts.items():
|
| 248 |
+
percentage = (count / total_objs) * 100 if total_objs > 0 else 0
|
| 249 |
+
print(f" โข {domain}: {count} ({percentage:.1f}%)")
|
| 250 |
+
print()
|
| 251 |
+
|
| 252 |
+
# Print first few objectives as examples
|
| 253 |
+
print("๐ Sample Objectives (First 3):")
|
| 254 |
+
print("โ" * 80)
|
| 255 |
+
for i, obj in enumerate(objectives[:3], 1):
|
| 256 |
+
print(f"\n{i}. Unit: {obj['unit']}")
|
| 257 |
+
print(f" Axis: {obj['axis']}")
|
| 258 |
+
print(f" Level: {obj['level']}")
|
| 259 |
+
print(f" Verbs: {', '.join(obj['verbs'])}")
|
| 260 |
+
print(f" Objective: {obj['objective']}")
|
| 261 |
+
print()
|
| 262 |
+
print("โ" * 80)
|
| 263 |
+
|
| 264 |
+
# Save to file
|
| 265 |
+
output_file = 'objectives_output.json'
|
| 266 |
+
with open(output_file, 'w', encoding='utf-8') as f:
|
| 267 |
+
json.dump(result, f, ensure_ascii=False, indent=2)
|
| 268 |
+
|
| 269 |
+
print(f"๐พ Full output saved to: {output_file}")
|
| 270 |
+
print()
|
| 271 |
+
|
| 272 |
+
return result
|
| 273 |
+
|
| 274 |
+
except Exception as e:
|
| 275 |
+
print()
|
| 276 |
+
print("โ" * 80)
|
| 277 |
+
print("โ Error During Generation")
|
| 278 |
+
print("โ" * 80)
|
| 279 |
+
print(f"Error: {str(e)}")
|
| 280 |
+
print()
|
| 281 |
+
import traceback
|
| 282 |
+
traceback.print_exc()
|
| 283 |
+
return None
|
| 284 |
+
|
| 285 |
+
|
| 286 |
+
# โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
| 287 |
+
# ๐ฏ Main Execution
|
| 288 |
+
# โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
| 289 |
+
|
| 290 |
+
if __name__ == "__main__":
|
| 291 |
+
test_objectives_generator()
|
| 292 |
+
|