Pi PPT Generation
Functionality
- 1. Generate PPTs using the PI (Presentation Intelligence) API.
Setup
- 1. API Key: Ensure the PIPPTBASEURL, PIPPTAPPID and PIPPTAPPSECRET environment variables are set with your valid API key. You can obtain API key from the PI website: https://www.pi.inc/ .
- Environment: The API key should be available in the runtime environment.
Generate a PPT
Run the following script:
PIPPT_BASE_URL=xxx PIPPT_APP_ID=xxx PIPPT_APP_SECRET=xxx python3 scripts/generate_pi_ppt.py --content --language --cards --file
Input arguments:
content(str, required): Topic and description, for example: "Create a PPT introducing Chinese GPU vendors in a formal business style."
cards(int, optional): Expected number of slides, for example 10. Default is 8. If you generate a PPT from an uploaded document, do not specify cards because the slide count is determined by the document content.
language(str, required): Target language of the PPT. 'zh' for Chinese, 'en' for English. Default is 'zh'.
file(str, optional): Path to the document to upload, for example: "/Users/jack/download/weekly
report20250304.doc". Supported file types: .doc/.docx/.txt/.md/.pdf/.pptx/.ppt. Other file types are not supported. Only one document can be uploaded.
Complete command examples:
Generate from an uploaded document (slide count is determined by content, do not pass --cards):
CODEBLOCK1
Generate from a one-line prompt / topic (you can specify slide count):
CODEBLOCK2
Notes
- - Generating one PPT usually takes about 3-6 minutes. Please remind users to be patient.
Pi PPT 生成
功能
- 1. 使用PI(演示智能)API生成PPT。
设置
- 1. API密钥: 确保已设置PIPPTBASEURL、PIPPTAPPID和PIPPTAPPSECRET环境变量,并填入有效的API密钥。您可以从PI官网获取API密钥:https://www.pi.inc/。
- 环境: API密钥应在运行时环境中可用。
生成PPT
运行以下脚本:
bash
PIPPT
BASEURL=xxx PIPPT
APPID=xxx PIPPT
APPSECRET=xxx python3 scripts/generate
pippt.py --content --language --cards --file
输入参数:
content(str, 必填):主题和描述,例如:以正式商务风格创建一个介绍中国GPU供应商的PPT。
cards(int, 可选):期望的幻灯片数量,例如10。默认为8。如果从上传的文档生成PPT,请勿指定cards,因为幻灯片数量由文档内容决定。
language(str, 必填):PPT的目标语言。zh表示中文,en表示英文。默认为zh。
file(str, 可选):要上传的文档路径,例如:/Users/jack/download/weeklyreport20250304.doc。支持的文件类型:.doc/.docx/.txt/.md/.pdf/.pptx/.ppt。不支持其他文件类型。仅可上传一个文档。
完整命令示例:
从上传的文档生成(幻灯片数量由内容决定,请勿传递--cards):
bash
PIPPTBASEURL=xxx PIPPTAPPID=xxx PIPPTAPPSECRET=xxx python3 scripts/generatepippt.py \
--content 根据附件文档生成结构清晰的商务报告PPT \
--language zh \
--file /Users/YourName/Documents/quarterly_review.docx
从单行提示/主题生成(可指定幻灯片数量):
bash
PIPPTBASEURL=xxx PIPPTAPPID=xxx PIPPTAPPSECRET=xxx python3 scripts/generatepippt.py \
--content 以正式商务风格创建一个介绍中国GPU供应商的PPT \
--language zh \
--cards 10
注意事项
- - 生成一个PPT通常需要约3-6分钟。请提醒用户耐心等待。