Skip to main content

PPT Generation - AI-Powered Presentations

NeuroLink enables AI-powered PowerPoint presentation generation from text prompts. Transform ideas into professional, visually-appealing presentations with intelligent content planning, multiple slide types, and optional AI-generated images.

Overview

PPT generation in NeuroLink uses a multi-stage pipeline powered by any supported AI provider:

  1. Accepts a text prompt describing the presentation topic via input.text
  2. Plans structured content using AI-powered content planning
  3. Generates individual slides with appropriate types, layouts, and content
  4. Creates optional AI-generated images for visual slides
  5. Assembles a complete .pptx file using pptxgenjs
  6. Returns a PPTGenerationResult containing file path and metadata
graph LR
A[Text Prompt] --> B[Content Planning AI]
B --> C[Slide Schemas]
C --> D[Slide Generator]
D --> E[Image Generation]
E --> F[PPTX Assembly]
F --> G[PPTGenerationResult]
G --> H[Save to File]

What You Get

  • Professional presentations – Generate complete PowerPoint files with 5-50 slides
  • 35 slide types – From title and content slides to charts, timelines, dashboards, and composite layouts
  • 5 built-in themes – Modern, Corporate, Creative, Minimal, and Dark
  • AI image generation – Optional background and decorative images using Gemini
  • User-provided images – Use your own images instead of AI generation
  • SDK integration – Use neurolink.generate() with output.mode: "ppt"
  • CLI support – Generate presentations directly from command line
  • Multi-provider support – Works with Vertex AI, OpenAI, Anthropic, Google AI, Azure, and Bedrock

Supported Providers & Models

Provider Compatibility

ProviderRecommended ModelsSlide TypesImage GenQualityNotes
vertexgemini-2.5-pro, gemini-3All 35✅ NativeHighestFull feature support
google-aigemini-2.5-pro, gemini-3All 35✅ NativeHighestFull feature support
openaigpt-4o, gpt-4-turboAll 35⚠️ ExternalHighUses OpenAI for planning
anthropicclaude-4.5-sonnet, claude-3-opusAll 35⚠️ ExternalHighestAdvanced reasoning
azuregpt-4o, gpt-4-turboAll 35⚠️ ExternalHighEnterprise deployment
bedrockclaude-3-sonnet, titanAll 35⚠️ ExternalHighAWS integration

Model Tiers

TierModelsSlide TypesNotes
advancedclaude-4.5-opus, claude-4.5-sonnet, gpt-4o, gemini-2.5-pro, gemini-3-proAll 35Full prompt with all features
basicgemini-flash, claude-instant, gpt-3.510 coreSimplified prompt for speed

Prerequisites

  1. AI provider credentials configured for your chosen provider
  2. For AI images: Vertex AI or Google AI credentials with Gemini access
  3. Sufficient storage: Output files range from 100KB to 10MB+ depending on images

Quick Start

SDK Usage

import { NeuroLink } from "@juspay/neurolink";

const neurolink = new NeuroLink();

// Basic PPT generation
const result = await neurolink.generate({
input: {
text: "Create a presentation about AI in Healthcare",
},
provider: "vertex",
model: "gemini-2.5-pro",
output: {
mode: "ppt",
ppt: {
pages: 10,
theme: "modern",
audience: "business",
tone: "professional",
},
},
});

// Access result
if (result.ppt) {
console.log(`Presentation saved: ${result.ppt.filePath}`);
console.log(`Total slides: ${result.ppt.totalSlides}`);
}

With Full Options

import { NeuroLink } from "@juspay/neurolink";
import { readFileSync } from "fs";

const neurolink = new NeuroLink();

const result = await neurolink.generate({
input: {
text: "Quarterly Sales Report Q4 2025 - Key achievements, challenges, and outlook",
},
provider: "vertex",
model: "gemini-2.5-pro",
output: {
mode: "ppt",
ppt: {
pages: 15,
theme: "corporate",
audience: "business",
tone: "professional",
generateAIImages: true,
aspectRatio: "16:9",
outputPath: "./presentations/q4-report.pptx",
logoPath: readFileSync("./assets/company-logo.png"),
},
},
});

