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
| Option | Type | Required | Default |
|---|---|---|---|
model | string | LanguageModel | Yes | — |
content | string | FileContent | Yes | — |
count | number (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 />.