Розроблення AI-системи генерації навчальних матеріалів
AI-система генерує структуровані навчальні матеріали: конспекти, презентації, робочі листи, глосарії, кейси. Застосовується на EdTech-платформах, корпоративному навчанні, школах та вузах для масштабування виробництва контенту.
Генератор курсу з теми
from openai import AsyncOpenAI
from dataclasses import dataclass
client = AsyncOpenAI()
@dataclass
class CourseStructure:
title: str
target_audience: str
learning_objectives: list[str]
modules: list[dict] # [{title, topics, exercises, duration_min}]
assessment: dict
prerequisites: list[str]
async def generate_course_structure(
topic: str,
level: str, # beginner, intermediate, advanced
duration_hours: int = 10,
audience: str = ""
) -> CourseStructure:
response = await client.chat.completions.create(
model="gpt-4o",
messages=[{
"role": "system",
"content": f"""You are an online education methodologist.
Create course structure with Bloom's taxonomy for each objective.
Level: {level}.
Duration: {duration_hours} hours.
Break into modules of 1-2 hours each.
For each module: topic, subtopics, practical assignments, review questions.
Return JSON."""
}, {
"role": "user",
"content": f"Topic: {topic}\nTarget audience: {audience or 'not specified'}"
}],
response_format={"type": "json_object"}
)
data = json.loads(response.choices[0].message.content)
return CourseStructure(**data)
Генерація контенту модуля
async def generate_lesson_content(
module_title: str,
topics: list[str],
level: str,
include_examples: bool = True,
include_exercises: bool = True
) -> dict:
response = await client.chat.completions.create(
model="gpt-4o",
messages=[{
"role": "system",
"content": f"""Write material for an educational module.
Level: {level}.
Markdown structure:
- ## Introduction (why topic matters)
- ## Theory (H3 for each subtopic)
- {'## Examples (real-world use cases)' if include_examples else ''}
- {'## Exercises (practical assignments with solutions)' if include_exercises else ''}
- ## Key Takeaways (bullet list)
- ## Review Questions (5 questions with answers)
Style: clear, concrete, no fluff."""
}, {
"role": "user",
"content": f"Module: {module_title}\nTopics: {', '.join(topics)}"
}]
)
return {
"content": response.choices[0].message.content,
"format": "markdown"
}
Генерація робочих листів та тестів
async def generate_worksheet(
topic: str,
exercise_types: list[str], # multiple_choice, fill_blank, open_question, case_study
difficulty: str = "medium",
num_exercises: int = 10
) -> dict:
response = await client.chat.completions.create(
model="gpt-4o",
messages=[{
"role": "system",
"content": f"""Create a worksheet for reinforcing topic.
Exercise types: {', '.join(exercise_types)}.
Difficulty: {difficulty}.
Number of exercises: {num_exercises}.
For each exercise provide correct answer and explanation.
Return JSON: {{exercises: [{{type, question, options, answer, explanation}}]}}"""
}, {
"role": "user",
"content": f"Topic: {topic}"
}],
response_format={"type": "json_object"}
)
return json.loads(response.choices[0].message.content)
Адаптивна персоналізація матеріалу
async def adapt_material_for_learner(
base_material: str,
learner_profile: dict # {level, background, learning_style, mistakes_made}
) -> str:
response = await client.chat.completions.create(
model="gpt-4o",
messages=[{
"role": "system",
"content": f"""Adapt educational material for specific learner.
Profile: {json.dumps(learner_profile, ensure_ascii=False)}.
- Simplify concepts causing difficulty
- Add examples from familiar domains
- Highlight areas where errors occurred previously"""
}, {
"role": "user",
"content": base_material
}]
)
return response.choices[0].message.content
Сроки: генератор структури курсу + матеріалів модулів — 2–3 тижні. Повна платформа з персоналізацією, відстеженням прогресу та адаптивними тестами — 2–3 місяці.