console.log("Presentation metadata:", {
filePath: result.ppt?.filePath,
slides: result.ppt?.totalSlides,
theme: result.ppt?.metadata?.theme,
fileSize: result.ppt?.metadata?.fileSize,
});

With User-Provided Images

import { NeuroLink } from "@juspay/neurolink";
import { readFileSync } from "fs";

const neurolink = new NeuroLink();

// Use your own images instead of AI generation
const result = await neurolink.generate({
input: {
text: "Product Launch Presentation for our new smartphone",
images: [
readFileSync("./product-hero.jpg"),
readFileSync("./product-features.png"),
"./marketing/lifestyle-shot.jpg", // File path also works
],
},
provider: "anthropic",
model: "claude-3.5-sonnet",
output: {
mode: "ppt",
ppt: {
pages: 12,
theme: "creative",
generateAIImages: false, // Use provided images only
},
},
});

CLI Usage

# Basic PPT generation
npx @juspay/neurolink generate "Introduction to Machine Learning" \
--outputMode ppt \
--pptPages 10 \
--pptOutput ./ml-presentation.pptx

# Full options
npx @juspay/neurolink generate "Company Strategy 2026" \
--provider vertex \
--model gemini-2.5-pro \
--outputMode ppt \
--pptPages 15 \
--pptTheme corporate \
--pptAudience business \
--pptTone professional \
--pptAspectRatio 16:9 \
--pptOutput ./strategy-2026.pptx

# Disable AI image generation
npx @juspay/neurolink generate "Machine Learning 101" \
--outputMode ppt \
--pptTheme minimal \
--pptTone educational \
--pptNoImages

CLI Arguments

  • --outputMode (string, default: text) — Output mode: text, video, or ppt
  • --pptPages, --pages (number, default: 10) — Number of slides (5-50)
  • --pptTheme (string, default: AI-selected) — Theme: modern, corporate, creative, minimal, dark
  • --pptAudience (string, default: AI-selected) — Target audience: business, students, technical, general
  • --pptTone (string, default: AI-selected) — Presentation tone: professional, casual, educational, persuasive
  • --pptNoImages (boolean, default: false) — Disable AI images for visual slides (images are enabled by default)
  • --pptAspectRatio (string, default: 16:9) — Aspect ratio: 16:9 or 4:3
  • --pptOutput, --po (string, default: auto-generated) — Output file path

Slide Types

NeuroLink supports 35 distinct slide types organized by category:

Opening/Closing Slides

TypeDescriptionLayout Options
titleOpening slide with main titletitle-centered, title-bottom
section-headerSection divider with large titletitle-centered
thank-youFinal slide with contact infocontact-info, title-centered
closingSummary and next stepssummary-bullets, title-content

Content Slides

TypeDescriptionLayout Options
contentStandard title + bullet pointstitle-content, image layouts
agendaTable of contentstitle-content, two-column
bulletsEnhanced bullet pointstitle-content
numbered-listStep-by-step contenttitle-content

Visual Slides

TypeDescriptionImage Required
image-focusLarge centered imageYes
image-leftImage left, content rightYes
image-rightContent left, image rightYes
full-bleed-imageFull background imageYes
galleryMultiple images gridYes

Data Slides

TypeDescriptionData Structure
tableData table with headersTableRow[]
chart-barBar chartChartSeries
chart-lineLine chart for trendsChartSeries
chart-piePie chart for proportionsChartSeries
chart-areaArea chartChartSeries
statisticsBig numbers displayStatistic[]

Layout Slides

TypeDescriptionColumns
two-columnTwo equal columns2
three-columnThree column layout3
split-contentAsymmetric 60/40 split2
comparisonSide-by-side comparison2

Special Slides

TypeDescriptionKey Content
quoteImpactful quotequote, author
timelineChronological eventsTimelineItem[]
process-flowStep-by-step processProcessStep[]
featuresFeature list with iconsFeatureItem[]
teamTeam member profilesTeamMember[]
iconsIcon grid with labelsicons[]
conclusionSummary with takeawaysbullets

Composite/Dashboard Slides

