Edu SDKEdu SDK

createLearningSet

Generate any mix of learning artifacts from the same content in one call.

Runs the generators you list in include in parallel from shared model, content, difficulty, and optional learnerContext. Supported types: createQuiz(), createFlashcards(), createPracticeProblems(), createNote(), and createStudyGuide().

Usage

import { createLearningSet } from "edu-sdk";

const set = await createLearningSet({
  model: "google/gemini-3.6-flash",
  content,
  difficulty: "medium",
  include: [
    { type: "quiz", count: 10, numOfOptions: 4 },
    { type: "flashcards", count: 12 },
    { type: "practiceProblems", count: 5 },
    { type: "notes", length: "medium" },
    { type: "studyGuide" },
  ],
});

Options

OptionTypeRequiredDefault
modelstring | LanguageModelYes
contentstring | FileContentYes
difficulty"easy" | "medium" | "hard"No"medium"
learnerContextLearnerContextNo
includearray of include items (min 1)Yes

content may be a string or FileContent (PDF / text / markdown bytes). File content is extracted once before nested generators run.

When learnerContext is set, it is forwarded to every nested create* call. See Personalization.

include items

Each entry has a type. Duplicate types are rejected.

typeExtra fieldsNotes
"quiz"count (required), numOfOptions (optional, min 2, default 4)
"flashcards"count (required)
"practiceProblems"count (required)
"notes"length?: "short" | "medium" | "long"Defaults to "medium"
"studyGuide"Uses shared options only

Returns

Promise<Artifact<LearningSetContent>> where LearningSetContent only includes keys for the types you requested:

{
  id: string;
  title: string;
  description?: string;
  metadata: {
    createdAt: string;
    model: string;
    difficulty: "easy" | "medium" | "hard";
  };
  content: {
    quiz?: Artifact<QuizQuestion[]>;
    flashcards?: Artifact<Flashcard[]>;
    practiceProblems?: Artifact<PracticeProblem[]>;
    notes?: Artifact<string>;
    studyGuide?: Artifact<StudyGuideContent>;
  };
}

The outer envelope prefers title/description from notes, then study guide, quiz, flashcards, then practice problems (with a "Learning set" fallback title). Each nested value is a full artifact from the corresponding helper.

If any helper fails, the whole call fails.

Example

import { createLearningSet } from "edu-sdk";

const set = await createLearningSet({
  model: "google/gemini-3.6-flash",
  content: lectureNotes,
  include: [
    { type: "quiz", count: 5 },
    { type: "flashcards", count: 8 },
  ],
});

const { quiz, flashcards } = set.content;

// Nested values are full artifacts — pass .content into list UIs
// <Quiz questions={quiz!.content} />
// <Flashcards flashcards={flashcards!.content} />

Invalid input throws InvalidInputError.

See Concepts for nested artifact shapes, and Study session flow when materials come from a session.

On this page