使用PopAI API创建演示文稿(PPT)。当被要求创建幻灯片、演示文稿、演讲稿或PPT内容时使用。具备内置研究能力——只需...
Create presentations programmatically via PopAI's API. The API has powerful built-in research and information gathering capabilities — it will automatically search, collect, and organize relevant content. Optionally upload files as reference material or templates. If a .pptx template is provided, the output will fully preserve the template's layout, styles, and design — 100% faithful reproduction based on your template. After initial generation, you can send follow-up modification instructions using the same channel ID.
export POPAI_ACCESS_TOKEN=<token>Tips: You can save the key in TOOLS.md for future reference.
generate_ppt.py - Generate PPT via PopAI API (upload files → create channel → SSE stream → get pptx); also supports multi-round modification via --channel-idbash
# Generate PPT from topic only
python3 generate_ppt.py --query "AI Development Trends Report"
# With reference files (max 5)
python3 generate_ppt.py --query "Tesla Earnings PPT" --file data.pdf chart.png
# With a PPT template file (applied as layout template)
python3 generate_ppt.py --query "Tesla Annual Report" --tpl template.pptx
# With both template and reference files
python3 generate_ppt.py --query "Tesla Annual Report" --tpl template.pptx --file data.pdf chart.png
# Multi-round modification: modify an existing PPT (template cannot be changed)
python3 generate_ppt.py --channel-id "CHANNEL_ID" --query "Add a competitive analysis slide and make the color scheme blue"
# With URLs as reference material (included in query)
python3 generate_ppt.py --query "Create a PPT summarizing this article: https://example.com/report.html"
# Multi-round modification with additional reference files
python3 generate_ppt.py --channel-id "CHANNEL_ID" --query "Update the financial data with this new report" --file new_data.pdf
Get PPT topic from user
If user provides reference material:
--file (max 5) and/or --tpl (PPT template for layout)--query text — the API will fetch and process them automaticallyRun script (timeout: 1200000): bash
python3 generate_ppt.py --query "TOPIC" [--file FILE1 FILE2 ...] [--tpl TEMPLATE.pptx]
Tell user: "Generating your PPT, estimated 5 minutes..."
While the script is running, monitor stdout JSON lines and report progress to user in real time (e.g. task status updates, search actions, tool results)
When generation completes, present final results to user:
summary text (from NODE_END event) as the generation summarypptx_url as the download link: "Download PPT: <pptx_url>"web_url as the site link: "View/Edit online: <web_url>"If user requests the pptx file directly, download it from pptx_url and deliver the file to user
Save the channel_id from web_url (last path segment of https://www.popai.pro/agentic-pptx/<channelId>) for potential follow-up modifications
Use when the user wants to revise or improve an already-generated PPT (e.g. "add a slide", "change the title", "use a darker theme").
Rules:
--channel-id (from previous generation) + --query (modification instruction)--file to supply new reference files for the revision--tpl is ignored in modify mode — the original template cannot be changedConfirm the channel_id from the previous generation (stored from web_url)
Get modification instruction from user
If user provides additional reference files, pass as --file
Run script (timeout: 1200000): bash
python3 generate_ppt.py --channel-id "CHANNEL_ID" --query "MODIFICATION_INSTRUCTION" [--file FILE1 ...]
Tell user: "Applying your modifications, estimated 3-5 minutes..."
Parse and present results the same way as initial generation (new pptx_url and web_url)
Event types (stdout, one JSON per line):
json
{"type": "task", "id": "1", "content": "Search for Tesla latest earnings data", "status": "progressing"}
{"type": "search", "action": "Web Searching", "results": [{"title": "...", "url": "...", "snippet": "...", "date": "..."}]}
{"type": "tool_result", "event": "TOOL_CALLS-xxx", "action": "...", "result": "..."}
{"type": "summary", "text": "Tesla earnings PPT has been created..."}
{"type": "stream_end"}
Final result ( is_end: true):
json
{
"type": "pptx_ready",
"is_end": true,
"pptx_url": "https://popai-file-boe.s3-accelerate.amazonaws.com/.../xxx.pptx",
"file_name": "xxx.pptx",
"preview_images": ["https://...0.jpeg"],
"preview_count": xx,
"web_url": "https://www.popai.pro/agentic-pptx/<channelId>"
}
pptx_url: Download link for the .pptx fileweb_url: PopAI site link for online viewing and editingpreview_images: Page-by-page screenshots of the generated PPT (one image per slide)preview_count: Total number of preview images (i.e. number of slides)summary: Final summary text from the NODE_END event, shown to the user as a generation recapFor any issues, contact customerservice@popai.pro
TOOL_CALLS-pptx event contains final .pptx download URL; last:true marks stream endgetPresignedPost, supports any file typeweb_url — last path segment of https://www.popai.pro/agentic-pptx/<channelId>send_generate directly with existing channel_id; tpl_info is never passed (template is fixed after channel creation)