TypeDescriptionComponents
dashboardMulti-zone flexible gridcharts + stats + bullets
mixed-contentLeft bullets + right chartbullets + data
stats-gridMultiple stat boxesStatistic[]
icon-gridIcon boxes in gridicons

Themes

Built-in Themes

ThemeColorsBest For
modernBlue, Purple, CyanTech, Innovation
corporateDark Blue, Green, SlateBusiness, Finance
creativeOrange, Pink, YellowMarketing, Design
minimalBlack, White, GrayClean, Professional
darkCyan, Purple on DarkTech, Startups

Theme Structure

interface PresentationTheme {
name: string;
displayName: string;
description: string;
colors: {
primary: string; // Main accent color
secondary: string; // Secondary accent
accent: string; // Highlight color
background: string; // Slide background
text: string; // Body text color
textOnPrimary: string; // Text on primary color
muted: string; // Muted/caption text
};
fonts: {
heading: string;
body: string;
sizes: {
title: number;
subtitle: number;
heading: number;
body: number;
caption: number;
};
};
}

Type Definitions

PPTOutputOptions

Options for PPT generation configuration:

type PPTOutputOptions = {
/** Number of slides (5-50) */
pages: number;
/** Output format (currently only 'pptx') */
format?: "pptx";
/** Presentation theme */
theme?: "modern" | "corporate" | "creative" | "minimal" | "dark";
/** Target audience */
audience?: "business" | "students" | "technical" | "general";
/** Presentation tone */
tone?: "professional" | "casual" | "educational" | "persuasive";
/** Generate AI images for visual slides */
generateAIImages?: boolean;
/** Output file path */
outputPath?: string;
/** Aspect ratio */
aspectRatio?: "16:9" | "4:3";
/** Logo image (Buffer, file path, or ImageWithAltText) */
logoPath?: Buffer | string | ImageWithAltText;
};

PPTGenerationResult

Result type for generated presentation:

type PPTGenerationResult = {
/** Path to generated file */
filePath: string;
/** Total number of slides */
totalSlides: number;
/** Output format */
format: "pptx";
/** Provider used for content planning */
provider: string;
/** Model used for content planning */
model: string;
/** Additional metadata */
metadata?: {
theme?: string;
audience?: string;
tone?: string;
imageModel?: string;
fileSize?: number;
};
};

Content Structure Types

// Bullet point with optional formatting
type BulletPoint = {
text: string;
subBullets?: string[];
icon?: string;
emphasis?: boolean;
fontSize?: number;
bulletStyle?: "disc" | "number" | "checkmark" | "arrow" | "dash" | "none";
color?: string;
bold?: boolean;
};

// Statistics for data slides
type Statistic = {
value: string;
label: string;
trend?: "up" | "down" | "neutral";
change?: string;
icon?: string;
};

// Timeline items
type TimelineItem = {
date: string;
title: string;
description?: string;
icon?: string;
};

// Process steps
type ProcessStep = {
step: number;
title: string;
description?: string;
icon?: string;
};

// Chart data
type ChartSeries = {
name: string;
labels: string[];
values: number[];
color?: string;
};

Extended GenerateResult

The generate() function returns an extended result when PPT mode is enabled:

type GenerateResult = {
content: string;
provider?: string;
model?: string;
usage?: TokenUsage;
responseTime?: number;

// PPT-specific field (present when output.mode === "ppt")
ppt?: PPTGenerationResult;

// Other optional fields
toolsUsed?: string[];
analytics?: AnalyticsData;
evaluation?: EvaluationData;
};

Configuration & Best Practices

Configuration Options

OptionTypeDefaultRequiredDescription
input.textstring-YesTopic/description (10-1000 chars)
input.imagesArray<Buffer>-NoUser-provided images
providerstringvertexNoAI provider for content planning
modelstringprovider defaultNoModel for content planning
output.modestringtextYesMust be "ppt" for PPT output
output.ppt.pagesnumber10YesNumber of slides (5-50)
output.ppt.themestringmodernNoPresentation theme
output.ppt.audiencestringgeneralNoTarget audience
output.ppt.tonestringprofessionalNoPresentation tone
output.ppt.generateAIImagesbooleanfalseNoEnable AI image generation
output.ppt.aspectRatiostring16:9NoSlide aspect ratio
output.ppt.outputPathstringauto-generatedNoOutput file path
output.ppt.logoPathBuffer | string-NoLogo for slides

