Edu SDKEdu SDK

createPracticeProblems

Generate practice problems from educational content.

Generates practice problems from educational content. Each problem includes a hint, an answer, and a worked solution.

Usage

import { createPracticeProblems } from "edu-sdk";

const problems = await createPracticeProblems({
  model: "google/gemini-3.6-flash",
  content,
  count: 5,
  difficulty: "medium"
});

Options

OptionTypeRequiredDefault
modelstring | LanguageModelYes—
contentstring | FileContentYes—
countnumber (positive int)Yes—
difficulty"easy" | "medium" | "hard"No"medium"

content may be a string or FileContent (PDF / text / markdown bytes).

Returns

Promise<Artifact<PracticeProblem[]>>

{
  id: string;
  title: string;
  description?: string;
  metadata: {
    createdAt: string;
    model: string;
    difficulty: "easy" | "medium" | "hard";
  };
  content: PracticeProblem[];
}

Each problem in content contains:

{
  id: string;
  question: string;
  hint: string;
  answer: string;
  solution: string;
}

Example

import { createPracticeProblems } from "edu-sdk";

const problems = await createPracticeProblems({
  model: "google/gemini-3.6-flash",
  content: worksheetNotes,
  count: 6,
  difficulty: "hard"
});

// <PracticeProblems problems={problems.content} />

Render with <PracticeProblems />.

On this page