// 1. Create a folder for the course
const courseFolder = await client.v1.folders.create({
name: 'Biology 101 - Spring 2024'
});
// 2. Generate course outline
const outline = await client.v1.materials.generateAndProcess({
name: 'Biology 101 Course Outline',
topic: 'Introduction to Biology for first-year students',
type: 'outline',
folderId: courseFolder._id,
level: 'college',
length: 'long'
});
console.log('Course outline generated:', outline.name);
// 3. Generate chapter materials
const chapters = [
{ name: 'Cell Biology', topic: 'Cell structure, organelles, and functions' },
{ name: 'Genetics', topic: 'DNA, RNA, heredity, and gene expression' },
{ name: 'Evolution', topic: 'Natural selection, speciation, and evidence' }
];
const chapterMaterials = await Promise.all(
chapters.map(chapter =>
client.v1.materials.generate({
name: `${chapter.name} - Study Notes`,
topic: chapter.topic,
type: 'notes',
folderId: courseFolder._id,
level: 'college',
length: 'medium',
context: 'Include diagrams descriptions and key terminology'
})
)
);
console.log(`Generated ${chapterMaterials.length} chapter materials`);
// 4. Generate quick summaries for review
const summaries = await Promise.all(
chapters.map(chapter =>
client.v1.materials.generateAndProcess({
name: `${chapter.name} - Quick Review`,
topic: chapter.topic,
type: 'summary',
folderId: courseFolder._id,
level: 'college',
length: 'short'
})
)
);
// 5. List all materials in the folder
const allMaterials = await client.v1.materials.list({
folderId: courseFolder._id
});
console.log('\nCourse materials:');
allMaterials.forEach(material => {
console.log(`- ${material.name} (${material.generationType || material.contentType})`);
});