Best Practices

1. Prompt Engineering

// ❌ Vague prompt
const vaguePrompt = "Make a presentation";

// ✅ Specific and detailed
const specificPrompt =
"Create a presentation about Machine Learning in Healthcare: covering benefits, use cases (diagnosis, drug discovery, patient care), implementation challenges, and future outlook";

// ✅ Include structure hints
const structuredPrompt = `Product Launch Presentation for SmartWatch Pro:
- Start with value proposition
- Cover 5 key features
- Include competitor comparison
- Show pricing tiers
- End with launch timeline and CTA`;

2. Audience & Tone Matching

// Technical audience
const technicalPpt = await neurolink.generate({
input: {
text: "Kubernetes Architecture Deep Dive",
},
output: {
mode: "ppt",
ppt: {
pages: 15,
audience: "technical",
tone: "educational",
theme: "dark",
},
},
});

// Executive audience
const executivePpt = await neurolink.generate({
input: {
text: "Digital Transformation ROI Report",
},
output: {
mode: "ppt",
ppt: {
pages: 10,
audience: "business",
tone: "professional",
theme: "corporate",
},
},
});

3. Image Strategy

// AI-generated images for creative presentations
const creativePpt = await neurolink.generate({
input: { text: "Future of Space Tourism" },
output: {
mode: "ppt",
ppt: {
pages: 12,
theme: "creative",
generateAIImages: true, // AI generates thematic images
},
},
});

// User-provided images for brand consistency
const brandPpt = await neurolink.generate({
input: {
text: "Annual Report 2025",
images: [
readFileSync("./brand/hero.jpg"),
readFileSync("./brand/team.jpg"),
readFileSync("./brand/office.jpg"),
],
},
output: {
mode: "ppt",
ppt: {
pages: 20,
generateAIImages: false,
logoPath: "./brand/logo.png",
},
},
});

Comprehensive Examples

Example 1: Basic Presentation

import { NeuroLink } from "@juspay/neurolink";

const neurolink = new NeuroLink();

async function generateBasicPresentation() {
const result = await neurolink.generate({
input: {
text: "Introduction to Cloud Computing: Benefits, Types, and Best Practices",
},
provider: "vertex",
model: "gemini-2.5-pro",
output: {
mode: "ppt",
ppt: {
pages: 10,
theme: "modern",
audience: "general",
tone: "educational",
},
},
});

if (result.ppt) {
console.log({
filePath: result.ppt.filePath,
totalSlides: result.ppt.totalSlides,
provider: result.ppt.provider,
});
}
}

Example 2: Business Presentation with Analytics

import { NeuroLink } from "@juspay/neurolink";

const neurolink = new NeuroLink();

async function generateBusinessPresentation() {
const result = await neurolink.generate({
input: {
text: `Q4 2025 Sales Performance Report:
- Revenue: $12.5M (up 23% YoY)
- New customers: 450
- Customer retention: 94%
- Top products: Enterprise Suite, Cloud Platform
- Challenges: Supply chain, competition
- 2026 targets: $18M revenue, 600 new customers`,
},
provider: "anthropic",
model: "claude-3.5-sonnet",
enableAnalytics: true,
output: {
mode: "ppt",
ppt: {
pages: 15,
theme: "corporate",
audience: "business",
tone: "professional",
outputPath: "./reports/q4-sales.pptx",
},
},
});

console.log("Analytics:", result.analytics);
console.log("Presentation:", result.ppt);
}

Example 3: Technical Documentation with Code

import { NeuroLink } from "@juspay/neurolink";

const neurolink = new NeuroLink();

