Core
Generation APIs in the edu-sdk package.
edu-sdk generates learning materials from content. Pass a model (string ID or AI SDK LanguageModel), content (string or FileContent), and optional difficulty (easy | medium | hard).
Every generator returns an Artifact<T> envelope. Invalid options throw InvalidInputError. Unsupported or empty files throw UnsupportedContentError / ContentExtractionError.
When to use which
| Goal | API |
|---|---|
| One material type | A single generator below |
| Several materials from the same content | createLearningSet() |
| Timed agenda plus materials | createStudySession() |
| Text from a file first | extractContent() |
| Score quiz answers | gradeQuiz() / Assessment |
Content
| Function | Returns |
|---|---|
extractContent() | Extracted text from file bytes (not an artifact) |
Pass a file object directly as content on any create* call, or extract first to inspect / cache / trim. See Working with files.
Generators
| Function | content type |
|---|---|
createFlashcards() | Flashcard[] (each with id) |
createNote() | Markdown string |
createQuiz() | QuizQuestion[] (each with id) |
createStudyGuide() | StudyGuideContent |
createPracticeProblems() | PracticeProblem[] (each with id) |
Workflows
| Function | content type |
|---|---|
createLearningSet() | Nested artifacts chosen via include |
createStudySession() | Timed agenda + LearningSetContent materials |
Assessment
| Function | Role |
|---|---|
gradeQuiz() | Deterministic scoring (no model call) |
| Assessment | createQuizAttempt() / completeQuizAttempt() for attempt lifecycle |
See Quick Start for a full createQuiz example, and Concepts for the shared contract.