首页/ AI 技能 / @skilllib/skill-2117939930272413834
Skill站外收录 @skilllib/skill-2117939930272413834

gamma-core-workflow-a

根据输入的主题、文档或结构化内容自动生成包含图文和演讲备注的专业演示文稿,支持批量处理与多格式源文件转换,适用于从文本到视觉内容的高效创作流程。

0.0 (0) 29 次安装 原作者 编程导航
收录于 2026-01-22

Skills.MD

# Gamma Core Workflow A: AI Presentation Generation ## Overview Implement the core workflow for generating presentations using Gamma's AI capabilities from various input sources. ## Prerequisites - Completed `gamma-sdk-patterns` setup - Understanding of async patterns - Content ready for presentation ## Instructions ### Step 1: Prompt-Based Generation ```typescript import { GammaClient } from '@gamma/sdk'; const gamma = new GammaClient({ apiKey: process.env.GAMMA_API_KEY }); async function generateFromPrompt(topic: string, slides: number = 10) { const presentation = await gamma.presentations.generate({ prompt: topic, slideCount: slides, style: 'professional', includeImages: true, includeSpeakerNotes: true, }); return presentation; } // Usage const deck = await generateFromPrompt('Introduction to Machine Learning', 8); console.log('Generated:', deck.url); ``` ### Step 2: Document-Based Generation ```typescript async function generateFromDocument(filePath: string) { const document = await fs.readFile(filePath, 'utf-8'); const presentation = await gamma.presentations.generate({ sourceDocument: document, sourceType: 'markdown', // or 'pdf', 'docx', 'text' extractKeyPoints: true, maxSlides: 15, }); return presentation; } ``` ### Step 3: Structured Content Generation ```typescript interface SlideOutline { title: string; points: string[]; imagePrompt?: string; } async function generateFromOutline(outline: SlideOutline[]) { const presentation = await gamma.presentations.generate({ slides: outline.map(slide => ({ title: slide.title, content: slide.points.join('\n'), generateImage: slide.imagePrompt, })), style: 'modern', }); return presentation; } ``` ### Step 4: Batch Generation Pipeline ```typescript async function batchGenerate(topics: string[]) { const results = await Promise.allSettled( topics.map(topic => gamma.presentations.generate({ prompt: topic, slideCount: 5, }) ) ); return results.map((r, i) => ({ topic: topics[i], status: r.status, url: r.status === 'fulfilled' ? r.value.url : null, error: r.status === 'rejected' ? r.reason.message : null, })); } ``` ## Output - AI-generated presentations from prompts - Document-to-presentation conversion - Structured content transformation - Batch processing capability ## Error Handling | Error | Cause | Solution | |-------|-------|----------| | Generation Timeout | Complex prompt | Reduce slide count or simplify | | Content Too Long | Document exceeds limit | Split into sections | | Rate Limit | Too many requests | Implement queue system | | Style Not Found | Invalid style name | Check available styles | ## Resources - [Gamma AI Generation](https://gamma.app/docs/ai-generation) - [Prompt Best Practices](https://gamma.app/docs/prompts) ## Next Steps Proceed to `gamma-core-workflow-b` for presentation editing and export workflows.

评论 0

还没有评论,来抢沙发。