async function generateTechnicalDocs() {
const result = await neurolink.generate({
input: {
text: `API Integration Guide for Payment Gateway:
- Authentication (OAuth 2.0, API Keys)
- Endpoints overview
- Request/Response formats
- Error handling
- Code examples in TypeScript
- Testing and sandbox environment
- Security best practices`,
},
provider: "openai",
model: "gpt-4o",
output: {
mode: "ppt",
ppt: {
pages: 12,
theme: "dark",
audience: "technical",
tone: "educational",
},
},
});

return result.ppt;
}

Example 4: Batch Presentation Generation

import { NeuroLink } from "@juspay/neurolink";
import pLimit from "p-limit";

const neurolink = new NeuroLink();
const limit = pLimit(2); // Max 2 concurrent generations

const topics = [
{ topic: "AI in Healthcare", audience: "business" },
{ topic: "Machine Learning Basics", audience: "students" },
{ topic: "Cloud Architecture Patterns", audience: "technical" },
];

async function batchGenerate() {
const results = await Promise.all(
topics.map((item) =>
limit(async () => {
const result = await neurolink.generate({
input: { text: item.topic },
output: {
mode: "ppt",
ppt: {
pages: 10,
audience: item.audience as any,
outputPath: `./presentations/${item.topic.replace(/\s+/g, "-").toLowerCase()}.pptx`,
},
},
});
return {
topic: item.topic,
filePath: result.ppt?.filePath,
slides: result.ppt?.totalSlides,
};
}),
),
);

console.table(results);
}

Example 5: Error Handling

import { NeuroLink, NeuroLinkError, PPTError } from "@juspay/neurolink";

const neurolink = new NeuroLink();

async function generateWithErrorHandling(topic: string) {
try {
const result = await neurolink.generate({
input: { text: topic },
output: {
mode: "ppt",
ppt: {
pages: 10,
theme: "modern",
},
},
timeout: 300000, // 5 minutes for PPT generation
});

return result.ppt;
} catch (error) {
if (error instanceof PPTError) {
console.error(`PPT Error [${error.code}]:`, error.message);

switch (error.code) {
case "PPT_PLANNING_FAILED":
console.error("Content planning failed - try a different prompt");
break;
case "PPT_INVALID_AI_RESPONSE":
console.error(
"AI returned invalid response - retry with different model",
);
break;
case "PPT_IMAGE_GENERATION_FAILED":
console.error("Image generation failed - try without AI images");
break;
case "PPT_ASSEMBLY_FAILED":
console.error("PPTX assembly failed - check file permissions");
break;
case "PPT_FILE_WRITE_FAILED":
console.error("File write failed - check disk space and permissions");
break;
case "PPT_TIMEOUT":
console.error("Generation timed out - try fewer slides");
break;
}
} else if (error instanceof NeuroLinkError) {
console.error(`NeuroLink Error:`, error.message);
}

throw error;
}
}

Error Handling & Validation

Validation Rules

ParameterValidationError TypeExample Message
input.text10-1000 charactersPPTErrorPrompt must be 10-1000 characters
output.ppt.pages5-50 slidesPPTErrorPages must be between 5 and 50
output.ppt.themeValid theme namePPTErrorInvalid theme. Use: modern, corporate...
output.ppt.audienceValid audience typePPTErrorInvalid audience type
output.ppt.toneValid tone typePPTErrorInvalid tone type
output.ppt.aspectRatio16:9 or 4:3PPTErrorInvalid aspect ratio

Error Codes

const PPT_ERROR_CODES = {
PLANNING_FAILED: "PPT_PLANNING_FAILED",
INVALID_AI_RESPONSE: "PPT_INVALID_AI_RESPONSE",
IMAGE_GENERATION_FAILED: "PPT_IMAGE_GENERATION_FAILED",
ASSEMBLY_FAILED: "PPT_ASSEMBLY_FAILED",
FILE_WRITE_FAILED: "PPT_FILE_WRITE_FAILED",
INVALID_INPUT: "PPT_INVALID_INPUT",
TIMEOUT: "PPT_TIMEOUT",
};

Troubleshooting

SymptomCauseSolution
Content planning failsInvalid/vague promptUse more specific, detailed prompts
Slides have wrong typesModel not following instructionsTry advanced-tier model (claude-3.5, gpt-4o)
Images not generatinggenerateAIImages not enabledSet generateAIImages: true
Images fail to generateMissing Vertex AI credentialsConfigure GOOGLE_APPLICATION_CREDENTIALS
File write failsPermission deniedCheck output directory permissions
Generation times outToo many slides with imagesReduce pages or disable AI images
Bullet formatting wrongAI not following formatUse simplified slide types
Charts have no dataAI didn't generate chart dataProvide explicit data in prompt
Logo not appearingInvalid logo path/bufferVerify logo file exists and is valid image
Incorrect aspect ratioUsing wrong dimensionEnsure aspectRatio matches content design

Debug Mode

// Enable verbose logging
const neurolink = new NeuroLink({
debug: true,
logLevel: "verbose",
});

// Or via environment variable
// export NEUROLINK_DEBUG=true

Testing

Unit Test Example

import { describe, it, expect, vi } from "vitest";
import { NeuroLink } from "@juspay/neurolink";

describe("PPT Generation", () => {
it("should generate presentation with valid options", async () => {
const neurolink = new NeuroLink();

const result = await neurolink.generate({
input: { text: "Test presentation about AI" },
output: {
mode: "ppt",
ppt: {
pages: 5,
theme: "modern",
audience: "general",
tone: "professional",
},
},
});

expect(result.ppt).toBeDefined();
expect(result.ppt?.filePath).toMatch(/\.pptx$/);
expect(result.ppt?.totalSlides).toBeGreaterThanOrEqual(5);
expect(result.ppt?.format).toBe("pptx");
});

it("should throw error for invalid page count", async () => {
const neurolink = new NeuroLink();

await expect(
neurolink.generate({
input: { text: "Test" },
output: {
mode: "ppt",
ppt: { pages: 100 }, // Invalid: max is 50
},
}),
).rejects.toThrow();
});
});

Mock Strategy for CI/CD

import { vi } from "vitest";

vi.mock("@juspay/neurolink", () => ({
NeuroLink: vi.fn().mockImplementation(() => ({
generate: vi.fn().mockResolvedValue({
content: "",
provider: "vertex",
model: "gemini-2.5-pro",
ppt: {
filePath: "./test-output.pptx",
totalSlides: 10,
format: "pptx",
provider: "vertex",
model: "gemini-2.5-pro",
metadata: {
theme: "modern",
audience: "general",
tone: "professional",
},
},
}),
})),
}));

Limitations

LimitationDescriptionWorkaround
Max slides50 slides per presentationSplit into multiple presentations
Min slides5 slides minimumUse at least 5 pages
Output formatOnly PPTX supportedConvert with external tools if needed
Image generationOnly with Vertex AI / Google AIUse user-provided images
Custom templatesNot supported yetUse theme customization
AnimationsBasic transitions onlyEdit in PowerPoint after generation
Video embeddingNot supportedAdd videos manually after generation

Performance Optimization

Generation Time Estimates

ConfigurationEstimated TimeNotes
10 slides, no images15-30sFast, text-only
10 slides, with AI images60-120sImage generation adds time
20 slides, no images30-60sLinear scaling
20 slides, with AI images120-240sParallel image generation
50 slides, no images60-120sLarge presentation
50 slides, with AI images300-600sConsider splitting

Optimization Tips

  1. Disable AI images for faster generation: generateAIImages: false
  2. Use basic-tier models for simple presentations: gemini-2.5-flash
  3. Provide user images instead of AI generation for brand consistency
  4. Limit slide count to what's actually needed
  5. Use structured prompts for better AI content planning

Implementation Files

FilePurpose
src/lib/features/ppt/presentationOrchestrator.tsMain orchestration pipeline
src/lib/features/ppt/contentPlanner.tsAI-powered content planning
src/lib/features/ppt/slideGenerator.tsIndividual slide generation
src/lib/features/ppt/slideRenderers.tsSlide type rendering functions
src/lib/features/ppt/constants.tsThemes, prompts, and configuration
src/lib/features/ppt/types.tsType definitions
src/lib/types/pptTypes.tsPublic API types
src/lib/utils/parameterValidation.tsInput validation: validatePPTGenerationInput()

Next: Video Generation | Multimodal Chat